* { box-sizing: border-box; }

:root {
  --bg: #0a0d1c;
  --panel: #141a33;
  --panel-2: #1b2347;
  --line: #2c3766;
  --text: #e9edff;
  --muted: #97a1cc;
  --lime: #c8ff00;
  --cyan: #45e6ff;
  --pink: #ff5cc8;
  --orange: #ffb020;
  --red: #ff4d5e;
  --green: #3dff9e;
}

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'SN Pro', system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 700px at 70% -10%, #1b2a5e 0%, var(--bg) 55%);
  color: var(--text);
  overflow-x: hidden;
}

#stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: rgba(10, 13, 28, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; letter-spacing: .3px; }
.brand__ufo { font-size: 1.5rem; animation: hover 2.6s ease-in-out infinite; }
.brand__text b { color: var(--lime); }

@keyframes hover { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-5px) } }

.clock { display: flex; align-items: center; gap: 8px; }
.clock__time {
  font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 1.4rem;
  color: var(--cyan); min-width: 5ch; text-align: center;
}
.clock.is-done .clock__time { color: var(--red); animation: blink .6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25 } }

.scores { display: flex; align-items: center; gap: 10px; }
.scores__vs { color: var(--muted); font-size: .8rem; font-weight: 700; }
.team {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px;
}
.team__name { font-size: .72rem; font-weight: 800; letter-spacing: 1px; color: var(--muted); }
.team__score {
  font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 1.25rem;
  min-width: 2ch; text-align: center; color: var(--lime);
}
.team[data-team="2"] .team__score { color: var(--pink); }
.team__btns { display: flex; gap: 4px; }

/* ---------- buttons ---------- */
.btn {
  font: inherit; font-weight: 700; cursor: pointer;
  background: var(--lime); color: #10131f; border: none; border-radius: 10px;
  padding: 9px 16px; transition: transform .12s, box-shadow .12s, background .12s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(200, 255, 0, .25); }
.btn:active { transform: translateY(0); }
.btn--mini { padding: 5px 9px; font-size: .78rem; border-radius: 8px; }
.btn--ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn--ghost:hover { color: var(--text); box-shadow: none; border-color: var(--cyan); }
.btn--cyan { background: var(--cyan); }
.btn--pink { background: var(--pink); color: #fff; }
.btn--red { background: var(--red); color: #fff; }
.btn--big { padding: 13px 24px; font-size: 1.02rem; }

/* ---------- timeline ---------- */
.timeline {
  position: relative; z-index: 10;
  display: flex; gap: 8px; overflow-x: auto;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: rgba(15, 19, 40, .7);
}
.step {
  flex: 1 0 auto; min-width: 130px;
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 12px; cursor: pointer; color: var(--text); font: inherit; text-align: left;
  transition: border-color .15s, transform .15s;
}
.step:hover { transform: translateY(-2px); border-color: var(--cyan); }
.step.is-active { background: var(--panel-2); border-color: var(--lime); box-shadow: 0 0 0 1px var(--lime); }
.step__time { font-family: 'JetBrains Mono', monospace; font-size: .7rem; color: var(--cyan); }
.step__title { font-size: .84rem; font-weight: 700; }
.step__emoji { font-size: 1.1rem; }

/* ---------- stage layout ---------- */
.stage { position: relative; z-index: 5; max-width: 1080px; margin: 0 auto; padding: 22px 16px 60px; }
.stage__head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.stage__time {
  font-family: 'JetBrains Mono', monospace; font-size: .78rem; color: #10131f;
  background: var(--cyan); padding: 3px 9px; border-radius: 999px; font-weight: 600;
}
.stage__title { margin: 0; font-size: clamp(1.4rem, 3vw, 2rem); }
.stage__sub { color: var(--muted); margin: 0 0 18px; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; margin-bottom: 16px;
}
.card h3 { margin: 0 0 10px; font-size: 1.02rem; color: var(--cyan); letter-spacing: .4px; text-transform: uppercase; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }

.teacher {
  border-left: 4px solid var(--orange); background: rgba(255, 176, 32, .08);
  border-radius: 0 12px 12px 0; padding: 12px 16px; font-size: .93rem; line-height: 1.55;
}
.teacher b { color: var(--orange); }

/* ---------- speech bubbles ---------- */
.bubble {
  position: relative; background: #232c57; border: 1px solid var(--line);
  border-radius: 16px; padding: 14px 18px; font-size: 1.05rem; line-height: 1.5;
}
.bubble--alien { background: #173a2e; border-color: #2f7d5c; font-weight: 700; color: var(--green); }
.bubble--alien::after {
  content: ''; position: absolute; left: 26px; bottom: -9px;
  border: 9px solid transparent; border-top-color: #2f7d5c; border-bottom: 0;
}
.bubble__emoji { font-size: 2rem; margin-right: 8px; vertical-align: middle; }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-weight: 700; cursor: pointer;
  background: var(--panel-2); color: var(--text);
  border: 1px dashed var(--line); border-radius: 999px; padding: 7px 14px;
  transition: all .14s;
}
.chip:hover { border-color: var(--cyan); color: var(--cyan); }
.chip.is-used { background: var(--green); color: #08211a; border-style: solid; border-color: var(--green); opacity: .65; cursor: default; }
.chip:disabled { cursor: default; }

/* ---------- sentences / lists ---------- */
.sentences { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sentences li {
  background: #0f1430; border: 1px solid var(--line); border-left: 4px solid var(--green);
  border-radius: 8px; padding: 9px 12px; font-size: 1.02rem;
  animation: pop .25s ease;
}
.sentences li:empty { display: none; }
@keyframes pop { from { transform: translateY(6px); opacity: 0 } to { transform: none; opacity: 1 } }

.frame {
  background: #0f1430; border: 1px solid var(--cyan); border-radius: 12px;
  padding: 10px 14px; font-family: 'JetBrains Mono', monospace; color: var(--cyan); font-weight: 600;
}

/* ---------- item cards ---------- */
.items { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.item {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; text-align: center; transition: border-color .15s, transform .15s;
}
.item:hover { border-color: var(--pink); transform: translateY(-3px); }
.item__emoji { font-size: 3rem; display: block; }
.item__word { font-weight: 800; font-size: 1.05rem; color: var(--lime); letter-spacing: .5px; }
.item__clues { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .93rem; }
.item__clues li { opacity: 0; }
.item__clues li.show { opacity: 1; animation: pop .3s ease; }
.item__hidden { color: var(--muted); filter: blur(6px); user-select: none; }

/* ---------- big hero bits ---------- */
.alert {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(90deg, rgba(255, 77, 94, .22), rgba(255, 77, 94, .05));
  border: 1px solid var(--red); border-radius: 14px; padding: 14px 18px; margin-bottom: 16px;
}
.alert__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--red); animation: blink .7s steps(2) infinite; }
.alert__text { font-weight: 800; letter-spacing: .6px; color: var(--red); }

.news {
  background: linear-gradient(135deg, #1c1030, #0f1430);
  border: 1px solid var(--pink); border-radius: 16px; padding: 18px; margin-bottom: 16px;
}
.news__tag {
  display: inline-block; background: var(--red); color: #fff; font-weight: 800;
  font-size: .75rem; letter-spacing: 2px; padding: 4px 10px; border-radius: 6px; margin-bottom: 10px;
  animation: blink 1.2s steps(2) infinite;
}
.news__headline { margin: 0; font-size: clamp(1.3rem, 3.4vw, 2.1rem); line-height: 1.25; }
.news__headline span { color: var(--lime); }

.big-emoji { font-size: clamp(3.5rem, 12vw, 6rem); line-height: 1; display: block; text-align: center; }

/* ---------- timers inside stages ---------- */
.timer {
  font-family: 'JetBrains Mono', monospace; font-weight: 600;
  font-size: clamp(2rem, 7vw, 3.4rem); color: var(--orange); text-align: center; margin: 6px 0;
}
.timer.is-over { color: var(--red); animation: blink .5s steps(2) infinite; }

.secret {
  font-family: 'JetBrains Mono', monospace; font-weight: 600; text-align: center;
  font-size: clamp(1.6rem, 6vw, 2.6rem); letter-spacing: 3px; color: var(--lime);
  background: #0f1430; border: 2px dashed var(--line); border-radius: 14px; padding: 14px;
}
.secret.is-open { border-style: solid; border-color: var(--lime); }

/* ---------- banned words ---------- */
textarea {
  width: 100%; min-height: 110px; resize: vertical; font: inherit; font-size: 1rem;
  background: #0f1430; color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 12px;
}
textarea:focus { outline: none; border-color: var(--cyan); }
.check { margin-top: 10px; font-weight: 700; }
.check--ok { color: var(--green); }
.check--bad { color: var(--red); }
.banned {
  display: inline-block; background: rgba(255, 77, 94, .18); border: 1px solid var(--red);
  color: var(--red); border-radius: 8px; padding: 6px 12px; margin: 4px 6px 0 0; font-weight: 800;
}
.swap { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.swap:last-child { border-bottom: none; }
.swap__bad { color: var(--red); text-decoration: line-through; }
.swap__good { color: var(--green); font-weight: 700; }

/* ---------- win ---------- */
.win { text-align: center; padding: 30px 10px; animation: pop .4s ease; }
.win__title { font-size: clamp(1.8rem, 6vw, 3rem); margin: 10px 0; color: var(--lime); }
.hint { color: var(--muted); font-size: .9rem; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.foot {
  position: relative; z-index: 5; text-align: center; color: var(--muted);
  font-size: .82rem; padding: 18px 16px 30px; border-top: 1px solid var(--line);
}

@media (max-width: 760px) {
  .topbar { justify-content: center; }
  .scores { order: 3; }
}
