:root {
  color-scheme: dark;
  --background: #06070f;
  --background-2: #080a14;
  --card: rgba(15, 18, 32, 0.72);
  --card-strong: rgba(15, 18, 32, 0.94);
  --panel: rgba(255, 255, 255, 0.055);
  --panel-strong: rgba(255, 255, 255, 0.09);
  --text: #f5f7ff;
  --muted: rgba(245, 247, 255, 0.64);
  --soft: rgba(245, 247, 255, 0.42);
  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.15);
  --primary: #3b6dff;
  --primary-2: #6b8dff;
  --violet: #a445ff;
  --accent: #ff2e55;
  --success: #35d594;
  --warning: #ffcc5c;
  --danger: #ff5577;
  --shadow: 0 24px 70px -34px rgba(0, 0, 0, 0.86);
  --shadow-blue: 0 24px 70px -36px rgba(59, 109, 255, 0.55);
  --radius: 28px;
  --max: 1160px;
  --header: 76px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 8%, rgba(59, 109, 255, 0.16), transparent 35%),
    radial-gradient(circle at 88% 14%, rgba(255, 46, 85, 0.11), transparent 34%),
    radial-gradient(circle at 50% 100%, rgba(164, 69, 255, 0.08), transparent 46%),
    linear-gradient(180deg, var(--background) 0%, var(--background-2) 55%, #0a0d1a 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .54; }
img, svg, canvas { max-width: 100%; }
a { color: inherit; text-decoration: none; }

::selection { background: rgba(59, 109, 255, .28); color: white; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(59, 109, 255, .75), rgba(255, 46, 85, .58)) border-box;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.45), transparent 78%);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  width: min(calc(100% - 24px), var(--max));
  min-height: var(--header);
  margin: 12px auto 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(8, 10, 20, .74);
  box-shadow: 0 12px 40px -22px rgba(0,0,0,.9);
  backdrop-filter: blur(24px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}
.text-brand strong {
  font-size: 1.18rem;
  font-weight: 950;
  letter-spacing: -.045em;
  padding-left: 10px;
}
.text-brand:hover strong { color: white; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  box-shadow: 0 18px 38px -20px rgba(59,109,255,.8);
}
.brand-mark svg { width: 44px; height: 44px; display: block; }
.brand-copy { display: grid; min-width: 0; }
.brand-copy strong { font-weight: 900; letter-spacing: -.03em; line-height: 1; }
.brand-copy small { margin-top: 3px; color: var(--muted); font-size: .74rem; font-weight: 700; }

.nav-room-counter {
  display: inline-flex;
  justify-self: center;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.045);
  color: rgba(255,255,255,.78);
  font-size: .9rem;
  font-weight: 800;
  white-space: nowrap;
}
.nav-room-counter strong { color: white; }
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(53,213,148,.11), 0 0 20px rgba(53,213,148,.45);
}

.header-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.primary-button, .ghost-button, .glass-button, .danger-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  color: white;
  font-size: .88rem;
  font-weight: 900;
  letter-spacing: -.01em;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, opacity .18s ease;
}
.primary-button {
  background: linear-gradient(95deg, var(--primary), var(--violet) 52%, var(--accent));
  box-shadow: 0 18px 44px -22px rgba(59,109,255,.9);
}
.ghost-button, .glass-button {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.055);
}
.danger-button {
  background: rgba(255, 85, 119, .14);
  border: 1px solid rgba(255, 85, 119, .28);
}
.primary-button:hover, .ghost-button:hover, .glass-button:hover, .danger-button:hover { transform: translateY(-1px); }
.ghost-button:hover, .glass-button:hover { border-color: var(--border-strong); background: rgba(255,255,255,.08); }
.large { min-height: 52px; padding-inline: 22px; }
.small { min-height: 34px; padding-inline: 12px; font-size: .78rem; }
.full { width: 100%; }
.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: white;
  font-size: 1.4rem;
  line-height: 1;
}

.main-shell {
  width: min(calc(100% - 28px), var(--max));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, .55fr);
  gap: 22px;
  align-items: center;
  padding: 66px 0 44px;
}
.hero-copy { max-width: 760px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin-bottom: 14px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.045);
  color: rgba(255,255,255,.74);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.eyebrow svg { width: 15px; height: 15px; fill: currentColor; }
.eyebrow.muted { color: rgba(255,255,255,.58); }
h1, h2, h3, p { margin: 0; }
h1 {
  max-width: 830px;
  font-size: clamp(2.55rem, 7vw, 5.9rem);
  line-height: .95;
  letter-spacing: -.075em;
  font-weight: 950;
}
.hero-copy p {
  max-width: 690px;
  margin-top: 22px;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 1.75;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 28px; }
.hero-actions.single-action { max-width: 230px; }

.status-card, .game-card, .public-rooms-section, .modal, .play-card, .room-sidebar {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(15,18,32,.78), rgba(10,12,22,.66));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}
.status-card {
  padding: 20px;
  border-radius: var(--radius);
}
.status-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.status-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(59,109,255,.22), rgba(255,46,85,.13));
  color: white;
}
.status-icon svg { width: 24px; height: 24px; fill: currentColor; }
.status-card strong { display: block; font-size: 1rem; }
.status-card small { display: block; margin-top: 4px; color: var(--muted); line-height: 1.4; }
.room-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 18px 0;
}
.room-stat-grid div {
  padding: 14px 8px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255,255,255,.045);
  text-align: center;
}
.room-stat-grid span { display: block; font-size: 1.4rem; font-weight: 950; }
.status-note { color: var(--muted); font-size: .9rem; line-height: 1.65; }

.games-section { padding: 22px 0 32px; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.section-heading.compact { align-items: center; }
.section-heading h2 { font-size: clamp(1.75rem, 4vw, 3.1rem); line-height: 1; letter-spacing: -.045em; font-weight: 950; }
.section-heading p { max-width: 580px; margin-top: 8px; color: var(--muted); line-height: 1.65; }

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 330px) 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.search-box {
  display: grid;
  gap: 7px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 23px;
  background: rgba(255,255,255,.045);
}
.search-box span, label > span {
  color: rgba(255,255,255,.56);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.search-box input, .room-form input, .room-form select, .room-form textarea, .game-input, .game-select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 16px;
  outline: none;
  background: rgba(255,255,255,.065);
  color: white;
  padding: 0 12px;
  transition: border-color .16s ease, background .16s ease;
}
.room-form textarea, .game-input.textarea { min-height: 110px; resize: vertical; padding-top: 12px; line-height: 1.5; }
.search-box input { min-height: 34px; border: 0; background: transparent; padding: 0; }
.search-box input::placeholder, .room-form input::placeholder, .room-form textarea::placeholder, .game-input::placeholder { color: rgba(255,255,255,.33); }
.search-box input:focus, .room-form input:focus, .room-form select:focus, .room-form textarea:focus, .game-input:focus, .game-select:focus { border-color: rgba(59,109,255,.62); background: rgba(255,255,255,.09); }
select option { background: #101522; color: white; }

.filter-pills {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-pills button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.045);
  color: rgba(255,255,255,.66);
  font-size: .84rem;
  font-weight: 900;
}
.filter-pills button.active, .filter-pills button:hover { color: white; border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.09); }

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.game-card {
  position: relative;
  overflow: hidden;
  min-height: 282px;
  padding: 20px;
  border-radius: 28px;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.game-card:hover { transform: translateY(-4px); border-color: rgba(255,255,255,.16); box-shadow: var(--shadow-blue); }
.game-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background: radial-gradient(circle at 82% 8%, var(--game-glow, rgba(59,109,255,.16)), transparent 34%);
  opacity: .9;
}
.game-card > * { position: relative; z-index: 1; }
.card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.game-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(59,109,255,.18), rgba(164,69,255,.14), rgba(255,46,85,.1));
  color: white;
  border: 1px solid rgba(255,255,255,.09);
}
.game-icon svg { width: 28px; height: 28px; fill: currentColor; }
.room-count-pill, .mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.055);
  color: rgba(255,255,255,.72);
  font-size: .74rem;
  font-weight: 900;
  white-space: nowrap;
}
.mode-pill { margin-right: 5px; }
.card-title { margin-top: 22px; }
.card-title h3 { font-size: 1.28rem; font-weight: 950; letter-spacing: -.035em; }
.card-title p { margin-top: 7px; color: var(--muted); line-height: 1.5; font-size: .92rem; }
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 15px;
}
.card-meta span {
  padding: 7px 9px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.65);
  font-size: .76rem;
  font-weight: 850;
}
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.card-actions .primary-button, .card-actions .ghost-button { flex: 1; min-width: 120px; }

.public-rooms-section {
  margin: 28px 0 54px;
  padding: 20px;
  border-radius: var(--radius);
}
.public-room-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.public-room {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255,255,255,.045);
}
.public-room h3 { font-size: 1rem; }
.public-room p { margin-top: 5px; color: var(--muted); font-size: .86rem; }
.mini-code { align-self: center; font-size: .74rem; }
.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed rgba(255,255,255,.14);
  border-radius: 22px;
  background: rgba(255,255,255,.035);
  text-align: center;
  color: var(--muted);
}
.empty-state strong { display: block; color: white; margin-bottom: 6px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,.58);
  backdrop-filter: blur(14px);
}
.modal-backdrop.open { display: flex; }
.modal {
  position: relative;
  width: min(100%, 720px);
  max-height: min(88vh, 850px);
  overflow: auto;
  padding: 24px;
  border-radius: 30px;
}
.small-modal { width: min(100%, 480px); }
.modal-close { position: absolute; top: 16px; right: 16px; }
.modal-heading { padding-right: 48px; margin-bottom: 16px; }
.modal-heading h2 { font-size: clamp(1.7rem, 4vw, 2.45rem); line-height: 1; letter-spacing: -.045em; }
.modal-heading p { margin-top: 9px; color: var(--muted); line-height: 1.6; }
.room-form { display: grid; gap: 12px; }
.room-form label { display: grid; gap: 7px; }
.form-grid-two, .settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.settings-grid .span-two { grid-column: 1 / -1; }
.check-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.045);
}
.check-row input { width: 18px; height: 18px; accent-color: var(--primary); }

.play-shell {
  position: fixed;
  inset: 0;
  z-index: 70;
  overflow: auto;
  padding: 16px;
  background:
    radial-gradient(circle at 15% 12%, rgba(59,109,255,.16), transparent 34%),
    radial-gradient(circle at 88% 10%, rgba(255,46,85,.12), transparent 34%),
    rgba(6,7,15,.96);
}
.play-layout {
  width: min(100%, 1200px);
  min-height: calc(100vh - 32px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 14px;
}
.play-card, .room-sidebar { border-radius: 28px; padding: 18px; }
.play-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.play-header h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1; letter-spacing: -.04em; }
.play-header p { margin-top: 7px; color: var(--muted); line-height: 1.6; }
.play-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.room-code {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(255,255,255,.07);
  color: white;
  font-weight: 950;
  letter-spacing: .08em;
}
.game-panel {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}
.game-box {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255,255,255,.045);
}
.game-box h3 { margin-bottom: 10px; font-size: 1.2rem; }
.game-box p { color: var(--muted); line-height: 1.65; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form .game-input, .inline-form .game-select { flex: 1; min-width: 190px; }
.choice-grid, .word-grid, .memory-grid, .players-list, .vote-grid, .score-list {
  display: grid;
  gap: 8px;
}
.choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-button, .cell-button, .player-row, .score-row, .vote-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.055);
  color: white;
  padding: 12px;
  text-align: left;
}
.choice-button:hover, .cell-button:hover, .vote-card:hover { border-color: rgba(255,255,255,.17); background: rgba(255,255,255,.085); }
.choice-button.selected { border-color: rgba(59,109,255,.7); background: rgba(59,109,255,.16); }
.word-grid { grid-template-columns: repeat(5, 42px); }
.word-cell {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.055);
  font-weight: 950;
  text-transform: uppercase;
}
.word-cell.hit { background: rgba(53,213,148,.2); border-color: rgba(53,213,148,.5); }
.word-cell.near { background: rgba(255,204,92,.18); border-color: rgba(255,204,92,.46); }
.word-cell.miss { opacity: .58; }
.feedback-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.75);
  font-size: .8rem;
  font-weight: 850;
}

.room-sidebar { align-self: start; position: sticky; top: 16px; }
.room-sidebar h3 { font-size: 1rem; margin-bottom: 10px; }
.player-row, .score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.player-name { font-weight: 900; }
.player-meta { color: var(--muted); font-size: .82rem; }
.host-badge { color: var(--warning); font-size: .75rem; font-weight: 900; }
.room-divider { height: 1px; background: var(--border); margin: 14px 0; }

.memory-grid {
  grid-template-columns: repeat(4, minmax(54px, 1fr));
  max-width: 460px;
}
.memory-card {
  min-height: 74px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.055);
  color: white;
  font-size: 1.6rem;
  font-weight: 950;
}
.memory-card.matched { background: rgba(53,213,148,.18); border-color: rgba(53,213,148,.4); }
.reaction-pad {
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(255,255,255,.055);
  user-select: none;
  text-align: center;
}
.reaction-pad.ready { background: rgba(53,213,148,.2); border-color: rgba(53,213,148,.45); }
.reaction-pad.waiting { background: rgba(255,204,92,.12); }
.reaction-pad strong { display: block; font-size: clamp(1.5rem, 4vw, 3rem); }
.reaction-pad span { color: var(--muted); }

.draw-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.draw-canvas {
  width: 100%;
  height: auto;
  max-height: 56vh;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: white;
  touch-action: none;
}
.reveal-image { width: 100%; max-height: 360px; object-fit: contain; border-radius: 18px; background: white; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 100;
  transform: translateX(-50%) translateY(20px);
  max-width: min(92vw, 520px);
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(12,15,26,.94);
  color: white;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: rgba(255,85,119,.35); }
.toast.success { border-color: rgba(53,213,148,.35); }

@media (max-width: 980px) {
  .site-header { grid-template-columns: 1fr auto; border-radius: 28px; }
  .nav-room-counter { grid-column: 1 / -1; justify-self: stretch; justify-content: center; order: 3; }
  .hero { grid-template-columns: 1fr; padding-top: 42px; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { grid-template-columns: 1fr; }
  .filter-pills { justify-content: flex-start; }
  .play-layout { grid-template-columns: 1fr; }
  .room-sidebar { position: static; }
}

@media (max-width: 680px) {
  :root { --header: auto; }
  .site-header { width: min(calc(100% - 16px), var(--max)); margin-top: 8px; padding: 9px; }
  .brand-copy small { display: none; }
  .header-actions { grid-column: 1 / -1; justify-content: stretch; }
  .header-actions button { flex: 1; }
  .main-shell { width: min(calc(100% - 18px), var(--max)); }
  .hero { padding: 34px 0 30px; }
  h1 { letter-spacing: -.06em; }
  .hero-actions .primary-button, .hero-actions .glass-button { width: 100%; }
  .section-heading, .section-heading.compact { display: grid; align-items: start; }
  .game-grid, .public-room-list { grid-template-columns: 1fr; }
  .game-card { min-height: auto; }
  .form-grid-two, .settings-grid { grid-template-columns: 1fr; }
  .settings-grid .span-two { grid-column: auto; }
  .choice-grid { grid-template-columns: 1fr; }
  .play-shell { padding: 10px; }
  .play-layout { min-height: calc(100vh - 20px); }
  .play-header { display: grid; }
  .play-actions { justify-content: stretch; }
  .play-actions button { flex: 1; }
}

.brand-mark, .game-icon { display: none !important; }

.text-only-card-top { min-height: 32px; }
.game-kicker {
  color: rgba(255,255,255,.48);
  font-size: .72rem;
  font-weight: 950;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.compact-meta span:nth-child(n+4) { display: none; }
.compact-status { min-height: 40px; }
.big-question {
  color: white;
  font-size: clamp(2.2rem, 8vw, 4.6rem);
  font-weight: 950;
  letter-spacing: -.05em;
  line-height: 1;
}
.sequence-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.sequence-preview span, .sequence-preview small {
  min-width: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.07);
  color: white;
  font-weight: 950;
}
.sequence-preview small { padding-inline: 14px; color: var(--muted); }
.sequence-pad {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
}
.sequence-pad .choice-button { min-height: 82px; font-size: 1.5rem; }
@media (max-width: 680px) {
  .text-brand strong { padding-left: 4px; }
  .sequence-pad { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

.locked-game {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(59,109,255,.13), rgba(164,69,255,.08));
}
.locked-game span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.locked-game strong { font-size: 1.08rem; }
.locked-game small { color: var(--muted); }
.host-strip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  background: rgba(255,255,255,.055);
}
.host-strip span {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.host-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 18px;
  background: rgba(255,255,255,.055);
}
.host-card span { font-weight: 950; }
.host-card strong { color: var(--warning); font-size: .78rem; }
.player-row.is-host-row {
  border-color: rgba(255,204,92,.28);
  background: rgba(255,204,92,.08);
}
.compact-settings h3 { margin-bottom: 8px; }
.draw-canvas { max-width: 100%; height: auto; }


/* Final layout polish */
.site-header {
  top: 12px;
  margin-top: 12px;
}
.main-shell { padding-bottom: 18px; }
.hero {
  grid-template-columns: minmax(0, 1fr) minmax(280px, .42fr);
  gap: 18px;
  padding: 48px 0 32px;
}
.hero-copy { max-width: 680px; }
h1 {
  font-size: clamp(2.1rem, 5vw, 4.05rem);
  line-height: 1.02;
  letter-spacing: -.055em;
}
.hero-copy p {
  max-width: 600px;
  margin-top: 14px;
  font-size: clamp(.95rem, 1.2vw, 1.03rem);
  line-height: 1.65;
}
.eyebrow {
  min-height: 30px;
  margin-bottom: 10px;
  font-size: .68rem;
}
.status-card { padding: 16px; border-radius: 24px; }
.room-stat-grid { margin: 14px 0 0; }
.room-stat-grid div { padding: 11px 8px; border-radius: 17px; }
.room-stat-grid span { font-size: 1.18rem; }
.games-section { padding-top: 14px; }
.section-heading { margin-bottom: 14px; }
.section-heading h2 {
  font-size: clamp(1.45rem, 2.6vw, 2.25rem);
  letter-spacing: -.035em;
}
.section-heading p { margin-top: 6px; font-size: .94rem; line-height: 1.55; }
.toolbar { margin-bottom: 14px; }
.game-grid { gap: 12px; }
.game-card {
  min-height: 246px;
  padding: 18px;
  border-radius: 24px;
}
.card-title { margin-top: 18px; }
.card-title h3 { font-size: 1.13rem; letter-spacing: -.025em; }
.card-title p { font-size: .86rem; line-height: 1.48; }
.card-meta { margin-top: 13px; }
.card-actions { margin-top: 16px; }
.public-rooms-section {
  margin-top: 22px;
  border-radius: 24px;
}
.public-room {
  grid-template-columns: minmax(0,1fr) auto;
  padding: 13px;
  border-radius: 20px;
}
.public-room-main { min-width: 0; }
.public-room-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.public-room h3 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .98rem;
}
.public-room p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .82rem;
}
.public-room-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 850;
}
.player-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  background: rgba(255,255,255,.055);
  color: white;
  font-size: .74rem;
  font-weight: 950;
  white-space: nowrap;
}
.public-join-button { min-width: 72px; }
.play-card, .room-sidebar { border-radius: 24px; }
.play-header h2 {
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  letter-spacing: -.032em;
}
.game-box h3 { font-size: 1.05rem; }
.big-question {
  font-size: clamp(1.85rem, 6vw, 3.2rem);
  letter-spacing: -.035em;
}
.reaction-pad { min-height: 220px; border-radius: 24px; }
.reaction-pad strong { font-size: clamp(1.35rem, 3vw, 2.3rem); }

@media (max-width: 980px) {
  .site-header { top: 10px; }
  .hero { padding-top: 36px; }
}

@media (max-width: 680px) {
  .site-header { top: 8px; }
  h1 { font-size: clamp(1.95rem, 10vw, 3rem); }
  .hero { padding: 28px 0 24px; }
  .status-card { display: none; }
  .public-room { grid-template-columns: 1fr; }
  .public-join-button { width: 100%; }
  .nav-room-counter { min-height: 38px; }
}

/* Bright clean refinement */
:root {
  --background: #090d1a;
  --background-2: #0d1224;
  --card: rgba(20, 26, 46, 0.78);
  --card-strong: rgba(20, 26, 46, 0.96);
  --panel: rgba(255, 255, 255, 0.07);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.2);
  --primary: #4f7cff;
  --primary-2: #8aa4ff;
  --violet: #b762ff;
  --accent: #ff4d70;
  --success: #3fe0a0;
}
body {
  background:
    radial-gradient(circle at 12% 8%, rgba(79, 124, 255, 0.22), transparent 36%),
    radial-gradient(circle at 88% 14%, rgba(255, 77, 112, 0.15), transparent 34%),
    radial-gradient(circle at 52% 100%, rgba(183, 98, 255, 0.13), transparent 48%),
    linear-gradient(180deg, var(--background) 0%, var(--background-2) 56%, #11172b 100%);
}
.site-header {
  top: 14px;
  background: rgba(13, 17, 32, .8);
  border-color: rgba(255,255,255,.14);
}
.return-room-button[hidden] { display: none !important; }
.return-room-button:not([hidden]) {
  background: linear-gradient(95deg, rgba(79,124,255,.22), rgba(183,98,255,.16));
  border-color: rgba(138,164,255,.32);
}
.status-card, .game-card, .public-rooms-section, .modal, .play-card, .room-sidebar {
  background: linear-gradient(180deg, rgba(22,28,50,.84), rgba(13,17,32,.72));
}
.game-card::before {
  opacity: 1;
  background:
    radial-gradient(circle at 82% 8%, var(--game-glow, rgba(79,124,255,.2)), transparent 35%),
    linear-gradient(135deg, rgba(255,255,255,.035), transparent 45%);
}
.room-form select,
.room-form input,
.room-form textarea,
.game-input,
.game-select {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.13);
}
.room-form select:focus,
.room-form input:focus,
.room-form textarea:focus,
.game-input:focus,
.game-select:focus {
  border-color: rgba(138,164,255,.72);
  background: rgba(255,255,255,.11);
}
.locked-join-code {
  display: grid;
  gap: 6px;
  padding: 13px 14px;
  border: 1px solid rgba(138,164,255,.25);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(79,124,255,.16), rgba(183,98,255,.1));
}
.locked-join-code[hidden] { display: none !important; }
.locked-join-code span {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.locked-join-code strong { font-size: 1.05rem; letter-spacing: .05em; }
.player-row.is-host-row {
  border-color: rgba(255,204,92,.46);
  background: linear-gradient(135deg, rgba(255,204,92,.13), rgba(255,255,255,.055));
  box-shadow: inset 0 0 0 1px rgba(255,204,92,.08);
}
.host-badge {
  padding: 5px 8px;
  border: 1px solid rgba(255,204,92,.35);
  border-radius: 999px;
  background: rgba(255,204,92,.1);
}
.host-card, .host-strip { display: none !important; }
.play-actions .ghost-button { white-space: nowrap; }
.public-room {
  background: rgba(255,255,255,.055);
  border-color: rgba(255,255,255,.12);
}
.public-room:hover {
  border-color: rgba(138,164,255,.28);
  background: rgba(255,255,255,.075);
}
.card-title p, .section-heading p, .hero-copy p, .game-box p, .play-header p, .public-room p {
  color: rgba(245,247,255,.7);
}
.hero { padding-top: 44px; }
h1 { font-size: clamp(2rem, 4.4vw, 3.65rem); }
.section-heading h2 { font-size: clamp(1.38rem, 2.3vw, 2rem); }
.game-card { min-height: 232px; }
@media (max-width: 980px) {
  .site-header { top: 10px; }
}
@media (max-width: 680px) {
  .site-header { top: 8px; }
  .header-actions { grid-template-columns: 1fr 1fr; display: grid; }
  .return-room-button[hidden] + .ghost-button { grid-column: 1 / -1; }
}


.winner-row {
  border-color: rgba(255, 204, 92, .28);
  background: rgba(255, 204, 92, .08);
}

.play-actions .danger-button {
  white-space: nowrap;
}

.game-box .inline-form {
  margin-top: 12px;
}


/* Game depth update */
.word-board { display: grid; gap: 8px; }
.dynamic-word-grid { grid-template-columns: repeat(var(--word-size), 42px); }
.choice-button.correct, .vote-card.correct { border-color: rgba(53,213,148,.6); background: rgba(53,213,148,.18); }
.choice-button.wrong { border-color: rgba(255,46,85,.55); background: rgba(255,46,85,.12); }
.status-note { margin-top: 10px; color: var(--muted); }
.emoji-clue { font-size: clamp(2rem, 8vw, 3.5rem) !important; line-height: 1.1 !important; color: white !important; letter-spacing: .02em; }
.result-bars { display: grid; gap: 10px; }
.result-bars div { position: relative; overflow: hidden; min-height: 38px; border: 1px solid var(--border); border-radius: 999px; background: rgba(255,255,255,.045); }
.result-bars i { position: absolute; inset: 0 auto 0 0; display: block; border-radius: inherit; background: linear-gradient(90deg, rgba(59,109,255,.42), rgba(164,69,255,.32)); }
.result-bars span { position: relative; z-index: 1; display: flex; align-items: center; height: 100%; padding: 0 13px; color: white; font-weight: 900; }
.clue-list { display: grid; gap: 8px; margin-top: 12px; }
.code-history { display: grid; gap: 8px; margin-bottom: 10px; }
.code-guess { letter-spacing: .12em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.color-dot { width: 30px; height: 30px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); background: var(--dot); box-shadow: inset 0 0 0 2px rgba(0,0,0,.12); }
.color-dot:hover { transform: translateY(-1px); border-color: white; }
.memory-grid { grid-template-columns: repeat(var(--memory-columns, 4), minmax(48px, 1fr)); max-width: 620px; }
.sequence-1 { background: rgba(59,109,255,.14); }
.sequence-2 { background: rgba(164,69,255,.14); }
.sequence-3 { background: rgba(53,213,148,.14); }
.sequence-4 { background: rgba(255,204,92,.14); }
.winner-row { border-color: rgba(255,204,92,.42) !important; background: rgba(255,204,92,.09) !important; }
@media (max-width: 680px) {
  .dynamic-word-grid { grid-template-columns: repeat(var(--word-size), minmax(30px, 38px)); }
  .word-cell { width: 38px; height: 38px; }
  .memory-grid { grid-template-columns: repeat(4, minmax(42px, 1fr)) !important; }
}

/* MegaStudios banner-inspired simplification */
:root {
  --background: #101326;
  --background-2: #141936;
  --card: rgba(22, 25, 48, 0.82);
  --card-strong: rgba(18, 22, 44, 0.96);
  --panel: rgba(255, 255, 255, 0.065);
  --panel-strong: rgba(255, 255, 255, 0.115);
  --border: rgba(255, 255, 255, 0.13);
  --border-strong: rgba(255, 255, 255, 0.22);
  --primary: #8ba4ff;
  --primary-2: #b7bef6;
  --violet: #9b7ee3;
  --accent: #e81242;
  --rose: #bc4e8f;
  --success: #37daa0;
  --warning: #ffd064;
  --radius: 24px;
  --max: 1180px;
}

body {
  background:
    radial-gradient(circle at 12% 7%, rgba(232, 18, 66, .34), transparent 28%),
    radial-gradient(circle at 76% 4%, rgba(139, 164, 255, .32), transparent 34%),
    linear-gradient(115deg, rgba(232, 18, 66, .34) 0%, rgba(188, 78, 143, .22) 36%, rgba(139, 164, 255, .2) 72%, rgba(207, 216, 255, .16) 100%),
    linear-gradient(180deg, #0d1020 0%, #131832 58%, #101426 100%);
}

.page-bg {
  opacity: .42;
  background:
    radial-gradient(circle at 22% 18%, rgba(255,255,255,.08), transparent 28%),
    radial-gradient(circle at 88% 10%, rgba(255,255,255,.08), transparent 24%),
    linear-gradient(135deg, transparent, rgba(255,255,255,.035));
}

.site-header {
  top: 14px;
  min-height: 66px;
  padding: 9px 10px;
  background: rgba(15, 17, 32, .82);
  border-color: rgba(255,255,255,.16);
  box-shadow: 0 18px 60px -34px rgba(0,0,0,.9);
}
.text-brand strong { font-size: 1.05rem; padding-left: 10px; }
.nav-room-counter { min-height: 38px; font-size: .84rem; background: rgba(255,255,255,.06); }
.primary-button { background: linear-gradient(95deg, var(--accent), var(--rose) 42%, var(--primary)); }
.ghost-button, .glass-button { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); }
.danger-button { background: rgba(232,18,66,.14); border-color: rgba(232,18,66,.32); }

.hero {
  padding: 42px 0 28px;
  grid-template-columns: minmax(0, 1fr) minmax(250px, .36fr);
}
h1 {
  font-size: clamp(1.9rem, 4vw, 3.1rem) !important;
  line-height: 1.04;
  letter-spacing: -.045em;
  max-width: 720px;
}
.hero-copy p { max-width: 560px; font-size: .98rem; line-height: 1.58; }
.eyebrow { color: rgba(255,255,255,.68); background: rgba(255,255,255,.055); border-color: rgba(255,255,255,.12); }
.status-card, .game-card, .public-rooms-section, .modal, .play-card, .room-sidebar {
  background: linear-gradient(180deg, rgba(24, 29, 56, .86), rgba(14, 18, 36, .76));
  border-color: rgba(255,255,255,.13);
  box-shadow: 0 24px 70px -40px rgba(0,0,0,.86);
}
.status-card { padding: 14px; border-radius: 22px; }
.room-stat-grid span { font-size: 1.05rem; }

.section-heading { margin-bottom: 12px; }
.section-heading h2 { font-size: clamp(1.34rem, 2.1vw, 1.82rem) !important; }
.section-heading p { max-width: 520px; color: rgba(245,247,255,.66); }
.toolbar { gap: 10px; margin-bottom: 13px; }
.search-box { border-radius: 19px; padding: 11px 13px; background: rgba(255,255,255,.055); }
.filter-pills button { min-height: 36px; padding: 0 12px; font-size: .78rem; }

.game-grid { gap: 13px; }
.game-card.polished-card {
  min-height: 218px;
  padding: 17px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
}
.game-card.polished-card::before {
  background:
    radial-gradient(circle at 92% 0%, var(--game-glow), transparent 36%),
    linear-gradient(135deg, rgba(255,255,255,.052), transparent 48%);
}
.polished-card .card-top { align-items: flex-start; }
.polished-card .card-top h3 {
  margin-top: 5px;
  font-size: 1.12rem;
  line-height: 1.15;
  letter-spacing: -.025em;
}
.card-line {
  margin: 14px 0 0;
  color: rgba(245,247,255,.72);
  font-size: .88rem;
  line-height: 1.48;
}
.game-kicker { letter-spacing: .12em; color: rgba(255,255,255,.48); }
.room-count-pill, .mode-pill, .tag, .player-count-pill {
  background: rgba(255,255,255,.062);
  border-color: rgba(255,255,255,.13);
}
.card-meta { margin-top: auto; padding-top: 14px; }
.card-meta span { background: rgba(255,255,255,.045); }
.card-actions { margin-top: 13px; }
.card-actions .primary-button, .card-actions .ghost-button { min-height: 40px; }

.public-rooms-section { padding: 18px; }
.public-room { border-radius: 18px; background: rgba(255,255,255,.055); }
.public-room h3 { font-size: .96rem; }
.public-room-meta .mini-code { letter-spacing: .08em; }

.modal-backdrop { z-index: 100; background: rgba(5,7,16,.68); backdrop-filter: blur(18px); }
.modal { border-radius: 26px; padding: 22px; }
.modal-heading h2 { font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: -.035em; }
.room-form input, .room-form select, .room-form textarea, .game-input, .game-select {
  border-radius: 14px;
  min-height: 42px;
  background: rgba(255,255,255,.075);
}
.check-row { border-radius: 16px; min-height: 50px; }

body.in-play .site-header, body.in-play .main-shell { visibility: hidden; }
.play-shell {
  z-index: 90;
  padding: 18px;
  background:
    radial-gradient(circle at 12% 8%, rgba(232, 18, 66, .24), transparent 28%),
    radial-gradient(circle at 82% 3%, rgba(139, 164, 255, .25), transparent 34%),
    linear-gradient(115deg, rgba(232, 18, 66, .18), rgba(188, 78, 143, .14) 38%, rgba(139, 164, 255, .16) 72%, rgba(207,216,255,.11)),
    #101326;
}
.play-layout.full-room-page {
  width: min(100%, 1280px);
  min-height: calc(100vh - 36px);
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  align-items: start;
}
.play-layout.solo-page { grid-template-columns: minmax(0, 1fr); max-width: 980px; }
.room-page-card {
  min-height: calc(100vh - 36px);
  padding: 18px;
  border-radius: 26px;
}
.room-page-header {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.room-topline { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.play-header h2 { font-size: clamp(1.45rem, 2.8vw, 2.2rem) !important; }
.play-header p { max-width: 760px; font-size: .9rem; }
.play-actions .small { min-height: 34px; }
.room-sidebar.players-panel { top: 18px; border-radius: 24px; }
.player-row.is-host-row { outline: 1px solid rgba(255,208,100,.28); outline-offset: 0; }
.host-badge { color: #ffe18b; }
.game-panel { gap: 12px; }
.waiting-panel { max-width: 880px; }
.lobby-box { display: grid; gap: 10px; }
.lobby-share-actions { margin-top: 4px; }
.game-box { border-radius: 20px; padding: 15px; background: rgba(255,255,255,.052); }
.game-box h3 { font-size: 1rem; }
.game-box p { line-height: 1.55; }
.choice-button, .cell-button, .player-row, .score-row, .vote-card { border-radius: 16px; background: rgba(255,255,255,.055); }
.big-question { font-size: clamp(1.75rem, 5vw, 2.65rem) !important; }
.emoji-clue { font-size: clamp(2rem, 7vw, 3.15rem) !important; }

.letter-guide {
  display: grid;
  grid-template-columns: repeat(13, minmax(24px, 1fr));
  gap: 6px;
}
.letter-key {
  display: grid;
  place-items: center;
  min-height: 28px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  background: rgba(255,255,255,.045);
  color: rgba(255,255,255,.58);
  font-size: .72rem;
  font-weight: 900;
}
.letter-key.near { color: white; border-color: rgba(255,208,100,.38); background: rgba(255,208,100,.12); }
.letter-key.miss { opacity: .42; }

.draw-canvas { border-radius: 18px; box-shadow: 0 18px 48px -32px rgba(0,0,0,.75); }
.reaction-pad { min-height: 210px; }
.memory-card { min-height: 66px; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 34px; }
  .play-layout.full-room-page { grid-template-columns: 1fr; }
  .room-page-card { min-height: auto; }
  body.in-play .site-header, body.in-play .main-shell { display: none; }
}

@media (max-width: 680px) {
  .site-header { top: 8px; min-height: auto; border-radius: 24px; }
  .text-brand strong { font-size: 1rem; }
  .nav-room-counter { order: 3; }
  h1 { font-size: clamp(1.72rem, 9vw, 2.55rem) !important; }
  .hero { padding: 24px 0 22px; }
  .status-card { display: block; }
  .room-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .game-card.polished-card { min-height: 190px; }
  .play-shell { padding: 10px; }
  .play-layout.full-room-page { min-height: calc(100vh - 20px); }
  .room-page-card { border-radius: 22px; }
  .letter-guide { grid-template-columns: repeat(7, minmax(24px, 1fr)); }
  .choice-grid { grid-template-columns: 1fr; }
}

/* Banner colour pass + cleaner card/game polish */
:root {
  --banner-red: #e81242;
  --banner-rose: #bc4e8f;
  --banner-blue: #8ba4ff;
  --banner-lavender: #cfd8ff;
  --glass-a: rgba(255, 255, 255, .075);
  --glass-b: rgba(255, 255, 255, .12);
}

body {
  background:
    radial-gradient(circle at 8% 5%, rgba(232, 18, 66, .38), transparent 24%),
    radial-gradient(circle at 84% 0%, rgba(139, 164, 255, .34), transparent 34%),
    radial-gradient(circle at 52% 38%, rgba(188, 78, 143, .14), transparent 35%),
    linear-gradient(125deg, rgba(232,18,66,.28) 0%, rgba(188,78,143,.18) 36%, rgba(139,164,255,.18) 74%, rgba(207,216,255,.13) 100%),
    linear-gradient(180deg, #101326 0%, #121735 50%, #0c1022 100%);
}

.page-bg {
  opacity: .5;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,.022) 0 1px, transparent 1px 128px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.018) 0 1px, transparent 1px 136px),
    radial-gradient(circle at 18% 14%, rgba(255,255,255,.09), transparent 24%),
    radial-gradient(circle at 84% 12%, rgba(255,255,255,.08), transparent 23%);
}

.site-header {
  background:
    linear-gradient(115deg, rgba(232,18,66,.12), rgba(188,78,143,.08) 38%, rgba(139,164,255,.12)),
    rgba(14, 17, 34, .82);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 18px 70px -44px rgba(139,164,255,.7), 0 16px 50px -38px rgba(232,18,66,.65);
  overflow: hidden;
}
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(232,18,66,.5), rgba(188,78,143,.34), rgba(139,164,255,.46), rgba(207,216,255,.14));
  height: 2px;
  opacity: .8;
}
.text-brand strong {
  background: linear-gradient(90deg, white 0%, #ffe9f0 32%, #dfe5ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav-room-counter {
  background:
    linear-gradient(110deg, rgba(232,18,66,.09), rgba(139,164,255,.12)),
    rgba(255,255,255,.065);
  border-color: rgba(255,255,255,.18);
}
.live-dot { box-shadow: 0 0 20px rgba(53,213,148,.75); }

.hero {
  border-radius: 32px;
}
.hero-copy h1 {
  background: linear-gradient(92deg, #fff 0%, #ffe6ee 32%, #dfe6ff 76%, #fff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-copy p, .section-heading p { color: rgba(245,247,255,.72); }
.status-card {
  background:
    linear-gradient(140deg, rgba(232,18,66,.12), rgba(139,164,255,.12)),
    rgba(16,20,42,.78);
}
.room-stat-grid div {
  background: linear-gradient(135deg, rgba(255,255,255,.09), rgba(255,255,255,.045));
  border: 1px solid rgba(255,255,255,.11);
}

.primary-button {
  background: linear-gradient(105deg, var(--banner-red), var(--banner-rose) 45%, var(--banner-blue));
  box-shadow: 0 16px 34px -26px rgba(232,18,66,.85), 0 12px 30px -28px rgba(139,164,255,.85);
}
.primary-button:hover { box-shadow: 0 18px 40px -26px rgba(139,164,255,.9), 0 18px 42px -30px rgba(232,18,66,.85); }
.ghost-button, .glass-button {
  background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(139,164,255,.045));
  border-color: rgba(255,255,255,.16);
}
.ghost-button:hover, .glass-button:hover {
  background: linear-gradient(135deg, rgba(232,18,66,.10), rgba(139,164,255,.11));
}

.toolbar, .search-box {
  background: rgba(14,17,34,.44);
  border-color: rgba(255,255,255,.12);
}
.filter-pills button.active {
  background: linear-gradient(105deg, rgba(232,18,66,.22), rgba(139,164,255,.18));
  border-color: rgba(255,255,255,.22);
  color: white;
}

.game-card.theme-card {
  position: relative;
  isolation: isolate;
  min-height: 236px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.035)),
    rgba(14, 18, 38, .78);
  border: 1px solid rgba(255,255,255,.14);
  overflow: hidden;
}
.game-card.theme-card::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--tone-a, var(--banner-red)), var(--tone-b, var(--banner-blue)));
  opacity: .85;
}
.game-card.theme-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,.22);
  box-shadow: 0 26px 70px -42px var(--tone-shadow, rgba(139,164,255,.8));
}
.card-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 92% 4%, var(--game-glow), transparent 32%),
    linear-gradient(120deg, rgba(255,255,255,.08), transparent 45%);
  opacity: .95;
  z-index: 0;
}
.game-card.theme-card > *:not(.card-sheen) { position: relative; z-index: 1; }
.tone-red { --tone-a: var(--banner-red); --tone-b: var(--banner-rose); --tone-shadow: rgba(232,18,66,.78); }
.tone-rose { --tone-a: var(--banner-rose); --tone-b: var(--banner-blue); --tone-shadow: rgba(188,78,143,.78); }
.tone-blue { --tone-a: var(--banner-blue); --tone-b: var(--banner-lavender); --tone-shadow: rgba(139,164,255,.78); }
.tone-lavender { --tone-a: #b7bef6; --tone-b: var(--banner-lavender); --tone-shadow: rgba(183,190,246,.68); }
.tone-violet { --tone-a: #9b7ee3; --tone-b: var(--banner-blue); --tone-shadow: rgba(155,126,227,.75); }

.card-title-block h3 { margin-bottom: 0; }
.live-room-pill {
  background: linear-gradient(110deg, rgba(53,213,148,.18), rgba(139,164,255,.10));
  border-color: rgba(53,213,148,.24);
}
.solo-pill {
  background: linear-gradient(110deg, rgba(207,216,255,.14), rgba(255,255,255,.06));
}
.game-fit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 13px 0 0;
}
.game-fit-row span {
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.11);
  background: rgba(255,255,255,.052);
  color: rgba(245,247,255,.72);
  padding: 6px 9px;
  font-size: .75rem;
  font-weight: 800;
}
.card-meta.compact-meta span {
  border-color: rgba(255,255,255,.1);
  background: rgba(255,255,255,.042);
}
.card-line { color: rgba(245,247,255,.78); }

.public-rooms-section {
  background:
    linear-gradient(145deg, rgba(232,18,66,.08), rgba(139,164,255,.09)),
    rgba(14,18,38,.72);
  border-color: rgba(255,255,255,.14);
}
.public-room.theme-public-room {
  background:
    linear-gradient(135deg, rgba(255,255,255,.075), rgba(255,255,255,.04)),
    rgba(16,20,42,.68);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: inset 3px 0 0 var(--tone-a, var(--banner-blue));
}
.public-room.theme-public-room:hover { border-color: rgba(255,255,255,.2); }

.modal {
  background:
    linear-gradient(145deg, rgba(232,18,66,.10), rgba(139,164,255,.10)),
    rgba(14,18,38,.92);
  border-color: rgba(255,255,255,.18);
}
.locked-game, .locked-join-code {
  background: linear-gradient(120deg, rgba(232,18,66,.10), rgba(139,164,255,.10));
  border-color: rgba(255,255,255,.15);
}

.play-shell {
  background:
    radial-gradient(circle at 8% 4%, rgba(232,18,66,.32), transparent 24%),
    radial-gradient(circle at 88% 0%, rgba(139,164,255,.28), transparent 34%),
    linear-gradient(125deg, rgba(232,18,66,.18), rgba(188,78,143,.13) 38%, rgba(139,164,255,.14) 72%, rgba(207,216,255,.1)),
    #0f1326;
}
.play-card, .room-sidebar {
  background:
    linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.035)),
    rgba(14,18,38,.86);
  border-color: rgba(255,255,255,.15);
}
.room-page-header {
  background: linear-gradient(120deg, rgba(232,18,66,.075), rgba(139,164,255,.09));
  margin: -6px -6px 16px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.09);
}
.room-code {
  background: linear-gradient(105deg, rgba(232,18,66,.16), rgba(139,164,255,.16));
  border-color: rgba(255,255,255,.2);
}

.game-frame {
  display: grid;
  gap: 13px;
}
.game-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.12);
  background:
    radial-gradient(circle at 100% 0%, var(--tone-a, rgba(139,164,255,.3)), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,.075), rgba(255,255,255,.04));
}
.game-stage-head h3 {
  margin: 4px 0 0;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  letter-spacing: -.025em;
}
.game-stage-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.game-stage-stats span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 0 11px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.055);
  color: rgba(245,247,255,.70);
  font-size: .78rem;
  font-weight: 800;
}
.game-stage-stats strong { color: white; }
.game-panel { gap: 13px; }
.game-box {
  background:
    linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.04));
  border: 1px solid rgba(255,255,255,.105);
}
.game-focus-card {
  background:
    radial-gradient(circle at 100% 0%, var(--tone-a, rgba(139,164,255,.24)), transparent 35%),
    linear-gradient(135deg, rgba(255,255,255,.09), rgba(255,255,255,.042));
}
.prompt-text {
  font-size: clamp(1.08rem, 2.4vw, 1.45rem);
  line-height: 1.35;
  color: white;
  margin: 8px 0;
  font-weight: 850;
  letter-spacing: -.025em;
}
.soft-question {
  font-size: clamp(1.65rem, 4.8vw, 2.8rem) !important;
  letter-spacing: -.045em;
  background: linear-gradient(90deg, #fff, #f7dfe9 40%, #dce4ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.board-card { overflow: hidden; }
.empty-board-note {
  min-height: 76px;
  display: grid;
  place-items: center;
  color: rgba(245,247,255,.58);
  border: 1px dashed rgba(255,255,255,.14);
  border-radius: 16px;
}
.word-input, .code-input { text-transform: uppercase; letter-spacing: .12em; font-weight: 900; }
.polished-choices .choice-button, .pick-card {
  min-height: 82px;
  text-align: left;
  justify-content: flex-start;
  padding: 16px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.07), rgba(255,255,255,.038));
}
.choice-button.selected, .vote-card.selected {
  background: linear-gradient(135deg, rgba(232,18,66,.16), rgba(139,164,255,.16));
  border-color: rgba(255,255,255,.24);
}
.choice-button.correct { border-color: rgba(53,213,148,.45); background: rgba(53,213,148,.12); }
.choice-button.wrong { border-color: rgba(232,18,66,.44); background: rgba(232,18,66,.10); }
.reveal-card {
  border-color: rgba(207,216,255,.2);
  background: linear-gradient(135deg, rgba(139,164,255,.12), rgba(255,255,255,.045));
}
.digit-guide {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}
.digit-chip {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(255,255,255,.07);
  font-weight: 950;
}
.code-row { align-items: center; }
.emoji-card { text-align: center; }
.emoji-card .emoji-clue { margin: 6px 0 12px; }
.host-control-row {
  border-top: 1px solid rgba(255,255,255,.09);
  padding-top: 12px;
}

.upgraded-lobby .hero-lobby-card h3, .finish-hero h3 {
  font-size: clamp(1.25rem, 2.4vw, 1.8rem);
  letter-spacing: -.035em;
}
.lobby-meter {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
}
.lobby-meter span {
  display: block;
  width: var(--fill, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--banner-red), var(--banner-rose), var(--banner-blue));
}

.podium-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.podium-card {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.045));
}
.podium-card span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--banner-red), var(--banner-blue));
  font-weight: 950;
}
.podium-card strong { font-size: 1rem; }
.podium-card small { color: rgba(245,247,255,.64); }
.winner-row {
  border-color: rgba(255,208,100,.28) !important;
  background: linear-gradient(135deg, rgba(255,208,100,.12), rgba(255,255,255,.05)) !important;
}

.draw-box.canvas-night .draw-canvas { background: #101326; }
.draw-box.canvas-soft .draw-canvas { background: #f3f0ff; }
.draw-toolbar {
  border-radius: 16px;
  padding: 8px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
}
.color-dot {
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.3), 0 8px 18px -14px #000;
}
.draw-canvas {
  touch-action: none;
  background: white;
}

.room-sidebar.players-panel {
  background:
    linear-gradient(145deg, rgba(232,18,66,.07), rgba(139,164,255,.08)),
    rgba(14,18,38,.84);
}
.player-row.is-host-row {
  outline-color: rgba(139,164,255,.36);
  background: linear-gradient(135deg, rgba(232,18,66,.10), rgba(139,164,255,.10));
}
.host-badge {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(255,255,255,.055);
  color: #f4e9ff;
  font-size: .72rem;
}

@media (max-width: 760px) {
  .game-stage-head { align-items: stretch; flex-direction: column; }
  .game-stage-stats { justify-content: flex-start; }
  .podium-grid { grid-template-columns: 1fr; }
  .game-card.theme-card { min-height: auto; }
  .polished-choices .choice-button, .pick-card { min-height: 70px; }
}

/* Final layout polish: compact search/filter bar and centred public room heading */
.toolbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  width: 100% !important;
  margin: 0 0 18px !important;
  padding: 8px 10px !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  border-radius: 24px !important;
  background:
    linear-gradient(105deg, rgba(232,18,66,.105), rgba(139,164,255,.095)),
    rgba(13,16,34,.66) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 18px 46px -36px rgba(0,0,0,.9) !important;
  overflow: hidden !important;
}

.search-box {
  flex: 0 1 285px !important;
  min-width: 220px !important;
  min-height: 52px !important;
  display: grid !important;
  align-content: center !important;
  gap: 2px !important;
  padding: 8px 12px !important;
  border-radius: 18px !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  background: rgba(9,10,24,.46) !important;
}

.search-box span {
  font-size: .68rem !important;
  line-height: 1 !important;
  letter-spacing: .09em !important;
  color: rgba(255,255,255,.58) !important;
}

.search-box input {
  min-height: 24px !important;
  height: 24px !important;
  line-height: 24px !important;
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  font-size: .9rem !important;
}

.filter-pills {
  flex: 1 1 auto !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 7px !important;
  min-width: 0 !important;
}

.filter-pills button {
  min-height: 34px !important;
  padding: 0 12px !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.052) !important;
  border-color: rgba(255,255,255,.14) !important;
  color: rgba(245,247,255,.72) !important;
  box-shadow: none !important;
}

.filter-pills button.active,
.filter-pills button:hover {
  background: linear-gradient(105deg, rgba(232,18,66,.24), rgba(139,164,255,.20)) !important;
  border-color: rgba(255,255,255,.24) !important;
  color: #fff !important;
}

.public-rooms-section .section-heading.compact {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  text-align: center !important;
  margin-bottom: 18px !important;
}

.public-rooms-section .section-heading.compact > div {
  display: grid !important;
  justify-items: center !important;
  text-align: center !important;
}

.public-rooms-section .section-heading.compact h2,
.public-rooms-section .section-heading.compact p {
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.public-rooms-section .section-heading.compact .ghost-button {
  position: absolute !important;
  right: 0 !important;
  top: 0 !important;
}

@media (max-width: 900px) {
  .toolbar {
    align-items: stretch !important;
    flex-direction: column !important;
    padding: 10px !important;
  }
  .search-box {
    width: 100% !important;
    flex-basis: auto !important;
  }
  .filter-pills {
    width: 100% !important;
    justify-content: flex-start !important;
  }
  .public-rooms-section .section-heading.compact .ghost-button {
    position: static !important;
    margin-top: 4px !important;
  }
}

@media (max-width: 520px) {
  .toolbar {
    border-radius: 20px !important;
  }
  .filter-pills {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    padding-bottom: 2px !important;
    scrollbar-width: thin;
  }
  .filter-pills button {
    flex: 0 0 auto !important;
  }
}
