/* =============================================================
   FESTKODE — design system
   Mobile-first, Kahoot/Jackbox inspired, dark + vibrant.
   ============================================================= */

:root {
  /* surfaces */
  --bg-0: #0c0420;
  --bg-1: #1b0c3a;
  --bg-2: #2a1456;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-strong: rgba(255, 255, 255, 0.1);
  --surface-glass: rgba(255, 255, 255, 0.92);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);

  /* ink */
  --ink: #ffffff;
  --ink-soft: rgba(255, 255, 255, 0.78);
  --ink-mute: rgba(255, 255, 255, 0.55);
  --ink-dark: #15082e;
  --ink-dark-soft: rgba(21, 8, 46, 0.7);

  /* accents — Jackbox-y, party-coded */
  --hot: #ff3d7f;
  --hot-2: #ff7a59;
  --gold: #ffd23f;
  --mint: #06d6a0;
  --cyan: #4cc9f0;
  --violet: #b388ff;
  --indigo: #6366f1;

  /* effects */
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 0 4px rgba(255, 61, 127, 0.18);

  /* radius + spacing */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  /* motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur: 220ms;

  /* layout */
  --maxw: 720px;
  --pad: clamp(16px, 4vw, 28px);
  --safe-bottom: max(env(safe-area-inset-bottom), 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* HTML hidden attribute must always win over class-level display rules. */
[hidden] { display: none !important; }

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(60% 50% at 12% 0%, rgba(179, 136, 255, 0.32), transparent 70%),
    radial-gradient(50% 40% at 100% 10%, rgba(76, 201, 240, 0.22), transparent 70%),
    radial-gradient(80% 60% at 50% 100%, rgba(255, 61, 127, 0.22), transparent 70%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.05;
}

p {
  margin: 0;
}

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

input {
  -webkit-appearance: none;
  appearance: none;
}

a {
  color: inherit;
  text-decoration: none;
}

.muted { color: var(--ink-mute); }
.small { font-size: 0.9rem; }

/* =========================================================
   AGE GATE
   ========================================================= */
.gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: var(--pad);
  background: rgba(12, 4, 32, 0.86);
  backdrop-filter: blur(18px);
  animation: fade-in 240ms var(--ease);
}
.gate.hidden { display: none; }

.gate-panel {
  background: var(--surface-glass);
  color: var(--ink-dark);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: clamp(24px, 6vw, 36px);
  max-width: 480px;
  width: 100%;
  display: grid;
  gap: 14px;
  animation: rise 360ms var(--ease) both;
}

.gate-panel h1 {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
}

.gate-panel p { color: var(--ink-dark-soft); }

.gate-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin-top: 6px;
}

/* =========================================================
   TOPBAR
   ========================================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px var(--pad);
  background: rgba(12, 4, 32, 0.72);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--hot), var(--gold));
  color: var(--ink-dark);
  font-size: 18px;
  box-shadow: 0 6px 22px rgba(255, 61, 127, 0.5);
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  max-width: min(42vw, 220px);
}

.account-chip span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ink-mute);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.account-chip.is-signed-in .account-dot {
  background: var(--mint);
  box-shadow: 0 0 0 3px rgba(6, 214, 160, 0.16);
}

.topbar-code {
  font-family: "Bricolage Grotesque", monospace;
  font-weight: 800;
  letter-spacing: 0.16em;
  font-size: 1rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

/* =========================================================
   MAIN + VIEWS
   ========================================================= */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px var(--pad) calc(120px + var(--safe-bottom));
}

.view {
  display: none;
  animation: view-in 360ms var(--ease) both;
}
.view.is-active { display: block; }

@keyframes view-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

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

@keyframes rise {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

@keyframes pop {
  0%   { transform: scale(0.7); opacity: 0; }
  60%  { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50%      { opacity: 1;   transform: scale(1.15); }
}

/* =========================================================
   TOAST
   ========================================================= */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 30;
  background: var(--ink-dark);
  color: var(--ink);
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
  animation: pop 280ms var(--ease) both;
}

/* =========================================================
   BADGES + PILLS
   ========================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge-glow {
  background: linear-gradient(135deg, rgba(255, 61, 127, 0.25), rgba(255, 210, 63, 0.22));
  border-color: rgba(255, 210, 63, 0.45);
  color: var(--ink);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.08);
  color: var(--ink-dark);
}

.pill-mint { background: rgba(6, 214, 160, 0.18); color: #0a6f55; }
.pill-gold { background: rgba(255, 210, 63, 0.22); color: #7a5a05; }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-border: var(--line);
  appearance: none;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-radius: 14px;
  padding: 0 18px;
  min-height: 48px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  position: relative;
  overflow: hidden;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  --btn-bg: linear-gradient(135deg, var(--hot) 0%, var(--hot-2) 100%);
  --btn-fg: #fff;
  --btn-border: transparent;
  box-shadow: 0 14px 34px rgba(255, 61, 127, 0.4);
}
.btn-primary:hover { box-shadow: 0 18px 40px rgba(255, 61, 127, 0.55); }

.btn-secondary {
  --btn-bg: linear-gradient(135deg, var(--gold) 0%, #ffb648 100%);
  --btn-fg: var(--ink-dark);
  --btn-border: transparent;
  box-shadow: 0 14px 34px rgba(255, 210, 63, 0.32);
}

.btn-ghost {
  --btn-bg: rgba(255, 255, 255, 0.06);
  --btn-fg: var(--ink);
  --btn-border: var(--line);
}
.btn-ghost:hover { --btn-bg: rgba(255, 255, 255, 0.1); }

.gate-panel .btn-ghost {
  --btn-bg: rgba(21, 8, 46, 0.06);
  --btn-fg: var(--ink-dark);
  --btn-border: rgba(21, 8, 46, 0.14);
}

.btn-xl {
  min-height: 60px;
  font-size: 1.1rem;
  border-radius: 18px;
  padding: 0 22px;
}

.btn-sm {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.85rem;
  border-radius: 10px;
}

.btn-full { width: 100%; }

.btn-meta {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
}

.btn-secondary .btn-meta { background: rgba(21, 8, 46, 0.15); color: var(--ink-dark); }

.btn-icon {
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 10px;
}

.btn-icon-danger {
  --btn-bg: rgba(255, 61, 127, 0.1);
  --btn-border: rgba(255, 61, 127, 0.3);
  color: #ffaecc;
}

.back {
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  margin-bottom: 12px;
}
.back:hover { color: var(--ink); }

/* =========================================================
   HERO (landing)
   ========================================================= */
.hero {
  text-align: center;
  padding: 28px 0 36px;
  display: grid;
  gap: 18px;
  justify-items: center;
}

.hero-title {
  font-size: clamp(2.4rem, 10vw, 4rem);
}

.hero-accent {
  background: linear-gradient(135deg, var(--gold), var(--hot));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.hero-sub {
  max-width: 520px;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.hero-actions {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  max-width: 460px;
  margin-top: 4px;
}

.hero-actions .btn { min-height: 72px; flex-direction: column; gap: 4px; }
.hero-actions .btn > span:first-child { font-size: 1.15rem; }

.feature-grid {
  display: grid;
  gap: 12px;
  margin: 16px 0 36px;
}

.feature {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.feature:hover { background: var(--surface-strong); transform: translateY(-2px); }

.feature h3 { font-size: 1.05rem; margin-bottom: 2px; min-width: 0; }
.feature p {
  grid-column: 2;
  color: var(--ink-mute);
  font-size: 0.95rem;
  min-width: 0;
}

.feature-icon {
  grid-row: 1 / span 2;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 1.6rem;
}
.feature-icon-pink   { background: rgba(255, 61, 127, 0.18); }
.feature-icon-yellow { background: rgba(255, 210, 63, 0.18); }
.feature-icon-mint   { background: rgba(6, 214, 160, 0.18); }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.section-head h2,
.section-head h3 { font-size: 1.2rem; }

.count {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 24px;
  padding: 0 8px;
  margin-left: 6px;
  background: var(--surface-strong);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

/* =========================================================
   PACKAGES
   ========================================================= */
.packages { margin-top: 8px; }

.package-grid {
  display: grid;
  gap: 12px;
}

.pkg {
  background: var(--surface-glass);
  color: var(--ink-dark);
  padding: 18px;
  border-radius: var(--r-md);
  display: grid;
  gap: 6px;
  box-shadow: var(--shadow-md);
}
.pkg h3 { font-size: 1.15rem; }
.pkg p  { color: var(--ink-dark-soft); font-size: 0.95rem; }
.pkg strong { font-size: 1.3rem; color: var(--hot); margin-top: 4px; }
.pkg .pill { align-self: start; }

.pkg-featured {
  border: 2px solid rgba(255, 210, 63, 0.75);
}

/* =========================================================
   FORMS
   ========================================================= */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(20px, 5vw, 28px);
  display: grid;
  gap: 14px;
  backdrop-filter: blur(10px);
}

.panel h2 { font-size: clamp(1.6rem, 5vw, 2rem); }

.account-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.05);
}

.account-panel strong {
  display: block;
  margin: 2px 0;
}

.account-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.field.compact input {
  min-height: 44px;
  font-size: 0.95rem;
}

.field {
  display: grid;
  gap: 8px;
}
.field > span {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.field input,
.prompt-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 14px;
  padding: 0 16px;
  min-height: 54px;
  font-size: 1rem;
  font-weight: 500;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.field input::placeholder,
.prompt-input::placeholder { color: rgba(255, 255, 255, 0.35); }

.field input:focus,
.prompt-input:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 4px rgba(255, 210, 63, 0.18);
}

#roomCodeInput {
  letter-spacing: 0.32em;
  text-align: center;
  font-family: "Bricolage Grotesque", monospace;
  font-weight: 800;
  font-size: 1.6rem;
}

/* =========================================================
   LOBBY
   ========================================================= */
.lobby-head {
  display: grid;
  gap: 18px;
  align-items: start;
  margin-bottom: 22px;
}

.lobby-head h2 {
  font-size: clamp(1.6rem, 5vw, 2rem);
  margin-top: 8px;
}

.room-code-card {
  background: linear-gradient(135deg, rgba(255, 61, 127, 0.18), rgba(76, 201, 240, 0.16));
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.room-code-card > span { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-soft); }
.room-code-card strong {
  font-family: "Bricolage Grotesque", monospace;
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  font-weight: 900;
  letter-spacing: 0.16em;
  color: var(--gold);
  flex: 1;
  text-align: center;
}

.players-section { margin: 18px 0 24px; }
.games-section { margin: 18px 0 18px; }

.player-list {
  display: grid;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  animation: rise 320ms var(--ease) both;
}

.player-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.player-name {
  flex: 1;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-tag {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 999px;
}
.player-tag.host { background: rgba(255, 210, 63, 0.22); color: var(--gold); }
.player-tag.you  { background: rgba(76, 201, 240, 0.22); color: var(--cyan); }
.player-tag.done { background: rgba(6, 214, 160, 0.22); color: var(--mint); }
.player-tag.wait { background: rgba(255, 255, 255, 0.08); color: var(--ink-mute); }

.player-action {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-mute);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 10px;
  cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.player-action:hover { color: var(--hot); border-color: var(--hot); }

.tabs {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}
.tab {
  background: transparent;
  border: 0;
  color: var(--ink-mute);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.tab.is-active { background: var(--ink); color: var(--ink-dark); }

.game-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.game-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  display: grid;
  gap: 10px;
  align-content: start;
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
  color: inherit;
  font: inherit;
}

.game-card:hover { background: var(--surface-strong); transform: translateY(-2px); }

.game-card.is-selected {
  border-color: var(--gold);
  background: rgba(255, 210, 63, 0.12);
  box-shadow: 0 0 0 3px rgba(255, 210, 63, 0.18);
}

.game-card.is-locked { opacity: 0.7; }

.game-art {
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
  position: relative;
  overflow: hidden;
}

.game-card h4 { font-size: 1rem; margin: 0; }
.game-card p { color: var(--ink-mute); font-size: 0.82rem; line-height: 1.4; }

.game-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.vote-count {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--ink-mute);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.vote-count.has-votes { color: var(--gold); }

.lock-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.5);
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
}

/* =========================================================
   HOST BAR (sticky bottom action)
   ========================================================= */
.host-bar {
  position: sticky;
  bottom: calc(14px + var(--safe-bottom));
  margin-top: 20px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  background: rgba(12, 4, 32, 0.92);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  z-index: 5;
}

.host-bar-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.host-bar-info > span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
}
.host-bar-info > strong {
  font-size: 1.05rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.waiting-host {
  margin-top: 20px;
  padding: 14px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  color: var(--ink-soft);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.dot-pulse {
  width: 10px;
  height: 10px;
  background: var(--gold);
  border-radius: 50%;
  animation: pulse 1.4s var(--ease) infinite;
}

/* =========================================================
   PROMPT COLLECTION
   ========================================================= */
.prompt-progress {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 14px;
  text-align: center;
  display: grid;
  gap: 2px;
  min-width: 96px;
}
.prompt-progress strong {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.3rem;
  color: var(--mint);
}
.prompt-progress span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-mute); }

.prompt-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

.prompt-card .prompt-step {
  display: grid;
  gap: 6px;
}
.prompt-card label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--ink-mute);
}
.prompt-card .hint {
  color: var(--ink-mute);
  font-size: 0.85rem;
  font-style: italic;
}

.prompt-card .prompt-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.prompt-done {
  text-align: center;
  display: grid;
  gap: 6px;
  padding: 18px 0 4px;
}
.prompt-done .emoji { font-size: 2.4rem; }

/* =========================================================
   GAME VIEW
   ========================================================= */
.game-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.game-head h2 { font-size: clamp(1.4rem, 5vw, 1.8rem); }

.round-progress {
  font-family: "Bricolage Grotesque", monospace;
  font-size: 1.05rem;
  font-weight: 800;
  background: var(--surface-strong);
  border-radius: 999px;
  padding: 6px 14px;
}

.round-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  padding: 22px;
  display: grid;
  gap: 18px;
  min-height: 320px;
  animation: rise 380ms var(--ease) both;
}

.round-target {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.round-prompt {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(1.6rem, 6vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}

.round-attrib {
  font-size: 0.85rem;
  color: var(--ink-mute);
  font-style: italic;
}

.action-grid {
  display: grid;
  gap: 10px;
}
.action-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.action-grid .btn { min-height: 68px; font-size: 1.05rem; }

.choice-btn {
  --btn-bg: var(--surface);
  --btn-border: var(--line-strong);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.choice-btn[data-color="hot"]   { --btn-bg: rgba(255, 61, 127, 0.18); --btn-border: rgba(255, 61, 127, 0.5); color: #ffaecc; }
.choice-btn[data-color="gold"]  { --btn-bg: rgba(255, 210, 63, 0.18); --btn-border: rgba(255, 210, 63, 0.5); color: var(--gold); }
.choice-btn[data-color="mint"]  { --btn-bg: rgba(6, 214, 160, 0.18);  --btn-border: rgba(6, 214, 160, 0.5);  color: var(--mint); }
.choice-btn[data-color="cyan"]  { --btn-bg: rgba(76, 201, 240, 0.18); --btn-border: rgba(76, 201, 240, 0.5); color: var(--cyan); }
.choice-btn[data-color="violet"]{ --btn-bg: rgba(179, 136, 255, 0.18);--btn-border: rgba(179, 136, 255, 0.5);color: var(--violet); }

.choice-btn.is-busy {
  opacity: 0.55;
  transform: scale(0.98);
  pointer-events: none;
}

.answer-status {
  background: rgba(6, 214, 160, 0.12);
  border: 1px solid rgba(6, 214, 160, 0.3);
  color: var(--mint);
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.results-strip {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}
.results-strip-title {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.tally-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}

.answer-status.auto-next {
  border-color: rgba(255, 210, 63, 0.5);
  color: var(--gold);
  animation: pulse-glow 1.2s var(--ease) infinite;
}
.tally-bar-name {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.tally-bar-name strong { font-weight: 700; }
.tally-bar-track {
  background: rgba(255, 255, 255, 0.08);
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
}
.tally-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--hot), var(--gold));
  border-radius: 999px;
  transition: width 480ms var(--ease);
}
.tally-bar-count {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  min-width: 24px;
  text-align: right;
}

.rules-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.rules-list span {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--ink-soft);
}

.host-bar .btn { width: 100%; }
#gameHostBar { grid-template-columns: 1fr 2fr; }

/* host bar gets a vertical stack when toggle is present */
.host-bar-stack { grid-template-columns: 1fr; }
.host-bar-stack .btn { justify-self: stretch; }

/* prompt source toggle */
.source-toggle {
  display: inline-flex;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  align-self: start;
  max-width: 100%;
  overflow: hidden;
}
.src-pill {
  background: transparent;
  border: 0;
  color: var(--ink-mute);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.src-pill.is-active {
  background: linear-gradient(135deg, var(--gold), #ffb648);
  color: var(--ink-dark);
}

/* spotlight reveal */
.spotlight-badge {
  background: linear-gradient(135deg, rgba(255, 210, 63, 0.22), rgba(255, 61, 127, 0.18));
  border: 1px solid rgba(255, 210, 63, 0.5);
  padding: 6px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  align-self: flex-start;
  width: auto;
}
.spotlight-waiting {
  background: rgba(76, 201, 240, 0.1);
  border-color: rgba(76, 201, 240, 0.3);
  color: #b6e7fa;
  justify-content: center;
}
.spotlight-reveal {
  background: linear-gradient(135deg, rgba(255, 210, 63, 0.18), rgba(255, 61, 127, 0.18));
  border: 1px solid rgba(255, 210, 63, 0.4);
  border-radius: 18px;
  padding: 20px;
  text-align: center;
  display: grid;
  gap: 8px;
  animation: pop 360ms var(--ease) both;
}
.reveal-value {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  font-weight: 900;
  color: var(--gold);
}
.reveal-card {
  background: rgba(255, 61, 127, 0.18);
  border-color: rgba(255, 61, 127, 0.5);
  color: #ffaecc;
}

/* race button */
.race-btn {
  min-height: 130px !important;
  font-size: 1.8rem !important;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 900 !important;
  letter-spacing: 0.02em;
  animation: pulse-glow 1.6s var(--ease) infinite;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 14px 34px rgba(255, 61, 127, 0.4); }
  50%      { box-shadow: 0 18px 50px rgba(255, 210, 63, 0.55); }
}

.answer-status.big {
  font-size: 1.2rem;
  justify-content: center;
  text-align: center;
}

/* would-you-rather display */
.wyr-line {
  display: block;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.wyr-or {
  display: block;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 6px 0;
}

/* forbidden word reveal */
.forbidden-word {
  display: inline-block;
  background: linear-gradient(135deg, var(--hot), var(--hot-2));
  color: #fff;
  padding: 4px 14px;
  border-radius: 12px;
  margin-top: 6px;
  text-transform: lowercase;
}

/* =========================================================
   INTENSITY SELECTOR
   ========================================================= */
.intensity-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 14px;
}
.intensity-label {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.intensity-pills {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  flex-wrap: wrap;
}
.ipill {
  background: transparent;
  border: 0;
  color: var(--ink-mute);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.ipill:hover:not(:disabled):not(.is-active) { color: var(--ink); }
.ipill:disabled { cursor: default; opacity: 0.9; }
.ipill[data-level="family"].is-active  { background: rgba(6, 214, 160, 0.22);  color: var(--mint); }
.ipill[data-level="spicy"].is-active   { background: rgba(255, 122, 89, 0.25); color: #ffd1a8; }
.ipill[data-level="extreme"].is-active { background: linear-gradient(135deg, var(--hot), var(--hot-2)); color: #fff; box-shadow: 0 6px 20px rgba(255, 61, 127, 0.5); }

/* =========================================================
   VOTER CHIPS (tally + drink reveal)
   ========================================================= */
.tally-voters,
.drink-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.voter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 4px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  animation: pop 280ms var(--ease) both;
  max-width: 100%;
  overflow: hidden;
}

.voter-init {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.voter-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 8rem;
}

/* =========================================================
   DRINK REVEAL
   ========================================================= */
.drink-reveal {
  background: linear-gradient(135deg, rgba(255, 61, 127, 0.2), rgba(255, 122, 89, 0.18));
  border: 1px solid rgba(255, 61, 127, 0.4);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 8px;
  animation: pop 340ms var(--ease) both;
}
.drink-reveal.is-winner {
  background: linear-gradient(135deg, rgba(255, 210, 63, 0.25), rgba(6, 214, 160, 0.18));
  border-color: rgba(255, 210, 63, 0.5);
}
.drink-title {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.drink-text {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

/* =========================================================
   RESULTS
   ========================================================= */
.results-hero {
  text-align: center;
  padding: 28px 0 18px;
  display: grid;
  gap: 8px;
  justify-items: center;
}
.results-hero h2 { font-size: clamp(2rem, 7vw, 2.6rem); }

.leaderboard {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: grid;
  gap: 8px;
}

.leaderboard li {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
}

.leaderboard li:nth-child(1) { background: linear-gradient(135deg, rgba(255, 210, 63, 0.2), rgba(255, 61, 127, 0.15)); border-color: rgba(255, 210, 63, 0.5); }
.leaderboard li:nth-child(2) { background: rgba(255, 255, 255, 0.07); }
.leaderboard li:nth-child(3) { background: rgba(255, 122, 89, 0.1); }

.leaderboard .rank {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 900;
  font-size: 1.4rem;
  text-align: center;
  color: var(--gold);
}
.leaderboard .score {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
}

.results-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px var(--pad) calc(28px + var(--safe-bottom));
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-mute);
  font-size: 0.85rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
}

/* =========================================================
   RESPONSIVE (≥640px)
   ========================================================= */
@media (min-width: 640px) {
  :root { --maxw: 820px; }

  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .package-grid {
    grid-template-columns: 0.85fr 1.15fr;
  }

  .game-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .lobby-head {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .results-actions {
    grid-template-columns: 1fr 1fr;
    justify-content: center;
    max-width: 460px;
    margin: 0 auto;
  }

  .hero-actions .btn {
    flex-direction: row;
    min-height: 64px;
  }
}

@media (min-width: 960px) {
  :root { --maxw: 960px; }
  .hero { padding: 56px 0 40px; }
}

/* =========================================================
   MODALS (account + premium info)
   ========================================================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: var(--pad);
  animation: fade-in 200ms var(--ease);
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(8, 2, 24, 0.72);
  backdrop-filter: blur(14px);
  cursor: pointer;
}

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: linear-gradient(160deg, #221049 0%, #150830 100%);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  padding: clamp(22px, 5vw, 30px);
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 14px;
  animation: rise 280ms var(--ease) both;
  max-height: min(92vh, 720px);
  overflow-y: auto;
}

.modal-panel h2 {
  font-size: clamp(1.45rem, 4.5vw, 1.85rem);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
}
.modal-close:hover { color: var(--ink); border-color: var(--line-strong); }

.account-status-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: grid;
  gap: 6px;
}

.btn-vipps {
  background: #ff5b24;
  color: #ffffff;
  border: 1px solid #ff5b24;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
}
.btn-vipps:hover { background: #ff7a4a; }
.btn-vipps.is-soon {
  background: rgba(255, 91, 36, 0.18);
  color: rgba(255, 255, 255, 0.55);
  border-color: rgba(255, 91, 36, 0.35);
  cursor: not-allowed;
}
.btn-vipps.is-soon:hover { background: rgba(255, 91, 36, 0.18); }
.btn-vipps.is-soon .vipps-mark {
  background: rgba(255, 255, 255, 0.6);
  color: rgba(255, 91, 36, 0.6);
}
.btn-vipps .vipps-mark {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: 1.1rem;
  background: #ffffff;
  color: #ff5b24;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: lowercase;
}

.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--ink-mute);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-links a:hover { color: var(--ink-soft); }

/* =========================================================
   LEGAL PAGES (vilkar / personvern / kontakt)
   ========================================================= */
body.legal {
  background: var(--bg-0);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.6;
}
.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 22px 80px;
}
.legal-page h1 {
  font-family: "Bricolage Grotesque", "Inter", sans-serif;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  margin: 12px 0 4px;
}
.legal-page h2 {
  font-family: "Bricolage Grotesque", "Inter", sans-serif;
  font-size: 1.15rem;
  margin: 26px 0 8px;
  color: var(--ink);
}
.legal-page p, .legal-page li { color: var(--ink-soft); }
.legal-page ul { padding-left: 20px; margin: 6px 0 12px; }
.legal-page li { margin-bottom: 4px; }
.legal-page a {
  color: var(--cyan);
  text-decoration: underline;
}
.legal-page .back {
  display: inline-block;
  color: var(--ink-mute);
  text-decoration: none;
  margin-bottom: 18px;
}
.legal-page .back:hover { color: var(--ink); }
.legal-page strong { color: var(--ink); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 2px;
  color: var(--ink-mute);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-result {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  display: grid;
  gap: 4px;
}
.auth-result.is-success {
  background: rgba(6, 214, 160, 0.16);
  border: 1px solid rgba(6, 214, 160, 0.45);
  color: #b9fbe2;
}
.auth-result.is-error {
  background: rgba(255, 61, 127, 0.16);
  border: 1px solid rgba(255, 61, 127, 0.45);
  color: #ffd0e0;
}
.auth-result strong { display: block; font-weight: 800; }
.auth-result span { font-size: 0.85rem; font-weight: 500; opacity: 0.85; }

.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.premium-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: grid;
  gap: 10px;
}
.premium-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.premium-list li span:first-child {
  font-size: 1.2rem;
  line-height: 1;
}

.premium-actions {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

/* =========================================================
   PHOTO UPLOAD (Photoroulette)
   ========================================================= */
.photo-picker {
  display: grid;
  gap: 6px;
  place-items: center;
  text-align: center;
  padding: 22px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.photo-picker:hover {
  border-color: var(--gold);
  background: rgba(255, 210, 63, 0.06);
}
.photo-picker-emoji {
  font-size: 2rem;
  line-height: 1;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 4px;
}
@media (max-width: 480px) {
  .photo-grid { grid-template-columns: repeat(4, 1fr); }
}

.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
}
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  background: rgba(12, 4, 32, 0.78);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}
.photo-thumb.is-uploading {
  display: grid;
  place-items: center;
  color: var(--ink-mute);
  font-size: 0.75rem;
}
.photo-thumb.is-uploading::after {
  content: "…";
  font-size: 1.4rem;
}

.photo-stage {
  display: grid;
  gap: 14px;
  justify-items: center;
  margin-bottom: 10px;
}
.photo-stage img {
  width: 100%;
  max-width: 360px;
  max-height: 60vh;
  border-radius: var(--r-md);
  background: var(--surface);
  object-fit: contain;
  box-shadow: var(--shadow-md);
}

/* =========================================================
   A11Y / motion preferences
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
