@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800;900&display=swap');

/* Spot the Spy — design tokens */
:root {
  --gp-sky: #89cff0;
  --gp-sky-deep: #6eb8e0;
  --gp-sky-light: #b0d9fa;
  --gp-brand: #3652cc;
  --gp-brand-light: #427aea;
  --gp-ink: #1e1e2f;
  --gp-ink-soft: #3d3d56;
  --gp-border: #2a2a3a;
  --gp-border-width: 4px;
  --gp-panel: #ffffff;
  --gp-yellow: #fdad00;
  --gp-yellow-dark: #c98900;
  --gp-orange: #fdad00;
  --gp-start: #a855f7;
  --gp-start-dark: #6d28d9;
  --gp-accent: #a855f7;
  --gp-accent-bright: #fdad00;
  --gp-accent-dark: #7c3aed;
  --gp-secondary: #fdad00;
  --gp-secondary-dark: #c98900;
  --gp-danger: #ff0013;
  --gp-danger-dark: #cc0010;
  --gp-purple: #c084fc;
  --gp-text-muted: #5a5a72;
  --gp-radius: 20px;
  --gp-radius-sm: 14px;
  --gp-font-display: 'Nunito', system-ui, sans-serif;
  --gp-font: 'Nunito', system-ui, sans-serif;
  --gp-shadow-3d: 0 8px 0 1px var(--gp-border);
  --gp-shadow-soft: 0 14px 28px rgba(30, 30, 47, 0.22);
  --gp-shadow-panel: 0 8px 0 1px var(--gp-border), 0 18px 36px rgba(30, 30, 47, 0.2);
  --gp-shadow-green: 0 8px 0 var(--gp-start-dark), 0 12px 20px rgba(109, 40, 217, 0.28);
  --gp-shadow-danger: 0 8px 0 var(--gp-danger-dark), 0 12px 20px rgba(204, 0, 16, 0.28);
  --gp-shadow-yellow: 0 8px 0 var(--gp-yellow-dark), 0 12px 20px rgba(201, 137, 0, 0.28);
  --gp-game-bg-color: #87259d;
  --gp-game-bg-image:
    repeating-conic-gradient(
      from 0deg at 50% 50%,
      transparent 0deg,
      transparent 7deg,
      rgba(255, 255, 255, 0.045) 7deg,
      rgba(255, 255, 255, 0.045) 8.5deg
    ),
    linear-gradient(
      90deg,
      #ca2e61 0%,
      #b22882 22%,
      #87259d 50%,
      #6c1ab5 78%,
      #5e0abc 100%
    );
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--gp-font);
  color: var(--gp-ink);
  background-color: var(--gp-game-bg-color);
  background-image: var(--gp-game-bg-image);
  background-attachment: fixed;
}

body:has(#roomApp:not(.hidden)) {
  overflow: hidden;
  height: 100dvh;
}

a { color: var(--gp-brand); font-weight: 800; text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }

/* ── App shell ── */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.app-header {
  width: 100%;
  max-width: 760px;
  padding: 16px 20px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: transparent;
  border: none;
  position: relative;
  z-index: 10;
}

.app-header--lobby {
  max-width: 760px;
}

.app-header--room {
  max-width: 1400px;
  margin-bottom: 6px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 16px 16px 0;
}

.app-header--room .room-header-actions {
  margin-left: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand:hover {
  text-decoration: none;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gp-panel);
  border: var(--gp-border-width) solid var(--gp-border);
  display: grid;
  place-items: center;
  font-size: 22px;
  box-shadow: var(--gp-shadow-3d);
}

.brand-text h1 {
  margin: 0;
  font-family: var(--gp-font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gp-panel);
  text-shadow: 2px 2px 0 var(--gp-border), -1px -1px 0 var(--gp-border);
  text-decoration: none;
}

.brand-icon img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.brand-icon--logo {
  width: auto;
  height: 42px;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.brand-icon--logo img {
  height: 42px;
  width: auto;
  border-radius: 0;
  object-fit: contain;
}

.icon-img {
  width: 1.1em;
  height: 1.1em;
  display: inline-block;
  vertical-align: -0.15em;
  object-fit: contain;
}

.btn .icon-img {
  width: 1em;
  height: 1em;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  min-width: 36px;
  min-height: 36px;
}

.btn-start-icon {
  display: inline-flex;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
}

.btn-start-icon img {
  width: 34px;
  height: 34px;
  display: block;
}

.htp-illustration img {
  width: 100%;
  max-width: 320px;
  height: auto;
  display: block;
}

.error-page-icon img {
  width: 64px;
  height: 64px;
  display: block;
  margin: 0 auto;
}

.room-code .icon-img,
.join-gate-code .icon-img {
  width: 1em;
  height: 1em;
  margin-right: 4px;
}

.lang-pill {
  padding: 6px 14px;
  background: var(--gp-panel);
  border: 3px solid var(--gp-border);
  border-radius: 999px;
  font-family: var(--gp-font-display);
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 6px 0 1px var(--gp-border), var(--gp-shadow-soft);
}

button.lang-pill,
.lang-pill[data-lang-switch] {
  cursor: pointer;
  color: inherit;
}

.app-main {
  width: 100%;
  max-width: 520px;
  padding: 8px 16px 48px;
  flex: 1;
}

.app-main--lobby {
  max-width: 720px;
  background: transparent;
}

.app-main--wide {
  max-width: 1400px;
}

/* ── Hero title ── */
.page-hero {
  text-align: center;
  margin-bottom: 20px;
}

.brand-title {
  font-family: var(--gp-font-display);
  font-size: clamp(2.2rem, 8vw, 3.2rem);
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow:
    3px 3px 0 var(--gp-border),
    -2px -2px 0 var(--gp-border),
    2px -2px 0 var(--gp-border),
    -2px 2px 0 var(--gp-border),
    0 4px 0 rgba(0,0,0,0.15);
}

.brand-subtitle {
  margin: 8px 0 0;
  font-family: var(--gp-font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gp-panel);
  text-shadow: 1px 1px 0 var(--gp-border);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Белый/светлый fill не должен заходить под border — иначе на скруглениях виден просвет */
.gp-surface,
.panel,
.card,
.modal-content,
.form-input,
.form-select,
.terminal-input,
.mode-switch,
.mode-switch-btn.active,
.how-to-play-step,
.player-card,
.user-info,
.social-btn,
.voting-option,
.btn-ghost,
.game-card,
.avatar-frame,
.location-set-item,
.chat-section,
.chat-compose,
.how-to-play-nav button {
  background-clip: padding-box;
  background-origin: padding-box;
}

/* ── White panel with thick border ── */
.card,
.panel {
  background: var(--gp-panel);
  border: var(--gp-border-width) solid var(--gp-border);
  border-radius: var(--gp-radius);
  box-shadow: var(--gp-shadow-panel);
  padding: 24px 22px;
}

.panel--main {
  padding: 28px 32px 32px;
}

.card + .card,
.panel + .panel {
  margin-top: 16px;
}

.panel--flush {
  padding: 0;
  overflow: hidden;
}

.panel--flush .chat-section {
  background: transparent;
}

.panel--flush .chat-header {
  border-radius: calc(var(--gp-radius) - var(--gp-border-width))
    calc(var(--gp-radius) - var(--gp-border-width)) 0 0;
}

.panel--flush .chat-input-row {
  border-radius: 0 0 calc(var(--gp-radius) - var(--gp-border-width))
    calc(var(--gp-radius) - var(--gp-border-width));
}

.panel-heading {
  margin: 0 0 18px;
  font-family: var(--gp-font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  color: var(--gp-ink-soft);
}

/* ── Mode switch (Anonymous / Authorization) ── */
.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: -4px -4px 24px;
  padding: 4px;
  background: #eef1f8;
  border: 3px solid var(--gp-border);
  border-radius: var(--gp-radius-sm);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}

.mode-switch-btn {
  padding: 14px 12px;
  border: 3px solid transparent;
  border-radius: 10px;
  background: transparent;
  font-family: var(--gp-font-display);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gp-text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.mode-switch-btn:hover:not(.active) {
  color: var(--gp-ink);
  background: rgba(255,255,255,0.6);
}

.mode-switch-btn.active {
  background: var(--gp-panel);
  color: var(--gp-ink);
  border-color: var(--gp-border);
  box-shadow: var(--gp-shadow-3d);
}

.mode-panel {
  display: none;
}

.mode-panel.active {
  display: block;
}

.auth-tabs--inline {
  margin-bottom: 16px;
}

/* ── How to play ── */
.how-to-play {
  margin-top: 20px;
}

.how-to-play-title {
  margin: 0 0 20px;
  font-family: var(--gp-font-display);
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gp-ink);
}

.how-to-play-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.how-to-play-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  background: #f8f9fc;
  border: 3px solid var(--gp-border);
  border-radius: var(--gp-radius-sm);
  box-shadow: 0 6px 0 1px rgba(42, 42, 58, 0.18), 0 8px 16px rgba(30, 30, 47, 0.08);
}

.step-num {
  flex-shrink: 0;
  font-family: var(--gp-font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gp-brand);
  line-height: 1;
  min-width: 28px;
}

.step-body {
  flex: 1;
  min-width: 0;
}

.step-title {
  margin: 0 0 4px;
  font-family: var(--gp-font-display);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gp-ink);
}

.step-text {
  margin: 0;
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--gp-text-muted);
}

.step-text:empty::before,
.step-text:has(:only-child) {
  content: none;
}

.card-title {
  font-family: var(--gp-font-display);
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 6px;
  color: var(--gp-ink);
}

.card-subtitle {
  text-align: center;
  margin: 0 0 20px;
  color: var(--gp-text-muted);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.45;
}

.hero-card { display: none; }

/* ── Avatar picker ── */
.avatar-section {
  margin-bottom: 16px;
}

.avatar-picker label,
.avatar-section > label {
  display: block;
  text-align: center;
  font-family: var(--gp-font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gp-ink-soft);
  margin-bottom: 12px;
}

.avatar-carousel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.avatar-frame {
  padding: 12px;
  background: #f8f9fc;
  border: 3px solid var(--gp-border);
  border-radius: var(--gp-radius);
  display: flex;
  justify-content: center;
}

.player-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--gp-brand-light);
  cursor: pointer;
  transition: transform 0.15s;
  background: #fff;
}

.player-avatar:hover { transform: scale(1.06); }

.avatar-hint {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gp-text-muted);
  margin-top: 8px;
}

.avatar-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.avatar-list img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  background: #f0f4ff;
  padding: 4px;
  transition: transform 0.12s, border-color 0.12s;
}

.avatar-list img:hover {
  border-color: var(--gp-brand);
  transform: scale(1.08);
}

/* ── Inputs ── */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--gp-font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gp-ink-soft);
  text-align: center;
}

.form-input,
.form-select,
.terminal-input {
  width: 100%;
  padding: 14px 16px;
  border: 3px solid var(--gp-border);
  border-radius: var(--gp-radius-sm);
  font: 800 1.05rem var(--gp-font);
  text-align: center;
  color: var(--gp-ink);
  background: #fff;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}

.form-input:focus,
.form-select:focus,
.terminal-input:focus {
  outline: none;
  border-color: var(--gp-brand);
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  cursor: pointer;
}

.form-checkbox input {
  width: 20px;
  height: 20px;
  accent-color: var(--gp-start);
}

/* ── Buttons (3D) ── */
.btn,
.button,
.terminal-button-primary,
.button-primary,
.terminal-button-secondary,
.button-secondary,
.button-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 24px;
  border: 3px solid var(--gp-border);
  border-radius: var(--gp-radius-sm);
  font-family: var(--gp-font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  text-decoration: none;
  color: #fff;
}

.btn:active,
.button:active { transform: translateY(3px); box-shadow: none !important; }

.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 0.8rem; }

.btn-primary,
.button-primary,
.terminal-button-primary {
  background: var(--gp-start);
  box-shadow: var(--gp-shadow-green);
}

.btn-secondary,
.button-secondary,
.terminal-button-secondary {
  background: var(--gp-yellow);
  color: var(--gp-ink);
  box-shadow: var(--gp-shadow-yellow);
}

.btn-success {
  background: var(--gp-start);
  box-shadow: var(--gp-shadow-green);
}

.btn-danger,
.button-danger {
  background: var(--gp-danger);
  box-shadow: 0 5px 0 var(--gp-danger-dark);
}

.btn-ghost {
  background: #fff;
  color: var(--gp-ink);
  box-shadow: var(--gp-shadow-3d), 0 10px 18px rgba(30, 30, 47, 0.1);
}

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--gp-text-muted);
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 3px;
  background: #e0e4ec;
  border-radius: 2px;
}

/* ── Social / auth ── */
.social-buttons { display: flex; flex-direction: column; gap: 10px; }

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 3px solid var(--gp-border);
  border-radius: var(--gp-radius-sm);
  background: #fff;
  font-family: var(--gp-font-display);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 3px 0 1px var(--gp-border);
  text-transform: uppercase;
}

.social-btn img { width: 22px; height: 22px; }

.social-btn--brand {
  padding: 14px 20px;
}

.social-btn--brand img {
  width: auto;
  height: 36px;
  max-width: min(220px, 100%);
  object-fit: contain;
}

.user-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 3px solid var(--gp-border);
  border-radius: var(--gp-radius-sm);
  font-weight: 800;
  background: #f8f9fc;
}

.status-pill {
  display: none;
}

.app-footer {
  padding: 16px;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.9);
  text-shadow: 1px 1px 0 var(--gp-border);
}

.app-footer--room {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 16px 32px;
}

.room-footer-logo {
  display: block;
  width: min(240px, 72vw);
  text-decoration: none;
}

.room-footer-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.app-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 8px;
}

/* ── Modals ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 30, 47, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 2500;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--gp-panel);
  border: var(--gp-border-width) solid var(--gp-border);
  border-radius: var(--gp-radius);
  box-shadow: var(--gp-shadow-panel);
  padding: 24px;
  width: min(440px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-content .close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 3px solid var(--gp-border);
  border-radius: 50%;
  background: var(--gp-yellow);
  background-clip: padding-box;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  box-shadow: none;
  filter: drop-shadow(0 3px 0 var(--gp-border));
}

.modal-content h3 {
  margin: 0 0 16px;
  font-family: var(--gp-font-display);
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; }

.tab-link {
  flex: 1;
  padding: 10px;
  border: 3px solid var(--gp-border);
  border-radius: var(--gp-radius-sm);
  background: #f0f4ff;
  font-family: var(--gp-font-display);
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.tab-link.active {
  background: var(--gp-brand);
  color: #fff;
  box-shadow: 0 3px 0 var(--gp-border);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.error-message {
  margin-top: 12px;
  padding: 12px;
  border: 3px solid var(--gp-danger);
  border-radius: var(--gp-radius-sm);
  background: #fff0f0;
  color: var(--gp-danger-dark);
  font-weight: 800;
  font-size: 0.9rem;
}

.location-sets-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }

.location-set-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 3px solid var(--gp-border);
  border-radius: var(--gp-radius-sm);
  font-weight: 800;
  background: #f8f9fc;
}

.location-set-item-actions { display: flex; gap: 6px; }

/* ── Room page ── */
.room-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.room-code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--gp-yellow);
  border: 3px solid var(--gp-border);
  border-radius: 999px;
  font-family: var(--gp-font-display);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--gp-yellow-dark), 0 2px 5px rgba(201, 137, 0, 0.16);
  color: var(--gp-ink);
  transition: transform 0.1s, box-shadow 0.1s;
  user-select: none;
}

.room-code:active {
  transform: translateY(2px);
  box-shadow: none;
}

.room-code span { letter-spacing: 0.08em; }

.room-voice-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 3px solid var(--gp-border);
  border-radius: 999px;
  font-family: var(--gp-font-display);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--gp-ink);
  text-decoration: none;
  box-shadow: 0 3px 0 1px var(--gp-border);
  transition: transform 0.1s, box-shadow 0.1s;
}

.room-voice-link:hover {
  text-decoration: none;
  color: var(--gp-ink);
  transform: translateY(-1px);
}

.room-voice-link.hidden {
  display: none;
}

.room-voice-link-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

.room-settings-field-error {
  margin: 8px 0 0;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.4;
  color: var(--gp-danger);
}

.room-settings-field-error.hidden {
  display: none;
}

.room-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.room-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  align-items: stretch;
}

.room-side-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.room-side-column > .panel--flush {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.room-side-column .chat-section {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

@media (max-width: 900px) {
  .room-grid { grid-template-columns: 1fr; }
  .room-side-column { min-height: 0; }
}

.panel-title {
  margin: 0 0 14px;
  font-family: var(--gp-font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  color: var(--gp-ink-soft);
}

.players-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f8f9fc;
  border: 3px solid var(--gp-border);
  border-radius: var(--gp-radius-sm);
  cursor: pointer;
  transition: transform 0.1s;
}

.player-card:hover { transform: translateX(2px); background: #fff; }
.player-card.is-out { opacity: 0.5; }

.player-card--self {
  background: #eef4ff;
  border-color: var(--gp-brand);
  box-shadow: inset 0 0 0 1px rgba(74, 108, 247, 0.15);
}

.player-card--self:hover {
  background: #e8f0ff;
}

.player-card--self .player-card-avatar {
  border-color: var(--gp-brand);
}

.player-card--asker {
  border-color: var(--gp-orange);
  background: #fff8ef;
}

.player-card--target {
  border-color: var(--gp-brand);
  background: #eef4ff;
}

.player-card-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gp-brand-light);
  flex-shrink: 0;
}

.player-card-info { flex: 1; min-width: 0; }

.player-card-name {
  font-family: var(--gp-font-display);
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-card-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  border: 2px solid var(--gp-border);
}

.badge-ready { background: #d4f5dc; }
.badge-waiting { background: #fff3cd; }
.badge-votes { background: #e8f0ff; color: var(--gp-brand); }
.badge-spy { background: #ffd6d6; }
.badge-player { background: #d6e4ff; }
.badge-out { background: #e9ecef; color: var(--gp-text-muted); }
.badge-self { background: var(--gp-brand); color: #fff; border-color: #3a56c4; }

.player-card-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ccc;
  border: 2px solid var(--gp-border);
  flex-shrink: 0;
}

.player-card-status.online { background: var(--gp-start); }

.btn-kick {
  padding: 4px 8px;
  border: 2px solid var(--gp-border);
  border-radius: 8px;
  background: var(--gp-danger);
  color: #fff;
  font-weight: 800;
  font-size: 0.7rem;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--gp-danger-dark);
}

/* ── Game phase ── */
.game-phase { padding: 20px; }

#phaseTitle {
  margin: 0 0 6px;
  font-family: var(--gp-font-display);
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

#phaseDescription {
  margin: 0;
  text-align: center;
  font-weight: 700;
  color: var(--gp-text-muted);
  font-size: 0.9rem;
}

.game-timer {
  display: block;
  width: fit-content;
  margin: 12px auto 0;
  padding: 8px 20px;
  background: var(--gp-brand);
  color: #fff;
  border: 3px solid var(--gp-border);
  border-radius: 999px;
  font-family: var(--gp-font-display);
  font-weight: 700;
  font-size: 1.2rem;
  box-shadow: 0 3px 0 var(--gp-border);
}

.game-timer.urgent {
  background: var(--gp-danger);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  50% { transform: scale(1.04); }
}

.game-card {
  margin-top: 16px;
  padding: 24px 16px;
  text-align: center;
  background: #f8f9fc;
  border: 3px dashed var(--gp-border);
  border-radius: var(--gp-radius-sm);
}

.game-card h3 {
  margin: 0 0 8px;
  font-family: var(--gp-font-display);
  font-weight: 700;
  font-size: 1.2rem;
}

.game-card p {
  margin: 0;
  font-weight: 700;
  color: var(--gp-text-muted);
  line-height: 1.5;
}

.game-card.spy { background: #fff0f0; border-style: solid; border-color: var(--gp-danger); }
.game-card.spy h3 { color: var(--gp-danger-dark); }
.game-card.spy .spy-partners {
  margin-top: 12px;
  font-weight: 700;
  color: var(--gp-danger-dark);
}
.game-card.player { background: #e8f8ef; border-style: solid; border-color: var(--gp-start); }
.game-card.player h3 { color: var(--gp-start-dark); }
.game-card.eliminated { background: #f0f0f0; }

.role-reveal {
  margin-top: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  width: 100%;
}

.role-reveal-scene {
  height: 100%;
  perspective: 900px;
}

.role-reveal-card {
  position: relative;
  height: 100%;
  width: auto;
  aspect-ratio: 1;
  transform-style: preserve-3d;
  transform: rotateY(180deg) scale(0.92);
  transition: transform 0.95s cubic-bezier(0.22, 1.08, 0.36, 1);
}

.role-reveal--shown .role-reveal-card {
  transform: rotateY(0deg) scale(1);
}

.role-reveal--instant .role-reveal-card {
  transform: rotateY(0deg) scale(1);
  transition: none;
}

.role-reveal-side {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
}

.role-reveal-side--back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 6px 0 1px var(--gp-border),
    0 14px 24px rgba(30, 30, 47, 0.28);
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.04) 0 8px,
      transparent 8px 16px
    ),
    linear-gradient(145deg, #2a1038 0%, #5e0abc 45%, #87259d 100%);
  border: 3px solid var(--gp-border);
}

.role-reveal-back-stamp {
  font-family: var(--gp-font-display);
  font-weight: 900;
  font-size: 0.5rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  padding: 4px 8px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
}

.role-reveal-back-mark {
  font-family: var(--gp-font-display);
  font-weight: 900;
  font-size: clamp(1.6rem, 8vw, 2.4rem);
  line-height: 1;
  color: rgba(255, 255, 255, 0.18);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.role-reveal-side--front {
  transform: rotateY(0deg);
  overflow: visible;
  background: transparent;
  border: none;
  box-shadow: none;
}

.role-reveal-art {
  display: block;
  height: 100%;
  width: auto;
  max-width: none;
  object-fit: contain;
}

.role-reveal--spy .role-reveal-art {
  filter:
    drop-shadow(0 6px 0 var(--gp-danger-dark))
    drop-shadow(0 10px 18px rgba(204, 0, 16, 0.28));
}

.role-reveal--citizen .role-reveal-art {
  filter:
    drop-shadow(0 6px 0 var(--gp-border))
    drop-shadow(0 10px 18px rgba(30, 30, 47, 0.28));
}

.role-reveal-brief-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 0, 19, 0.14) 48%,
    transparent 100%
  );
  opacity: 0;
  animation: roleRevealBriefScan 2.4s ease-in-out 1.1s 2;
}

@keyframes roleRevealBriefScan {
  0%, 100% { transform: translateX(-110%); opacity: 0; }
  12%, 88% { opacity: 1; }
  50% { transform: translateX(110%); }
}

.role-reveal-brief {
  min-width: 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 3px solid var(--gp-border);
  background: var(--gp-panel);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  opacity: 0;
  transform: translateX(16px) scale(0.98);
  transition:
    opacity 0.55s ease,
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: 0.82s;
}

.role-reveal--shown .role-reveal-brief {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.role-reveal--instant .role-reveal-brief {
  opacity: 1;
  transform: none;
  transition: none;
}

.role-reveal--spy .role-reveal-brief {
  position: relative;
  background: linear-gradient(180deg, #fff5f5 0%, #fff 100%);
  border-color: var(--gp-danger-dark);
  box-shadow: var(--gp-shadow-danger);
}

.role-reveal--citizen .role-reveal-brief {
  background: linear-gradient(180deg, #f8f9fc 0%, #fff 100%);
  border-color: var(--gp-border);
  box-shadow: var(--gp-shadow-3d);
}

.role-reveal-brief-label {
  display: inline-block;
  margin-bottom: 8px;
  font-family: var(--gp-font-display);
  font-weight: 900;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gp-text-muted);
}

.role-reveal--spy .role-reveal-brief-label { color: var(--gp-danger-dark); }
.role-reveal--citizen .role-reveal-brief-label { color: var(--gp-ink); }

.role-reveal-location {
  margin: 0 0 8px;
  width: 100%;
  font-family: var(--gp-font-display);
  font-weight: 900;
  font-size: clamp(1.15rem, 4.2vw, 1.75rem);
  line-height: 1.12;
  color: var(--gp-ink);
  word-break: break-word;
}

.role-reveal-brief-desc {
  margin: 0;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--gp-text-muted);
}

.role-reveal-brief-body {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
}

.role-reveal-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 2px solid var(--gp-danger-dark);
  background: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--gp-danger-dark);
}

.role-reveal-solo {
  display: block;
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--gp-danger-dark);
}

@media (prefers-reduced-motion: reduce) {
  .role-reveal-card,
  .role-reveal-brief,
  .role-reveal-brief-scan {
    animation: none !important;
    transition: none !important;
  }

  .role-reveal-brief {
    opacity: 1;
    transform: none;
  }
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e0e4ec;
  border-top-color: var(--gp-brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

.turn-display {
  margin: 0 0 14px;
  padding: 14px 16px;
  background: #fff;
  border: 3px solid var(--gp-border);
  border-radius: var(--gp-radius-sm);
  text-align: center;
  box-shadow: 0 3px 0 1px var(--gp-border);
}

.turn-display.hidden {
  display: none;
}

.turn-display-text {
  font-family: var(--gp-font-display);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.45;
}

.turn-display-round {
  margin-top: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gp-text-muted);
  text-transform: uppercase;
}

.turn-display .btn {
  margin-top: 12px;
}

/* ── Voting ── */
.voting-section h3 {
  font-family: var(--gp-font-display);
  text-align: center;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.voting-timer {
  display: block;
  width: fit-content;
  margin: 0 auto 16px;
  padding: 10px 24px;
  background: var(--gp-orange);
  border: 3px solid var(--gp-border);
  border-radius: 999px;
  font-family: var(--gp-font-display);
  font-weight: 700;
  font-size: 1.3rem;
  box-shadow: 0 3px 0 var(--gp-border);
}

.voting-timer.warning { background: var(--gp-yellow); }
.voting-timer.danger { background: var(--gp-danger); color: #fff; }

.voting-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.voting-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: #fff;
  border: 3px solid var(--gp-border);
  border-radius: var(--gp-radius-sm);
  cursor: pointer;
  box-shadow: 0 3px 0 1px var(--gp-border);
  transition: transform 0.1s;
}

.voting-option:hover { transform: translateY(-2px); }
.voting-option.selected {
  border-color: var(--gp-start);
  background: #e8f8ef;
  box-shadow: 0 3px 0 1px var(--gp-start-dark);
}

.voting-option--self {
  cursor: default;
  background: #f4f6fb;
}

.voting-option--self:hover {
  transform: none;
}

.voting-option-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gp-brand-light);
}

.voting-option-name {
  font-family: var(--gp-font-display);
  font-weight: 700;
  font-size: 0.85rem;
  text-align: center;
}

.voting-option-votes,
.voting-option-count {
  font-weight: 800;
  font-size: 0.75rem;
  color: var(--gp-text-muted);
}

/* ── Chat ── */
.chat-section {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-header,
.chat-input-row,
.typing-indicator {
  flex-shrink: 0;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  background: var(--gp-brand);
  color: #fff;
  border-bottom: 3px solid var(--gp-border);
}

.chat-header h3 {
  margin: 0;
  font-family: var(--gp-font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.chat-controls { display: flex; gap: 6px; }

.chat-header .btn-ghost {
  padding: 4px 8px;
  font-size: 0.75rem;
  border-width: 2px;
  box-shadow: 0 2px 0 var(--gp-border);
}

.chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px;
  background: #fafbfd;
}

.chat-message {
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.4;
}

.chat-message.own {
  background: #e8f0ff;
  border-left: 4px solid var(--gp-brand);
}

.chat-message.system {
  background: #fff8e1;
  border-left: 4px solid var(--gp-yellow-dark);
  font-size: 0.85rem;
}

.chat-message.voting-result {
  margin: 12px 0;
  padding: 14px 16px;
  text-align: center;
  border: 3px solid var(--gp-border);
  border-radius: var(--gp-radius-sm);
  box-shadow: 0 4px 0 1px var(--gp-border);
}

.chat-message.voting-result--eliminated {
  background: #fff0f0;
  border-color: var(--gp-danger);
  box-shadow: 0 4px 0 1px var(--gp-danger-dark, #c62828);
}

.chat-message.voting-result--tie {
  background: #fffbea;
  border-color: var(--gp-yellow-dark);
  box-shadow: 0 4px 0 1px var(--gp-yellow-dark);
}

.voting-result-label {
  font-family: var(--gp-font-display);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gp-text-muted);
  margin-bottom: 6px;
}

.voting-result-headline {
  font-family: var(--gp-font-display);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
}

.voting-result--eliminated .voting-result-headline {
  color: var(--gp-danger-dark, #c62828);
}

.voting-result--tie .voting-result-headline {
  color: #9a6700;
}

.voting-result-tally {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 2px dashed rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.voting-result-tally-row {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gp-ink-soft);
}

.voting-result-time {
  margin-top: 8px;
  font-size: 0.68rem;
  color: var(--gp-text-muted);
}

.chat-message-author {
  font-family: var(--gp-font-display);
  color: var(--gp-brand);
  margin-right: 6px;
}

.chat-message-time {
  font-size: 0.7rem;
  color: var(--gp-text-muted);
}

.chat-message-text .mention { color: var(--gp-purple); font-weight: 900; }
.chat-message-text .link { color: var(--gp-brand); font-weight: 900; }

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 3px solid var(--gp-border);
  background: #fff;
  position: relative;
}

.chat-input-row .form-input {
  text-align: left;
  font-size: 0.95rem;
  padding: 10px 12px;
}

.chat-input-row .btn-icon {
  padding: 8px 10px;
  min-width: 40px;
}

.typing-indicator {
  padding: 4px 12px 8px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--gp-text-muted);
  font-style: italic;
}

#gameControls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 3px dashed #e0e4ec;
}

.room-settings-modal {
  max-width: 480px;
  overflow: visible;
}

.room-settings-grid {
  display: grid;
  gap: 12px;
}

.room-settings-grid .form-group {
  margin-bottom: 0;
}

.room-settings-checkbox {
  grid-column: 1 / -1;
  margin-top: 2px;
}

.room-settings-label-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.room-settings-label-row label {
  cursor: pointer;
}

.setting-help {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.setting-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 2px solid var(--gp-border);
  border-radius: 50%;
  background: var(--gp-yellow);
  background-clip: padding-box;
  color: var(--gp-ink);
  font-family: var(--gp-font-display);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  cursor: help;
  box-shadow: none;
  filter: drop-shadow(0 2px 0 var(--gp-border));
  user-select: none;
}

.setting-help-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translateX(-50%);
  z-index: 30;
  width: max-content;
  max-width: min(260px, 70vw);
  padding: 10px 12px;
  border: 3px solid var(--gp-border);
  border-radius: var(--gp-radius-sm);
  background: #fff;
  background-clip: padding-box;
  color: var(--gp-ink);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  white-space: normal;
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.setting-help-tooltip::before {
  content: '';
  position: absolute;
  top: calc(100% - 1px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #fff;
}

.setting-help-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: var(--gp-border);
  z-index: -1;
}

.setting-help:hover .setting-help-tooltip,
.setting-help:focus-visible .setting-help-tooltip {
  opacity: 1;
  visibility: visible;
}

.setting-help:focus-visible .setting-help-icon {
  outline: 2px solid var(--gp-accent);
  outline-offset: 2px;
}

.room-settings-suboptions {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 12px 14px;
  background: #f4f6fb;
  border: 2px solid var(--gp-border);
  border-radius: var(--gp-radius-sm);
}

.room-settings-suboptions.hidden {
  display: none;
}

.room-settings-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.room-settings-actions .btn {
  width: 100%;
  margin: 0;
}

.room-settings-copied {
  margin-top: 10px;
  padding: 10px 12px;
  border: 3px solid var(--gp-start);
  border-radius: var(--gp-radius-sm);
  background: rgba(17, 176, 60, 0.1);
  color: var(--gp-start-dark);
  font-weight: 800;
  font-size: 0.85rem;
  text-align: center;
}

@media (min-width: 520px) {
  .room-settings-grid {
    grid-template-columns: 1fr 1fr;
  }

  .room-settings-grid .form-group:first-child {
    grid-column: 1 / -1;
  }
}

#gameControls:empty {
  display: none;
  margin: 0;
  padding: 0;
  border: none;
}

#gameControls .btn,
#gameControls .button {
  width: 100%;
  margin: 0;
}

.observer-note {
  width: 100%;
  text-align: center;
  padding: 10px;
  border: 3px dashed var(--gp-border);
  border-radius: var(--gp-radius-sm);
  background: #fff8e1;
  font-weight: 800;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.results-section h3 {
  font-family: var(--gp-font-display);
  text-align: center;
  text-transform: uppercase;
}

#resultContent {
  margin: 16px 0;
  font-weight: 800;
  line-height: 1.6;
  text-align: center;
}

/* ── Toasts ── */
.notification,
.terminal-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  max-width: 320px;
  padding: 14px 18px;
  border: 3px solid var(--gp-border);
  border-radius: var(--gp-radius-sm);
  font-family: var(--gp-font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  z-index: 10000;
  box-shadow: var(--gp-shadow-3d);
  transform: translateX(calc(100% + 40px));
  transition: transform 0.3s ease;
}

.notification.show { transform: translateX(0); }

.notification-info, .terminal-notification-info { background: var(--gp-brand); }
.notification-success, .terminal-notification-success { background: var(--gp-start); }
.notification-warning, .terminal-notification-warning { background: var(--gp-yellow); color: var(--gp-ink); }
.notification-error, .terminal-notification-error { background: var(--gp-danger); }

/* ── Loading ── */
.loading-indicator {
  position: fixed;
  inset: 0;
  background: rgba(137, 207, 240, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  gap: 16px;
}

.loading-indicator p {
  font-family: var(--gp-font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--gp-ink);
  text-transform: uppercase;
}

.loader-dots { display: flex; gap: 10px; }

.loader-dots .dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gp-start);
  border: 3px solid var(--gp-border);
  animation: bounce 1.2s infinite ease-in-out;
}

.loader-dots .dot:nth-child(2) { animation-delay: 0.15s; background: var(--gp-yellow); }
.loader-dots .dot:nth-child(3) { animation-delay: 0.3s; background: var(--gp-brand); }

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
}

/* ── Error pages ── */
.error-page-icon { font-size: 4rem; text-align: center; }

.error-code-big {
  text-align: center;
  font-family: var(--gp-font-display);
  font-size: 4rem;
  font-weight: 700;
  color: var(--gp-brand);
}

.error-box {
  padding: 14px;
  border: 3px solid var(--gp-border);
  border-radius: var(--gp-radius-sm);
  background: #f8f9fc;
  font-weight: 800;
  text-align: center;
}

.confirm-dialog-buttons {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.confirm-dialog-buttons .btn { flex: 1; }

@media (max-width: 640px) {
  .brand-title { font-size: 2rem; }
  .app-main { padding-bottom: 32px; }
}

/* ══════════════════════════════════════════════════════════════
   LOBBY layout
   ══════════════════════════════════════════════════════════════ */

/* Shared game background (lobby, room, etc.) */
.app-shell--lobby,
.app-shell--room {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--gp-game-bg-color);
  background-image: var(--gp-game-bg-image);
  background-attachment: fixed;
}

.app-shell--room {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

.app-shell--room .app-header--room {
  flex-shrink: 0;
  margin-bottom: 0;
}

.app-shell--room .app-main--wide {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: 8px;
  padding-bottom: 8px;
}

.app-shell--room .room-grid {
  flex: 1 1 auto;
  min-height: 0;
}

.app-shell--room .room-grid > .panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.app-shell--room .room-grid > .panel .panel-heading {
  flex-shrink: 0;
}

.app-shell--room .panel--flush .chat-section {
  height: 100%;
}

.app-shell--room .players-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.app-shell--room #gameControls {
  flex-shrink: 0;
}

.app-shell--room .room-side-column {
  min-height: 0;
  height: 100%;
}

.app-shell--room .room-side-column .game-phase {
  flex: 0 1 auto;
  max-height: min(42vh, 380px);
  overflow-y: auto;
}

.app-shell--room .room-side-column .chat-section {
  flex: 1 1 auto;
  min-height: 0;
}

.app-shell--room .chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.app-shell--room .app-footer--room {
  flex-shrink: 0;
  padding-top: 12px;
  padding-bottom: 16px;
}

@media (max-width: 900px) {
  .app-shell--room .room-grid {
    grid-template-rows: minmax(0, 36%) minmax(0, 1fr);
  }

  .app-shell--room .room-grid > .panel:first-child {
    min-height: 0;
  }

  .app-shell--room .room-side-column .game-phase {
    max-height: min(34vh, 280px);
  }
}

.app-shell--lobby {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
}

.app-shell--lobby .app-main--lobby {
  max-width: 1400px;
  width: 100%;
  padding: 0;
  flex: 0 0 auto;
  background: transparent;
}

.panel--lobby {
  width: 100%;
  min-height: clamp(620px, 90vh, 1020px);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(26, 14, 46, 0.88);
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 28px;
  box-shadow:
    0 32px 72px rgba(0, 0, 0, 0.52),
    0 14px 0 rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: var(--gp-font);
}

.panel--secondary {
  margin-top: 16px;
  background: var(--gp-panel);
  color: var(--gp-ink);
}

.lobby-panel-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 12px;
  padding: 28px 40px 12px;
}

.lobby-header-spacer {
  width: 1px;
}

.lang-pill--lobby {
  justify-self: start;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
}

.lobby-logo-block {
  text-align: center;
  justify-self: center;
}

.lobby-logo {
  display: block;
  width: min(380px, 82vw);
  height: auto;
  margin: 0 auto;
}

.brand-title--lobby {
  font-family: var(--gp-font-display);
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  font-weight: 700;
  margin: 0;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow:
    3px 3px 0 #000,
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000,
    0 4px 0 rgba(0, 0, 0, 0.15);
}

.brand-subtitle--lobby {
  margin: 10px 0 0;
  font-family: var(--gp-font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lobby-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0;
  flex: 1;
  min-height: 540px;
}

.lobby-entry {
  --folder-bg: rgba(32, 18, 56, 0.95);
  --folder-border: rgba(255, 255, 255, 0.22);
  display: flex;
  flex-direction: column;
  padding: 20px 40px 32px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  min-height: 0;
}

/* Folder-style tabs (Anonymous / Authorization) */
.mode-switch--folder {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.mode-switch--folder .mode-switch-btn {
  flex: 1;
  position: relative;
  padding: 12px 16px 13px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px 14px 0 0;
  background: rgba(0, 0, 0, 0.32);
  color: rgba(255, 255, 255, 0.38);
  text-shadow: none;
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.2);
  font-family: var(--gp-font-display);
  font-size: 1.42rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  z-index: 1;
  transition: color 0.15s, background 0.15s, text-shadow 0.15s, border-color 0.15s;
}

.mode-switch--folder .mode-switch-btn:hover:not(.active) {
  color: rgba(255, 255, 255, 0.52);
  background: rgba(0, 0, 0, 0.38);
  text-shadow: none;
}

.mode-switch--folder .mode-switch-btn.active {
  padding: 14px 18px 15px;
  color: var(--gp-accent-bright);
  background: var(--folder-bg);
  border-color: var(--folder-border);
  border-bottom: 2px solid var(--folder-bg);
  margin-bottom: -2px;
  text-shadow:
    2px 2px 0 rgba(0, 0, 0, 0.85),
    0 0 10px rgba(253, 173, 0, 0.45);
  box-shadow: none;
  z-index: 3;
}

.mode-switch--folder .mode-switch-btn.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 4px;
  background: var(--folder-bg);
}

.lobby-entry .mode-panel.active,
.join-gate-panel .mode-panel.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-height: 0;
  position: relative;
  z-index: 2;
  margin-top: 0;
  padding: 24px 20px;
  border: 2px solid var(--folder-border);
  border-top: none;
  background: var(--folder-bg);
  border-radius: 0 0 16px 16px;
  box-shadow: none;
}

.lobby-entry .mode-switch--folder,
.join-gate-panel .mode-switch--folder {
  margin-bottom: 0;
}

.how-to-play-column {
  --folder-bg: rgba(32, 18, 56, 0.95);
  --folder-border: rgba(255, 255, 255, 0.22);
  padding: 20px 40px 32px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Avatar + nickname row */
.entry-row {
  display: flex;
  gap: 28px;
  align-items: center;
  margin-bottom: 24px;
}

.avatar-column {
  flex-shrink: 0;
  width: 200px;
  padding-top: 28px;
  overflow: visible;
}

.avatar-frame--lobby {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 200px;
  height: 188px;
  padding: 0;
  background: transparent;
  border: none;
}

.player-avatar--lobby {
  width: 210px;
  height: 210px;
  border: none;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
  object-position: center bottom;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.player-avatar--lobby:hover {
  transform: scale(1.05);
}

.nickname-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.entry-label {
  display: block;
  margin-bottom: 16px;
  font-family: var(--gp-font-display);
  font-size: clamp(1rem, 2.5vw, 1.22rem);
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.35;
  text-align: center;
}

.lobby-entry .entry-label,
.join-gate .entry-label {
  max-width: 22em;
  margin-left: auto;
  margin-right: auto;
}

.entry-label--auth-avatar {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 0;
  text-align: left;
  font-size: clamp(1.2rem, 3.2vw, 1.55rem);
  font-weight: 900;
}

.form-input--lobby {
  width: 100%;
  min-height: 64px;
  text-align: center;
  font: 800 1.45rem var(--gp-font);
  padding: 18px 22px;
  border-radius: var(--gp-radius-sm);
}

.form-group--lobby label {
  text-align: left;
  font-family: var(--gp-font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
}

.form-group--lobby {
  margin-bottom: 12px;
}

/* White START button */
.btn-start {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: fit-content;
  min-width: 280px;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  background: #fff;
  color: var(--gp-ink);
  border: 4px solid var(--gp-border);
  font-family: var(--gp-font-display);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 20px 56px;
  margin-top: 0;
  box-shadow: 0 8px 0 1px var(--gp-border), 0 14px 28px rgba(0, 0, 0, 0.22);
}

.btn-start:hover:not(.is-loading) {
  filter: brightness(1.02);
}

.btn-start > span:not(.btn-start-icon) {
  font-weight: 900;
}

.btn-lobby-link {
  margin-top: 12px;
  padding: 10px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--gp-font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: none;
}

.btn-lobby-link:hover {
  color: #fff;
  text-decoration: underline;
}

/* Auth tabs in lobby */
.auth-tabs--folder {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.12);
}

.auth-tabs--folder .tab-link {
  flex: 1;
  padding: 12px 10px;
  background: transparent;
  border: none;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  color: rgba(255, 255, 255, 0.45);
  font-family: var(--gp-font-display);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  margin-bottom: -2px;
}

.auth-tabs--folder .tab-link.active {
  color: var(--gp-accent);
  border-bottom-color: var(--gp-accent);
}

.divider--lobby {
  color: rgba(255, 255, 255, 0.35);
  margin: 14px 0;
}

.social-buttons--lobby .social-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.error-message--lobby {
  margin-top: 14px;
  padding: 12px;
  text-align: center;
  background: rgba(255, 0, 19, 0.15);
  border: 3px solid var(--gp-danger);
  border-radius: var(--gp-radius-sm);
  color: var(--gp-danger);
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.user-info--lobby {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

/* How to play carousel */
.panel--lobby .how-to-play-title {
  margin: 0 0 -2px;
  padding: 14px 18px 15px;
  position: relative;
  z-index: 3;
  font-family: var(--gp-font-display);
  font-size: 1.42rem;
  font-weight: 900;
  text-align: center;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gp-accent-bright);
  text-shadow:
    2px 2px 0 rgba(0, 0, 0, 0.85),
    0 0 10px rgba(253, 173, 0, 0.45);
  border: 2px solid var(--folder-border);
  border-bottom: 2px solid var(--folder-bg);
  border-radius: 14px 14px 0 0;
  background: var(--folder-bg);
}

.panel--lobby .how-to-play-title::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 4px;
  background: var(--folder-bg);
}

.how-to-play-column .htp-carousel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-top: 0;
  padding: 20px 16px 12px;
  border: 2px solid var(--folder-border);
  border-top: none;
  border-radius: 0 0 16px 16px;
  background: var(--folder-bg);
}

.htp-carousel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.htp-slides {
  flex: 1;
  min-height: 360px;
}

.htp-slide {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.htp-slide.active {
  display: flex;
  animation: htpFade 0.25s ease;
}

@keyframes htpFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.htp-illustration {
  width: 100%;
  max-width: 320px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  background: transparent;
  border: none;
  border-radius: 0;
}

.htp-step-text {
  margin: 0;
  flex-shrink: 0;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.85);
  max-width: 320px;
}

.htp-step-text strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--gp-font-display);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
}

.htp-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
}

.htp-arrow {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0 0 2px;
  transition: background 0.15s, border-color 0.15s;
}

.htp-arrow:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
}

.htp-dots {
  display: flex;
  gap: 10px;
  align-items: center;
}

.htp-dot {
  position: relative;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.htp-dot-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.htp-dot.active .htp-dot-ring {
  opacity: 1;
  visibility: visible;
}

.htp-dot-ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 2;
}

.htp-dot-ring-progress {
  fill: none;
  stroke: var(--gp-secondary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 62.83;
  stroke-dashoffset: 62.83;
  opacity: 0;
}

.htp-dot.active .htp-dot-ring-progress {
  opacity: 1;
  animation: htpDotProgress 6s linear forwards;
}

@keyframes htpDotProgress {
  to { stroke-dashoffset: 0; }
}

.htp-dot-core {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transition: background 0.15s, transform 0.15s;
}

.htp-dot.active .htp-dot-core {
  background: var(--gp-secondary);
}

.htp-dot:hover:not(.active) .htp-dot-core {
  background: rgba(255, 255, 255, 0.45);
}

/* Panel footer */
.lobby-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 40px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.45);
}

.lobby-footer-brand {
  font-family: var(--gp-font-display);
  letter-spacing: 0.04em;
}

.lobby-footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.lobby-footer-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.lobby-footer-voice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lobby-footer-voice-label {
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.lobby-footer-voice-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.lobby-footer-voice-link:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  text-decoration: none;
}

.lobby-footer-voice-icon {
  display: block;
  flex-shrink: 0;
}

html[lang="en"] [data-lang-only="ru"] {
  display: none;
}

html[lang="ru"] [data-lang-only="en"] {
  display: none;
}

.lobby-footer-links a {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 700;
  text-decoration: none;
}

.lobby-footer-links a:hover {
  color: #fff;
  text-decoration: underline;
}

.lobby-footer-credit a {
  color: var(--gp-accent-bright);
  font-weight: 700;
  text-decoration: none;
}

.lobby-footer-credit a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .app-shell--lobby {
    justify-content: flex-start;
    padding-top: 16px;
  }

  .panel--lobby {
    min-height: auto;
  }

  .lobby-grid {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .lobby-entry {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .lobby-panel-header {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }

  .lobby-logo-block {
    grid-column: 1 / -1;
    order: -1;
  }

  .lobby-header-spacer {
    display: none;
  }

  .htp-slides {
    min-height: 300px;
  }
}

@media (max-width: 480px) {
  .entry-row {
    flex-direction: column;
    align-items: stretch;
  }

  .avatar-column {
    width: 140px;
    padding-top: 18px;
    margin: 0 auto;
  }

  .avatar-frame--lobby {
    width: 140px;
    height: 132px;
  }

  .player-avatar--lobby {
    width: 148px;
    height: 148px;
  }

  .form-input--lobby {
    min-height: 56px;
    font-size: 1.2rem;
    padding: 16px 18px;
  }

  .btn-start {
    min-width: 240px;
    font-size: 1.15rem;
    padding: 18px 40px;
  }

  .btn-start-icon,
  .btn-start-icon img {
    width: 30px;
    height: 30px;
  }

  .lobby-entry,
  .how-to-play-column {
    padding: 16px 18px 20px;
  }

  .lobby-panel-footer {
    flex-direction: column;
    text-align: center;
  }
}

/* ── Room join gate ── */
.join-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background-color: var(--gp-game-bg-color);
  background-image: var(--gp-game-bg-image);
  background-attachment: fixed;
}

.join-gate.visible {
  display: flex;
}

.join-gate-panel {
  --folder-bg: rgba(32, 18, 56, 0.95);
  --folder-border: rgba(255, 255, 255, 0.22);
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: min(920px, 94vw);
  min-height: min(640px, 88vh);
  padding: 32px 40px 40px;
}

.join-gate-panel.panel--lobby {
  min-height: min(640px, 88vh);
}

.join-gate-title {
  margin: 0 0 6px;
  font-family: var(--gp-font-display);
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
}

.join-gate-subtitle {
  margin: 0 0 8px;
  text-align: center;
  font-weight: 700;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.7);
}

.join-gate-code {
  margin: 0 0 20px;
  text-align: center;
  font-family: var(--gp-font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gp-accent-bright);
  letter-spacing: 0.08em;
}

.join-gate-auth-hint,
.auth-panel-hint {
  margin: 0 0 16px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.75);
}

.auth-panel-hint {
  margin-bottom: 20px;
}

.auth-panel-hint--inline {
  margin: 6px 0 0;
  text-align: left;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.65);
}

.auth-avatar-row {
  margin-bottom: 14px;
}

.nickname-column--full {
  width: 100%;
}

.auth-name-row {
  margin-bottom: 14px;
}

.lobby-status,
.room-status {
  margin: 12px auto 0;
  max-width: 720px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.65);
}

.room-status {
  margin: 0 0 12px;
  color: var(--gp-error, #e74c3c);
}

/* ── Legal / Terms page ── */
.app-shell--legal {
  justify-content: center;
  padding: 16px 12px;
}

.app-main--legal {
  width: 100%;
  max-width: 1400px;
  padding: 0;
  flex: 0 0 auto;
  background: transparent;
}

.legal-panel {
  min-height: clamp(620px, 90vh, 1020px);
}

.legal-panel-header .legal-home-link {
  justify-self: start;
  align-self: center;
  font-family: var(--gp-font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
}

.legal-panel-header .legal-home-link:hover {
  color: #fff;
  text-decoration: underline;
}

.legal-panel-header .lang-pill--lobby {
  justify-self: end;
}

.legal-logo {
  width: min(220px, 42vw);
}

.legal-layout {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(0, 3fr);
  flex: 1;
  min-height: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.legal-sidebar {
  padding: 28px 20px 32px 32px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.legal-sidebar-title {
  margin: 0 0 22px;
  font-family: var(--gp-font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.legal-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.legal-nav-item {
  display: block;
  padding: 9px 10px;
  border: 2px solid transparent;
  border-radius: 10px;
  font-family: var(--gp-font-display);
  font-size: clamp(0.68rem, 1.2vw, 0.78rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.42);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.legal-nav-item:hover {
  color: rgba(255, 255, 255, 0.78);
}

.legal-nav-item.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

.legal-content {
  padding: 28px 40px 36px 36px;
  overflow-y: auto;
}

.legal-section {
  display: none;
}

.legal-section.is-active {
  display: block;
}

.legal-section-title {
  margin: 0 0 18px;
  font-family: var(--gp-font-display);
  font-size: clamp(1.05rem, 2.2vw, 1.28rem);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #fff;
}

.legal-callout {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--gp-radius-sm);
  background: rgba(0, 0, 0, 0.18);
}

.legal-callout p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
}

.legal-section-body p,
.legal-section-body li {
  margin: 0 0 12px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 600;
  font-size: 0.94rem;
}

.legal-section-body ul {
  margin: 0 0 14px;
  padding-left: 1.25rem;
}

.legal-section-body a {
  color: var(--gp-accent-bright);
  font-weight: 700;
}

.legal-panel-footer {
  margin-top: auto;
}

@media (max-width: 900px) {
  .legal-layout {
    grid-template-columns: minmax(160px, 1fr) minmax(0, 3fr);
  }

  .legal-sidebar {
    padding: 20px 14px 24px 20px;
  }

  .legal-content {
    padding: 20px 24px 28px 20px;
  }
}

@media (max-width: 720px) {
  .legal-layout {
    grid-template-columns: 1fr;
  }

  .legal-sidebar {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 18px 18px;
  }

  .legal-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .legal-nav-item {
    font-size: 0.68rem;
    padding: 8px;
  }

  .legal-content {
    padding: 20px 18px 28px;
  }
}

.app-footer a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.app-footer a:hover {
  text-decoration: underline;
}

