:root {
  --paper: #f7f2e7;
  --paper-strong: #fffaf1;
  --ink: #1f2330;
  --muted: #6d7687;
  --red: #c94b4b;
  --red-strong: #942d2d;
  --blue: #296ca8;
  --blue-strong: #194a75;
  --gold: #d6a43a;
  --shadow: 0 18px 45px rgba(31, 35, 48, 0.14);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(214, 164, 58, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(41, 108, 168, 0.18), transparent 26%),
    linear-gradient(180deg, #efe2c4 0%, #f7f2e7 44%, #e8eef4 100%);
}

button,
input {
  font: inherit;
}

.ambient {
  position: fixed;
  width: 30rem;
  height: 30rem;
  border-radius: 999px;
  filter: blur(42px);
  opacity: 0.36;
  pointer-events: none;
}

.ambient-left {
  left: -10rem;
  top: 10rem;
  background: rgba(201, 75, 75, 0.28);
}

.ambient-right {
  right: -12rem;
  top: -8rem;
  background: rgba(41, 108, 168, 0.24);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1380px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.hero-card,
.panel {
  background: rgba(255, 250, 241, 0.8);
  border: 1px solid rgba(109, 118, 135, 0.14);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-card {
  padding: 2rem;
  animation: rise 420ms ease-out both;
}

.eyebrow {
  margin: 0 0 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  color: var(--muted);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Baskerville", "Palatino Linotype", serif;
}

h1 {
  font-size: clamp(2.3rem, 3vw, 4rem);
  line-height: 0.95;
  max-width: 12ch;
}

.hero-copy,
.panel-head p,
.meta-label,
.field span,
.activity-item span {
  color: var(--muted);
}

.hero-grid,
.room-layout {
  display: grid;
  gap: 1.25rem;
}

.hero-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 1.75rem;
}

.room-layout {
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  margin-top: 1.5rem;
}

.side-column,
.board-column {
  display: grid;
  gap: 1.25rem;
}

.panel {
  padding: 1.25rem;
}

.stack-form,
.field,
.participant-card,
.activity-item,
.seat-card,
.board-card,
.active-clue {
  display: grid;
  gap: 0.45rem;
}

.field input,
.rename-row input {
  width: 100%;
  padding: 0.86rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(31, 35, 48, 0.14);
  background: rgba(255, 255, 255, 0.72);
}

.primary-button,
.secondary-button,
.ghost-button {
  border: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.primary-button,
.secondary-button {
  padding: 0.92rem 1.1rem;
  border-radius: 16px;
  color: white;
  font-weight: 700;
}

.primary-button {
  background: linear-gradient(135deg, var(--blue-strong), var(--blue));
}

.secondary-button {
  background: linear-gradient(135deg, var(--red-strong), var(--red));
}

.ghost-button {
  padding: 0.72rem 0.92rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.seat-card:hover,
.board-card.clickable:hover {
  transform: translateY(-1px);
}

.wide {
  width: 100%;
}

.room-head,
.rename-row,
.meta-grid,
.status-strip,
.score-row {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  justify-content: space-between;
}

.meta-grid {
  justify-content: flex-start;
}

.meta-grid > div {
  flex: 1;
  display: grid;
  gap: 0.2rem;
}

.seat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.seat-card {
  text-align: left;
  padding: 1rem;
  border: 1px solid transparent;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  min-height: 7.2rem;
}

.seat-card.red {
  border-color: rgba(201, 75, 75, 0.28);
}

.seat-card.blue {
  border-color: rgba(41, 108, 168, 0.28);
}

.seat-card.yours {
  box-shadow: inset 0 0 0 2px var(--gold);
}

.seat-team {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}

.participant-list,
.activity-list {
  display: grid;
  gap: 0.7rem;
}

.participant-card,
.activity-item {
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
}

.participant-card em {
  color: var(--blue-strong);
  font-style: normal;
  font-weight: 700;
}

.participant-card.host {
  border: 1px solid rgba(214, 164, 58, 0.42);
}

.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  font-weight: 700;
}

.score-pill.red {
  background: rgba(201, 75, 75, 0.12);
  color: var(--red-strong);
}

.score-pill.blue {
  background: rgba(41, 108, 168, 0.12);
  color: var(--blue-strong);
}

.board-panel {
  min-height: 620px;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.95rem;
}

.board-card {
  position: relative;
  min-height: 120px;
  padding: 0.95rem;
  border-radius: 18px;
  border: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, var(--paper-strong), var(--paper));
  box-shadow: inset 0 0 0 1px rgba(31, 35, 48, 0.08);
}

.board-card .word {
  font-weight: 800;
  font-size: 0.96rem;
}

.board-card .affiliation {
  align-self: end;
  font-size: 0.72rem;
  color: var(--muted);
}

.board-card.red,
.board-card.blue,
.board-card.neutral,
.board-card.assassin {
  color: white;
}

.board-card.red {
  background: linear-gradient(180deg, #d26a6a, #9f3030);
}

.board-card.blue {
  background: linear-gradient(180deg, #4c8fca, #205e94);
}

.board-card.neutral {
  background: linear-gradient(180deg, #848c96, #59606a);
}

.board-card.assassin {
  background: linear-gradient(180deg, #2b2f3d, #13151d);
}

.board-card.hidden-card {
  color: var(--ink);
}

.board-card.hidden-card .affiliation {
  color: rgba(109, 118, 135, 0.6);
}

.board-card.clickable {
  cursor: pointer;
}

.board-card:disabled {
  cursor: default;
}

.board-empty {
  display: grid;
  place-items: center;
  min-height: 520px;
  border-radius: 20px;
  border: 1px dashed rgba(31, 35, 48, 0.14);
  color: var(--muted);
  text-align: center;
  padding: 2rem;
}

.active-clue {
  padding: 1rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(41, 108, 168, 0.12), rgba(214, 164, 58, 0.18));
}

.flash {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: rgba(201, 75, 75, 0.12);
  color: var(--red-strong);
  font-weight: 700;
}

.hidden {
  display: none !important;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1040px) {
  .room-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 1rem, 100%);
    padding-top: 0.75rem;
  }

  .hero-card,
  .panel {
    padding: 1rem;
  }

  .seat-grid,
  .board-grid {
    grid-template-columns: 1fr;
  }

  .room-head,
  .rename-row,
  .status-strip,
  .score-row {
    flex-direction: column;
    align-items: stretch;
  }

  .board-card {
    min-height: 96px;
  }
}
