/* Creature Lab: a dark, neon "mad-science" lab. */

:root {
  --bg: #0a1420;
  --bg-2: #0e1b2b;
  --panel: #12233a;
  --panel-2: #172c48;
  --line: rgba(173, 216, 255, 0.16);
  --text: #e8f4ff;
  --muted: #93a9c2;
  --lime: #b8ff3c;
  --lime-deep: #8fd41a;
  --cyan: #34e7e4;
  --magenta: #ff3dac;
  --orange: #ffa63d;
  --violet: #9b7bff;
  --radius: 20px;
  --radius-sm: 12px;
  --glow-lime: 0 0 0 1px rgba(184, 255, 60, 0.35), 0 0 24px rgba(184, 255, 60, 0.25);
  --glow-cyan: 0 0 0 1px rgba(52, 231, 228, 0.35), 0 0 24px rgba(52, 231, 228, 0.2);
  --font-display: 'Bungee', 'Impact', system-ui, sans-serif;
  --font-body: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Space Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(173, 216, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(173, 216, 255, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 8px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mono { font-family: var(--font-mono); letter-spacing: 0.04em; }
.mono-tag {
  display: inline-block;
  margin: 0 0 12px;
  padding: 3px 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  border: 1px solid rgba(52, 231, 228, 0.45);
  border-radius: 999px;
  background: rgba(52, 231, 228, 0.07);
}

/* ---------- glowing backdrop ---------- */

.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.28; }
.glow-1 { width: 560px; height: 560px; background: var(--lime); top: -260px; left: -180px; opacity: 0.18; }
.glow-2 { width: 520px; height: 520px; background: var(--magenta); top: 35%; right: -240px; }
.glow-3 { width: 480px; height: 480px; background: var(--cyan); bottom: -260px; left: 25%; opacity: 0.2; }

/* ---------- header / brand ---------- */

.site-header { display: flex; justify-content: center; padding: 26px 16px 6px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  text-decoration: none;
  border-radius: 18px;
}
.brand-logo {
  width: 84px;
  height: 84px;
  flex: none;
  filter: drop-shadow(0 0 14px rgba(184, 255, 60, 0.35));
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.brand:hover .brand-logo { transform: rotate(-10deg) scale(1.06); }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: var(--font-display);
  font-size: 2.1rem;
  letter-spacing: 0.02em;
  color: var(--lime);
  text-shadow: 0 0 18px rgba(184, 255, 60, 0.45), 3px 3px 0 var(--magenta);
}
.brand-lab {
  color: transparent;
  -webkit-text-stroke: 2px var(--cyan);
  text-shadow: 0 0 16px rgba(52, 231, 228, 0.5);
}
.brand-sub {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- layout ---------- */

main { width: min(1100px, 100%); margin: 0 auto; padding: 8px 16px 40px; }
.view { animation: view-in 0.45s ease both; }
@keyframes view-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.panel {
  position: relative;
  padding: 24px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.panel-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.2;
  letter-spacing: 0.02em;
}
.panel-title .mono { font-size: 0.95rem; color: var(--lime); letter-spacing: 0.18em; text-transform: uppercase; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.8em 1.5em;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--text);
  background: transparent;
  border: 2px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: progress; transform: none; }
.btn-lime {
  color: #0a1420;
  background: var(--lime);
  border-color: var(--lime);
  box-shadow: 0 0 22px rgba(184, 255, 60, 0.4), inset 0 -3px 0 rgba(0, 0, 0, 0.18);
}
.btn-lime:hover { box-shadow: 0 0 34px rgba(184, 255, 60, 0.65), inset 0 -3px 0 rgba(0, 0, 0, 0.18); }
.btn-ghost { border-color: rgba(52, 231, 228, 0.5); color: var(--cyan); }
.btn-ghost:hover { background: rgba(52, 231, 228, 0.1); box-shadow: var(--glow-cyan); }
.btn-xl { font-family: var(--font-display); font-weight: 400; font-size: 1.35rem; padding: 0.75em 1.6em; letter-spacing: 0.04em; }
.btn-small { font-size: 0.92rem; padding: 0.55em 1.1em; }
.btn-icon { width: 1.1em; height: 1.1em; }

/* ---------- hero ---------- */

.hero { max-width: 780px; margin: 22px auto 30px; text-align: center; }
.hero h1 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.9rem, 5.2vw, 3.3rem);
  line-height: 1.1;
}
.hero h1:focus { outline: none; }
.neon {
  color: var(--lime);
  text-shadow: 0 0 22px rgba(184, 255, 60, 0.55), 0 0 2px rgba(184, 255, 60, 0.8);
}
.lede { max-width: 640px; margin: 0 auto; font-size: 1.12rem; color: var(--muted); }

/* ---------- builder ---------- */

.bench {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.pods { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; }
.pod {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 16px;
  background: rgba(10, 20, 32, 0.55);
  border: 1px solid rgba(184, 255, 60, 0.35);
  border-radius: 22px;
  box-shadow: inset 0 0 30px rgba(184, 255, 60, 0.06);
}
.pod-b { border-color: rgba(255, 61, 172, 0.4); box-shadow: inset 0 0 30px rgba(255, 61, 172, 0.07); }
.pod-label { margin: 0; font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--lime); }
.pod-b .pod-label { color: var(--magenta); }
.pod-window {
  display: grid;
  place-items: center;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.25), transparent 40%),
    radial-gradient(circle, rgba(184, 255, 60, 0.28), rgba(52, 231, 228, 0.12) 70%);
  border: 3px solid rgba(232, 244, 255, 0.75);
  box-shadow: 0 0 28px rgba(184, 255, 60, 0.35), inset 0 -10px 20px rgba(0, 0, 0, 0.25);
}
.pod-b .pod-window {
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.25), transparent 40%),
    radial-gradient(circle, rgba(255, 61, 172, 0.3), rgba(155, 123, 255, 0.14) 70%);
  box-shadow: 0 0 28px rgba(255, 61, 172, 0.35), inset 0 -10px 20px rgba(0, 0, 0, 0.25);
}
.pod-emoji {
  font-size: 3.6rem;
  line-height: 1;
  font-family: var(--font-display);
  color: var(--text);
  animation: float 3s ease-in-out infinite;
}
.pod-b .pod-emoji { animation-delay: -1.5s; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-6px) rotate(4deg); }
}
.pod-window.is-pop .pod-emoji { animation: pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes pop { from { transform: scale(0.4); } to { transform: scale(1); } }

.select-wrap { position: relative; width: 100%; }
.select-wrap::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2.5px solid var(--cyan);
  border-bottom: 2.5px solid var(--cyan);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.select-wrap select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  padding: 12px 42px 12px 14px;
  font-weight: 700;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.select-wrap select:hover { border-color: rgba(52, 231, 228, 0.6); }
.select-wrap option, .select-wrap optgroup { color: var(--text); background: var(--bg-2); }

.pod-info { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 28px; margin: 0; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  background: rgba(232, 244, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}
.chip-mystery { color: var(--lime); border-color: rgba(184, 255, 60, 0.4); }

.splice-sign {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  color: var(--bg);
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 26px rgba(52, 231, 228, 0.6);
  animation: spin-slow 6s linear infinite;
}
.splice-sign svg { width: 30px; height: 30px; }
@keyframes spin-slow { to { transform: rotate(360deg); } }

.bench-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; margin-top: 26px; }
.hint { margin: 16px 0 0; text-align: center; font-size: 0.95rem; color: var(--muted); }
.hint .mono { color: var(--magenta); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.14em; }
.hint strong { color: var(--text); }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 920px;
  margin: 32px auto 0;
  padding: 0;
  list-style: none;
}
.steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: var(--muted);
  background: rgba(18, 35, 58, 0.6);
  border: 1px dashed rgba(173, 216, 255, 0.25);
  border-radius: var(--radius-sm);
}
.steps strong { color: var(--text); }
.step-num { font-family: var(--font-mono); font-weight: 700; font-size: 1.1rem; color: var(--lime); }

/* ---------- result ---------- */

.shared-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 920px;
  margin: 0 auto 18px;
  padding: 12px 18px;
  background: rgba(255, 61, 172, 0.12);
  border: 1px solid rgba(255, 61, 172, 0.5);
  border-radius: var(--radius-sm);
}
.shared-banner p { flex: 1 1 220px; margin: 0; font-weight: 700; }
.shared-emoji { font-size: 1.6rem; }

.reveal { margin: 12px 0 28px; text-align: center; }
.creature-name {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 8.5vw, 5rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
  background: linear-gradient(95deg, var(--lime) 0%, var(--cyan) 50%, var(--magenta) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(52, 231, 228, 0.35));
}
.creature-name:focus { outline: none; }
.parents-line { margin: 0 0 12px; font-weight: 700; font-size: 1.15rem; }
.parents-line .plus { display: inline-block; margin: 0 0.35em; color: var(--cyan); font-family: var(--font-display); }
.badge {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 5px 14px;
  font-weight: 800;
  font-size: 0.92rem;
  border-radius: 999px;
  color: var(--bg);
  background: var(--lime);
}
.badge.is-real { background: var(--cyan); }
.badge.is-legendary {
  background: linear-gradient(95deg, var(--orange), var(--magenta));
  color: #fff;
  box-shadow: 0 0 24px rgba(255, 61, 172, 0.55);
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.tank { position: sticky; top: 16px; margin: 0; }
.tank-frame {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-2);
  border: 2px solid rgba(52, 231, 228, 0.6);
  border-radius: 28px;
  box-shadow: 0 0 0 6px rgba(52, 231, 228, 0.08), 0 0 50px rgba(52, 231, 228, 0.22), 0 24px 60px rgba(0, 0, 0, 0.5);
}
.tank-frame > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.tank-frame[data-state="ready"] > img { opacity: 1; }
.corner {
  position: absolute;
  z-index: 2;
  width: 26px;
  height: 26px;
  border: 3px solid var(--lime);
  pointer-events: none;
}
.corner.tl { top: 14px; left: 14px; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.corner.tr { top: 14px; right: 14px; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.corner.bl { bottom: 14px; left: 14px; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.corner.br { bottom: 14px; right: 14px; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }

.photo-loading,
.photo-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px;
  text-align: center;
  background:
    repeating-linear-gradient(0deg, rgba(52, 231, 228, 0.05) 0 2px, transparent 2px 5px),
    radial-gradient(circle at 50% 45%, rgba(184, 255, 60, 0.16), transparent 60%),
    var(--bg-2);
}
.tank-frame:not([data-state="loading"]) .photo-loading { display: none; }
.tank-frame:not([data-state="error"]) .photo-error { display: none; }
.loading-logo { width: 104px; height: 104px; animation: bob 1.1s ease-in-out infinite alternate; }
@keyframes bob {
  from { transform: translateY(0) rotate(-5deg); }
  to { transform: translateY(-14px) rotate(5deg); }
}
.loading-text { margin: 0; min-height: 1.6em; font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem; color: var(--lime); }
.loading-note { margin: 0; font-size: 0.85rem; color: var(--muted); }
.loading-bar {
  position: relative;
  width: min(240px, 80%);
  height: 10px;
  overflow: hidden;
  background: rgba(232, 244, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.loading-bar span {
  position: absolute;
  inset: 0;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lime), var(--cyan));
  box-shadow: 0 0 12px rgba(184, 255, 60, 0.7);
  animation: slide 1.2s ease-in-out infinite;
}
@keyframes slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}
.error-emoji { margin: 0; font-size: 3rem; line-height: 1; }
.photo-error p { margin: 0; }

.tank-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  font-weight: 600;
  color: var(--muted);
}
.tank-caption .mono {
  padding: 2px 10px;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--cyan);
  border-radius: 6px;
}

.details { display: grid; gap: 24px; }
.description { margin: 0 0 18px; font-size: 1.05rem; color: #cfe2f5; }

.stats { display: grid; gap: 10px; margin: 0 0 18px; }
.stat {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 12px;
}
.stat dt { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.stat dd { margin: 0; }
.stat .stat-value { font-weight: 800; font-size: 0.92rem; text-align: right; white-space: nowrap; }
.stat-text { grid-column: 2 / 4; font-weight: 700; }
.cells { display: flex; gap: 5px; }
.cells span {
  flex: 1;
  height: 12px;
  max-width: 34px;
  border-radius: 4px;
  background: rgba(232, 244, 255, 0.08);
}
.cells span.on { background: var(--lime); box-shadow: 0 0 10px rgba(184, 255, 60, 0.6); }
.stat:nth-child(2) .cells span.on { background: var(--cyan); box-shadow: 0 0 10px rgba(52, 231, 228, 0.6); }
.stat:nth-child(3) .cells span.on { background: var(--magenta); box-shadow: 0 0 10px rgba(255, 61, 172, 0.6); }

.powers h4 { margin: 0 0 8px; font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--orange); }
.powers ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.powers li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  font-weight: 600;
  background: rgba(255, 166, 61, 0.08);
  border: 1px solid rgba(255, 166, 61, 0.3);
  border-radius: var(--radius-sm);
}
.powers li svg { width: 18px; height: 18px; margin-top: 3px; flex: none; color: var(--orange); }

.name-options { display: grid; gap: 10px; }
.name-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  background: rgba(10, 20, 32, 0.5);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, transform 0.12s ease;
}
.name-option:hover { border-color: rgba(184, 255, 60, 0.5); transform: translateY(-1px); }
.name-option[aria-checked="true"] {
  background: rgba(184, 255, 60, 0.1);
  border-color: var(--lime);
  box-shadow: var(--glow-lime);
}
.name-check {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border: 2px solid var(--muted);
  border-radius: 50%;
}
.name-option[aria-checked="true"] .name-check { border-color: var(--lime); }
.name-option[aria-checked="true"] .name-check::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime);
}
.name-text { display: flex; flex-direction: column; line-height: 1.25; }
.name-value { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: 0.02em; }
.name-why { font-size: 0.9rem; color: var(--muted); }

.custom-name { display: grid; gap: 6px; margin-top: 14px; font-weight: 600; font-size: 0.95rem; color: var(--muted); }
.custom-name input {
  width: 100%;
  padding: 11px 14px;
  font-weight: 700;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.custom-name input::placeholder { color: rgba(147, 169, 194, 0.7); }
.custom-name input.is-active { border-color: var(--lime); box-shadow: var(--glow-lime); }

.share { margin-top: 28px; }
.share-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 16px; }
.share-head .panel-title { margin: 0; }
.share-preview { margin: 0; color: var(--muted); font-weight: 500; }
.share-buttons { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 14px 10px; }
.share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.share-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  color: #fff;
  background: var(--panel-2);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.share-icon svg { width: 25px; height: 25px; }
.share-btn:hover .share-icon { transform: translateY(-3px); box-shadow: 0 0 20px rgba(255, 255, 255, 0.25); }
.share-native .share-icon { background: var(--magenta); }
.share-whatsapp .share-icon { background: #25d366; }
.share-facebook .share-icon { background: #0866ff; }
.share-x .share-icon { background: #000; }
.share-reddit .share-icon { background: #ff4500; }
.share-pinterest .share-icon { background: #bd081c; }
.share-telegram .share-icon { background: #26a5e4; }
.share-sms .share-icon { background: var(--violet); }
.share-email .share-icon { background: var(--violet); }
.share-copy .share-icon { background: var(--cyan); color: var(--bg); }
.share-download .share-icon { background: var(--lime); color: var(--bg); }

.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 30px; }

/* ---------- splicing overlay ---------- */

.mixing {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(10, 20, 32, 0.85);
  backdrop-filter: blur(6px);
  animation: fade-in 0.2s ease both;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.mixing-card {
  width: min(520px, 100%);
  padding: 28px 22px;
  text-align: center;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid rgba(184, 255, 60, 0.4);
  border-radius: var(--radius);
  box-shadow: 0 0 60px rgba(184, 255, 60, 0.2);
}
.mixing-card .loading-bar { margin: 0 auto; }
.mixing-row { display: flex; align-items: center; justify-content: center; gap: 16px; }
.mixing-emoji { font-size: 3rem; line-height: 1; }
#mixing-a-emoji { animation: drop-left 1.4s ease-in both; }
#mixing-b-emoji { animation: drop-right 1.4s ease-in both; }
@keyframes drop-left {
  0%, 20% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(70px, 10px) scale(0.2); opacity: 0; }
}
@keyframes drop-right {
  0%, 20% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(-70px, 10px) scale(0.2); opacity: 0; }
}
.mixing-logo { width: 120px; height: 120px; flex: none; animation: shake 0.25s ease-in-out 0.6s 4 both; }
@keyframes shake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-8deg) scale(1.04); }
  75% { transform: rotate(8deg) scale(1.04); }
}
.mixing-text { margin: 16px 0 14px; font-family: var(--font-mono); font-weight: 700; color: var(--lime); }

/* ---------- toast & sparks ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  font-weight: 700;
  color: var(--bg);
  background: var(--lime);
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(184, 255, 60, 0.5);
  transform: translate(-50%, 150%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
  pointer-events: none;
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

.spark {
  position: fixed;
  z-index: 40;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  animation: spark-fly ease-out forwards;
}
@keyframes spark-fly {
  from { transform: translate(0, 0) scale(1); opacity: 1; }
  to { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; }
}

/* ---------- footer ---------- */

.site-footer { padding: 10px 16px 34px; text-align: center; font-size: 0.9rem; color: var(--muted); }
.site-footer > p { max-width: 640px; margin: 0 auto; }

/* old-fashioned hit counter, as glowing nixie tubes */
.visitor-counter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 20px;
  padding: 14px 20px 12px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid rgba(255, 166, 61, 0.45);
  border-radius: 16px;
  box-shadow: 0 0 24px rgba(255, 166, 61, 0.15);
}
.vc-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--orange);
}
.vc-digits {
  display: flex;
  gap: 6px;
  padding: 6px 8px;
  background: #05090f;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.vc-digits span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 42px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.55rem;
  line-height: 1;
  color: #ffb45c;
  text-shadow: 0 0 6px rgba(255, 140, 40, 0.9), 0 0 14px rgba(255, 120, 20, 0.6);
  background: radial-gradient(ellipse at 50% 40%, rgba(255, 140, 40, 0.18), rgba(10, 20, 32, 0.9) 70%);
  border: 1px solid rgba(255, 166, 61, 0.25);
  border-radius: 13px 13px 6px 6px;
  box-shadow: inset 0 0 8px rgba(255, 140, 40, 0.15);
}
.visitor-counter[data-state="loading"] .vc-digits span { animation: vc-flicker 0.9s steps(2) infinite; }
@keyframes vc-flicker { from { opacity: 1; } to { opacity: 0.4; } }
.vc-note { margin: 0; font-size: 0.85rem; color: var(--muted); }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .result-grid { grid-template-columns: 1fr; }
  .tank { position: static; max-width: 560px; width: 100%; margin: 0 auto; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-header { padding-top: 18px; }
  .brand { gap: 10px; }
  .brand-logo { width: 62px; height: 62px; }
  .brand-name { font-size: 1.55rem; text-shadow: 0 0 14px rgba(184, 255, 60, 0.45), 2px 2px 0 var(--magenta); }
  .brand-lab { -webkit-text-stroke-width: 1.5px; }
  .brand-sub { font-size: 0.62rem; letter-spacing: 0.18em; }
  .mono-tag { font-size: 0.66rem; letter-spacing: 0.06em; padding: 3px 10px; }
  .bench, .panel { padding: 18px; }
  .pods { grid-template-columns: 1fr; gap: 12px; }
  .pod { gap: 10px; padding: 14px; }
  .pod-window { width: 84px; height: 84px; }
  .pod-emoji { font-size: 2.6rem; }
  .splice-sign { width: 46px; height: 46px; margin: 0 auto; }
  .splice-sign svg { width: 24px; height: 24px; }
  .bench-actions .btn { width: 100%; }
  .btn-xl { font-size: 1.2rem; }
  .steps { grid-template-columns: 1fr; gap: 10px; }
  .stat { grid-template-columns: 88px 1fr auto; gap: 8px; }
  .share-buttons { grid-template-columns: repeat(4, 1fr); gap: 12px 6px; }
  .share-icon { width: 48px; height: 48px; }
  .share-icon svg { width: 22px; height: 22px; }
  .share-btn { font-size: 0.78rem; }
  .result-actions .btn { flex: 1 1 100%; }
}

@media (max-width: 360px) {
  .share-buttons { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
