:root {
  --bg: #0a0512;
  --ink: #f3edff;
  --ink-soft: rgba(243, 237, 255, 0.66);
  --pink: #ff2ec4;
  --cyan: #2be8ff;
  --violet: #8b5cf6;
  --gold: #ffcc33;
  --green: #39ff88;
  --line: rgba(139, 92, 246, 0.35);
  --line-soft: rgba(139, 92, 246, 0.18);
  --glow-pink: 0 0 16px rgba(255, 45, 196, 0.45);
  --glow-cyan: 0 0 16px rgba(43, 232, 255, 0.4);
  --glow-gold: 0 0 16px rgba(255, 204, 51, 0.4);
  --glow-green: 0 0 16px rgba(57, 255, 136, 0.4);
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.55);
  --radius: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  position: relative;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(255, 45, 196, 0.16), transparent 60%),
    radial-gradient(900px 520px at 100% 0%, rgba(43, 232, 255, 0.14), transparent 55%),
    radial-gradient(700px 500px at 50% 120%, rgba(139, 92, 246, 0.2), transparent 60%),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: overlay;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px);
}

body.phase-finished::after {
  animation: victory-reveal 0.8s ease forwards;
  background-image:
    linear-gradient(180deg, rgba(10, 5, 18, 0.5) 0%, rgba(10, 5, 18, 0.22) 45%, rgba(10, 5, 18, 0.93) 100%),
    url("/img/wallpaper-scene.jpg");
  background-position: center 10%;
  background-repeat: no-repeat;
  background-size: cover;
  content: "";
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  z-index: 0;
}

@keyframes victory-reveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.victory-confetti {
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  position: fixed;
}

.victory-confetti i {
  animation: confetti-drift 3.2s ease-in-out infinite;
  border-radius: 1px;
  height: 10px;
  opacity: 0.85;
  position: absolute;
  width: 6px;
}

@keyframes confetti-drift {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
  50% { transform: translateY(10px) rotate(var(--rot, 0deg)); }
}

@media (prefers-reduced-motion: reduce) {
  .victory-confetti i {
    animation: none;
  }
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.app-shell {
  width: min(100%, 980px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 18px 92px;
  position: relative;
  z-index: 1;
}

.bottom-nav {
  background: rgba(12, 6, 24, 0.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  bottom: 0;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: space-around;
  left: 0;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  position: fixed;
  right: 0;
  width: 100%;
  z-index: 40;
}

.nav-tab {
  align-items: center;
  color: var(--ink-soft);
  display: grid;
  gap: 3px;
  justify-items: center;
  min-width: 64px;
  padding: 4px 6px;
}

.nav-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.nav-label {
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-tab.active {
  color: var(--pink);
  filter: drop-shadow(0 0 8px rgba(255, 45, 196, 0.5));
}

.screen-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.round-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 4px 0 2px;
}

.round-dot {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  height: 8px;
  width: 8px;
}

.round-dot.active {
  background: var(--pink);
  box-shadow: var(--glow-pink);
}

.host-tag {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.nav-tab.actionable {
  cursor: pointer;
  transition: transform 0.15s ease;
}

.nav-tab.actionable:hover,
.nav-tab.actionable:active {
  transform: translateY(-2px);
  color: var(--cyan);
}

.nav-tab.actionable.active:hover,
.nav-tab.actionable.active:active {
  color: var(--pink);
}

/* Modal */
.modal-overlay {
  align-items: center;
  background: rgba(5, 2, 12, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 60;
  animation: modal-fade 0.18s ease;
}

.modal-panel {
  background: linear-gradient(180deg, #1a0f2e, #0b0614);
  border: 1px solid var(--cyan);
  border-radius: var(--radius);
  box-shadow: var(--glow-cyan), var(--shadow);
  display: grid;
  gap: 12px;
  max-height: 82vh;
  max-width: 420px;
  overflow-y: auto;
  padding: 20px;
  width: 100%;
  animation: modal-pop 0.2s ease;
}

.modal-panel.wide {
  max-width: 520px;
}

.modal-panel.danger {
  border-color: var(--pink);
  box-shadow: var(--glow-pink), var(--shadow);
}

.modal-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.modal-message {
  color: var(--ink-soft);
  margin: 0;
}

.modal-body {
  display: grid;
  gap: 10px;
}

.modal-body .rules-item {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  margin: 0;
  padding: 10px;
}

@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Toast */
.toast {
  background: #150c28;
  border: 1px solid var(--cyan);
  border-radius: 100px;
  box-shadow: var(--glow-cyan), var(--shadow);
  bottom: 92px;
  color: var(--ink);
  font-weight: 800;
  left: 50%;
  padding: 10px 18px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 70;
  animation: toast-in 0.2s ease;
}

.toast-success {
  border-color: var(--green);
  box-shadow: var(--glow-green), var(--shadow);
}

.toast-error {
  border-color: var(--pink);
  box-shadow: var(--glow-pink), var(--shadow);
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Message banner */
.message {
  align-items: center;
  display: flex;
  gap: 8px;
}

.message-icon {
  flex: 0 0 auto;
}

.message-text {
  flex: 1 1 auto;
}

.message-close {
  background: transparent;
  border: 0;
  color: inherit;
  flex: 0 0 auto;
  font-size: 0.85rem;
  font-weight: 900;
  line-height: 1;
  opacity: 0.6;
  padding: 4px;
}

.message-close:hover,
.message-close:active {
  opacity: 1;
}

.message-error {
  background: rgba(255, 45, 196, 0.12);
  border-color: var(--pink);
  color: var(--pink);
}

/* Connection dot */
.conn-dot {
  border-radius: 50%;
  flex: 0 0 auto;
  height: 9px;
  width: 9px;
}

.conn-dot.online {
  background: var(--green);
  box-shadow: 0 0 6px rgba(57, 255, 136, 0.7);
}

.conn-dot.offline {
  background: rgba(255, 255, 255, 0.25);
}

/* Progress bar */
.progress-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  height: 8px;
  margin: 4px 0 12px;
  overflow: hidden;
}

.progress-fill {
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  border-radius: 100px;
  height: 100%;
  transition: width 0.3s ease;
}

/* Timer danger state */
.timer.danger {
  animation: timer-pulse 1s ease-in-out infinite;
  border-color: var(--pink);
  box-shadow: var(--glow-pink), inset 0 0 30px rgba(255, 45, 196, 0.1);
  color: var(--pink);
  text-shadow: 0 0 18px rgba(255, 45, 196, 0.65);
}

@keyframes timer-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* Link row */
.link-row {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.link-row code {
  background: #0b0614;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--cyan);
  flex: 1 1 auto;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 8px;
}

.splash {
  align-items: center;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(255, 45, 196, 0.16), transparent 60%),
    radial-gradient(900px 520px at 100% 0%, rgba(43, 232, 255, 0.14), transparent 55%),
    radial-gradient(700px 500px at 50% 120%, rgba(139, 92, 246, 0.2), transparent 60%),
    var(--bg);
  display: flex;
  flex-direction: column;
  gap: 22px;
  inset: 0;
  justify-content: center;
  opacity: 1;
  overflow: hidden;
  padding: 24px;
  position: fixed;
  transition: opacity 0.4s ease;
  z-index: 50;
}

.splash::before {
  background-image:
    linear-gradient(180deg, rgba(10, 5, 18, 0.45) 0%, rgba(10, 5, 18, 0.55) 55%, rgba(10, 5, 18, 0.9) 100%),
    url("/img/wallpaper-scene.jpg");
  background-position: center 18%;
  background-repeat: no-repeat;
  background-size: cover;
  content: "";
  filter: blur(7px) brightness(0.55) saturate(0.85);
  inset: -20px;
  position: absolute;
  transform: scale(1.06);
  z-index: 0;
}

.splash-logo,
.splash-bar,
.splash-status {
  position: relative;
  z-index: 1;
}

.splash-hide {
  opacity: 0;
  pointer-events: none;
}

.splash-logo {
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
}

.splash-title {
  animation: splash-pulse 1.8s ease-in-out infinite;
  background: linear-gradient(90deg, var(--pink), var(--violet) 55%, var(--cyan));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  font-size: clamp(2.2rem, 12vw, 4rem);
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 0.95;
  margin: 0;
  text-transform: uppercase;
}

.splash-title span {
  -webkit-text-fill-color: var(--gold);
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255, 204, 51, 0.6);
}

.splash-tag {
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 0;
  text-transform: uppercase;
}

.splash-bar {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 100px;
  height: 8px;
  overflow: hidden;
  width: min(72vw, 260px);
}

.splash-bar-fill {
  animation: splash-load 1.1s ease-in-out infinite;
  background: linear-gradient(90deg, var(--pink), var(--violet), var(--cyan));
  border-radius: 100px;
  height: 100%;
  width: 40%;
}

.splash-status {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin: 0;
  text-align: center;
  text-transform: uppercase;
}

@keyframes splash-pulse {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(255, 45, 196, 0.35)); }
  50% { filter: drop-shadow(0 0 22px rgba(43, 232, 255, 0.55)); }
}

@keyframes splash-load {
  0% { margin-left: -40%; }
  100% { margin-left: 100%; }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 18px;
}

.brand {
  display: grid;
  gap: 2px;
}

.brand-title {
  margin: 0;
  font-size: clamp(1.5rem, 7vw, 3rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  font-weight: 900;
  background: linear-gradient(90deg, var(--pink), var(--violet) 55%, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(255, 45, 196, 0.35));
}

.brand-title span {
  color: var(--gold);
  -webkit-text-fill-color: var(--gold);
  text-shadow: 0 0 12px rgba(255, 204, 51, 0.6);
}

.tagline {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge {
  align-items: center;
  background: linear-gradient(135deg, var(--pink), var(--violet));
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  box-shadow: var(--glow-pink);
  color: white;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 42px;
  min-width: 78px;
  padding: 8px 10px;
  text-align: center;
  text-transform: uppercase;
}

.top-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
  min-height: 42px;
  padding: 8px 12px;
  text-transform: uppercase;
}

.icon-btn.menu-btn {
  font-size: 1.15rem;
  line-height: 1;
  min-width: 42px;
  padding: 8px 14px;
}

.header-menu-backdrop {
  background: transparent;
  inset: 0;
  position: fixed;
  z-index: 45;
}

.header-menu {
  background: linear-gradient(180deg, #1a0f2e, #0b0614);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--glow-cyan), var(--shadow);
  display: grid;
  gap: 4px;
  margin: -6px 0 14px;
  padding: 6px;
  position: relative;
  z-index: 46;
  animation: modal-pop 0.15s ease;
}

.header-menu-item {
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.86rem;
  padding: 12px 10px;
  text-align: left;
  min-height: 44px;
}

.header-menu-item:hover,
.header-menu-item:active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--cyan);
}

.header-menu-item.danger {
  color: var(--pink);
}

.header-menu-item.danger:hover,
.header-menu-item.danger:active {
  background: rgba(255, 51, 102, 0.1);
  color: var(--pink);
}

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  padding: 16px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gate-panel {
  margin-top: min(22vh, 160px);
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.input,
.select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  min-height: 48px;
  padding: 10px 12px;
  width: 100%;
}

.input:focus,
.select:focus {
  outline: 2px solid var(--cyan);
  outline-offset: 1px;
  box-shadow: var(--glow-cyan);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.actions.inline {
  margin: 0;
}

.actions.inline .btn {
  min-height: 36px;
  padding: 7px 9px;
}

.btn {
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--ink);
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  letter-spacing: 0.03em;
  min-height: 48px;
  padding: 12px 14px;
  text-transform: uppercase;
}

.btn.primary {
  background: linear-gradient(90deg, var(--pink), var(--violet));
  border-color: transparent;
  box-shadow: var(--glow-pink);
  color: #fff;
}

.btn.secondary {
  background: rgba(43, 232, 255, 0.12);
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn.warning {
  background: rgba(255, 204, 51, 0.14);
  border-color: var(--gold);
  color: var(--gold);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn.danger {
  border-color: var(--pink);
  color: var(--pink);
}

.btn:disabled {
  box-shadow: none;
  cursor: not-allowed;
  filter: grayscale(0.5);
  opacity: 0.4;
}

.message {
  background: rgba(255, 204, 51, 0.12);
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  color: var(--gold);
  font-weight: 800;
  margin: 0 0 14px;
  padding: 10px 12px;
}

.current-character {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan), var(--shadow);
}

.danger-zone {
  border-color: var(--pink);
  box-shadow: var(--glow-pink), var(--shadow);
}

.scoreboard,
.mini-list {
  display: grid;
  gap: 8px;
}

.score-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
  max-width: 220px;
}

.mini-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 900;
  min-height: 28px;
  padding: 4px 6px;
  text-transform: uppercase;
}

.lobby-list,
.team-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 12px;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--cyan) transparent;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.character-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 4px 16px;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--pink) transparent;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.character-grid-2x2 {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 4px 0 8px;
}

.character-card {
  align-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink);
  display: grid;
  gap: 8px;
  flex: 0 0 min(84vw, 340px);
  justify-items: center;
  min-height: 330px;
  padding: 18px 12px;
  scroll-snap-align: center;
  text-align: center;
}

.character-grid-2x2 .character-card {
  flex: none;
  min-height: 210px;
  padding: 14px 8px;
}

.character-grid-2x2 .avatar {
  height: clamp(90px, 26vw, 120px);
  width: clamp(90px, 26vw, 120px);
}

.character-grid-2x2 .character-name {
  font-size: 0.9rem;
}

.character-card.green {
  border-color: var(--green);
  box-shadow: var(--glow-green), var(--shadow);
}

.character-card.yellow {
  border-color: var(--gold);
  box-shadow: var(--glow-gold), var(--shadow);
}

.character-card.blue {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan), var(--shadow);
}

.character-card.pink {
  border-color: var(--pink);
  box-shadow: var(--glow-pink), var(--shadow);
}

.character-card.selected {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.03));
}

.character-card:disabled {
  cursor: not-allowed;
  filter: grayscale(0.6);
  opacity: 0.4;
}

.avatar {
  align-items: center;
  background: transparent;
  border: 0;
  color: white;
  display: flex;
  filter: drop-shadow(0 0 18px rgba(139, 92, 246, 0.35));
  font-size: 2rem;
  font-weight: 900;
  height: clamp(170px, 54vw, 240px);
  justify-content: center;
  width: clamp(170px, 54vw, 240px);
}

.avatar img {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.avatar-badge {
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  display: inline-flex;
  flex: 0 0 auto;
  font-weight: 900;
  justify-content: center;
  overflow: hidden;
}

.avatar-badge.green {
  border-color: var(--green);
  box-shadow: var(--glow-green);
}

.avatar-badge.yellow {
  border-color: var(--gold);
  box-shadow: var(--glow-gold);
}

.avatar-badge.blue {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}

.avatar-badge.pink {
  border-color: var(--pink);
  box-shadow: var(--glow-pink);
}

.avatar-badge.compact {
  height: 64px;
  width: 64px;
}

.avatar-badge.medium {
  height: 86px;
  width: 86px;
}

.avatar-badge.large {
  height: clamp(120px, 36vw, 180px);
  width: clamp(120px, 36vw, 180px);
}

.avatar-badge img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.character-name {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.05;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.player-row,
.score-row,
.found-row {
  align-items: center;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-height: 44px;
  padding: 8px 10px;
}

.lobby-list .player-row,
.team-list .player-row {
  flex: 0 0 min(78vw, 340px);
  min-height: 72px;
  scroll-snap-align: start;
}

.player-name {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.player-identity,
.active-player-card {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
}

.character-summary {
  align-items: stretch;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  display: grid;
  gap: 12px;
  padding: 12px;
}

.character-summary .player-identity {
  justify-content: center;
}

.character-summary .player-name {
  font-size: 1.25rem;
  max-width: 15ch;
  overflow-wrap: normal;
  text-align: left;
  word-break: normal;
}

.character-summary .btn {
  width: 100%;
}

.active-player-card p {
  margin: 0 0 6px;
}

.team-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  min-height: 140px;
  padding: 12px;
}

.section-title {
  align-items: center;
  display: flex;
  font-size: 1rem;
  font-weight: 900;
  gap: 8px;
  justify-content: space-between;
  letter-spacing: 0.02em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.pill {
  background: rgba(57, 255, 136, 0.14);
  border: 1px solid var(--green);
  border-radius: 100px;
  color: var(--green);
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 5px 10px;
  text-transform: uppercase;
}

.game-head {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
  align-items: start;
}

.timer {
  align-items: center;
  background: #0b0614;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--glow-gold), inset 0 0 30px rgba(255, 204, 51, 0.08);
  color: var(--gold);
  display: flex;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: clamp(2rem, 12vw, 5rem);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  justify-content: center;
  line-height: 1;
  min-height: 92px;
  min-width: 112px;
  padding: 10px;
  text-shadow: 0 0 18px rgba(255, 204, 51, 0.65);
}

.card-stage {
  display: grid;
  margin: 18px auto;
  max-width: 460px;
  min-height: 320px;
  perspective: 900px;
}

.card-stage.swipe-found .game-card {
  transform: translateX(28px) rotate(2deg);
}

.card-stage.swipe-pass .game-card {
  transform: translateX(-28px) rotate(-2deg);
}

.game-card {
  align-content: space-between;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(10, 5, 18, 0.6));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  min-height: 320px;
  overflow: hidden;
  padding: 16px;
  position: relative;
}

.game-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px);
}

.card-kicker {
  align-self: start;
  border-radius: 100px;
  color: #0b0614;
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 7px 10px;
  position: relative;
  text-transform: uppercase;
  width: fit-content;
  z-index: 1;
}

.game-card.music .card-kicker { background: var(--pink); box-shadow: var(--glow-pink); }
.game-card.screen .card-kicker { background: var(--cyan); box-shadow: var(--glow-cyan); }
.game-card.people .card-kicker { background: var(--green); box-shadow: var(--glow-green); }
.game-card.objects .card-kicker { background: var(--gold); box-shadow: var(--glow-gold); }

.game-card.music { border-color: var(--pink); }
.game-card.screen { border-color: var(--cyan); }
.game-card.people { border-color: var(--green); }
.game-card.objects { border-color: var(--gold); }

.review-panel {
  display: grid;
  gap: 10px;
}

.review-panel .small {
  margin: 0;
}

.review-card-list {
  display: grid;
  gap: 12px;
  padding: 4px 0;
}

.review-card {
  align-content: space-between;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(10, 5, 18, 0.6));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  min-height: 150px;
  padding: 12px;
}

.review-card.music { border-color: var(--pink); box-shadow: var(--glow-pink), var(--shadow); }
.review-card.screen { border-color: var(--cyan); box-shadow: var(--glow-cyan), var(--shadow); }
.review-card.people { border-color: var(--green); box-shadow: var(--glow-green), var(--shadow); }
.review-card.objects { border-color: var(--gold); box-shadow: var(--glow-gold), var(--shadow); }

.review-card.music .card-kicker { background: var(--pink); box-shadow: var(--glow-pink); }
.review-card.screen .card-kicker { background: var(--cyan); box-shadow: var(--glow-cyan); }
.review-card.people .card-kicker { background: var(--green); box-shadow: var(--glow-green); }
.review-card.objects .card-kicker { background: var(--gold); box-shadow: var(--glow-gold); }

.review-progress-line {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.review-progress-count {
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 800;
}

.review-filter {
  margin: 2px 0 4px;
}

.review-row-list {
  display: grid;
  gap: 2px;
  max-height: 46vh;
  overflow-y: auto;
  padding-right: 2px;
}

.review-row {
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  gap: 10px;
  padding: 9px 4px;
}

.review-row:last-child {
  border-bottom: 0;
}

.review-row-index {
  color: var(--ink-soft);
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 800;
  min-width: 18px;
}

.review-row-dot {
  border-radius: 50%;
  flex: 0 0 auto;
  height: 9px;
  width: 9px;
}

.review-row.music .review-row-dot { background: var(--pink); box-shadow: var(--glow-pink); }
.review-row.screen .review-row-dot { background: var(--cyan); box-shadow: var(--glow-cyan); }
.review-row.people .review-row-dot { background: var(--green); box-shadow: var(--glow-green); }
.review-row.objects .review-row-dot { background: var(--gold); box-shadow: var(--glow-gold); }

.review-row-word {
  flex: 1 1 auto;
  font-size: 0.9rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-row-btn {
  flex: 0 0 auto;
  font-size: 0.66rem;
  min-height: 34px;
  padding: 6px 10px;
}

.review-card strong {
  display: block;
  font-size: 1.3rem;
  line-height: 1.08;
  margin-top: 14px;
  overflow-wrap: anywhere;
}

.review-card .btn {
  width: 100%;
}

.review-card-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.review-number {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 900;
}

.card-word {
  align-self: center;
  font-size: clamp(2.2rem, 12vw, 4.5rem);
  font-weight: 900;
  line-height: 1.02;
  overflow-wrap: anywhere;
  position: relative;
  text-align: center;
  text-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
  text-transform: uppercase;
  z-index: 1;
}

.card-help {
  background: rgba(255, 204, 51, 0.1);
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  font-size: clamp(1rem, 4vw, 1.35rem);
  font-weight: 800;
  line-height: 1.25;
  padding: 10px;
  position: relative;
  z-index: 1;
}

.card-number {
  align-self: end;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 800;
  justify-self: end;
  position: relative;
  z-index: 1;
}

.waiting {
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 12px;
  justify-items: center;
  min-height: 260px;
  padding: 20px;
  text-align: center;
}

.waiting strong {
  font-size: clamp(1.7rem, 9vw, 3.8rem);
  line-height: 1;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.start-card {
  border-color: var(--pink);
  box-shadow: var(--glow-pink), var(--shadow);
}

.score-row strong {
  color: var(--cyan);
  font-size: 1.4rem;
  text-shadow: 0 0 10px rgba(43, 232, 255, 0.5);
}

.small {
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.rules-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.rule-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 100px;
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 8px 12px;
  text-transform: uppercase;
}

.rule-chip.active {
  background: rgba(57, 255, 136, 0.14);
  border-color: var(--green);
  box-shadow: var(--glow-green);
  color: var(--green);
}

.link-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.link-list code {
  background: #0b0614;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--cyan);
  display: block;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
  padding: 8px;
}

.save-list,
.review-found-list {
  display: grid;
  gap: 10px;
}

.save-row {
  align-items: center;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-height: 58px;
  padding: 10px 12px;
  text-align: left;
}

.save-row-main {
  background: transparent;
  border: 0;
  color: inherit;
  display: grid;
  flex: 1 1 auto;
  gap: 3px;
  min-width: 0;
  padding: 0;
  text-align: left;
}

.save-row-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.save-row-actions .btn {
  min-height: 36px;
  padding: 7px 10px;
}

.home-choice-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-choice-card {
  align-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink);
  display: grid;
  gap: 6px;
  justify-items: center;
  min-height: 160px;
  padding: 20px 12px;
  text-align: center;
}

.home-choice-card:not(:disabled):hover,
.home-choice-card:not(:disabled):focus-visible {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan), var(--shadow);
}

.home-choice-icon {
  font-size: 1.6rem;
  font-weight: 900;
}

.new-player {
  background: rgba(139, 92, 246, 0.08);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 12px;
  margin-top: 10px;
  padding: 12px;
}

.toggle-row {
  align-items: center;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: flex;
  font-weight: 800;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
}

.toggle-row input {
  accent-color: var(--pink);
  height: 22px;
  width: 22px;
}

.teams-drawer {
  background: #150c28;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  margin-bottom: 14px;
  padding: 12px;
  position: sticky;
  top: 8px;
  z-index: 20;
}

.swipe-hint {
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  margin: 6px 0 0;
  text-align: center;
  text-transform: uppercase;
}

.found-review-row,
.vote-box {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 10px;
  padding: 10px;
}

.found-review-row {
  align-items: center;
  grid-template-columns: 1fr auto;
}

.found-review-row.removed {
  opacity: 0.5;
  text-decoration: line-through;
}

.vote-box.open {
  border-color: var(--gold);
  box-shadow: var(--glow-gold);
}

.vote-box.accepted {
  border-color: var(--pink);
  box-shadow: var(--glow-pink);
}

.vote-box.rejected {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}

.gm-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gm-grid > div,
.history-row {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.history-list {
  display: grid;
  gap: 6px;
}

.history-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.phone-link-grid {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
}

.phone-link-grid code {
  background: #0b0614;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--cyan);
  display: block;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
  padding: 10px;
}

.qr-code {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  height: 150px;
  padding: 6px;
  width: 150px;
}

@media (max-width: 760px) {
  .app-shell {
    padding: 12px;
  }

  .grid.two,
  .game-head {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: start;
  }

  .badge {
    min-width: 62px;
  }

  .actions .btn {
    flex: 1 1 140px;
  }

  .top-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .save-row,
  .found-review-row {
    grid-template-columns: 1fr;
  }

  .home-choice-grid {
    grid-template-columns: 1fr;
  }

  .gm-grid,
  .phone-link-grid {
    grid-template-columns: 1fr;
  }

  .qr-code {
    justify-self: center;
  }

  .character-card {
    flex-basis: min(88vw, 360px);
  }
}
