:root {
  color-scheme: dark;
  --bg: #101218;
  --panel: #20232c;
  --panel-strong: #2c303c;
  --text: #f8fafc;
  --muted: #9aa3b2;
  --accent: #ffd86f;
  --good: #64dc82;
  --bad: #e86262;
  --line: #42495b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 10%, #29324a 0 12rem, transparent 28rem), var(--bg);
  color: var(--text);
}

button { font: inherit; }

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 28px 0;
}

.screen { display: none; width: 100%; }
.screen.is-active { display: block; }

.hero-card, .panel {
  background: linear-gradient(145deg, rgba(44, 48, 60, 0.96), rgba(30, 33, 42, 0.96));
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  padding: clamp(24px, 5vw, 56px);
}

.hero-card { max-width: 760px; margin: 0 auto; text-align: center; }
.narrow { max-width: 620px; margin: 0 auto; }

h1, h2, h3 { margin: 0; line-height: 1; }
h1 { font-size: clamp(4rem, 13vw, 9rem); letter-spacing: -0.08em; }
h2 { font-size: clamp(2.4rem, 7vw, 5rem); letter-spacing: -0.06em; }
h3 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 22px; }

.eyebrow { color: var(--accent); font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.lede { color: var(--muted); font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1.6; }
.smallprint, .action-hint { color: var(--muted); line-height: 1.55; }
.action-hint { margin: 0; font-size: 0.94rem; }
.accent { color: var(--accent); }

.primary-action, .secondary-action, .country-button {
  border: 1px solid #6a7287;
  border-radius: 18px;
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
  padding: 18px 24px;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}
.primary-action, .country-button { background: #343844; }
.secondary-action { background: #242833; }
.primary-action:hover, .secondary-action:hover, .country-button:hover { transform: translateY(-2px); background: #4b5264; border-color: #9ca8c2; }
.text-button { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 8px 0; }
.text-button:hover { color: var(--text); }

.country-list { display: grid; gap: 16px; margin-top: 28px; }
.country-button { display: flex; justify-content: space-between; align-items: center; text-align: left; width: 100%; }
.country-button span { color: var(--muted); font-weight: 700; }

.game-header { display: flex; justify-content: space-between; gap: 20px; align-items: start; margin-bottom: 16px; }
.status-message { color: var(--muted); min-height: 1.5em; }
.game-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 20px; align-items: stretch; }
.stat-list { display: grid; gap: 14px; margin: 0 0 28px; }
.stat-list div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid rgba(154, 163, 178, 0.18); padding-bottom: 12px; }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 900; text-align: right; }
.action-row { display: grid; gap: 14px; }
.billionaire-cards { display: grid; gap: 14px; }
.billionaire-card { background: var(--panel-strong); border: 1px solid rgba(154, 163, 178, 0.22); border-radius: 20px; padding: 18px; }
.billionaire-card strong { display: block; font-size: 1.15rem; }
.billionaire-card p { color: var(--muted); margin: 7px 0; }
.billionaire-card .fortune { color: var(--text); font-size: 1.35rem; font-weight: 900; }
.results-panel { margin-top: 20px; text-align: center; }
.results-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; text-align: left; }
.verdict { font-size: 1.4rem; }
.toast-stack { position: fixed; right: 18px; bottom: 68px; display: grid; gap: 10px; max-width: min(420px, calc(100vw - 36px)); pointer-events: none; }
.toast { animation: floatOut 2.8s ease forwards; background: #20232c; border: 1px solid var(--line); border-radius: 999px; font-weight: 900; padding: 12px 16px; box-shadow: 0 10px 28px rgba(0,0,0,.32); }
.toast.good { color: var(--good); }
.toast.bad { color: var(--bad); }

@keyframes floatOut { 0% { opacity: 0; transform: translateY(16px); } 12%, 78% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-28px); } }

@media (max-width: 820px) {
  .app-shell { width: min(100% - 20px, 1180px); padding: 10px 0; }
  .game-header, .game-grid, .results-grid { grid-template-columns: 1fr; display: grid; }
  .hero-card, .panel { border-radius: 20px; padding: 22px; }
}

.paypal-link {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 10;
  max-width: min(230px, calc(100vw - 32px));
  border: 1px solid rgba(255, 216, 111, 0.55);
  border-radius: 999px;
  background: rgba(32, 35, 44, 0.9);
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 800;
  padding: 9px 13px;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(0,0,0,.24);
}
.paypal-link:hover { background: rgba(52, 56, 68, 0.96); border-color: var(--accent); }
.paypal-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
