@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=Source+Serif+4:wght@500;600;700&display=swap");

:root {
  --bg: #f4f6f9;
  --bg-alt: #e9eef4;
  --card: #ffffff;
  --ink: #0b1b2b;
  --accent: #0f4c81;
  --accent-2: #2d6b9f;
  --accent-3: #4c8bbd;
  --accent-4: #b9d0e8;
  --danger: #c0392b;
  --shadow: rgba(15, 34, 58, 0.15);
  --radius: 24px;
  --font-body: "IBM Plex Sans", "Trebuchet MS", sans-serif;
  --font-display: "Source Serif 4", "Georgia", serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(15, 76, 129, 0.08), transparent 45%),
    radial-gradient(circle at 90% 15%, rgba(76, 139, 189, 0.08), transparent 40%),
    radial-gradient(circle at 20% 85%, rgba(15, 76, 129, 0.06), transparent 45%),
    linear-gradient(140deg, #f8fafc, #eef3f8 55%, #e9eef4);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px 48px;
}

.glow {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 12% 20%, rgba(15, 76, 129, 0.08), transparent 45%),
    radial-gradient(circle at 82% 18%, rgba(76, 139, 189, 0.08), transparent 45%),
    radial-gradient(circle at 70% 80%, rgba(15, 76, 129, 0.06), transparent 45%);
  z-index: -2;
  animation: pulseGlow 10s ease-in-out infinite;
}

.grain {
  position: fixed;
  inset: 0;
  background-image: repeating-linear-gradient(
      130deg,
      rgba(255, 255, 255, 0.12) 0 1px,
      transparent 1px 3px
    ),
    repeating-linear-gradient(
      40deg,
      rgba(14, 35, 60, 0.04) 0 1px,
      transparent 1px 4px
    );
  opacity: 0.25;
  pointer-events: none;
  z-index: -1;
}

.topbar {
  width: min(1100px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink);
  letter-spacing: 0.04em;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.9);
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}

.brand {
  text-decoration: none;
  color: inherit;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  background: white;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

.topbar-hint {
  opacity: 0.75;
}

.hero {
  text-align: left;
  color: var(--ink);
  width: min(1100px, 100%);
  animation: fadeIn 0.8s ease-out;
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.badge {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15, 76, 129, 0.08);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
  border: 1px solid rgba(15, 76, 129, 0.18);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 4.5vw, 3.4rem);
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

h2,
h3 {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  margin: 0;
}

.subtitle {
  margin: 0;
  opacity: 0.85;
  max-width: 540px;
}

.card {
  width: min(1020px, 100%);
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px clamp(20px, 4vw, 46px);
  box-shadow: 0 30px 50px var(--shadow);
  border: 1px solid rgba(15, 23, 42, 0.08);
  margin-top: 26px;
  animation: popIn 0.6s ease-out;
}

.landing-card {
  width: min(1100px, 100%);
}

.monitor-card {
  width: min(1220px, 100%);
}

.room-card {
  width: min(980px, 100%);
}

.section {
  display: grid;
  gap: 24px;
}

.reveal {
  text-align: center;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.round-setup .section-head {
  padding: 20px 22px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(15, 76, 129, 0.14), rgba(255, 255, 255, 0.9));
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.12);
}

.round-setup .section-head h2 {
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
}

.round-setup .section-head .hint {
  font-size: 0.98rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  align-items: center;
}

.hero-panel {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 20px;
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 12px;
}

.hero-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  font-weight: 600;
  color: rgba(15, 23, 42, 0.72);
}

.hero-list li::before {
  content: "•";
  color: var(--accent);
  margin-right: 8px;
}

.form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

textarea,
input,
select {
  font-family: var(--font-body);
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  padding: 12px 14px;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.95);
}

textarea {
  resize: vertical;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  margin-top: 16px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.action-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.1);
  display: grid;
  gap: 14px;
}

.round-setup .action-card {
  border: 1px solid rgba(15, 76, 129, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(15, 76, 129, 0.05));
  box-shadow: 0 20px 32px rgba(15, 76, 129, 0.16);
}

.join {
  display: grid;
  gap: 10px;
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  background: var(--accent);
  border: none;
  border-radius: 999px;
  color: #f8fafc;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 16px 28px rgba(15, 76, 129, 0.28);
}

.primary:hover {
  transform: translateY(-2px) scale(1.01);
}

.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  border: 2px solid rgba(15, 76, 129, 0.28);
  background: white;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.ghost:hover {
  transform: translateY(-2px);
}

.alert {
  background: rgba(192, 57, 43, 0.12);
  border-left: 4px solid var(--danger);
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
}

.hint {
  color: rgba(15, 23, 42, 0.65);
  margin: 0;
}

.turn {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: rgba(15, 23, 42, 0.55);
}

.info-banner {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px dashed rgba(15, 23, 42, 0.2);
  font-weight: 600;
}

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

.step-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  font-size: 13px;
  font-weight: 600;
}

.step-chip.active {
  background: rgba(15, 76, 129, 0.14);
  border: 1px solid rgba(15, 76, 129, 0.28);
}

.panel {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(28, 20, 64, 0.12);
  display: grid;
  gap: 12px;
}

.panel.highlight {
  border: 2px solid rgba(15, 76, 129, 0.25);
  background: rgba(255, 255, 255, 0.92);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.secret {
  border: 2px dashed rgba(28, 20, 64, 0.2);
  padding: 18px;
  border-radius: 18px;
  margin: 0;
  background: rgba(15, 76, 129, 0.08);
}

.tag {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 76, 129, 0.16);
  font-weight: 700;
}

.tag.danger {
  background: rgba(192, 57, 43, 0.16);
  color: var(--danger);
}

.word {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  margin: 12px 0;
}

.sub {
  color: rgba(15, 23, 42, 0.6);
  margin: 0;
}

.step {
  margin: 12px auto 0;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.08);
  max-width: 520px;
  font-weight: 600;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 0;
}

.room-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

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

.pill {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  font-size: 0.9rem;
  word-break: break-all;
}

.pill.secondary {
  background: rgba(15, 23, 42, 0.05);
  color: rgba(15, 23, 42, 0.7);
  font-size: 0.82rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.join-form {
  max-width: 320px;
}

.qr {
  width: 160px;
  height: 160px;
  background: white;
  border-radius: 12px;
  padding: 8px;
  border: 2px solid rgba(15, 23, 42, 0.12);
}

.monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin: 0;
}

.monitor-top {
  align-items: stretch;
}

.monitor-wide {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.monitor-tile {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.72));
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.12);
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 12px;
}

.round-tile .tile-title {
  font-size: 1.05rem;
  letter-spacing: 0.12em;
}

.round-tile .hint {
  font-size: 0.92rem;
}

.round-tile .stat-row {
  opacity: 0.85;
}

.category-active {
  font-size: 0.82rem;
  letter-spacing: 0.1em;
}

.side-tile {
  align-content: start;
}

.qr-tile {
  align-items: center;
  text-align: center;
}
.monitor-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0 0, rgba(15, 76, 129, 0.12), transparent 50%),
    radial-gradient(circle at 100% 0, rgba(76, 139, 189, 0.12), transparent 45%);
  opacity: 0.7;
  pointer-events: none;
}

.monitor-tile > * {
  position: relative;
  z-index: 1;
}

.tile-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.tile-header img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 14px;
  background: white;
  border: 2px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.tile-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.round-indicator {
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(15, 23, 42, 0.7);
}

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

.word-bank {
  grid-column: 1 / -1;
  padding: 34px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(15, 76, 129, 0.08));
  border: 2px solid rgba(15, 76, 129, 0.2);
  box-shadow: 0 22px 36px rgba(15, 76, 129, 0.12);
}

.word-bank .tile-title {
  font-size: clamp(2rem, 3.2vw, 2.8rem);
}

.word-bank .word-wall-grid span {
  font-size: 16px;
  padding: 12px 14px;
}

.category-tile {
  padding: 14px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(28, 20, 64, 0.1);
  box-shadow: 0 12px 20px rgba(15, 23, 42, 0.1);
}

.category-tile .tile-title {
  font-size: 1.05rem;
}

.category-tile .turn {
  font-size: 10px;
}

.category-tile img {
  width: 40px;
  height: 40px;
}

.word-wall-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.word-wall-grid span {
  font-size: 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(15, 76, 129, 0.06));
  border-radius: 16px;
  border: 1px solid rgba(15, 76, 129, 0.22);
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 12px 20px rgba(15, 76, 129, 0.12);
}

.players {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.player-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(28, 20, 64, 0.1);
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(76, 139, 189, 0.18);
  color: #111827;
  font-weight: 700;
}

.player-name {
  font-weight: 700;
  margin: 0;
}

.player-word,
.player-votes {
  margin: 4px 0 0;
  font-size: 0.9rem;
}

.vote-list {
  display: grid;
  gap: 10px;
}

.vote-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(28, 20, 64, 0.12);
  background: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}

.vote-option input {
  accent-color: var(--accent);
}

.vote-results {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.vote-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(28, 20, 64, 0.08);
}

.impostor-reveal {
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(239, 71, 111, 0.35);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(255, 225, 230, 0.95));
  animation: revealPop 0.7s ease-out;
}

.impostor-reveal::after {
  content: "";
  position: absolute;
  inset: -40% 0 0;
  background: radial-gradient(circle at 50% 0, rgba(239, 71, 111, 0.28), transparent 65%);
  opacity: 0.9;
  pointer-events: none;
}

.impostor-reveal > * {
  position: relative;
  z-index: 1;
}

.impostor-name {
  margin: 8px 0;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--danger);
}

.monitor .card,
.monitor {
  animation: none;
}

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

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

@keyframes pulseGlow {
  0% {
    opacity: 0.9;
  }
  50% {
    opacity: 0.6;
  }
  100% {
    opacity: 0.9;
  }
}

@keyframes revealPop {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .monitor-wide {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
  .word-bank {
    padding: 24px;
  }
  .word-bank .tile-title {
    font-size: clamp(1.6rem, 5vw, 2.2rem);
  }
  .word-wall-grid span {
    font-size: 14px;
    padding: 10px 12px;
  }
}

@media (max-width: 600px) {
  .card {
    padding: 22px 18px;
  }
  .primary,
  .ghost {
    width: 100%;
  }
  .word-bank {
    padding: 18px;
  }
  .word-bank .tile-title {
    font-size: 1.2rem;
  }
  .word-bank .hint {
    font-size: 0.75rem;
  }
  .word-bank .turn {
    font-size: 0.62rem;
    letter-spacing: 0.05em;
  }
  .category-active {
    font-size: 0.68rem;
    letter-spacing: 0.06em;
  }
  .word-wall-grid {
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .word-wall-grid span {
    font-size: 13px;
    padding: 10px;
    letter-spacing: 0.02em;
    word-break: break-word;
    line-height: 1.2;
  }
  .word-bank .word-wall-grid span {
    font-size: 14px;
    padding: 12px 10px;
  }
}

@media (max-width: 420px) {
  .word-bank {
    padding: 16px;
  }
  .word-bank .tile-title {
    font-size: 1.05rem;
  }
  .word-bank .hint {
    font-size: 0.7rem;
  }
  .word-bank .turn {
    font-size: 0.6rem;
  }
  .category-active {
    font-size: 0.64rem;
  }
  .word-wall-grid {
    grid-template-columns: 1fr;
  }
  .word-wall-grid span {
    font-size: 14px;
  }
}
