:root {
  --bg: #f7efe2;
  --panel: #fffaf1;
  --text: #34151f;
  --muted: #7a6658;
  --accent: #e94f37;
  --accent-dark: #b83325;
  --teal: #1f8a84;
  --success: #2f9e44;
  --bad: #d62828;
  --line: #d9c5aa;
  --shadow: 0 18px 45px rgba(52, 21, 31, 0.14);
  --radius: 24px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(233, 79, 55, 0.18), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(31, 138, 132, 0.16), transparent 30rem),
    var(--bg);
}

button { font: inherit; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  color: var(--panel);
  background: var(--text);
  border-radius: 999px;
}

.skip-link:focus { top: 1rem; }

.app-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 3rem) 0;
}

.screen { display: none; }
.screen--active { display: block; }

.hero,
.screen:not(.hero) {
  border: 2px solid var(--line);
  border-radius: calc(var(--radius) + 10px);
  background: linear-gradient(145deg, rgba(255, 250, 241, 0.96), rgba(247, 239, 226, 0.9));
  box-shadow: var(--shadow);
  padding: clamp(1.4rem, 5vw, 4rem);
}

.hero {
  min-height: min(760px, calc(100vh - 2.5rem));
  display: none;
  place-content: center;
  text-align: center;
}
.hero.screen--active { display: grid; }

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--teal);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1, h2, h3 { margin: 0; line-height: 0.95; }
h1 { font-size: clamp(3.3rem, 12vw, 8.5rem); text-transform: uppercase; }
h2 { font-size: clamp(2.1rem, 6vw, 4.5rem); }
h3 { font-size: clamp(1.45rem, 3vw, 2.2rem); }

.subtitle {
  max-width: 780px;
  margin: 1.5rem auto;
  color: var(--muted);
  font-size: clamp(1.1rem, 2.5vw, 1.55rem);
}

.disclaimer, .hint { color: var(--muted); }
.disclaimer { margin: 1.25rem auto 0; max-width: 680px; }

.button {
  border: 2px solid var(--text);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
  padding: 0.9rem 1.35rem;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover:not(:disabled), .button:focus-visible:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 0 rgba(52, 21, 31, 0.15);
}

.button--primary { color: white; background: var(--accent); }
.button--secondary { color: white; background: var(--teal); }
.button--ghost { color: var(--text); background: transparent; }
.button:disabled { cursor: not-allowed; opacity: 0.55; }

.screen-header, .game-topbar, .actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.country-grid, .dashboard, .billionaire-grid {
  display: grid;
  gap: 1rem;
}

.country-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-top: 2rem; }
.dashboard { grid-template-columns: minmax(260px, 0.85fr) minmax(300px, 1.4fr); margin-top: 1rem; }
.billionaire-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-top: 1rem; }

.country-card, .panel, .billionaire-card {
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(52, 21, 31, 0.08);
}

.country-card {
  width: 100%;
  padding: 1.25rem;
  color: var(--text);
  text-align: left;
}
.country-card strong { display: block; font-size: 1.45rem; }
.country-card span { color: var(--muted); }

.panel { padding: clamp(1rem, 3vw, 1.5rem); }
.status {
  margin: 1.5rem 0 0;
  border-left: 6px solid var(--teal);
  border-radius: 14px;
  padding: 1rem;
  background: rgba(31, 138, 132, 0.09);
  font-weight: 800;
}

.stats-list { margin: 1rem 0 0; }
.stats-list div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.stats-list dt { color: var(--muted); font-weight: 800; }
.stats-list dd { margin: 0; font-weight: 950; text-align: right; }

.billionaire-card { padding: 1rem; }
.billionaire-card h4 { margin: 0 0 0.35rem; font-size: 1.2rem; }
.billionaire-card p { margin: 0.2rem 0; color: var(--muted); }
.billionaire-card .fortune { color: var(--accent-dark); font-size: 1.35rem; font-weight: 950; }

.actions-bar { margin-top: 1.5rem; }
.results-panel { margin-top: 1.5rem; border-color: var(--teal); }
.verdict { color: var(--success); font-size: 1.35rem; }
.verdict-note { color: var(--muted); font-weight: 800; }

.toast-region {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 20;
  display: grid;
  gap: 0.75rem;
  width: min(420px, calc(100vw - 2rem));
}
.toast {
  border: 2px solid var(--text);
  border-left: 10px solid var(--accent);
  border-radius: 18px;
  padding: 0.95rem 1rem;
  background: var(--panel);
  box-shadow: var(--shadow);
  font-weight: 850;
}
.toast--tax { border-left-color: var(--teal); }

@media (max-width: 760px) {
  .dashboard { grid-template-columns: 1fr; }
  .game-topbar .button, .actions-bar .button { width: 100%; }
  .stats-list div { align-items: flex-start; flex-direction: column; }
  .stats-list dd { text-align: left; }
}
