:root {
  --f9-green: #006b47;
  --f9-green-dark: #073d33;
  --f9-lime: #b8d832;
  --f9-cream: #f7f3df;
  --f9-pink: #ffb9ca;
  --ink: #10211d;
  --muted: #4e625c;
  --white: #ffffff;
  --danger: #a82c34;
  --focus: #ffca28;
  font-family: Inter, Aptos, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: #dce9e1;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  padding: clamp(8px, 2vw, 20px);
  background:
    linear-gradient(135deg, rgba(184, 216, 50, .2), transparent 45%),
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(0, 107, 71, .05) 24px),
    #dce9e1;
}

button { font: inherit; }

.game-shell {
  width: min(960px, 100%);
  min-height: min(540px, calc(100vh - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 4px solid var(--f9-green-dark);
  border-radius: 14px;
  background: var(--f9-cream);
  box-shadow: 10px 10px 0 rgba(7, 61, 51, .2);
}

.topbar {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px 18px;
  color: var(--white);
  background: var(--f9-green-dark);
}

.brand-lockup {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 800;
  letter-spacing: .04em;
}

.brand-code {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 3px solid var(--f9-lime);
  color: var(--f9-lime);
  font-size: 1.25rem;
}

.progress { width: min(260px, 42vw); font-size: .82rem; font-weight: 800; }
.progress-track { height: 10px; margin-top: 6px; overflow: hidden; border: 2px solid var(--white); }
.progress-track span { display: block; width: 25%; height: 100%; background: var(--f9-lime); transition: width .25s ease; }

.screen {
  display: grid;
  align-content: center;
  gap: 18px;
  min-height: 380px;
  padding: clamp(20px, 5vw, 52px);
  background:
    linear-gradient(rgba(247, 243, 223, .88), rgba(247, 243, 223, .88)),
    linear-gradient(90deg, var(--f9-green) 2px, transparent 2px),
    linear-gradient(var(--f9-green) 2px, transparent 2px);
  background-size: auto, 48px 48px, 48px 48px;
}

.eyebrow { margin: 0; color: var(--f9-green); font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
h1 { max-width: 20ch; margin: 0; font-size: clamp(2rem, 5vw, 3.6rem); line-height: .98; }
.lede { max-width: 66ch; margin: 0; font-size: clamp(1rem, 2.2vw, 1.25rem); line-height: 1.5; }
.role-card, .callout, .feedback {
  max-width: 760px;
  padding: 16px 18px;
  border: 3px solid var(--f9-green-dark);
  background: var(--white);
  box-shadow: 6px 6px 0 rgba(7, 61, 51, .18);
}
.role-card strong { display: block; color: var(--f9-green); font-size: 1.15rem; }
.callout { border-color: var(--f9-pink); background: #fff4f7; }
.feedback { border-color: var(--danger); color: #631b21; background: #fff0f1; }
.feedback.good { border-color: var(--f9-green); color: var(--f9-green-dark); background: #eff9f2; }

.actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 780px; }
.action, .primary {
  min-height: 52px;
  padding: 12px 16px;
  border: 3px solid var(--f9-green-dark);
  border-radius: 0;
  color: var(--ink);
  background: var(--white);
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  box-shadow: 4px 4px 0 rgba(7, 61, 51, .18);
}
.action[aria-pressed="true"] { background: var(--f9-lime); }
.primary { width: fit-content; min-width: 180px; color: var(--white); background: var(--f9-green); text-align: center; }
.action:hover, .primary:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 rgba(7, 61, 51, .18); }
.action:focus-visible, .primary:focus-visible, summary:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; }
.action:disabled { cursor: not-allowed; opacity: .65; transform: none; }

.values {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--f9-green-dark);
  color: var(--white);
  font-size: .78rem;
  font-weight: 800;
  text-align: center;
}
.values span { padding: 10px 6px; background: var(--f9-green); }

.debug { width: min(960px, 100%); margin: 12px auto 0; color: var(--muted); font-size: .82rem; }
.debug summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 800; }
.debug pre { max-height: 140px; overflow: auto; padding: 10px; color: #d7f4df; background: #071d17; white-space: pre-wrap; }

@media (max-width: 640px) {
  body { padding: 0; }
  .game-shell { min-height: 100vh; border-width: 0; border-radius: 0; box-shadow: none; }
  .topbar { align-items: flex-start; padding: 10px 12px; }
  .brand-lockup { font-size: .72rem; }
  .brand-code { width: 40px; height: 40px; }
  .screen { min-height: 0; padding: 24px 16px; }
  .actions { grid-template-columns: 1fr; }
  .values { grid-template-columns: repeat(2, 1fr); }
  .debug { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
