:root {
  color-scheme: dark;
  --bg: #1f1711;
  --bg-deep: #120d09;
  --panel: #35281d;
  --panel-strong: #443326;
  --fg: #fff7ea;
  --muted: #d8c4a9;
  --line: rgba(255, 247, 234, 0.15);
  --gold: #f0be74;
  --leaf: #7ea35b;
  --danger: #d66f55;
  --shadow: 10px 10px 0 rgba(12, 8, 5, 0.44);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(126, 163, 91, 0.13), transparent 34rem),
    linear-gradient(225deg, rgba(185, 120, 63, 0.17), transparent 34rem),
    linear-gradient(180deg, var(--bg) 0%, #271d15 48%, var(--bg-deep) 100%);
  color: var(--fg);
  font-family:
    "Space Grotesk", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.party-shell {
  width: min(1180px, calc(100% - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 0 30px;
}

.topbar,
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: #fff7ea;
  font-size: 0.78rem;
}

.pill,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 247, 234, 0.2);
  border-radius: 999px;
  background: rgba(126, 163, 91, 0.18);
  color: #f9eed7;
  font-size: 0.84rem;
  font-weight: 900;
}

.hero {
  display: grid;
  grid-template-columns: minmax(300px, 0.75fr) minmax(320px, 1.25fr);
  gap: clamp(22px, 5vw, 64px);
  align-items: start;
  padding: clamp(44px, 8vw, 86px) 0 34px;
}

.splash-hero {
  grid-template-columns: minmax(320px, 0.95fr) minmax(280px, 420px);
  align-items: end;
  padding-bottom: 28px;
}

.hero-copy {
  max-width: 760px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.hero-stats span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid rgba(255, 247, 234, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  padding: 0 12px;
}

.hero-stats strong {
  color: var(--fg);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  color: #fff7ea;
  font-size: clamp(3.6rem, 9vw, 7rem);
  line-height: 0.9;
}

.lead {
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.6;
}

.catalog-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 0 0 16px;
}

.catalog-head h2 {
  margin-bottom: 0;
  color: var(--fg);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 0.95;
}

.catalog-head .muted {
  max-width: 430px;
  margin-bottom: 4px;
  line-height: 1.5;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.02)),
    var(--panel);
  box-shadow: var(--shadow);
}

.setup {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.setup label {
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.input {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid rgba(255, 247, 234, 0.2);
  border-radius: 8px;
  background: rgba(18, 13, 9, 0.45);
  color: var(--fg);
  padding: 12px 14px;
  outline: none;
}

.input:focus {
  border-color: rgba(240, 190, 116, 0.68);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  padding: 0 0 34px;
}

.game-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 350px;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--fg);
  padding: 16px;
  text-align: left;
  text-decoration: none;
  box-shadow: 7px 7px 0 rgba(12, 8, 5, 0.34);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.game-card:hover {
  border-color: rgba(255, 247, 234, 0.32);
  background: var(--panel-strong);
  transform: translate(-2px, -2px);
}

.game-card:focus-visible {
  outline: 3px solid rgba(240, 190, 116, 0.72);
  outline-offset: 3px;
}

.game-visual {
  position: relative;
  display: grid;
  min-height: 142px;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(255, 247, 234, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--card-a), var(--card-b)),
    var(--panel-strong);
}

.game-visual::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 22px),
    linear-gradient(135deg, transparent 0 46%, rgba(18, 13, 9, 0.2) 46% 54%, transparent 54%);
  content: "";
}

.visual-disc {
  position: relative;
  z-index: 2;
  display: grid;
  width: 84px;
  min-width: 84px;
  height: 84px;
  place-items: center;
  border: 1px solid rgba(255, 247, 234, 0.18);
  border-radius: 8px;
  background: rgba(18, 13, 9, 0.52);
  box-shadow: 0 14px 28px rgba(18, 13, 9, 0.34);
  color: #fff7ea;
  font-size: clamp(1.45rem, 4vw, 2.15rem);
  font-weight: 950;
  line-height: 0.95;
  text-align: center;
}

.visual-shape {
  position: absolute;
  z-index: 1;
  display: block;
  border-radius: 6px;
  background: rgba(255, 247, 234, 0.15);
}

.visual-shape.one {
  width: 74px;
  height: 26px;
  top: 22px;
  left: 20px;
  transform: rotate(-18deg);
}

.visual-shape.two {
  width: 58px;
  height: 58px;
  right: 18px;
  bottom: 16px;
  transform: rotate(12deg);
}

.visual-shape.three {
  width: 32px;
  height: 96px;
  right: 48px;
  top: -18px;
  transform: rotate(35deg);
}

.game-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.game-kicker {
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.game-card h3 {
  margin-bottom: 0;
  color: var(--fg);
  font-size: clamp(1.65rem, 4vw, 2.45rem);
  line-height: 0.95;
  overflow-wrap: anywhere;
}

.game-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.game-footer {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.game-footer span,
.game-footer strong {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(255, 247, 234, 0.13);
  border-radius: 999px;
  padding: 0 10px;
}

.game-footer strong {
  justify-self: end;
  border-color: rgba(255, 247, 234, 0.2);
  background: #f4eadb;
  color: #1f1711;
}

.theme-shadow {
  --card-a: #3d2d21;
  --card-b: #19120d;
}

.theme-sun {
  --card-a: #b97a3f;
  --card-b: #59401f;
}

.theme-rose {
  --card-a: #9a5149;
  --card-b: #422238;
}

.theme-violet {
  --card-a: #5b4f8a;
  --card-b: #34234a;
}

.theme-ember {
  --card-a: #a74f35;
  --card-b: #4a2118;
}

.theme-mint {
  --card-a: #68875f;
  --card-b: #284338;
}

.theme-ink {
  --card-a: #3e455d;
  --card-b: #151a26;
}

.theme-sky {
  --card-a: #4b7184;
  --card-b: #243f53;
}

.theme-lime {
  --card-a: #7d8a4d;
  --card-b: #3d4624;
}

.theme-blue {
  --card-a: #456f9b;
  --card-b: #233653;
}

.theme-plum {
  --card-a: #744e72;
  --card-b: #342638;
}

.theme-gold {
  --card-a: #b8914d;
  --card-b: #5a4020;
}

.theme-night {
  --card-a: #3a4a68;
  --card-b: #171a23;
}

.theme-clay {
  --card-a: #9b6746;
  --card-b: #4b3125;
}

.theme-teal {
  --card-a: #4f857c;
  --card-b: #263f3c;
}

.play-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 360px);
  gap: clamp(18px, 4vw, 34px);
  align-items: start;
  padding: clamp(30px, 6vw, 58px) 0;
}

.play-card {
  display: grid;
  gap: 18px;
  min-height: 440px;
  padding: clamp(20px, 4vw, 36px);
}

.prompt {
  color: #fff7ea;
  font-size: clamp(2.2rem, 7vw, 5.8rem);
  font-weight: 950;
  line-height: 0.98;
}

.subprompt {
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.55;
}

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

.btn {
  min-height: 46px;
  border: 1px solid rgba(255, 247, 234, 0.2);
  border-radius: 999px;
  background: #f4eadb;
  color: #1f1711;
  padding: 0 18px;
  font-weight: 950;
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
}

.btn.danger {
  background: rgba(214, 111, 85, 0.22);
  color: #ffe0d8;
}

.side-panel {
  display: grid;
  gap: 14px;
}

.info-card {
  padding: 18px;
}

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

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

.vote-btn,
.choice-btn {
  min-height: 74px;
  border: 1px solid rgba(255, 247, 234, 0.16);
  border-radius: 8px;
  background: rgba(18, 13, 9, 0.34);
  color: var(--fg);
  padding: 12px;
  text-align: left;
  font-weight: 900;
}

.meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.meter span {
  display: block;
  height: 100%;
  background: var(--gold);
}

.timer {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: clamp(3rem, 9vw, 6rem);
  font-weight: 950;
  line-height: 1;
}

.word {
  color: #fff7ea;
  font-size: clamp(3rem, 11vw, 7rem);
  font-weight: 950;
  line-height: 0.9;
}

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

.role-list {
  display: grid;
  gap: 8px;
}

.role-row,
.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(255, 247, 234, 0.1);
  border-radius: 8px;
  background: rgba(18, 13, 9, 0.28);
  padding: 10px 12px;
}

.muted {
  color: var(--muted);
}

.toast {
  min-height: 24px;
  color: var(--gold);
  font-weight: 900;
}

.loading {
  display: grid;
  min-height: 80vh;
  place-items: center start;
}

@media (max-width: 980px) {
  .hero,
  .play-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {
  .party-shell {
    width: min(100% - 22px, 1180px);
    padding-top: 14px;
  }

  .topbar,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .games-grid,
  .vote-grid,
  .choice-grid,
  .team-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(4rem, 18vw, 5.4rem);
  }
}
