/* ============================================================
   CityScape™ Vancouver — Styles
   Vintage Vancouver travel poster × modern board game UI
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Barlow+Condensed:wght@500;600;700&display=swap');

/* ── Variables ──────────────────────────────────────────── */

:root {
  --navy: #1A1F2E;
  --navy-light: #242B3D;
  --navy-mid: #2A3248;
  --gold: #C8A951;
  --gold-dim: #A08A42;
  --white: #FFFFFF;
  --muted: #8895A7;
  --muted-dark: #5A6577;
  --bg: #0F1219;
  --panel: #1A1F2E;
  --panel-hover: #242B3D;
  --border: #2A3248;
  --text: #E8ECF2;
  --text-dim: #8895A7;
  --success: #4CAF80;
  --danger: #E05C5C;
  --warning: #E8924A;
  --info: #4A90D9;

  /* Subtype Colors */
  --local-business: #4CAF80;
  --culture: #9B72CF;
  --park: #4ABFBF;
  --landmark: #C8A951;
  --neighbourhood: #4A90D9;
  --city-event: #E8924A;
  --special-event: #E05C5C;
  --appeal: #4A90D9;
  --money: #4CAF80;
  --revenue: #C8A951;

  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --transition: 0.2s ease;
}

/* ── Reset & Base ───────────────────────────────────────── */

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Barlow', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.light-mode {
  --bg: #E8ECF2;
  --panel: #FFFFFF;
  --panel-hover: #F0F2F5;
  --border: #D0D5DD;
  --text: #1A1F2E;
  --text-dim: #5A6577;
  --navy: #FFFFFF;
  --navy-light: #F0F2F5;
  --navy-mid: #E0E4EA;
  --gold-dim: #A08A42;
  --muted: #6B7A8D;
  --muted-dark: #9BA5B2;
  --shadow: 0 4px 20px rgba(0,0,0,0.1);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
}

body.light-mode .top-bar {
  background: #F5F6F8;
  border-bottom-color: #D0D5DD;
}

body.light-mode .top-bar-item {
  background: #E0E4EA;
  color: #3A4555;
}

body.light-mode .hand-card {
  background: #F5F6F8;
}

body.light-mode .nh-slot {
  background: #F0F2F5;
}

body.light-mode .draw-btn {
  background: #F0F2F5;
  border-color: #D0D5DD;
}

body.light-mode .draw-modal,
body.light-mode .event-modal,
body.light-mode .win-modal {
  background: #FFFFFF;
  border-color: var(--gold);
}

body.light-mode .log-entry {
  color: #1A1F2E;
}

body.light-mode .card-name-bar {
  background: rgba(0,0,0,0.75);
}

body.light-mode .money-chip.m5 { background: #d4f0e0; color: #2a6b47; }
body.light-mode .money-chip.m2 { background: #d4e4f0; color: #2a4f6b; }
body.light-mode .money-chip.m1 { background: #f0f0d4; color: #6b6b2a; }

body.light-mode .target-btn {
  background: #F0F2F5;
  border-color: #D0D5DD;
  color: #1A1F2E;
}

h1, h2, h3, h4 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}

button {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all var(--transition);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Explainer Screen ──────────────────────────────────── */

#explainerScreen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--bg) 0%, var(--navy) 100%);
  overflow-y: auto;
  z-index: 1000;
}

.explainer-container {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  max-width: 680px;
  width: 100%;
  box-shadow: var(--shadow);
  margin: 1rem 0 3rem;
}

.explainer-header {
  text-align: center;
  margin-bottom: 2rem;
}

.explainer-header img {
  width: 180px;
  height: auto;
  margin-bottom: 0.75rem;
}

.explainer-header h1 {
  font-size: 1.8rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.explainer-subtitle {
  color: var(--muted);
  font-size: 0.95rem;
}

.explainer-section {
  margin-bottom: 1.5rem;
  padding: 1.2rem;
  background: var(--navy-light);
  border-radius: var(--radius);
  border-left: 3px solid var(--gold);
}

.explainer-icon {
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
}

.explainer-section h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.explainer-section p {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.explainer-section p:last-child {
  margin-bottom: 0;
}

.explainer-steps {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.explainer-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.4;
}

.step-number {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: var(--gold);
  color: var(--navy);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.explainer-nh-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.explainer-nh {
  background: var(--navy-mid);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.4;
}

.explainer-card-types {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.explainer-card-type {
  font-size: 0.85rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ct-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 20px;
  border-radius: 3px;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
}

.explainer-revenue {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.explainer-revenue span {
  font-size: 0.85rem;
  color: var(--text);
  background: var(--navy-mid);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
}

.explainer-start-btn {
  margin-top: 1.5rem;
  font-size: 1.1rem;
}

/* ── Setup Screen ───────────────────────────────────────── */

#setupScreen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  background: linear-gradient(135deg, var(--bg) 0%, var(--navy) 100%);
}

.setup-container {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  max-width: 600px;
  width: 100%;
  box-shadow: var(--shadow);
}

.setup-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.setup-logo img {
  width: 200px;
  height: auto;
  margin-bottom: 1rem;
}

.setup-logo h1 {
  font-size: 2rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.setup-logo p {
  color: var(--muted);
  font-size: 0.9rem;
}

.setup-section {
  margin-bottom: 1.5rem;
}

.setup-section label {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.setup-section input,
.setup-section select {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--navy-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-size: 0.95rem;
}

.setup-section input:focus,
.setup-section select:focus {
  border-color: var(--gold);
  outline: none;
}

.player-setup-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: center;
}

.player-setup-row input { flex: 1; }
.player-setup-row select { width: 130px; }

.player-tag {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--gold);
  color: var(--navy);
  font-weight: 600;
  white-space: nowrap;
}

.start-btn {
  width: 100%;
  padding: 1rem;
  background: var(--gold);
  color: var(--navy);
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: var(--radius);
  margin-top: 1rem;
}

.start-btn:hover {
  background: #D9BA62;
  transform: translateY(-1px);
}

/* ── Game Layout ────────────────────────────────────────── */

#gameScreen {
  display: none;
  height: 100vh;
  grid-template-rows: auto 1fr;
  grid-template-columns: 1fr 320px;
}

#gameScreen.visible {
  display: grid;
}

/* ── Top Bar ────────────────────────────────────────────── */

.top-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1.2rem;
  background: var(--navy);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.top-bar-logo img {
  height: 28px;
  width: auto;
}

.top-bar-item {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 0.3rem 0.7rem;
  background: var(--navy-light);
  border-radius: var(--radius-sm);
}

.top-bar-item.round { color: var(--white); }
.top-bar-item.turn { color: var(--gold); }

.city-flow-badge {
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-sm);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.city-flow-badge.grace {
  background: var(--warning);
  color: var(--navy);
}

.city-flow-badge.active {
  background: var(--success);
  color: var(--navy);
}

.objective-banner {
  flex: 1;
  text-align: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.progress-label { color: var(--gold); margin-right: 4px; }
.progress-count { color: var(--muted); font-size: 0.75rem; margin-left: 4px; }

#endTurnBtn {
  padding: 0.5rem 1.5rem;
  background: var(--navy-mid);
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#endTurnBtn:hover:not(:disabled) {
  background: var(--gold);
  color: var(--navy);
}

#darkModeToggle {
  background: none;
  font-size: 1.2rem;
  padding: 0.3rem;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

#darkModeToggle:hover { color: var(--gold); }

/* ── Main Content Area ──────────────────────────────────── */

.main-area {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  overflow: hidden;
  padding: 0.8rem;
  min-height: 0;
}

/* ── Player Boards ──────────────────────────────────────── */

#playerBoards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  overflow-y: auto;
  padding-bottom: 0.5rem;
  flex: 1;
  min-height: 0;
  align-content: start;
}

.player-board {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem;
  transition: all var(--transition);
}

.player-board.active-player {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(200, 169, 81, 0.15);
}

.player-board.human-player {
  border-left: 3px solid var(--gold);
}

.player-header {
  margin-bottom: 0.5rem;
}

.player-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.player-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.active-badge {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.player-difficulty {
  font-size: 0.65rem;
  color: var(--muted);
  margin-left: auto;
  text-transform: uppercase;
}

.player-stats {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.stat {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--navy-light);
}

.money-stat { color: var(--money); }
.hand-stat { color: var(--info); }
.dev-stat { color: var(--gold); }

.money-chips {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}

.money-chip {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.money-chip.m5 { background: #2d4f3a; color: #7dd9a0; }
.money-chip.m2 { background: #2d3f4f; color: #7db8d9; }
.money-chip.m1 { background: #3a3a2d; color: #c8c878; }

/* ── Neighbourhood Slots ────────────────────────────────── */

.player-neighbourhoods {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.no-nh {
  color: var(--muted);
  font-size: 0.8rem;
  font-style: italic;
  padding: 0.5rem;
  text-align: center;
}

.nh-slot {
  background: var(--navy-light);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  border: 1px solid transparent;
}

.nh-slot.developed {
  border-color: var(--success);
  background: rgba(76, 175, 128, 0.08);
}

.nh-slot.locked {
  border-color: var(--gold);
}

.nh-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.nh-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--info);
}

.nh-badge {
  font-size: 0.6rem;
  padding: 1px 5px;
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.nh-badge.complete { background: var(--success); color: #fff; }
.nh-badge.locked { background: var(--gold); color: var(--navy); }

.nh-grid {
  display: flex;
  gap: 0.4rem;
}

.nh-column {
  flex: 1;
}

.nh-col-header {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  margin-bottom: 0.2rem;
}

.nh-slots {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.nh-card-slot {
  width: 100%;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1.5px dashed;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.nh-card-slot.filled {
  border-style: solid;
}

.nh-card-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: var(--radius-sm);
  transform: scale(1.25);
  transform-origin: top center;
}

.nh-card-slot.filled {
  cursor: pointer;
}

.slot-name-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  padding: 0.8rem 0.3rem 0.15rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.66rem;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s;
}

.nh-card-slot.filled:hover .slot-name-overlay {
  opacity: 1;
}

.card-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  color: white;
  font-weight: 600;
  text-align: center;
  padding: 2px;
  font-family: 'Barlow Condensed', sans-serif;
}

.slot-icon {
  color: var(--muted-dark);
  font-size: 0.8rem;
  font-weight: 700;
}

/* ── Bottom Section (Hand + Pool) ───────────────────────── */

.bottom-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.6rem;
  min-height: 220px;
  max-height: 260px;
  flex-shrink: 0;
}

/* ── Player Hand ────────────────────────────────────────── */

#playerHand {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

.hand-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.hand-money {
  font-size: 0.75rem;
  color: var(--muted);
}

.hand-cards {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.3rem;
  flex: 1;
  align-items: flex-start;
}

.hand-cards::-webkit-scrollbar {
  height: 4px;
}

.hand-cards::-webkit-scrollbar-track {
  background: var(--navy-light);
  border-radius: 2px;
}

.hand-cards::-webkit-scrollbar-thumb {
  background: var(--muted-dark);
  border-radius: 2px;
}

.hand-card {
  min-width: 130px;
  max-width: 130px;
  height: 170px;
  background: var(--navy-light);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.hand-card:hover {
  transform: translateY(-6px);
  border-color: var(--card-color);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.hand-card.playable {
  border-color: var(--card-color);
  box-shadow: 0 0 10px color-mix(in srgb, var(--card-color) 30%, transparent);
}

.hand-card.playable::after {
  content: 'PLAYABLE';
  position: absolute;
  top: 6px;
  left: 6px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--card-color);
  color: #fff;
  z-index: 2;
}

.hand-card.money-card {
  opacity: 0.75;
}

/* ── Art-Dominant Card Layout ───────────────────────────── */

.card-art-area {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.card-art-area img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-art-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem;
}

.card-art-fallback span {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  text-align: center;
  text-transform: uppercase;
  line-height: 1.3;
}

.card-name-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  padding: 1.2rem 0.5rem 0.4rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.2;
  z-index: 1;
}

.card-value-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--success);
  z-index: 2;
}

.card-value-badge.money-value-badge {
  color: var(--gold);
}

/* Legacy card elements (kept for zoom view) */
.card-name-bar {
  background: rgba(0,0,0,0.7);
  padding: 0.2rem 0.4rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-subtype-badge {
  display: inline-block;
  margin: 0.2rem 0.3rem;
  padding: 1px 6px;
  border-radius: 10px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 0.55rem;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-effect {
  padding: 0.15rem 0.4rem;
  font-size: 0.55rem;
  color: var(--text-dim);
  line-height: 1.3;
  max-height: 2.8em;
  overflow: hidden;
}

.card-value {
  padding: 0.15rem 0.4rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--success);
  text-align: right;
}

.money-value {
  color: var(--gold);
}

.zoom-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.hand-card:hover .zoom-btn {
  opacity: 1;
}

.empty-hand {
  color: var(--muted);
  font-style: italic;
  padding: 1rem;
  text-align: center;
  width: 100%;
}

/* ── Card Actions Panel ─────────────────────────────────── */

.card-actions-panel {
  background: var(--navy-mid);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 0.6rem;
  margin-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.actions-title {
  width: 100%;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.action-btn {
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: white;
}

.build-btn { background: var(--success); }
.build-btn:hover { background: #5bc991; }
.sell-btn { background: var(--warning); color: var(--navy); }
.sell-btn:hover { background: #f0a35c; }
.event-btn { background: var(--city-event); color: var(--navy); }
.event-btn:hover { background: #f0a35c; }
.revenue-btn { background: var(--revenue); color: var(--navy); }
.revenue-btn:hover { background: #d9ba62; }
.cancel-btn { background: var(--muted-dark); }
.cancel-btn:hover { background: var(--muted); }

/* ── Central Pool ───────────────────────────────────────── */

#centralPool {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem;
  overflow-y: auto;
}

.pool-header {
  margin-bottom: 0.4rem;
}

.pool-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--gold);
  letter-spacing: 0.06em;
}

.pool-subtitle {
  font-size: 0.7rem;
  color: var(--muted);
  display: block;
}

.pool-cards {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.pool-card {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  background: var(--navy-light);
  border-radius: var(--radius-sm);
  padding: 0.4rem;
  border: 1px solid var(--border);
}

.pool-card.claimed {
  opacity: 0.5;
}

.pool-card-art {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.pool-card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pool-card-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  color: white;
  font-weight: 600;
  text-align: center;
}

.pool-card-info { flex: 1; min-width: 0; }

.pool-card-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.pool-card-count {
  font-size: 0.65rem;
  color: var(--muted);
}

.pool-card-reqs {
  font-size: 0.6rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.market-subtype {
  font-weight: 600;
  font-size: 0.65rem;
  text-transform: uppercase;
}

.market-value {
  font-weight: 700;
  color: var(--gold);
  font-size: 0.7rem;
}

.claim-btn {
  padding: 0.3rem 0.6rem;
  background: var(--gold);
  color: var(--navy);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.claim-btn:hover {
  background: #d9ba62;
}

.claimed-badge {
  font-size: 0.6rem;
  color: var(--muted);
  text-transform: uppercase;
}

.deck-info {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
}

.deck-counter {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  color: var(--muted);
}

.deck-icon { font-size: 0.85rem; }

/* ── Right Sidebar ──────────────────────────────────────── */

.right-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.8rem 0.8rem 0.8rem 0;
  overflow-y: auto;
}

/* ── Player Guide ───────────────────────────────────────── */

#playerGuide {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem;
}

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

.guide-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hide-guide-btn, .show-guide-btn {
  padding: 0.2rem 0.5rem;
  background: var(--navy-light);
  color: var(--muted);
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  text-transform: uppercase;
}

.guide-content { }

.guide-step {
  margin-bottom: 0.5rem;
}

.guide-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  display: block;
  margin-bottom: 0.15rem;
}

.guide-step p {
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.4;
}

.guide-warning {
  background: rgba(232, 146, 74, 0.15);
  border: 1px solid var(--warning);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
  color: var(--warning);
}

/* ── Action Log ─────────────────────────────────────────── */

#actionLog {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.log-header {
  margin-bottom: 0.4rem;
}

.log-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.log-legend {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.legend-item {
  font-size: 0.55rem;
  padding: 1px 5px;
  border-radius: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.legend-item.build { background: var(--success); color: #fff; }
.legend-item.event { background: var(--danger); color: #fff; }
.legend-item.tax { background: var(--warning); color: var(--navy); }
.legend-item.special { background: var(--culture); color: #fff; }

.log-entries {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.log-entries::-webkit-scrollbar {
  width: 3px;
}

.log-entries::-webkit-scrollbar-thumb {
  background: var(--muted-dark);
  border-radius: 2px;
}

.log-entry {
  font-size: 0.72rem;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  display: flex;
  gap: 0.4rem;
  line-height: 1.3;
}

.log-round {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
  font-size: 0.65rem;
}

.log-msg { color: var(--text); }

.log-build { border-left: 2px solid var(--success); }
.log-event { border-left: 2px solid var(--danger); }
.log-tax { border-left: 2px solid var(--warning); }
.log-special { border-left: 2px solid var(--culture); }
.log-system { border-left: 2px solid var(--muted-dark); }

/* ── Overlays ───────────────────────────────────────────── */

#drawOverlay,
#eventOverlay,
#zoomOverlay,
#winOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

#eventOverlay {
  background: none;
  backdrop-filter: none;
  width: auto;
  height: auto;
  top: 60px;
  left: auto;
  right: 0.8rem;
  bottom: auto;
  align-items: stretch;
  justify-content: stretch;
  pointer-events: none;
}

#eventOverlay .event-modal {
  max-width: 320px;
  width: 320px;
  pointer-events: auto;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

.build-blocked-reason {
  font-size: 0.75rem;
  color: #E05C5C;
  padding: 0.4rem 0.6rem;
  background: rgba(224, 92, 92, 0.1);
  border-radius: 4px;
  margin-top: 0.3rem;
  text-align: center;
}

.draw-modal,
.event-modal,
.win-modal {
  background: var(--panel);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 440px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow);
}

.draw-modal h2,
.event-modal h2 {
  color: var(--gold);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.draw-modal p,
.event-modal p {
  color: var(--text);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.draw-options {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.draw-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 2rem;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--navy-light);
  color: var(--text);
  transition: all var(--transition);
  min-width: 140px;
}

.draw-btn:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(200, 169, 81, 0.2);
}

.draw-icon { font-size: 2rem; }

.draw-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.draw-count {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Event modal */
.event-prompt {
  color: var(--gold) !important;
  font-weight: 600;
}

.target-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

.target-btn {
  padding: 0.7rem 1rem;
  background: var(--navy-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.85rem;
  text-align: left;
}

.target-btn:hover {
  border-color: var(--gold);
  background: var(--navy-mid);
}

.target-btn.appeal-btn {
  border-color: var(--info);
}

.target-btn.decline-btn {
  border-color: var(--danger);
  color: var(--danger);
}

.event-modal .cancel-btn {
  padding: 0.5rem 1.5rem;
  background: var(--muted-dark);
  color: white;
  border-radius: var(--radius);
  margin-top: 0.5rem;
}

/* Win modal */
.win-modal {
  border-color: var(--gold);
  max-width: 500px;
}

.win-confetti { font-size: 3rem; margin-bottom: 0.5rem; }

.win-modal h1 {
  color: var(--gold);
  font-size: 3rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.win-modal h2 {
  color: var(--text);
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.win-details {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.win-nh {
  padding: 0.3rem 0.8rem;
  background: var(--success);
  color: white;
  border-radius: 20px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.win-stats {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.play-again-btn {
  padding: 0.8rem 2rem;
  background: var(--gold);
  color: var(--navy);
  border-radius: var(--radius);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.play-again-btn:hover {
  background: #d9ba62;
}

/* Zoom overlay */
.card-zoom-overlay {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.zoomed-card {
  background: var(--panel);
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  max-width: 360px;
  width: 90%;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: default;
  position: relative;
}

.zoom-art {
  width: 100%;
  overflow: hidden;
}

.zoom-art img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.zoom-art-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zoom-art-fallback span {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: white;
  text-transform: uppercase;
}

.zoom-info {
  padding: 1rem 1.2rem;
}

.zoom-info h2 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.zoom-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.zoom-nh { color: var(--info); font-size: 0.85rem; margin-bottom: 0.5rem; }
.zoom-effect { font-size: 0.85rem; margin-bottom: 0.5rem; line-height: 1.5; }
.zoom-flavour { color: var(--muted); font-style: italic; font-size: 0.8rem; margin-bottom: 0.5rem; }
.zoom-value { color: var(--success); font-weight: 600; font-size: 0.9rem; }

.zoom-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Zoom Action Buttons ────────────────────────────────── */

.zoom-actions {
  padding: 0.6rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border-top: 1px solid var(--border);
}

.zoom-action-btn {
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: white;
  width: 100%;
  text-align: center;
}

.zoom-action-btn.build-btn { background: var(--success); }
.zoom-action-btn.build-btn:hover { background: #5bc991; }
.zoom-action-btn.sell-btn { background: var(--warning); color: var(--navy); }
.zoom-action-btn.sell-btn:hover { background: #f0a35c; }
.zoom-action-btn.event-btn { background: var(--city-event); color: var(--navy); }
.zoom-action-btn.event-btn:hover { background: #f0a35c; }
.zoom-action-btn.revenue-btn { background: var(--revenue); color: var(--navy); }
.zoom-action-btn.revenue-btn:hover { background: #d9ba62; }

/* ── Toast ──────────────────────────────────────────────── */

#toastContainer {
  position: fixed;
  top: 60px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transform: translateX(110%);
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.toast.show {
  transform: translateX(0);
}

.toast-build { background: var(--success); color: #fff; }
.toast-event { background: var(--danger); color: #fff; }
.toast-tax { background: var(--warning); color: var(--navy); }
.toast-special { background: var(--culture); color: #fff; }
.toast-system { background: var(--navy-mid); color: var(--text); border: 1px solid var(--border); }
.toast-error { background: var(--danger); color: #fff; }

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 1200px) {
  #gameScreen {
    grid-template-columns: 1fr 260px;
  }
}

@media (max-width: 900px) {
  #gameScreen {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }
  .right-sidebar {
    flex-direction: row;
    padding: 0 0.8rem 0.8rem;
    max-height: 200px;
  }
  #playerBoards {
    grid-template-columns: 1fr;
  }
}
