/* =========================================================
   VoiceGame — Choicer Voicer–inspired UI (no characters / set)
   ========================================================= */

:root {
  --bg: #d5e2ea;
  --bg-deep: #c5d4de;
  --cyan: #5ad4f0;
  --cyan-bright: #7eecff;
  --cyan-deep: #2bb8d6;
  --cyan-soft: #b8eaf7;
  --cyan-btn: #a8d4e4;
  --cyan-btn-hover: #8ec6db;
  --magenta: #e056e8;
  --navy: #1b3a6b;
  --danger: #d62828;
  --panel: #ffffff;
  --text: #1a1a1a;
  --text-muted: #5a6670;
  --chrome: #6d7680;
  --chrome-dark: #4a5158;
  --dialogue-border: #7fd4ea;
  --shadow: 0 6px 0 rgba(0, 0, 0, 0.08);
  --font: "Segoe UI", "Trebuchet MS", system-ui, sans-serif;
}

body.dark {
  --bg: #1c2530;
  --bg-deep: #151c24;
  --cyan: #5ad4f0;
  --cyan-bright: #8ef0ff;
  --cyan-deep: #3ac4e0;
  --cyan-soft: #1e4a58;
  --cyan-btn: #3d6a7c;
  --cyan-btn-hover: #4d7f94;
  --panel: #1e2730;
  --text: #eef4f8;
  --text-muted: #9aadb8;
  --chrome: #3a444e;
  --chrome-dark: #2a323a;
  --dialogue-border: #4ec8e0;
  --shadow: 0 6px 0 rgba(0, 0, 0, 0.25);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
  color: inherit;
}

code {
  font-size: 0.88em;
  background: color-mix(in srgb, var(--cyan) 18%, var(--panel));
  border: 1px solid var(--dialogue-border);
  border-radius: 4px;
  padding: 0.05em 0.3em;
}

#app {
  min-height: 100vh;
  position: relative;
}

.screen {
  display: none;
  position: relative;
  min-height: 100vh;
  background: var(--bg);
}

.screen.active {
  display: block;
}

/* ===== Intro ===== */
#screen-intro {
  display: none;
  place-items: center;
  background: #0a0e12;
  z-index: 20;
}

#screen-intro.active {
  display: grid;
}

#screen-intro.intro-exit {
  animation: intro-fade-out 0.45s ease forwards;
}

.intro-inner {
  text-align: center;
  padding: 32px;
  animation: intro-rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.intro-logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  animation: intro-logo-pop 1.1s cubic-bezier(0.2, 0.9, 0.2, 1) both;
  filter: drop-shadow(0 0 24px rgba(90, 212, 240, 0.35));
}

.intro-logo .logo-title,
.intro-logo.logo-title {
  align-items: center;
}

.intro-logo .logo-main,
.intro-logo .logo-voice {
  align-items: center;
}

.intro-tag {
  margin: 22px 0 0;
  font-weight: 700;
  color: #9ec9d8;
  letter-spacing: 0.04em;
  opacity: 0;
  animation: intro-fade-in 0.6s ease 0.55s forwards;
}

.intro-bar {
  width: 160px;
  height: 4px;
  margin: 28px auto 0;
  background: #1e2a32;
  border-radius: 999px;
  overflow: hidden;
  opacity: 0;
  animation: intro-fade-in 0.3s ease 0.7s forwards;
}

.intro-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--cyan);
  border-radius: 999px;
  animation: intro-load 1.6s ease 0.85s forwards;
}

.intro-skip {
  margin-top: 28px;
  background: transparent;
  border: 2px solid #3a5560;
  color: #8ab;
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  animation: intro-fade-in 0.4s ease 1s forwards;
}

.intro-skip:hover {
  border-color: var(--cyan);
  color: #dff6ff;
}

@keyframes intro-rise {
  from { transform: translateY(18px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@keyframes intro-logo-pop {
  0% { transform: scale(0.72); opacity: 0; }
  60% { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes intro-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes intro-load {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes intro-fade-out {
  to { opacity: 0; visibility: hidden; }
}

/* ===== Chrome bars ===== */
.chrome-top,
.chrome-bottom {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--chrome);
  color: #fff;
  min-height: 48px;
}

.chrome-top {
  justify-content: space-between;
  background: var(--chrome-dark);
}

.chrome-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--chrome);
}

.breadcrumb {
  font-weight: 700;
  font-size: 0.95rem;
}

.version-tag {
  font-size: 0.8rem;
  opacity: 0.85;
}

.hint-line {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.9;
}

.round-chip,
.score-chip {
  background: color-mix(in srgb, #000 25%, var(--chrome-dark));
  border: 2px solid color-mix(in srgb, var(--cyan) 40%, #fff);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 0.92rem;
}

/* ===== Logo ===== */
.logo-block {
  margin-bottom: 22px;
}

.logo-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 0.85;
  filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.12));
}

.logo-the {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 800;
  color: #fff;
  -webkit-text-stroke: 3px var(--cyan-deep);
  paint-order: stroke fill;
  letter-spacing: 0.02em;
  margin-left: 0.2em;
}

.logo-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.logo-voice {
  display: flex;
  align-items: flex-end;
}

.mic-glyph {
  display: inline-block;
  width: 0.55em;
  height: 1.15em;
  margin-right: 0.02em;
  background: #fff;
  border: 4px solid var(--cyan-deep);
  border-radius: 999px 999px 8px 8px;
  position: relative;
  font-size: clamp(2.8rem, 8vw, 4.6rem);
  box-shadow: inset 0 -6px 0 color-mix(in srgb, var(--cyan) 30%, #fff);
}

.mic-glyph::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.28em;
  transform: translateX(-50%);
  width: 0.22em;
  height: 0.28em;
  background: #fff;
  border: 3px solid var(--cyan-deep);
  border-top: none;
}

.logo-oice,
.logo-game {
  font-size: clamp(2.8rem, 8vw, 4.6rem);
  font-weight: 900;
  color: #fff;
  -webkit-text-stroke: 5px var(--cyan-deep);
  paint-order: stroke fill;
  letter-spacing: -0.03em;
}

.logo-game {
  margin-top: -0.12em;
  margin-left: 0.15em;
}

.logo-sub {
  margin: 14px 0 0;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 1rem;
}

.outlined-title {
  margin: 0;
  font-weight: 900;
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  line-height: 1.1;
  color: #fff;
  -webkit-text-stroke: 3px var(--cyan-deep);
  paint-order: stroke fill;
  letter-spacing: -0.02em;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.1));
}

.outlined-title.small {
  font-size: 1.8rem;
  margin-bottom: 16px;
}

.outlined-title.game-banner {
  text-align: center;
  margin-bottom: 8px;
  max-width: 18ch;
}

/* ===== Buttons ===== */
.cv-btn {
  appearance: none;
  border: 3px solid color-mix(in srgb, var(--cyan-deep) 55%, #fff);
  background: var(--cyan-btn);
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
  border-radius: 12px;
  padding: 14px 22px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.12s ease, transform 0.08s ease;
}

.cv-btn:hover:not(:disabled) {
  background: var(--cyan-btn-hover);
}

.cv-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
}

.cv-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cv-btn-wide {
  width: 100%;
  max-width: 280px;
  font-size: 1.25rem;
  padding: 16px 20px;
}

.cv-btn-sm {
  font-size: 0.95rem;
  padding: 10px 14px;
  border-radius: 10px;
}

.cv-btn-pill {
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 1rem;
}

.cv-btn.alt {
  background: color-mix(in srgb, var(--chrome) 35%, var(--cyan-btn));
}

.file-btn {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  width: auto;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: color-mix(in srgb, var(--cyan) 35%, var(--chrome));
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--cyan-deep);
}

.mic-btn {
  width: 120px;
  height: 56px;
  border-radius: 999px;
  border: 4px solid #d8e6ee;
  background: #c8e6f2;
  box-shadow:
    0 4px 0 #8aabb8,
    inset 0 2px 0 #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.08s ease;
}

.mic-btn:hover {
  background: #b5dceb;
}

.mic-btn:active,
.mic-btn.recording {
  transform: translateY(2px);
  box-shadow:
    0 2px 0 #8aabb8,
    inset 0 2px 0 #fff;
  border-color: var(--cyan-bright);
  background: #7ecce8;
}

.mic-btn.recording .mic-icon {
  animation: pulse-mic 0.7s infinite;
}

.mic-icon {
  font-size: 1.5rem;
  line-height: 1;
}

@keyframes pulse-mic {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* ===== Menu ===== */
.menu-layout {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: calc(100vh - 96px);
  padding: 32px 40px 80px;
  max-width: 640px;
  margin: 0 auto;
}

.menu-stack {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 280px;
}

.menu-sound-count {
  margin: 18px 0 0;
  font-weight: 700;
  color: var(--text-muted);
}

/* ===== Settings ===== */
.settings-layout {
  position: relative;
  z-index: 2;
  padding: 20px 24px 80px;
  max-width: 760px;
  margin: 0 auto;
  min-height: calc(100vh - 100px);
}

.panel-white {
  background: var(--panel);
  border: 3px solid color-mix(in srgb, var(--chrome) 40%, #fff);
  border-radius: 16px;
  padding: 20px 22px 24px;
  box-shadow: var(--shadow);
}

.settings-grid {
  display: grid;
  gap: 12px;
}

.setting-row {
  background: color-mix(in srgb, var(--cyan) 8%, var(--panel));
  border: 2px solid color-mix(in srgb, var(--dialogue-border) 50%, transparent);
  border-radius: 12px;
  padding: 14px 16px;
}

.setting-row label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

.setting-help {
  margin: -4px 0 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.control-row input[type="range"] {
  flex: 1;
  accent-color: var(--cyan-deep);
}

.value-pill {
  min-width: 52px;
  text-align: center;
  font-weight: 800;
  background: var(--panel);
  border: 2px solid var(--dialogue-border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.9rem;
  color: var(--cyan-deep);
}

body.dark .value-pill {
  color: var(--cyan-bright);
}

.toggle-label {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 !important;
  cursor: pointer;
}

.toggle-label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-ui {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: var(--bg-deep);
  border: 2px solid var(--chrome);
  position: relative;
  flex-shrink: 0;
}

.toggle-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--cyan-deep);
  transition: transform 0.15s ease;
}

.toggle-label input:checked + .toggle-ui {
  background: var(--cyan);
}

.toggle-label input:checked + .toggle-ui::after {
  transform: translateX(18px);
}

.upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.check-inline {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  margin: 0 !important;
  font-weight: 600 !important;
  color: var(--text-muted);
  cursor: pointer;
}

.check-inline input {
  width: 16px;
  height: 16px;
  accent-color: var(--cyan-deep);
}

.sound-library-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
}

.sound-library-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 2px solid color-mix(in srgb, var(--dialogue-border) 40%, var(--chrome));
  border-radius: 10px;
  padding: 8px 10px;
}

.sound-meta {
  flex: 1;
  min-width: 0;
}

.sound-meta strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sound-meta span {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.btn-delete,
.btn-play-mini {
  border: 2px solid var(--dialogue-border);
  background: var(--cyan-soft);
  border-radius: 8px;
  padding: 6px 10px;
  font-weight: 700;
  cursor: pointer;
}

.btn-delete {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, var(--panel));
  border-color: color-mix(in srgb, var(--danger) 40%, #fff);
}

.empty-note {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 8px 0 0;
}

.empty-note[hidden] {
  display: none;
}

/* ===== Game ===== */
.game-stage {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  padding: 20px 20px 28px;
  min-height: calc(100vh - 56px);
  max-width: 1000px;
  margin: 0 auto;
  align-items: stretch;
}

.judges-rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}

.judge {
  background: var(--panel);
  border: 3px solid var(--dialogue-border);
  border-radius: 12px;
  padding: 8px 6px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.judge.revealed {
  border-color: var(--cyan-deep);
  transform: scale(1.03);
}

.judge-face {
  font-size: 1.4rem;
  line-height: 1;
}

.judge-name {
  font-weight: 800;
  font-size: 0.78rem;
  margin: 2px 0;
}

.judge-score {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--cyan-deep);
  min-height: 1.3em;
}

body.dark .judge-score {
  color: var(--cyan-bright);
}

.judge-comment {
  font-size: 0.68rem;
  color: var(--text-muted);
  min-height: 2em;
  line-height: 1.2;
}

.stage-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 0;
}

.clip-portrait {
  background: var(--panel);
  border: 3px solid var(--dialogue-border);
  border-radius: 14px;
  padding: 14px 24px;
  min-width: 180px;
  text-align: center;
  box-shadow: var(--shadow);
}

.clip-name {
  margin: 0;
  font-weight: 800;
  font-size: 1.15rem;
  max-width: 280px;
  word-break: break-word;
}

/* Choicer Voicer match waveform (canvas) */
.wave-box {
  width: min(100%, 680px);
  height: 150px;
  background: #0a0a12;
  border: 4px solid var(--cyan);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--cyan-deep) 50%, #000);
}

#wave-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.wave-labels {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 10px;
}

.wave-label {
  opacity: 0.7;
  text-shadow: 0 1px 2px #000;
}

.wave-label.target {
  color: var(--cyan);
}

.wave-label.player {
  color: var(--magenta);
}

.wave-box.active {
  border-color: var(--cyan-bright);
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 56px;
}

.dialogue-box {
  position: relative;
  width: min(100%, 520px);
  background: var(--panel);
  border: 3px solid var(--dialogue-border);
  border-radius: 16px;
  padding: 14px 36px 14px 18px;
  box-shadow: var(--shadow);
  text-align: left;
}

.dialogue-box p {
  margin: 0;
  font-weight: 600;
  line-height: 1.35;
}

.dialogue-box .status-line {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 1.2em;
}

.dialogue-dot {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  opacity: 0.5;
}

/* ===== Results ===== */
.results-center {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
  text-align: center;
  gap: 14px;
}

.score-display-box {
  background: #0a1a3a;
  border: 5px solid #6a8aa0;
  border-radius: 8px;
  padding: 16px 36px;
  min-width: 160px;
  box-shadow: 0 4px 0 #4a6578;
}

.score-display {
  font-family: "Consolas", "Courier New", monospace;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: #dce8ff;
  letter-spacing: 0.04em;
}

.results-sub {
  margin: 0;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.results-dialog {
  text-align: center;
}

.results-actions {
  display: grid;
  gap: 10px;
  width: min(100%, 280px);
  margin-top: 8px;
}

.results-actions .cv-btn-wide {
  max-width: none;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: #fff;
  border: 3px solid var(--cyan);
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  z-index: 50;
  max-width: min(90vw, 420px);
  text-align: center;
  box-shadow: var(--shadow);
}

.toast[hidden] {
  display: none;
}

/* Responsive */
@media (max-width: 800px) {
  .menu-layout {
    align-items: center;
    text-align: center;
    padding: 28px 20px 90px;
  }

  .logo-title,
  .logo-main,
  .logo-voice {
    align-items: center;
  }

  .menu-stack {
    justify-items: center;
    max-width: none;
  }

  .game-stage {
    grid-template-columns: 1fr;
  }

  .judges-rail {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .judge {
    min-width: 88px;
    flex: 1 1 88px;
    max-width: 120px;
  }
}

@media (max-width: 520px) {
  .logo-oice,
  .logo-game,
  .mic-glyph {
    font-size: 2.4rem;
  }

  .chrome-bottom .hint-line {
    display: none;
  }
}

/* ===== Multiplayer / Account ===== */
.menu-user-line {
  margin: 8px 0 0;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.mp-hub, .lobby-layout, .account-layout {
  max-width: 640px;
  margin: 20px auto 80px;
  padding: 22px;
}

.mp-hub-grid {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.mp-input {
  border: 2px solid var(--dialogue-border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--panel);
  font-weight: 700;
  min-width: 100px;
}

.mp-input.wide {
  flex: 1;
  min-width: 160px;
  width: 100%;
}

.join-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.public-rooms-list, .friend-list, .lobby-player-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.public-rooms-list li,
.friend-list li,
.lobby-player-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 2px solid color-mix(in srgb, var(--dialogue-border) 50%, var(--chrome));
  border-radius: 10px;
  background: color-mix(in srgb, var(--cyan) 6%, var(--panel));
}

.lobby-code-block {
  text-align: center;
  margin-bottom: 18px;
}

.lobby-code {
  font-family: "Consolas", "Courier New", monospace;
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--cyan-deep);
  margin: 6px 0 12px;
}

body.dark .lobby-code {
  color: var(--cyan-bright);
}

.lobby-public {
  justify-content: center;
}

.lobby-actions {
  margin-top: 16px;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.lobby-player-list .host-tag {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent, #c45c26);
  color: var(--cyan-deep);
}

.mp-intro-inner {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  text-align: center;
  background: var(--bg);
}

.mp-intro-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  width: min(100%, 360px);
}

.mp-intro-list li {
  padding: 14px 18px;
  border-radius: 12px;
  border: 3px solid var(--dialogue-border);
  background: var(--panel);
  font-weight: 800;
  font-size: 1.2rem;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  animation: mp-pop 0.45s ease forwards;
  box-shadow: var(--shadow);
}

.mp-intro-list li:nth-child(1) { animation-delay: 0.15s; }
.mp-intro-list li:nth-child(2) { animation-delay: 0.35s; }
.mp-intro-list li:nth-child(3) { animation-delay: 0.55s; }
.mp-intro-list li:nth-child(4) { animation-delay: 0.75s; }

.mp-intro-list li .turn-num {
  color: var(--cyan-deep);
  margin-right: 8px;
}

.mp-intro-sub {
  color: var(--text-muted);
  font-weight: 700;
}

@keyframes mp-pop {
  to { opacity: 1; transform: none; }
}

.account-forms {
  display: grid;
  gap: 10px;
}

.account-panel h3 {
  margin: 18px 0 8px;
}

.mp-scoreboard {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}

.mp-scoreboard .chip {
  background: var(--surface-2, #eef);
  background: color-mix(in srgb, var(--cyan) 10%, var(--panel));
  border: 2px solid var(--dialogue-border);
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 700;
  font-size: 0.85rem;
}

.mp-scoreboard .chip.me {
  border-color: var(--cyan-deep);
}

.mp-scoreboard .chip.turn {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--magenta) 50%, transparent);
}

/* ===== Chat / reactions / mobile / podium ===== */
.room-chat-panel {
  width: min(100%, 520px);
  margin-top: 12px;
  background: var(--panel);
  border: 2px solid var(--dialogue-border);
  border-radius: 12px;
  padding: 10px;
  text-align: left;
}

.chat-log {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  max-height: 140px;
  overflow: auto;
  display: grid;
  gap: 4px;
  font-size: 0.88rem;
}

.chat-log li {
  padding: 4px 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--cyan) 6%, transparent);
}

.chat-log .chat-name {
  font-weight: 800;
  color: var(--cyan-deep);
  margin-right: 6px;
}

body.dark .chat-log .chat-name { color: var(--cyan-bright); }

.chat-compose {
  display: flex;
  gap: 8px;
  align-items: center;
}

.reaction-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.react-btn {
  border: 2px solid var(--dialogue-border);
  background: var(--panel);
  border-radius: 999px;
  font-size: 1.15rem;
  padding: 4px 10px;
  cursor: pointer;
}

.react-btn:active { transform: scale(0.95); }

.reaction-float {
  min-height: 28px;
  font-size: 1.4rem;
  letter-spacing: 0.15em;
  text-align: center;
  margin-bottom: 6px;
}

.lobby-qr {
  margin: 10px auto;
  width: 120px;
  height: 120px;
  background: #fff;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.lobby-qr img {
  width: 120px;
  height: 120px;
  display: block;
}

.round-winner-banner {
  margin-top: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--cyan) 18%, var(--panel));
  border: 3px solid var(--cyan-deep);
  font-weight: 800;
  font-size: 1.05rem;
}

.podium-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  width: min(100%, 320px);
  text-align: left;
}

.podium-list li {
  padding: 10px 14px;
  border-radius: 12px;
  border: 2px solid var(--dialogue-border);
  background: var(--panel);
  font-weight: 800;
  display: flex;
  justify-content: space-between;
}

.podium-list li.gold { border-color: #e0b000; background: color-mix(in srgb, #e0b000 15%, var(--panel)); }
.podium-list li.silver { border-color: #a0a8b0; }
.podium-list li.bronze { border-color: #c67b3e; }

.reconnect-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: var(--panel);
  border: 3px solid var(--cyan);
  border-radius: 999px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
  font-weight: 700;
  max-width: 92vw;
}

/* class { display:flex } was overriding the hidden attribute — banner looked stuck */
.reconnect-banner[hidden] {
  display: none !important;
}

.kick-btn {
  font-size: 0.75rem;
  padding: 4px 8px;
}

/* Mobile */
@media (max-width: 600px) {
  .menu-layout {
    padding: 20px 14px 90px;
  }

  .menu-stack {
    max-width: none;
    width: 100%;
  }

  .game-stage {
    padding: 12px 10px 20px;
    min-height: calc(100vh - 48px);
  }

  .wave-box {
    height: 120px;
    width: 100%;
  }

  .mic-btn {
    width: 140px;
    height: 64px;
  }

  .game-actions .cv-btn {
    width: 100%;
  }

  .room-chat-panel {
    width: 100%;
  }

  .chat-log {
    max-height: 100px;
  }

  .mp-hub, .lobby-layout, .account-layout {
    margin: 12px 10px 80px;
    padding: 14px;
  }

  .lobby-code {
    letter-spacing: 0.12em;
    font-size: 2rem;
  }

  .chrome-top, .chrome-bottom {
    padding: 8px 10px;
  }

  .settings-layout {
    padding: 12px 10px 80px;
  }

  #mp-scoreboard {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }
}
