/* Gorgorus Games — shared arcade chrome */

:root {
  --background: #111318;
  --foreground: #fafaf2;
  --muted: #1b1f26;
  --muted-foreground: rgba(250, 250, 242, 0.66);
  --border: rgba(250, 250, 242, 0.11);
  --border-strong: rgba(250, 250, 242, 0.18);
  --destructive: #ff5a5f;
  --card: rgba(250, 250, 242, 0.06);
  --primary: #fafaf2;
  --primary-foreground: #15171a;
  --accent: #dc2626;
  --success: #059669;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: Georgia, 'Times New Roman', Times, serif;
  --font-mono: 'JetBrains Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  background:
    linear-gradient(135deg, rgba(112, 211, 139, 0.08), transparent 24%),
    linear-gradient(225deg, rgba(242, 184, 75, 0.10), transparent 30%),
    linear-gradient(180deg, #111318 0%, #17130f 46%, #101816 100%);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: none;
}

a { color: inherit; }

.page {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px 24px 64px;
  max-width: 720px;
  margin: 0 auto;
}

.masthead {
  width: 100%;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 14px;
  margin-bottom: 32px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.masthead .brand {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
  color: var(--foreground);
}
.masthead .brand em {
  font-style: italic;
  font-weight: 400;
  color: var(--muted-foreground);
}
.masthead .brand:hover em { color: var(--foreground); }

.masthead .meta {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--muted-foreground);
  text-align: right;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--destructive);
  margin-bottom: 12px;
}

h1 {
  font-family: var(--font-serif);
  font-size: 64px;
  line-height: 1.02;
  letter-spacing: 0;
  margin: 0 0 14px;
  font-weight: 700;
  text-wrap: balance;
}

.deck {
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.5;
  color: var(--muted-foreground);
  max-width: 56ch;
  margin: 0 0 28px;
  font-style: italic;
}

.byline {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--muted-foreground);
  margin-bottom: 28px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  background: transparent;
  padding: 10px 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
}

.game-frame {
  width: 100%;
  --foreground: #fafaf2;
  --muted-foreground: rgba(250, 250, 242, 0.68);
  --border: rgba(250, 250, 242, 0.14);
  --border-strong: rgba(250, 250, 242, 0.22);
  --destructive: #ff5a5f;
  --success: #70d38b;
  background: #101113;
  color: var(--foreground);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  box-shadow: 0 22px 70px rgb(0 0 0 / 0.42), 0 1px 0 rgb(255 255 255 / 0.08) inset;
  position: relative;
  aspect-ratio: 4 / 5;
  max-width: 480px;
  overflow: hidden;
  touch-action: none;
}

.game-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), inset 0 -90px 120px rgba(0, 0, 0, 0.16);
  z-index: 1;
  border-radius: inherit;
}

.game-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.hud {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 11px;
  color: var(--foreground);
  z-index: 3;
}

.hud .stat {
  background: rgba(16, 17, 19, 0.78);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 11px;
  line-height: 1;
  box-shadow: 0 10px 24px rgb(0 0 0 / 0.16);
  backdrop-filter: blur(8px);
  transition: border-color 160ms cubic-bezier(0.2, 0, 0, 1), transform 160ms cubic-bezier(0.2, 0, 0, 1), color 160ms;
}
.hud .stat.hot {
  border-color: var(--destructive);
  transform: translateY(-1px);
}
.hud .stat.good {
  border-color: var(--success);
}
.hud .stat.bump {
  animation: statBump 220ms cubic-bezier(0.2, 0, 0, 1);
}

.hud .stat .label {
  color: var(--muted-foreground);
  font-size: 9px;
  letter-spacing: 0;
  display: block;
  margin-bottom: 5px;
}

.hud .stat .value {
  font-size: 15px;
  font-weight: 600;
  font-feature-settings: 'tnum';
}

@keyframes statBump {
  0% { transform: scale(1); }
  45% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.hud .stat.right { text-align: right; }
.hud .stat .value.danger { color: var(--destructive); }

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(12, 13, 15, 0.70);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;        /* center small content, but let tall content scroll */
  text-align: center;
  padding: 28px 24px;
  z-index: 9;                          /* sit above any in-game tool rows / effect banners */
  overflow-y: auto;                    /* recap lists scroll when they exceed the frame height */
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(250, 250, 242, 0.22) transparent;
  transition: opacity 0.18s cubic-bezier(0.2, 0, 0, 1);
}
.overlay::-webkit-scrollbar { width: 6px; }
.overlay::-webkit-scrollbar-thumb { background: rgba(250, 250, 242, 0.22); border-radius: 3px; }
.overlay.hidden { opacity: 0; pointer-events: none; }

.overlay .kicker { margin-bottom: 14px; }

.overlay h2 {
  font-family: var(--font-sans);
  font-size: 38px;
  line-height: 1.05;
  margin: 0 0 12px;
  letter-spacing: 0;
  font-weight: 750;
  text-wrap: balance;
}
.overlay p {
  font-family: var(--font-sans);
  font-size: 16px;
  font-style: normal;
  line-height: 1.42;
  max-width: 32ch;
  color: var(--muted-foreground);
  margin: 0 0 20px;
}
.overlay .scoreline {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  margin: 8px 0 22px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--muted-foreground);
}
.overlay .scoreline strong {
  color: var(--foreground);
  font-weight: 600;
}

.btn {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  background: #f2b84b;
  color: #15110a;
  border: 1px solid #d49b36;
  border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
  transition: background 180ms cubic-bezier(0.2, 0, 0, 1), transform 120ms;
  line-height: 1;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { background: #ffd070; color: #15110a; }
.btn:active { transform: translateY(1px); }
.btn.ghost {
  background: transparent;
  color: var(--foreground);
  border-color: var(--border-strong);
}
.btn.ghost:hover { background: var(--muted); }

.footnote {
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--muted-foreground);
  text-align: center;
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.footnote a { color: var(--foreground); text-decoration: underline; text-underline-offset: 3px; }

.controls-hint {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--muted-foreground);
  text-align: center;
}

/* Visual first-run teaching: use game artifacts instead of long prose. */
.overlay.is-visual {
  background:
    radial-gradient(circle at 50% 40%, rgba(242, 184, 75, 0.10), transparent 30%),
    linear-gradient(180deg, rgba(12, 13, 15, 0.66), rgba(12, 13, 15, 0.88));
  backdrop-filter: blur(9px);
}
.overlay.is-visual .kicker { margin-bottom: 8px; }
.overlay.is-visual h2 { margin-bottom: 8px; }
.overlay.is-visual .intro-copy {
  margin-bottom: 12px;
  max-width: 28ch;
}

.visual-demo {
  width: min(100%, 352px);
  margin: 0 0 10px;
}
.demo-stage {
  position: relative;
  height: 92px;
  border: 1px solid rgba(250, 250, 242, 0.14);
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(35, 39, 49, 0.92), rgba(15, 17, 22, 0.96)),
    #111318;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.demo-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 26%, rgba(112, 211, 139, 0.14), transparent 22%),
    radial-gradient(circle at 76% 30%, rgba(255, 90, 95, 0.13), transparent 22%);
  pointer-events: none;
}
.demo-stage .stage-ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  height: 1px;
  background: rgba(250, 250, 242, 0.52);
}

.artifact-grid {
  width: min(100%, 352px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.artifact-card {
  min-height: 76px;
  padding: 8px 6px;
  border: 1px solid rgba(250, 250, 242, 0.14);
  border-radius: 16px;
  background: rgba(250, 250, 242, 0.07);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.artifact-card strong {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0;
  color: rgba(250, 250, 242, 0.92);
  font-weight: 600;
}
.artifact-card small {
  display: block;
  max-width: 9ch;
  font-family: var(--font-serif);
  font-size: 12px;
  line-height: 1.05;
  font-style: italic;
  color: rgba(250, 250, 242, 0.62);
}
.artifact {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.artifact.icon-pay,
.tax-demo-pay {
  width: 38px;
  height: 24px;
  border-radius: 7px;
  background: #70d38b;
  border: 2px solid #101113;
  color: #101113;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  box-shadow: 0 0 18px rgba(112, 211, 139, 0.35);
}
.artifact.icon-pay::before,
.tax-demo-pay::before {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  top: 6px;
  height: 2px;
  background: rgba(16, 17, 19, 0.45);
  box-shadow: 0 5px 0 rgba(16, 17, 19, 0.28);
}
.artifact.icon-coin,
.tax-demo-coin {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f2b84b;
  border: 2px solid #101113;
  color: #101113;
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 0 18px rgba(242, 184, 75, 0.35);
}
.artifact.icon-audit,
.tax-demo-audit {
  width: 36px;
  height: 28px;
  border-radius: 6px;
  background: #fafaf2;
  border: 2px solid #101113;
  color: #9b2226;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
}
.artifact.icon-audit::before,
.tax-demo-audit::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 8px;
  background: #ff5a5f;
  border-radius: 4px 4px 0 0;
}
.artifact.icon-audit::after,
.tax-demo-audit::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 7px;
  height: 2px;
  background: #9b2226;
  box-shadow: 0 5px 0 rgba(155, 34, 38, 0.55);
}
.artifact.icon-slide {
  width: 42px;
  height: 26px;
}
.artifact.icon-slide::before {
  content: "";
  position: absolute;
  left: 5px;
  bottom: 3px;
  width: 30px;
  height: 8px;
  border-radius: 999px;
  background: #fafaf2;
  transform: rotate(-10deg);
}
.artifact.icon-slide::after {
  content: "";
  position: absolute;
  left: 28px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e2b687;
}

.tax-demo-runner {
  position: absolute;
  left: 18px;
  bottom: 19px;
  width: 15px;
  height: 40px;
  background: #fafaf2;
  border-radius: 6px 6px 3px 3px;
  animation: taxDemoRunner 3s cubic-bezier(0.2, 0, 0, 1) infinite;
}
.tax-demo-runner::before {
  content: "";
  position: absolute;
  left: 2px;
  top: -12px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #e2b687;
}
.tax-demo-runner::after {
  content: "";
  position: absolute;
  left: -5px;
  bottom: -8px;
  width: 25px;
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
}
.tax-demo-pay,
.tax-demo-coin,
.tax-demo-audit {
  position: absolute;
  z-index: 1;
}
.tax-demo-pay { left: 112px; top: 30px; }
.tax-demo-coin { left: 176px; top: 26px; }
.tax-demo-audit { right: 48px; bottom: 20px; }
.tax-demo-arc {
  position: absolute;
  left: 60px;
  top: 28px;
  width: 156px;
  height: 34px;
  border-top: 2px dashed rgba(112, 211, 139, 0.55);
  border-radius: 50%;
  opacity: 0.9;
}

.artifact.icon-mw,
.grid-demo-mw {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: #70d38b;
  border: 2px solid #101113;
  color: #101113;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  box-shadow: 0 0 18px rgba(112, 211, 139, 0.42);
}
.artifact.icon-factory,
.grid-demo-factory {
  width: 42px;
  height: 34px;
  border-radius: 7px;
  background: #68707d;
  border: 2px solid #101113;
  box-shadow: 0 0 18px rgba(242, 184, 75, 0.24);
}
.artifact.icon-factory::before,
.grid-demo-factory::before {
  content: "";
  position: absolute;
  left: 8px;
  top: -14px;
  width: 8px;
  height: 14px;
  background: #3b414d;
  border: 2px solid #101113;
  border-bottom: 0;
}
.artifact.icon-factory::after,
.grid-demo-factory::after {
  content: "";
  position: absolute;
  left: 9px;
  bottom: 8px;
  width: 7px;
  height: 7px;
  background: #f2b84b;
  box-shadow: 12px 0 0 #f2b84b, 24px 0 0 #f2b84b;
}
.artifact.icon-overload,
.grid-demo-hazard {
  width: 31px;
  height: 31px;
  border-radius: 9px;
  background: #ff5a5f;
  border: 2px solid #101113;
  transform: rotate(45deg);
  box-shadow: 0 0 18px rgba(255, 90, 95, 0.42);
}
.artifact.icon-overload::before,
.grid-demo-hazard::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 13px;
  width: 13px;
  height: 3px;
  background: #101113;
  border-radius: 2px;
}
.artifact.icon-meter {
  width: 46px;
  height: 24px;
  border-radius: 12px;
  border: 1px solid rgba(250, 250, 242, 0.26);
  background: rgba(13, 14, 16, 0.82);
}
.artifact.icon-meter::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  height: 4px;
  border-radius: 3px;
  background: linear-gradient(90deg, #70d38b 0 52%, #f2b84b 52% 74%, #ff5a5f 74%);
}
.artifact.icon-meter::after {
  content: "";
  position: absolute;
  left: 26px;
  bottom: 4px;
  width: 2px;
  height: 8px;
  border-radius: 2px;
  background: #fafaf2;
}

.grid-stage::after {
  content: "";
  position: absolute;
  inset: 14px 22px 20px;
  background-image:
    linear-gradient(rgba(250, 250, 242, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(250, 250, 242, 0.13) 1px, transparent 1px);
  background-size: 34px 24px;
}
.grid-demo-path {
  position: absolute;
  left: 64px;
  right: 64px;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  background: #70d38b;
  border-radius: 2px;
  filter: drop-shadow(0 0 8px rgba(112, 211, 139, 0.55));
  z-index: 1;
}
.grid-demo-pulse {
  position: absolute;
  left: 56px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 50%;
  background: #70d38b;
  border: 2px solid #fafaf2;
  box-shadow: 0 0 14px rgba(112, 211, 139, 0.72);
  z-index: 3;
  animation: gridDemoPulse 2.8s cubic-bezier(0.2, 0, 0, 1) infinite;
}
.grid-demo-mw,
.grid-demo-factory,
.grid-demo-hazard {
  position: absolute;
  z-index: 2;
}
/* All three demo props sit on the same horizontal line as the path so they
 * read as a clear sequence: pulse → MW pickup → hazard → factory. */
.grid-demo-mw       { left: 110px; top: 50%; margin-top: -16px; }
.grid-demo-hazard   { left: 50%; top: 50%; margin: -16px 0 0 -16px; opacity: 0.92; }
.grid-demo-factory  { right: 32px; top: 50%; margin-top: -17px; }

@keyframes taxDemoRunner {
  0% { transform: translateX(0) translateY(0); }
  24% { transform: translateX(92px) translateY(-20px); }
  42% { transform: translateX(152px) translateY(-18px); }
  62% { transform: translateX(214px) translateY(0) scaleY(0.58); transform-origin: bottom center; }
  100% { transform: translateX(292px) translateY(0) scaleY(1); }
}
@keyframes gridDemoPulse {
  0%   { transform: translateX(0)   scale(1); }
  40%  { transform: translateX(40px) scale(1.06); }
  78%  { transform: translateX(180px) scale(1.06); }
  100% { transform: translateX(180px) scale(1); opacity: 0.4; }
}

/* Countdown overlay */
.ready-overlay {
  background: rgba(12, 13, 15, 0.52);
  backdrop-filter: blur(7px);
  pointer-events: none;
}
.ready-overlay .kicker { margin-bottom: 16px; }
.countdown {
  font-family: var(--font-sans);
  font-size: 96px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--foreground);
  margin: 0;
  animation: countdownPop 600ms cubic-bezier(0.2, 0, 0, 1) both;
}
.countdown.go {
  color: var(--destructive);
  font-size: 80px;
  letter-spacing: 0;
}
@keyframes countdownPop {
  0%   { opacity: 0; transform: scale(0.85); }
  25%  { opacity: 1; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1.00); }
}
.ready-hint {
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--muted-foreground);
  text-align: center;
}

/* Lobby grid */
.lobby-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: 16px;
}

.game-card {
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--foreground);
  transition: transform 180ms cubic-bezier(0.2, 0, 0, 1), box-shadow 180ms, border-color 180ms;
  box-shadow: 0 22px 60px rgb(0 0 0 / 0.22), 0 1px 0 rgb(255 255 255 / 0.06) inset;
  min-height: 180px;
}
.game-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 30px 84px rgb(0 0 0 / 0.32), 0 1px 0 rgb(255 255 255 / 0.08) inset;
  border-color: var(--foreground);
}
.game-card.coming-soon {
  pointer-events: none;
  opacity: 0.6;
}
.game-card .num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 8px;
}
.game-card .title {
  font-family: var(--font-serif);
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: 0;
  font-weight: 700;
  margin: 0 0 6px;
}
.game-card .blurb {
  font-family: var(--font-serif);
  font-size: 14px;
  font-style: italic;
  line-height: 1.4;
  color: var(--muted-foreground);
  margin: 0 0 14px;
}
.game-card .footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: uppercase;
}
.game-card .badge {
  padding: 3px 7px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--muted-foreground);
}
.game-card .badge.live {
  border-color: var(--destructive);
  color: var(--destructive);
}
.game-card .arrow {
  color: var(--muted-foreground);
}
.game-card:hover .arrow { color: var(--foreground); }

.section-title {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--muted-foreground);
  margin: 24px 0 12px;
}

/* Game pages: keep the playable surface high and the editorial chrome compact. */
.game-page {
  padding-top: 18px;
  padding-bottom: 42px;
}
.game-page .masthead {
  margin-bottom: 16px;
}
.game-page h1,
.game-page .kicker,
.game-page .deck {
  text-align: center;
}
.game-page h1 {
  font-size: 50px;
  margin-bottom: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: break-word;
}
.game-page .deck {
  font-size: 17px;
  line-height: 1.32;
  margin-bottom: 14px;
  width: 100%;
  min-width: 0;
  overflow-wrap: break-word;
}
.game-page .byline {
  margin-bottom: 16px;
}
.game-page .footnote {
  margin-top: 18px;
}

/* Lobby presentation */
.lobby-page {
  max-width: 980px;
}
.lobby-page h1 {
  align-self: flex-start;
  max-width: 820px;
}
.lobby-page .kicker,
.lobby-page .deck {
  align-self: flex-start;
}

.featured-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.game-card.featured {
  min-height: 292px;
  padding: 0;
  overflow: hidden;
}
.game-card.featured:hover .game-thumb.tax .runner {
  animation: thumbRun 380ms steps(2, end) infinite;
}
.game-card.featured:hover .game-thumb.tax .coin {
  animation: thumbFloat 620ms cubic-bezier(0.2, 0, 0, 1) infinite alternate;
}
.game-card.featured:hover .game-thumb.tax .audit {
  animation: thumbAudit 860ms cubic-bezier(0.2, 0, 0, 1) infinite alternate;
}
.game-card.featured:hover .game-thumb.grid .line {
  animation: thumbPulse 760ms cubic-bezier(0.2, 0, 0, 1) infinite alternate;
}
.game-card.featured:hover .game-thumb.grid .node {
  animation: thumbFloat 680ms cubic-bezier(0.2, 0, 0, 1) infinite alternate;
}

.game-thumb {
  position: relative;
  height: 128px;
  overflow: hidden;
  background: linear-gradient(180deg, #24262c 0%, #17181d 100%);
  border-bottom: 1px solid var(--border);
  border-radius: 18px 18px 0 0;
}
.game-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 24%, rgba(242, 184, 75, 0.16), transparent 26%),
    radial-gradient(circle at 84% 28%, rgba(112, 211, 139, 0.11), transparent 28%);
  opacity: 1;
}
.game-thumb .ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  height: 1px;
  background: var(--foreground);
}
.game-thumb .city {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 17px;
  height: 28px;
  background:
    linear-gradient(90deg, #333741 0 22px, transparent 22px 30px, #2b2f39 30px 56px, transparent 56px 66px, #3b3f49 66px 90px, transparent 90px 100px);
  opacity: 0.85;
}
.game-thumb.tax .runner {
  position: absolute;
  left: 52px;
  bottom: 18px;
  width: 16px;
  height: 42px;
  background: var(--foreground);
}
.game-thumb.tax .runner::before {
  content: "";
  position: absolute;
  left: 2px;
  top: -14px;
  width: 12px;
  height: 12px;
  background: #e2b687;
  border: 1px solid var(--foreground);
}
.game-thumb.tax .coin {
  position: absolute;
  right: 112px;
  bottom: 38px;
  width: 26px;
  height: 26px;
  background: #e8b14e;
  border: 2px solid var(--foreground);
  border-radius: 50%;
}
.game-thumb.tax .audit {
  position: absolute;
  right: 48px;
  bottom: 18px;
  width: 48px;
  height: 28px;
  background: var(--destructive);
  border: 2px solid var(--foreground);
}
.game-thumb.tax .audit::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  width: 32px;
  height: 3px;
  background: #ffffff;
  box-shadow: 0 7px 0 #ffffff;
}
.game-thumb.grid .node {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid var(--foreground);
  border-radius: 50%;
  background: #70d38b;
}
.game-thumb.grid .node.a { left: 44px; top: 42px; }
.game-thumb.grid .node.b { right: 54px; top: 72px; background: #f2b84b; }
.game-thumb.grid .line {
  position: absolute;
  left: 64px;
  top: 52px;
  width: 240px;
  height: 44px;
  border-left: 4px solid #70d38b;
  border-bottom: 4px solid #70d38b;
  border-radius: 0 0 0 12px;
}
.game-thumb.grid .factory {
  position: absolute;
  right: 28px;
  bottom: 18px;
  width: 48px;
  height: 34px;
  background: #3b3f49;
  border: 2px solid var(--foreground);
  border-radius: 6px 6px 2px 2px;
}
.game-thumb.grid .factory::before {
  content: "";
  position: absolute;
  left: 6px;
  top: -16px;
  width: 10px;
  height: 16px;
  background: #3b3f49;
  border: 2px solid var(--foreground);
  border-bottom: 0;
}
.game-card.featured .card-body {
  padding: 18px;
  display: flex;
  flex: 1;
  flex-direction: column;
}

@keyframes thumbFloat {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}
@keyframes thumbRun {
  0% { transform: skewX(0); }
  100% { transform: skewX(-8deg); }
}
@keyframes thumbAudit {
  from { transform: translateX(0); }
  to { transform: translateX(-18px); }
}
@keyframes thumbPulse {
  from { filter: drop-shadow(0 0 0 rgba(112, 211, 139, 0)); opacity: 0.78; }
  to { filter: drop-shadow(0 0 12px rgba(112, 211, 139, 0.65)); opacity: 1; }
}

.mobile-controls {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  display: none;
  justify-content: space-between;
  pointer-events: none;
}
.mobile-controls button {
  width: 60px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: rgba(16, 17, 19, 0.72);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 24px;
  line-height: 1;
  pointer-events: auto;
  box-shadow: 0 12px 28px rgb(0 0 0 / 0.26);
  backdrop-filter: blur(10px);
}
.mobile-controls button:active {
  transform: translateY(1px);
  background: rgba(242, 184, 75, 0.92);
  color: #19120a;
}

@media (hover: none), (pointer: coarse) {
  .mobile-controls {
    display: flex;
  }
}

.game-frame:has(.overlay:not(.hidden)) .mobile-controls {
  display: none;
}

@media (max-width: 760px) {
  .page {
    padding: 28px 20px 48px;
  }
  h1 {
    font-size: 50px;
  }
  .featured-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  html, body {
    font-size: 16px;
  }
  .page {
    padding: 22px 16px 44px;
  }
  .game-page {
    padding-top: 16px;
  }
  .masthead {
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 20px;
  }
  .masthead .meta {
    font-size: 10px;
    text-align: left;
  }
  h1,
  .game-page h1 {
    font-size: 38px;
    line-height: 1.08;
  }
  .deck,
  .game-page .deck {
    width: 100%;
    max-width: none;
    font-size: 18px;
    line-height: 1.42;
  }
  .game-page .deck {
    font-size: 17px;
    line-height: 1.32;
    margin-bottom: 12px;
    max-width: min(34ch, calc(100vw - 48px));
    align-self: center;
  }
  .game-page .kicker {
    margin-bottom: 8px;
  }
  .byline {
    gap: 10px;
    font-size: 10px;
  }
  .game-frame {
    width: 100%;
    max-width: calc(100vw - 32px);
  }
  .overlay {
    padding: 20px 18px;
  }
  .overlay h2 {
    font-size: 34px;
  }
  .overlay p {
    font-size: 15px;
    line-height: 1.35;
    max-width: 28ch;
  }
  .overlay.is-visual {
    padding: 16px 12px;
  }
  .overlay.is-visual h2 {
    font-size: 30px;
    margin-bottom: 6px;
  }
  .overlay.is-visual .kicker {
    margin-bottom: 6px;
  }
  .overlay.is-visual .intro-copy {
    font-size: 13px;
    line-height: 1.22;
    margin-bottom: 8px;
  }
  .overlay.is-visual .legend {
    gap: 6px;
    margin: 4px 0 10px;
  }
  .overlay.is-visual .legend li {
    gap: 8px;
    font-size: 12px;
    line-height: 1.16;
  }
  .overlay.is-visual .legend .lk {
    min-width: 52px;
    padding: 3px 6px;
    font-size: 9px;
  }
  .overlay.is-visual .legend .def,
  .overlay.is-visual .controls-hint {
    display: none;
  }
  .visual-demo {
    width: 100%;
  }
  .demo-stage {
    height: 82px;
    border-radius: 16px;
  }
  .artifact-grid {
    width: 100%;
    gap: 6px;
    margin-bottom: 12px;
  }
  .choice-strip {
    width: 100%;
    gap: 5px;
  }
  .choice-card {
    padding: 7px 4px;
  }
  .choice-card strong {
    font-size: 9px;
  }
  .choice-card small {
    font-size: 10px;
  }
  .upgrade-overlay {
    padding: 18px 14px;
  }
  .upgrade-overlay h2 {
    font-size: 28px;
  }
  .upgrade-grid {
    gap: 7px;
  }
  .upgrade-card {
    min-height: 84px;
    padding: 9px;
  }
  .artifact-card {
    min-height: 66px;
    border-radius: 14px;
    padding: 7px 5px;
  }
  .artifact-card strong {
    font-size: 9px;
  }
  .artifact-card small {
    font-size: 11px;
  }
  .controls-hint,
  .ready-hint {
    font-size: 9px;
    margin-top: 10px;
  }
  .hud {
    top: 10px;
    left: 10px;
    right: 10px;
  }
  .hud .stat {
    padding: 6px 8px;
  }
  .mobile-controls {
    display: flex;
  }
  .game-card {
    min-height: 158px;
  }
}

@media (max-width: 390px) {
  .game-frame .overlay.is-visual .city-pick,
  .game-frame .overlay.is-visual .scenario-pick,
  .game-frame .overlay.is-visual .country-pick {
    min-height: 38px;
  }
}

@media (max-width: 390px) {
  h1,
  .game-page h1 {
    font-size: 34px;
  }
  .masthead .brand {
    font-size: 19px;
  }
  .overlay p {
    font-size: 14px;
    max-width: 26ch;
  }
  .overlay.is-visual h2 {
    font-size: 28px;
  }
  .overlay.is-visual .legend {
    gap: 5px;
    margin-bottom: 8px;
  }
  .overlay.is-visual .legend li {
    justify-content: center;
  }
  .overlay.is-visual .legend .def,
  .overlay.is-visual .controls-hint {
    display: none;
  }
  .game-frame .overlay.is-visual:has(.city-grid) .intro-copy,
  .game-frame .overlay.is-visual:has(.scenario-grid) .intro-copy,
  .game-frame .overlay.is-visual:has(.country-grid) .intro-copy,
  .game-frame .overlay.is-visual:has(.city-grid) .controls-hint,
  .game-frame .overlay.is-visual:has(.scenario-grid) .controls-hint,
  .game-frame .overlay.is-visual:has(.country-grid) .controls-hint {
    display: none;
  }
  .game-frame .overlay.is-visual:has(.city-grid) h2,
  .game-frame .overlay.is-visual:has(.scenario-grid) h2,
  .game-frame .overlay.is-visual:has(.country-grid) h2 {
    font-size: 28px;
  }
  .game-frame .overlay.is-visual .city-pick,
  .game-frame .overlay.is-visual .scenario-pick,
  .game-frame .overlay.is-visual .country-pick {
    min-height: 38px;
  }
}

/* ----------------------------------------------------------------------
 * Side commentary, pause-on-hold, and end-of-run recap
 * ---------------------------------------------------------------------- */

/* Running event log shown next to (or below) the game frame */
/* (Deleted: stale "newspaper row" .event-log/.event-row definitions that
 * were overriding the streamer-chat treatment further below. The
 * .event-row:first-child rule was stripping the top border off the first
 * chip and the .event-row .body strong { display: block } was breaking the
 * inline title + sub layout.) */

/* Pause overlay — drops over the canvas while space is held */
.pause-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 12, 0.84);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 22px;
  z-index: 9;                         /* sit above in-game tool rows / effect banners */
  color: #fafaf2;
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: opacity 0.18s cubic-bezier(0.2, 0, 0, 1);
}
.pause-overlay.hidden { opacity: 0; pointer-events: none; }
.pause-overlay .kicker { color: var(--destructive); font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0; margin-bottom: 8px; }
.pause-overlay h2 { font-family: var(--font-serif); font-weight: 700; font-size: 28px; line-height: 1.05; margin: 0 0 8px; color: #fafaf2; }
.pause-overlay .sub { font-family: var(--font-serif); font-style: italic; font-size: 14px; color: rgba(250, 250, 242, 0.72); margin: 0 0 16px; max-width: 30ch; }
.pause-overlay .conditions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 360px;
  margin-bottom: 16px;
}
.pause-overlay .cond {
  background: rgba(250, 250, 242, 0.08);
  border: 1px solid rgba(250, 250, 242, 0.18);
  border-radius: 999px;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0;
  color: rgba(250, 250, 242, 0.85);
}
.pause-overlay .cond strong { color: #fafaf2; font-weight: 600; }
.pause-overlay .resume-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
  color: rgba(250, 250, 242, 0.55);
  text-transform: uppercase;
}
.pause-recent-events {
  width: min(100%, 360px);
  margin: 0 0 16px;
  text-align: left;
}
.pause-recent-events .label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: rgba(250, 250, 242, 0.55);
  text-transform: uppercase;
  letter-spacing: 0;
  margin-bottom: 7px;
  text-align: center;
}
.pause-recent-events ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.pause-recent-events li {
  border: 1px solid rgba(250, 250, 242, 0.12);
  border-radius: 9px;
  background: rgba(250, 250, 242, 0.06);
  padding: 7px 9px;
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 1.25;
  color: rgba(250, 250, 242, 0.70);
}
.pause-recent-events li.kind-bad {
  border-color: rgba(255, 90, 95, 0.42);
  background: rgba(255, 90, 95, 0.11);
}
.pause-recent-events li.kind-event {
  border-color: rgba(109, 179, 247, 0.35);
  background: rgba(109, 179, 247, 0.09);
}
.pause-recent-events li strong {
  display: inline;
  color: #fafaf2;
  font-weight: 700;
  margin-right: 4px;
}
.pause-recent-events li em {
  font-style: normal;
  color: rgba(250, 250, 242, 0.62);
}

/* End-of-run recap inside the game-over overlay */
.recap {
  width: 100%;
  max-width: 320px;
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  text-align: left;
}
.recap .label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--muted-foreground);
  margin-bottom: 8px;
}
.recap ol { margin: 0; padding-left: 18px; }
.recap li {
  font-family: var(--font-serif);
  font-size: 13px;
  line-height: 1.42;
  color: var(--muted-foreground);
  margin-bottom: 6px;
}
.recap li strong {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12px;
  color: var(--foreground);
  letter-spacing: 0;
}
.recap li em { font-style: italic; color: var(--muted-foreground); }

/* Big disruption announcement — full-canvas headline that flashes when
 * a herald fires (Wind Surge, Solar Peak, Demand Spike, Horde, etc.). */
.shout {
  position: absolute;
  top: 112px;
  right: 0;
  bottom: 74px;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
}
.shout.show {
  animation: shoutPop 1.6s cubic-bezier(0.2, 0, 0, 1) forwards;
}
.shout.readable {
  opacity: 1;
  transform: scale(1);
  animation: none !important;
}
.shout .shout-inner {
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 700;
  font-size: 56px;
  line-height: 0.95;
  letter-spacing: 0;
  color: #fafaf2;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
  padding: 0 18px;
}
.shout .shout-inner .small {
  display: block;
  font-family: var(--font-mono);
  font-style: normal;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--destructive);
  margin-bottom: 10px;
  text-shadow: none;
}
.shout.kind-wind  .shout-inner   { color: #cfe5ff; }
.shout.kind-solar .shout-inner   { color: #ffe79a; }
.shout.kind-demand .shout-inner  { color: #ffb0b0; }
.shout.kind-horde .shout-inner   { color: #ffb0b0; }
@keyframes shoutPop {
  0%   { opacity: 0; transform: scale(0.8); }
  20%  { opacity: 1; transform: scale(1.06); }
  60%  { opacity: 1; transform: scale(1.00); }
  100% { opacity: 0; transform: scale(0.96); }
}

.game-event-card {
  position: absolute;
  top: 112px;
  right: 12px;
  z-index: 7;
  width: min(318px, calc(100% - 24px));
  pointer-events: none;
  border: 1px solid rgba(250, 250, 242, 0.16);
  border-left: 4px solid rgba(109, 179, 247, 0.78);
  border-radius: 10px;
  background: rgba(13, 14, 16, 0.88);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(10px);
  padding: 9px 11px 10px;
  color: #fafaf2;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 180ms cubic-bezier(0.2, 0, 0, 1), transform 180ms cubic-bezier(0.2, 0, 0, 1);
}
.game-event-card.hidden {
  opacity: 0;
  transform: translateY(-6px);
}
.game-event-card.kind-bad { border-left-color: #ff5a5f; }
.game-event-card.kind-good { border-left-color: #70d38b; }
.game-event-card .event-card-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: rgba(250, 250, 242, 0.55);
  margin-bottom: 4px;
}
.game-event-card strong {
  display: block;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.15;
  color: #fafaf2;
  margin-bottom: 3px;
}
.game-event-card em {
  display: block;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 11px;
  line-height: 1.28;
  color: rgba(250, 250, 242, 0.70);
}

.game-pause-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 6;
  display: none;
  min-width: 52px;
  min-height: 34px;
  border: 1px solid rgba(250, 250, 242, 0.18);
  border-radius: 999px;
  background: rgba(13, 14, 16, 0.76);
  color: #fafaf2;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
  backdrop-filter: blur(8px);
}
.game-pause-btn:active { transform: translateY(1px); }

/* Side-by-side: game frame + live commentary on desktop. Stacks on narrow screens. */
.game-stack {
  display: grid;
  grid-template-columns: minmax(0, 480px) 1fr;
  gap: 24px;
  width: 100%;
  align-items: start;
}
.game-stack .event-log {
  margin-top: 0;
  max-width: none;
  align-self: start;
}
.game-page-wide.page { max-width: 880px; }
@media (max-width: 760px) {
  .game-stack { grid-template-columns: 1fr; }
  .game-stack .event-log {
    height: 260px;
    min-height: 0;
  }
}

/* Plain-text legend on the start overlay — replaces the illustrated demo. */
.legend {
  list-style: none;
  margin: 6px 0 18px;
  padding: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 30ch;
}
.legend li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: rgba(250, 250, 242, 0.84);
}
.legend .lk {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  padding: 4px 8px;
  border-radius: 999px;
  min-width: 60px;
  text-align: center;
}
.legend .lk-good { color: #5cd17a; background: rgba(112, 211, 139, 0.16); border: 1px solid rgba(112, 211, 139, 0.4); }
.legend .lk-warn { color: #f2b84b; background: rgba(242, 184, 75, 0.16); border: 1px solid rgba(242, 184, 75, 0.4); }
.legend .lk-bad  { color: #ff7a7f; background: rgba(255, 90, 95, 0.18);  border: 1px solid rgba(255, 90, 95, 0.4); }
.legend .def {
  font-style: italic;
  color: rgba(250, 250, 242, 0.78);
}

.choice-strip {
  width: min(100%, 352px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 12px;
}
.choice-card {
  border: 1px solid rgba(250, 250, 242, 0.16);
  border-radius: 24px;
  background: rgba(250, 250, 242, 0.07);
  color: rgba(250, 250, 242, 0.74);
  padding: 8px 5px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: border-color 160ms, background 160ms, transform 120ms;
}
.choice-card:hover {
  border-color: rgba(250, 250, 242, 0.36);
  background: rgba(250, 250, 242, 0.11);
}
.choice-card:active { transform: translateY(1px); }
.choice-card.active {
  border-color: #f2b84b;
  background: rgba(242, 184, 75, 0.18);
  color: #fafaf2;
  box-shadow: 0 0 18px rgba(242, 184, 75, 0.18);
}
.choice-card strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
}
.choice-card small {
  display: block;
  margin-top: 5px;
  font-family: var(--font-serif);
  font-size: 11px;
  line-height: 1.05;
  font-style: italic;
  color: rgba(250, 250, 242, 0.58);
}

/* Compact picker-heavy start screens so the choices stay visible inside the
 * fixed 4:5 game frame on mobile and small desktop embeds. */
.game-frame .overlay.is-visual .city-grid,
.game-frame .overlay.is-visual .scenario-grid,
.game-frame .overlay.is-visual .country-grid {
  gap: 5px;
  margin: 6px 0 8px;
  width: min(100%, 336px);
  align-self: center;
}
.game-frame .overlay.is-visual:has(.city-grid),
.game-frame .overlay.is-visual:has(.scenario-grid),
.game-frame .overlay.is-visual:has(.country-grid) {
  justify-content: flex-start;
  padding-top: 18px;
}
.game-frame .overlay.is-visual .city-pick,
.game-frame .overlay.is-visual .scenario-pick,
.game-frame .overlay.is-visual .country-pick {
  min-height: 46px;
  border-radius: 8px;
  padding: 6px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.game-frame .overlay.is-visual .city-pick .name,
.game-frame .overlay.is-visual .scenario-pick .vs,
.game-frame .overlay.is-visual .country-pick .cn-name {
  font-size: 12px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}
.game-frame .overlay.is-visual .city-pick .stat,
.game-frame .overlay.is-visual .scenario-pick .blurb,
.game-frame .overlay.is-visual .country-pick .cn-stat {
  margin-top: 3px;
  font-size: 8px;
  line-height: 1.08;
}
.game-frame .overlay.is-visual .country-pick .flag-big {
  font-size: 18px;
}
.game-frame .overlay.is-visual:has(.city-grid) .legend,
.game-frame .overlay.is-visual:has(.scenario-grid) .legend,
.game-frame .overlay.is-visual:has(.country-grid) .legend {
  gap: 6px;
  margin: 4px 0 12px;
}
.game-frame .overlay.is-visual:has(.city-grid) .legend li,
.game-frame .overlay.is-visual:has(.scenario-grid) .legend li,
.game-frame .overlay.is-visual:has(.country-grid) .legend li {
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.22;
}
.game-frame .overlay.is-visual:has(.city-grid) .legend .lk,
.game-frame .overlay.is-visual:has(.scenario-grid) .legend .lk,
.game-frame .overlay.is-visual:has(.country-grid) .legend .lk {
  min-width: 54px;
  padding: 3px 6px;
  font-size: 9px;
}

.upgrade-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 22px;
  color: #fafaf2;
  background:
    radial-gradient(circle at 50% 42%, rgba(112, 211, 139, 0.12), transparent 32%),
    rgba(12, 13, 15, 0.88);
  backdrop-filter: blur(10px);
  transition: opacity 180ms cubic-bezier(0.2, 0, 0, 1);
}
.upgrade-overlay.hidden { opacity: 0; pointer-events: none; }
.upgrade-overlay .kicker {
  color: #f2b84b;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
  margin-bottom: 8px;
}
.upgrade-overlay h2 {
  margin: 0 0 8px;
  font-family: var(--font-sans);
  font-size: 32px;
  line-height: 1.05;
}
.upgrade-overlay p {
  max-width: 32ch;
  margin: 0 0 14px;
  color: rgba(250, 250, 242, 0.68);
  font-size: 14px;
  line-height: 1.35;
}
.upgrade-grid {
  width: min(100%, 360px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.upgrade-card {
  min-height: 92px;
  border: 1px solid rgba(250, 250, 242, 0.16);
  border-radius: 14px;
  background: rgba(250, 250, 242, 0.07);
  color: #fafaf2;
  padding: 10px;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms, background 160ms, transform 120ms;
}
.upgrade-card:hover {
  border-color: #70d38b;
  background: rgba(112, 211, 139, 0.13);
}
.upgrade-card:active { transform: translateY(1px); }
.upgrade-card strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #70d38b;
  margin-bottom: 6px;
}
.upgrade-card span {
  display: block;
  font-family: var(--font-serif);
  font-size: 13px;
  line-height: 1.25;
  font-style: italic;
  color: rgba(250, 250, 242, 0.74);
}

/* ----------------------------------------------------------------------
 * Live-chat commentary — streamer-chat aesthetic.
 * Dark panel · big emoji badge · punchy color · slide-in.
 * ---------------------------------------------------------------------- */
.event-log {
  background: linear-gradient(180deg, #15171a, #0d0e10);
  border: 1px solid rgba(250, 250, 242, 0.10);
  border-radius: 24px;
  padding: 0;
  height: 600px;                       /* match the 480 x 600 game frame */
  max-height: 600px;
  overflow: hidden;                     /* outer cap; inner list does the scrolling */
  color: #fafaf2;
  box-shadow: 0 22px 70px rgb(0 0 0 / 0.36);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.event-log .head {
  flex-shrink: 0;
  background: linear-gradient(180deg, #1e2024, #15171a);
  padding: 22px 18px 14px;
  border-bottom: 1px solid rgba(250, 250, 242, 0.08);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(250, 250, 242, 0.60);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.event-log ul {
  list-style: none;
  margin: 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(250, 250, 242, 0.18) transparent;
  padding: 22px 16px 22px;          /* breathing room so first chip is not clipped */
}
.event-log ul::-webkit-scrollbar { width: 6px; }
.event-log ul::-webkit-scrollbar-thumb { background: rgba(250, 250, 242, 0.18); border-radius: 3px; }
.event-log .head strong { color: #fafaf2; font-weight: 700; }
.event-log .head .pause-hint { color: rgba(250, 250, 242, 0.55); }

.event-log .empty {
  font-family: var(--font-serif);
  font-style: italic;
  color: rgba(250, 250, 242, 0.55);
  font-size: 13px;
  padding: 6px 4px;
  text-align: center;
}

.event-row {
  display: flex !important;
  align-items: center;
  gap: 11px;
  padding: 10px 12px 10px 9px;
  border-radius: 18px;
  border: 1px solid rgba(250, 250, 242, 0.08);
  background: rgba(250, 250, 242, 0.04);
  animation: chatPop 280ms cubic-bezier(0.2, 0, 0, 1);
  position: relative;
}
.event-row.kind-good {
  border-color: rgba(112, 211, 139, 0.55);
  background: linear-gradient(90deg, rgba(112, 211, 139, 0.16), rgba(112, 211, 139, 0.04));
}
.event-row.kind-bad {
  border-color: rgba(255, 90, 95, 0.55);
  background: linear-gradient(90deg, rgba(255, 90, 95, 0.18), rgba(255, 90, 95, 0.04));
}
.event-row.kind-event {
  border-color: rgba(109, 179, 247, 0.55);
  background: linear-gradient(90deg, rgba(109, 179, 247, 0.16), rgba(109, 179, 247, 0.04));
}

/* Big circular emoji badge to the left, like a streamer's username avatar */
.event-row .emo {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(250, 250, 242, 0.16);
  animation: emoBounce 600ms cubic-bezier(0.2, 0, 0, 1);
}
.event-row.kind-good .emo {
  background: rgba(112, 211, 139, 0.30);
  border-color: rgba(112, 211, 139, 0.70);
  box-shadow: 0 0 12px rgba(112, 211, 139, 0.40);
}
.event-row.kind-bad .emo {
  background: rgba(255, 90, 95, 0.30);
  border-color: rgba(255, 90, 95, 0.70);
  box-shadow: 0 0 12px rgba(255, 90, 95, 0.40);
}
.event-row.kind-event .emo {
  background: rgba(109, 179, 247, 0.30);
  border-color: rgba(109, 179, 247, 0.70);
  box-shadow: 0 0 12px rgba(109, 179, 247, 0.40);
}

.event-row .body {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.35;
  color: rgba(250, 250, 242, 0.90);
  overflow-wrap: anywhere;
  min-width: 0;
}
.event-row .body strong {
  display: inline;
  font-weight: 700;
  font-size: 12.5px;
  margin-right: 5px;
  letter-spacing: 0.005em;
}
.event-row .body em {
  font-style: normal;
  color: rgba(250, 250, 242, 0.62);
  font-size: 11.5px;
}
.event-row.kind-good .body strong { color: #8be4a3; }
.event-row.kind-bad  .body strong { color: #ff8d92; }
.event-row.kind-event .body strong { color: #9bc6f9; }

/* On the lobby (light page), keep the dark chat panel but ensure contrast */
.game-stack .event-log { color: #fafaf2; }

@keyframes chatPop {
  0%   { opacity: 0; transform: translateX(20px) scale(0.92); }
  55%  { opacity: 1; transform: translateX(0) scale(1.04); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes emoBounce {
  0%   { transform: scale(0.4) rotate(-18deg); }
  55%  { transform: scale(1.22) rotate(10deg); }
  100% { transform: scale(1) rotate(0); }
}

@media (max-width: 560px) {
  .shout {
    top: 104px;
    bottom: 68px;
  }
  .shout .shout-inner {
    font-size: 42px;
    line-height: 1;
  }
  .game-event-card {
    top: 100px;
    right: 9px;
    width: min(292px, calc(100% - 18px));
    padding: 8px 9px;
  }
  .game-event-card strong { font-size: 12px; }
  .game-event-card em { font-size: 10.5px; }
  .game-frame .overlay.is-visual:has(.city-grid),
  .game-frame .overlay.is-visual:has(.scenario-grid),
  .game-frame .overlay.is-visual:has(.country-grid) {
    justify-content: flex-start;
    padding-top: 14px;
  }
  .game-frame .overlay.is-visual .city-grid,
  .game-frame .overlay.is-visual .scenario-grid,
  .game-frame .overlay.is-visual .country-grid {
    gap: 5px;
    margin: 7px 0 8px;
  }
  .game-frame .overlay.is-visual .city-pick,
  .game-frame .overlay.is-visual .scenario-pick,
  .game-frame .overlay.is-visual .country-pick {
    min-height: 38px;
    padding: 5px 5px;
  }
  .game-frame .overlay.is-visual .country-pick .flag-big {
    font-size: 16px;
  }
  .game-frame .overlay.is-visual:has(.city-grid) .legend li,
  .game-frame .overlay.is-visual:has(.scenario-grid) .legend li,
  .game-frame .overlay.is-visual:has(.country-grid) .legend li {
    font-size: 11.5px;
    line-height: 1.15;
  }
}
