:root {
  --bg-main: #090e1c;
  --bg-card: #121a30;
  --bg-card-2: #192442;
  --border: rgba(255, 255, 255, 0.14);
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;

  --cyan: #22d3ee;
  --blue: #38bdf8;
  --emerald: #34d399;
  --coral: #fb7185;
  --red: #ef4444;
  --gold: #facc15;
  --amber: #f59e0b;
  --violet: #a855f7;

  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 12% 15%, rgba(34, 211, 238, 0.14), transparent 38%),
    radial-gradient(circle at 88% 12%, rgba(168, 85, 247, 0.16), transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(251, 113, 133, 0.12), transparent 42%),
    var(--bg-main);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

h1, h2, h3, .brand-title, .center-title {
  font-family: 'Outfit', system-ui, sans-serif;
  margin: 0;
}

button, input, select {
  font-family: inherit;
}

.hidden {
  display: none !important;
}

/* ==================== TOPBAR ==================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: rgba(9, 14, 28, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.brand-badge {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  font-size: 1.45rem;
  box-shadow: 0 6px 20px rgba(34, 211, 238, 0.35);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  background: linear-gradient(90deg, #fff, var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.03em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-card);
  padding: 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.nav-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-btn.active {
  color: #090e1c;
  background: linear-gradient(135deg, var(--cyan), var(--emerald));
  box-shadow: 0 4px 16px rgba(34, 211, 238, 0.35);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-pill {
  border: 1px solid rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.14);
  color: #fff;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: transform 0.15s ease, background 0.2s ease;
}

.icon-pill.muted {
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(248, 113, 113, 0.15);
}

.icon-pill.secondary {
  border-color: var(--border);
  background: var(--bg-card);
}

.icon-pill:hover {
  transform: translateY(-1px);
}

/* ==================== MAIN CONTAINER & PAGES ==================== */
.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem;
}

.page {
  display: none;
  animation: fadeSlide 0.28s ease;
}

.page.active {
  display: block;
}

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

/* ==================== BUTTONS ==================== */
.btn {
  border: none;
  border-radius: 12px;
  padding: 0.72rem 1.25rem;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.btn-lg {
  padding: 0.95rem 1.6rem;
  font-size: 1.05rem;
}

.btn-sm {
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), #3b82f6);
  color: #06101e;
  box-shadow: 0 8px 24px rgba(34, 211, 238, 0.32);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--amber));
  color: #160f02;
  box-shadow: 0 8px 24px rgba(250, 204, 21, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, var(--emerald), #059669);
  color: #031910;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
}

.btn-danger-outline {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  border: 1.5px solid rgba(239, 68, 68, 0.45);
}

/* ==================== PAGE 1: HOME ==================== */
.hero-card {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 2rem;
  background: linear-gradient(145deg, var(--bg-card), #17203a);
  border: 1.5px solid var(--border);
  border-radius: 26px;
  padding: 2.25rem;
  box-shadow: var(--shadow-lg);
}

.pill-tag {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.16);
  border: 1px solid rgba(34, 211, 238, 0.45);
  color: var(--cyan);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.9rem;
}

.hero-title {
  font-size: clamp(2rem, 3.6vw, 3.1rem);
  font-weight: 900;
  line-height: 1.1;
  background: linear-gradient(95deg, #ffffff 30%, var(--cyan) 72%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.06rem;
  max-width: 56ch;
  margin: 0 0 1.6rem;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 1.6rem;
}

.sound-preview-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.preview-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.sfx-chip {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 0.38rem 0.78rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.sfx-chip:hover { transform: translateY(-1px); }
.sfx-chip.good { border-color: rgba(52, 211, 153, 0.55); color: var(--emerald); }
.sfx-chip.bad { border-color: rgba(239, 68, 68, 0.65); color: #fda4af; }
.sfx-chip.win { border-color: rgba(250, 204, 21, 0.55); color: var(--gold); }

.setup-panel {
  background: rgba(9, 14, 28, 0.7);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 1.35rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.panel-header h2 {
  font-size: 1.25rem;
}

.badge-chip {
  background: rgba(168, 85, 247, 0.22);
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #e9d5ff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

.player-setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.setup-player-card {
  background: var(--bg-card-2);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.setup-player-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.setup-input-row {
  display: flex;
  gap: 0.45rem;
}

.avatar-select {
  width: 52px;
  background: #0b1122;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #fff;
  font-size: 1.2rem;
  text-align: center;
  cursor: pointer;
}

.player-name-input {
  flex: 1;
  min-width: 0;
  background: #0b1122;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #fff;
  padding: 0.45rem 0.65rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.player-name-input:focus,
.setting-field select:focus,
.text-answer-input:focus {
  outline: 2px solid var(--cyan);
  border-color: transparent;
}

.game-settings-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.setting-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.setting-field select {
  background: #0b1122;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #fff;
  padding: 0.55rem 0.65rem;
  font-weight: 700;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-top: 1.5rem;
}

.feature-item {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 1.15rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.95rem;
}

.feature-item.cyan { border-left: 5px solid var(--cyan); }
.feature-item.magenta { border-left: 5px solid #ec4899; }
.feature-item.amber { border-left: 5px solid var(--gold); }

.feature-emoji {
  font-size: 1.9rem;
  line-height: 1;
}

.feature-item h3 {
  font-size: 1.08rem;
  margin-bottom: 0.2rem;
}

.feature-item p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ==================== PAGE 2: OBJECTIVES ==================== */
.page-header-banner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.page-header-banner h1 {
  font-size: clamp(1.6rem, 2.8vw, 2.35rem);
}

.main-objective-box {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.16), rgba(168, 85, 247, 0.18));
  border: 2px solid rgba(34, 211, 238, 0.45);
  border-radius: 22px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
}

.obj-icon {
  font-size: 3rem;
  flex-shrink: 0;
}

.obj-label {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.obj-statement {
  font-size: clamp(1.2rem, 2.2vw, 1.65rem);
  color: #fff;
  margin: 0.25rem 0 0.4rem;
}

.obj-desc {
  margin: 0;
  color: var(--text-muted);
}

.tense-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.tense-guide-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tense-guide-card.present { border-top: 5px solid var(--amber); }
.tense-guide-card.continuous { border-top: 5px solid var(--cyan); }
.tense-guide-card.past { border-top: 5px solid var(--coral); }

.tense-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tense-pill {
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
}

.tense-tag {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--gold);
}

.tense-guide-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.formula-box {
  background: #0a1020;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font-size: 0.88rem;
  display: grid;
  gap: 0.25rem;
}

.signal-words {
  font-size: 0.85rem;
  color: var(--cyan);
}

.example-list {
  display: grid;
  gap: 0.45rem;
  font-size: 0.88rem;
}

.ex-item {
  background: rgba(52, 211, 153, 0.09);
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
}

.how-to-win-box {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 1.35rem;
}

.how-to-win-box h3 {
  margin-bottom: 0.9rem;
}

.steps-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
}

.step-pill {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.step-pill strong {
  color: var(--gold);
}

/* ==================== PAGE 3: MONOPOLY GAME ==================== */
.game-layout {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 1.35rem;
  align-items: start;
}

.players-sidebar {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 22px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.round-badge {
  background: rgba(250, 204, 21, 0.16);
  border: 1px solid rgba(250, 204, 21, 0.5);
  color: var(--gold);
  font-weight: 800;
  font-size: 0.8rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}

.player-cards-list {
  display: grid;
  gap: 0.7rem;
}

.player-hud-card {
  background: var(--bg-card-2);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 0.8rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.player-hud-card.active-turn {
  transform: translateX(4px);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2), 0 10px 25px rgba(0, 0, 0, 0.45);
}

.hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.hud-identity {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.hud-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.hud-name {
  font-weight: 800;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-turn-chip {
  font-size: 0.68rem;
  font-weight: 900;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--gold);
  color: #111;
}

.hud-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.hud-cash {
  color: var(--emerald);
  font-weight: 800;
  font-size: 0.95rem;
}

.hud-jail-tag {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fca5a5;
}

.sidebar-actions {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.25rem;
}

/* ==================== 7x7 MONOPOLY BOARD ==================== */
.board-stage {
  display: flex;
  justify-content: center;
}

.monopoly-board {
  width: 100%;
  max-width: 820px;
  aspect-ratio: 1 / 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: repeat(7, minmax(0, 1fr));
  gap: 5px;
  background: #060a14;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 22px;
  padding: 8px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.board-tile {
  background: #141d35;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
  padding: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.board-tile.tile-active {
  box-shadow: 0 0 0 2.5px var(--gold), 0 0 18px rgba(250, 204, 21, 0.55);
  z-index: 4;
}

.tile-color-bar {
  height: 11px;
  width: 100%;
  flex-shrink: 0;
}

.tile-body {
  flex: 1;
  padding: 4px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2px;
}

.tile-icon {
  font-size: clamp(0.95rem, 1.5vw, 1.3rem);
  line-height: 1;
}

.tile-name {
  font-size: clamp(0.58rem, 0.85vw, 0.74rem);
  font-weight: 800;
  line-height: 1.12;
  color: #f8fafc;
}

.tile-meta {
  font-size: clamp(0.54rem, 0.75vw, 0.68rem);
  font-weight: 700;
  color: var(--gold);
}

.tile-corner {
  background: linear-gradient(145deg, #1b2747, #10182f);
  border-color: rgba(34, 211, 238, 0.35);
}

.tile-owner-badge {
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 6px;
  color: #090e1c;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.tile-tokens {
  position: absolute;
  bottom: 3px;
  left: 3px;
  right: 3px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
}

.board-token {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.76rem;
  border: 2px solid #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.65);
  animation: tokenPop 0.22s ease;
}

@keyframes tokenPop {
  from { transform: scale(0.6); }
  to { transform: scale(1.1); }
}

/* Center Hub inside 7x7 Grid (rows 2..6, cols 2..6) */
.board-center {
  grid-column: 2 / 7;
  grid-row: 2 / 7;
  background:
    radial-gradient(circle at 50% 25%, rgba(34, 211, 238, 0.14), transparent 60%),
    linear-gradient(160deg, #0f172d, #16203d);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.7rem;
  overflow: hidden;
}

.center-brand {
  text-align: center;
}

.center-tag {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--cyan);
}

.center-title {
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  background: linear-gradient(90deg, #fff, var(--cyan), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.free-pot-pill {
  display: inline-block;
  margin-top: 0.25rem;
  background: rgba(250, 204, 21, 0.14);
  border: 1px solid rgba(250, 204, 21, 0.4);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
}

.turn-control-box {
  background: rgba(9, 14, 28, 0.72);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.active-turn-banner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.turn-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  background: var(--cyan);
}

.turn-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.turn-name {
  font-size: 1.05rem;
  font-weight: 900;
}

.dice-arena {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dice-cube {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: linear-gradient(145deg, #ffffff, #dbeafe);
  color: #090e1c;
  display: grid;
  place-items: center;
  font-size: 1.75rem;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
}

.dice-cube.rolling {
  animation: diceSpin 0.45s linear infinite;
}

@keyframes diceSpin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(1); }
}

.btn-roll {
  flex: 1;
  padding: 0.85rem 1rem;
  font-size: 1rem;
}

.turn-status-msg {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cyan);
  text-align: center;
}

.activity-log-box {
  background: rgba(9, 14, 28, 0.58);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  flex: 1;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.log-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.game-log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  display: grid;
  gap: 0.22rem;
  font-size: 0.76rem;
  color: #e2e8f0;
}

/* ==================== PAGE 4: RESULT ==================== */
.result-hero {
  display: grid;
  gap: 1.5rem;
}

.winner-banner {
  text-align: center;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.16), rgba(34, 211, 238, 0.14));
  border: 2px solid rgba(250, 204, 21, 0.5);
  border-radius: 24px;
  padding: 2rem 1.5rem;
}

.trophy-icon {
  display: block;
  font-size: 3.8rem;
  margin-bottom: 0.35rem;
  animation: trophyBounce 1.4s ease infinite;
}

@keyframes trophyBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.winner-banner h1 {
  font-size: clamp(1.8rem, 3.2vw, 2.7rem);
  color: #fff;
  margin-bottom: 0.3rem;
}

.winner-banner p {
  margin: 0;
  color: var(--gold);
  font-weight: 700;
}

.podium-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.podium-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.podium-card.rank-1 {
  border-color: var(--gold);
  background: linear-gradient(160deg, rgba(250, 204, 21, 0.14), var(--bg-card));
  box-shadow: 0 12px 32px rgba(250, 204, 21, 0.18);
}

.podium-medal {
  font-size: 2rem;
}

.podium-avatar {
  font-size: 2.2rem;
}

.podium-worth {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--emerald);
}

.result-stats-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 1.35rem;
}

.result-stats-card h3 {
  margin-bottom: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.result-table th,
.result-table td {
  padding: 0.75rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.result-table th {
  color: var(--cyan);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

/* ==================== MODALS ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 8, 18, 0.78);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-card {
  width: 100%;
  max-width: 580px;
  background: #131c34;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  padding: 1.6rem;
  box-shadow: var(--shadow-lg);
  animation: modalPop 0.24s cubic-bezier(0.2, 1.3, 0.4, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.9) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.tense-badge {
  background: rgba(34, 211, 238, 0.18);
  border: 1px solid var(--cyan);
  color: var(--cyan);
  padding: 0.28rem 0.8rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.8rem;
}

.context-badge {
  background: rgba(250, 204, 21, 0.16);
  border: 1px solid rgba(250, 204, 21, 0.5);
  color: var(--gold);
  padding: 0.28rem 0.8rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.8rem;
}

.challenge-title {
  font-size: 1.45rem;
  margin-bottom: 0.25rem;
}

.challenge-prompt {
  margin: 0 0 0.9rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.question-box {
  background: #0b1122;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 1.15rem;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.option-btn {
  background: #1b2747;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  color: #fff;
  padding: 0.85rem 1rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: transform 0.14s ease, border-color 0.15s ease, background 0.15s ease;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--cyan);
  background: #23325b;
  transform: translateY(-2px);
}

.option-btn.correct {
  background: rgba(52, 211, 153, 0.22);
  border-color: var(--emerald);
  color: #a7f3d0;
}

.option-btn.wrong {
  background: rgba(239, 68, 68, 0.25);
  border-color: var(--red);
  color: #fecaca;
}

.option-letter {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 900;
  flex-shrink: 0;
}

.input-answer-form {
  display: grid;
  gap: 0.65rem;
}

.input-hint {
  font-size: 0.84rem;
  color: var(--gold);
  font-weight: 700;
}

.input-row {
  display: flex;
  gap: 0.55rem;
}

.text-answer-input {
  flex: 1;
  background: #0b1122;
  border: 2px solid var(--border);
  border-radius: 12px;
  color: #fff;
  padding: 0.75rem 0.9rem;
  font-size: 1rem;
  font-weight: 700;
}

.feedback-banner {
  margin-top: 1rem;
  border-radius: 14px;
  padding: 0.9rem 1rem;
}

.feedback-banner.good {
  background: rgba(52, 211, 153, 0.16);
  border: 1.5px solid var(--emerald);
}

.feedback-banner.bad {
  background: rgba(239, 68, 68, 0.16);
  border: 1.5px solid var(--red);
}

.feedback-title {
  font-weight: 900;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.feedback-explain {
  margin: 0;
  font-size: 0.88rem;
  color: #e2e8f0;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.7rem;
  margin-top: 1.15rem;
}

.event-card {
  text-align: center;
  max-width: 460px;
}

.event-emoji {
  font-size: 3.4rem;
  margin-bottom: 0.4rem;
}

.event-desc {
  color: var(--text-muted);
  margin: 0.65rem 0 0;
}

.event-card .modal-actions {
  justify-content: center;
}

.rules-list {
  padding-left: 1.2rem;
  display: grid;
  gap: 0.55rem;
  color: var(--text-muted);
  font-size: 0.93rem;
}

.rules-list strong {
  color: #fff;
}

.close-x {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-weight: 900;
  cursor: pointer;
}

/* ==================== GIANT RED ❌ OVERLAY ==================== */
.wrong-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  background: rgba(127, 29, 29, 0.36);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.wrong-overlay-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  animation: wrongPopShake 0.85s cubic-bezier(0.22, 1.4, 0.36, 1) forwards;
}

.wrong-x-mark {
  font-size: clamp(7rem, 18vw, 12rem);
  line-height: 1;
  filter: drop-shadow(0 0 38px rgba(239, 68, 68, 0.95));
}

.wrong-overlay-label {
  background: #dc2626;
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: clamp(1.2rem, 3vw, 1.9rem);
  letter-spacing: 0.08em;
  padding: 0.45rem 1.4rem;
  border-radius: 999px;
  border: 3px solid #fecaca;
  box-shadow: 0 12px 35px rgba(220, 38, 38, 0.7);
}

@keyframes wrongPopShake {
  0% { opacity: 0; transform: scale(0.25) rotate(-12deg); }
  25% { opacity: 1; transform: scale(1.18) rotate(5deg); }
  40% { transform: scale(0.95) rotate(-6deg); }
  55% { transform: scale(1.06) rotate(4deg); }
  75% { opacity: 1; transform: scale(1) rotate(0deg); }
  100% { opacity: 0; transform: scale(1.08) translateY(-14px); }
}

/* ==================== CELEBRATION ✓ TOAST ==================== */
.correct-overlay {
  position: fixed;
  inset: 0;
  z-index: 998;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.correct-overlay-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  animation: correctPop 0.85s cubic-bezier(0.22, 1.4, 0.36, 1) forwards;
}

.correct-check-mark {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--emerald), #059669);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 4.5rem;
  font-weight: 900;
  box-shadow: 0 0 40px rgba(52, 211, 153, 0.75);
}

.correct-overlay-label {
  background: #059669;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 1.25rem;
  padding: 0.35rem 1.2rem;
  border-radius: 999px;
  border: 2px solid #a7f3d0;
}

@keyframes correctPop {
  0% { opacity: 0; transform: scale(0.35); }
  30% { opacity: 1; transform: scale(1.12); }
  75% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.06) translateY(-18px); }
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 990;
  pointer-events: none;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1120px) {
  .game-layout {
    grid-template-columns: 1fr;
  }
  .player-cards-list {
    grid-template-columns: repeat(2, 1fr);
  }
  .sidebar-actions {
    grid-template-columns: 1fr 1fr;
  }
  .hero-card {
    grid-template-columns: 1fr;
  }
  .tense-cards-grid {
    grid-template-columns: 1fr;
  }
  .steps-row {
    grid-template-columns: 1fr 1fr;
  }
  .podium-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-wrap: wrap;
    padding: 0.65rem 0.9rem;
  }
  .main-nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }
  .nav-btn {
    padding: 0.45rem 0.65rem;
    font-size: 0.8rem;
  }
  .hide-sm {
    display: none;
  }
  .app-container {
    padding: 0.9rem;
  }
  .player-setup-grid,
  .player-cards-list,
  .feature-strip,
  .steps-row,
  .options-grid,
  .podium-grid {
    grid-template-columns: 1fr;
  }
  .board-center {
    padding: 0.55rem;
    gap: 0.4rem;
  }
  .activity-log-box {
    display: none;
  }
  .dice-cube {
    width: 44px;
    height: 44px;
    font-size: 1.35rem;
  }
  .btn-roll {
    padding: 0.6rem 0.7rem;
    font-size: 0.85rem;
  }
}
