@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800&family=Source+Sans+3:wght@400;600;700&display=swap');

:root {
  --green: #0b6338;
  --green-dark: #063d27;
  --yellow: #f7d117;
  --blue: #083b7a;
  --red: #c93434;
  --ink: #10231b;
  --paper: #f4f1e8;
  --white: #fff;
  --line: rgba(16, 35, 27, 0.16);
  --shadow: 0 14px 35px rgba(6, 61, 39, 0.16);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background-color: var(--paper);
  background-image: linear-gradient(rgba(11,99,56,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(11,99,56,.035) 1px, transparent 1px);
  background-size: 28px 28px;
  font-family: 'Source Sans 3', sans-serif;
}

button, input { font: inherit; }
a { color: inherit; }
.topbar {
  min-height: 72px;
  padding: 10px clamp(16px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--white);
  background: var(--green-dark);
  border-bottom: 5px solid var(--yellow);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 48px; height: 48px; object-fit: contain; }
.brand span, h1, h2 { font-family: 'Barlow Condensed', sans-serif; letter-spacing: 0; }
.brand span { font-size: clamp(1.35rem, 3vw, 1.85rem); font-weight: 800; }
nav { display: flex; gap: 8px; }
nav a { padding: 10px 14px; font-weight: 700; text-decoration: none; border-bottom: 3px solid transparent; }
nav a:hover, nav a.active { color: var(--yellow); border-color: var(--yellow); }
.menu-button { display: none; border: 0; background: transparent; color: var(--white); font-size: 1.6rem; cursor: pointer; }

.game-shell, .ranking-shell, .content-shell { width: min(100% - 24px, 1040px); margin: 0 auto; flex: 1; }
.game-shell { padding: 24px 0 56px; }
.score-strip {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) minmax(180px, 280px) minmax(96px, 1fr);
  align-items: center;
  min-height: 76px;
  color: var(--white);
  background: var(--blue);
  border-bottom: 5px solid var(--yellow);
  box-shadow: var(--shadow);
}
.score-strip > div:not(.competition-mark) { display: flex; align-items: baseline; justify-content: center; gap: 10px; }
.score-label { text-transform: uppercase; font-weight: 700; font-size: .78rem; }
.score-strip strong { font-family: 'Barlow Condensed', sans-serif; font-size: 2rem; }
.competition-mark { align-self: stretch; display: grid; place-items: center; padding: 8px; background: var(--white); clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%); }
.competition-mark img { width: 100%; max-height: 56px; }

.game-panel { margin-top: 18px; display: grid; grid-template-columns: minmax(250px, .85fr) minmax(320px, 1.15fr); grid-template-areas: 'question stage' 'options stage' 'status stage'; gap: 16px 30px; padding: clamp(22px, 4vw, 42px); background: rgba(255,255,255,.94); border: 1px solid var(--line); box-shadow: var(--shadow); }
.question-block { grid-area: question; text-align: left; }
.eyebrow { margin: 0 0 4px; color: var(--green); font-size: .78rem; font-weight: 800; text-transform: uppercase; }
h1 { margin: 0; color: var(--blue); font-size: clamp(2.4rem, 7vw, 4.6rem); line-height: .92; }
.clue { margin: 16px 0 0; font-weight: 700; font-size: 1.4rem; }
.player-stage { grid-area: stage; position: relative; overflow: hidden; min-height: 470px; display: grid; place-items: end center; background: linear-gradient(180deg, #72b7dc 0 36%, #159055 36% 100%); border: 6px solid var(--white); outline: 1px solid var(--line); }
.player-stage::before { content: ''; position: absolute; width: 115%; height: 48%; bottom: -28%; border: 3px solid rgba(255,255,255,.7); border-radius: 50%; }
.pitch-lines { position: absolute; inset: 36% 0 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 56px, rgba(255,255,255,.13) 56px 112px); }
.player-stage img { position: relative; z-index: 2; width: min(100%, 430px); height: 450px; object-fit: contain; object-position: bottom center; animation: player-in .35s ease both; filter: drop-shadow(0 12px 10px rgba(0,0,0,.24)); }
.loading-player { align-self: center; z-index: 2; color: var(--white); font-weight: 800; }
.options { grid-area: options; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
.option { min-width: 0; min-height: 58px; padding: 10px 14px; border: 2px solid var(--green); color: var(--green-dark); background: var(--white); font-weight: 700; cursor: pointer; transition: transform .15s ease, color .15s ease, background .15s ease; -webkit-tap-highlight-color: transparent; }
.option:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; transform: translateY(-2px); }
.option:disabled { cursor: default; }
.option.correct { color: var(--white); background: var(--green); }
.option.wrong { color: var(--white); border-color: var(--red); background: var(--red); }
.status-message { grid-area: status; min-height: 24px; margin: 0; font-weight: 700; }

.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; border: 2px solid transparent; border-radius: 3px; font-weight: 800; text-decoration: none; cursor: pointer; }
.button-primary { color: var(--white); background: var(--green); }
.button-secondary { color: var(--blue); background: var(--white); border-color: var(--blue); }
.game-over { margin: 18px auto 0; padding: clamp(24px, 5vw, 40px); background: var(--yellow); border-left: 9px solid var(--blue); box-shadow: var(--shadow); }
.game-over h2 { margin: 0; color: var(--blue); font-size: clamp(2rem, 5vw, 3.3rem); }
.game-over label { display: block; margin: 22px 0 6px; font-weight: 700; }
.submit-row { display: flex; gap: 10px; }
.submit-row input { min-width: 0; flex: 1; padding: 12px 14px; border: 2px solid var(--blue); border-radius: 3px; background: var(--white); }
.end-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.form-status { min-height: 24px; margin: 8px 0 0; }

.ranking-shell { padding: clamp(36px, 7vw, 76px) 0; }
.ranking-heading { margin-bottom: 24px; }
.ranking-heading h1 { max-width: 800px; }
.ranking-heading > p:last-child { font-size: 1.08rem; }
.ranking-board { overflow-x: auto; margin-bottom: 24px; background: var(--white); box-shadow: var(--shadow); border-top: 7px solid var(--yellow); }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th, td { padding: 15px 18px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--white); background: var(--blue); font-family: 'Barlow Condensed', sans-serif; font-size: 1.08rem; text-transform: uppercase; }
tbody tr:nth-child(-n+3) { background: #fffbea; }
tbody td:first-child { font-family: 'Barlow Condensed', sans-serif; font-size: 1.25rem; font-weight: 800; color: var(--green); }

.content-shell { padding: clamp(36px, 7vw, 76px) 0; }
.page-hero { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); align-items: center; gap: clamp(28px, 6vw, 72px); margin-bottom: clamp(36px, 7vw, 72px); }
.page-hero > img { width: 100%; max-height: 280px; object-fit: contain; }
.page-hero h1 { max-width: 720px; }
.page-hero .lead { max-width: 680px; margin: 18px 0 0; font-size: clamp(1.08rem, 2vw, 1.3rem); }
.content-band { margin: 0 calc(50% - 50vw); padding: clamp(34px, 6vw, 64px) max(12px, calc((100vw - 1016px) / 2)); background: var(--white); border-top: 7px solid var(--yellow); }
.content-band + .content-band { border-top: 1px solid var(--line); }
.content-band.alt { color: var(--white); background: var(--blue); border-color: var(--yellow); }
.content-band h2 { margin: 0 0 18px; color: inherit; font-size: clamp(1.8rem, 4vw, 2.8rem); }
.content-band p { max-width: 780px; font-size: 1.08rem; }
.rules-list { max-width: 820px; margin: 0; padding-left: 24px; }
.rules-list li { margin: 12px 0; padding-left: 6px; }
.install-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.install-grid section { border-top: 4px solid var(--green); }
.install-grid h3 { margin-bottom: 8px; font-family: 'Barlow Condensed', sans-serif; font-size: 1.65rem; }
.fame-callout { max-width: 800px; padding-left: clamp(20px, 4vw, 40px); border-left: 9px solid var(--yellow); }
.fame-callout strong { display: block; color: var(--yellow); font-family: 'Barlow Condensed', sans-serif; font-size: clamp(3rem, 10vw, 7rem); line-height: .85; }
.fame-callout p { margin-bottom: 0; font-size: clamp(1.25rem, 3vw, 1.8rem); font-weight: 700; }

footer { min-height: 68px; padding: 18px clamp(16px, 4vw, 48px); display: flex; align-items: center; justify-content: center; gap: 10px 22px; flex-wrap: wrap; color: var(--white); background: var(--green-dark); font-size: .9rem; }
footer a { color: var(--yellow); font-weight: 700; }
@keyframes player-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

@media (hover: hover) and (pointer: fine) {
  .option:hover:not(:disabled) { transform: translateY(-2px); }
}

@media (max-width: 760px) {
  .topbar { min-height: 64px; }
  .brand img { width: 40px; height: 40px; }
  .menu-button { display: block; margin-left: auto; }
  nav { display: none; position: absolute; z-index: 20; top: 64px; left: 0; right: 0; padding: 12px 18px 18px; background: var(--green-dark); flex-direction: column; }
  nav.open { display: flex; }
  .score-strip { grid-template-columns: 1fr 1fr; }
  .competition-mark { display: none; }
  .game-panel { grid-template-columns: 1fr; grid-template-areas: 'question' 'stage' 'options' 'status'; gap: 12px; padding: 14px; }
  .player-stage { min-height: 240px; }
  .player-stage img { height: 230px; }
  .options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .option { min-height: 56px; padding: 7px 8px; line-height: 1.15; }
  .submit-row { flex-direction: column; }
  .page-hero { grid-template-columns: 1fr; text-align: center; }
  .page-hero > img { width: min(52vw, 190px); margin: 0 auto; }
  .page-hero .lead { margin-left: auto; margin-right: auto; }
  .install-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
