*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--gfp-background); color: var(--gfp-text); }
body { font-family: var(--gfp-font); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
#app { max-width: 760px; margin: 0 auto; padding: 16px 16px 24px; }
html[data-mode="inline"] #app { padding: 12px 8px 16px; }
h1, h2, h3 { font-family: var(--gfp-heading-font); line-height: 1.15; margin: 0; }
button { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* hub */
.hub-head { padding: 8px 0 12px; border-bottom: 3px solid var(--gfp-brand); margin-bottom: 16px; }
.hub-head h1 { font-size: 2rem; }
.brand-link { display: inline-block; font-weight: 800; letter-spacing: .04em; color: var(--gfp-brand); text-decoration: none; margin-bottom: 4px; }
.date { color: var(--gfp-muted); margin: 4px 0 0; font-size: .9rem; }
.date::first-letter { text-transform: uppercase; }
.section { font-size: 1.15rem; margin: 20px 0 10px; }
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card { display: grid; grid-template-columns: auto 1fr; grid-template-rows: 1fr auto; gap: 8px 14px; padding: 14px; height: 100%;
  background: var(--gfp-surface); border: 1px solid var(--gfp-border); border-radius: var(--gfp-radius);
  color: inherit; text-decoration: none; transition: transform .12s ease, box-shadow .12s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgb(0 0 0 / .08); }
.card:focus-visible { outline: 3px solid var(--gfp-brand); outline-offset: 2px; }
.card h3 { font-size: 1.15rem; }
.card p { margin: 4px 0 0; color: var(--gfp-muted); font-size: .92rem; }
.card .streak { color: var(--gfp-text); font-weight: 600; }
.card-icon { display: flex; gap: 3px; grid-row: span 2; align-self: start; }
.card-cta { grid-column: 2; justify-self: start; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: .9rem;
  background: var(--gfp-brand); color: var(--gfp-on-brand); }
.card.is-done .card-cta { background: transparent; color: var(--gfp-correct); padding-left: 0; }
.tile { width: 26px; height: 26px; display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: var(--gfp-on-tile);
  border-radius: calc(var(--gfp-radius) / 2); font-family: system-ui, sans-serif; }
.tile-correct { background: var(--gfp-correct); }
.tile-present { background: var(--gfp-present); }
.tile-absent { background: var(--gfp-absent); }
.more { color: var(--gfp-muted); font-size: .9rem; margin-top: 16px; }

/* game */
.game-bar { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--gfp-border); margin-bottom: 8px; }
.game-bar h1 { font-size: 1.4rem; flex: 1; }
html[data-mode="inline"] .game-bar h1 { text-align: left; }
.game-stage { min-height: 200px; }
.game-frame { display: block; width: 100%; border: 0; background: transparent; }
.loading { color: var(--gfp-muted); text-align: center; padding: 60px 0; }

.btn { border: 1px solid var(--gfp-border); background: var(--gfp-surface); padding: 9px 16px; border-radius: var(--gfp-radius); cursor: pointer; font-weight: 600; }
.btn:focus-visible { outline: 3px solid var(--gfp-brand); outline-offset: 2px; }
.btn-primary { background: var(--gfp-brand); color: var(--gfp-on-brand); border-color: var(--gfp-brand); }
.btn-ghost { background: transparent; border-color: transparent; padding-left: 0; color: var(--gfp-muted); }

/* result */
.result { margin-top: 16px; padding: 20px 16px; border-top: 3px solid var(--gfp-brand); background: var(--gfp-surface); border-radius: var(--gfp-radius); text-align: center; }
.result h2 { font-size: 1.6rem; }
.result-line { margin: 6px 0 16px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 400px; margin: 0 auto; }
.stat strong { display: block; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: .78rem; color: var(--gfp-muted); }
.dist-title { font-size: .95rem; margin: 18px 0 8px; }
.dist { max-width: 320px; margin: 0 auto; display: grid; gap: 4px; text-align: left; }
.dist-row { display: flex; align-items: center; gap: 6px; font-size: .85rem; font-variant-numeric: tabular-nums; }
.dist-n { width: 12px; }
.dist-bar { background: var(--gfp-absent); color: var(--gfp-on-tile); padding: 1px 6px; text-align: right; font-weight: 700; border-radius: 2px; }
.share-row { margin: 20px 0 6px; display: flex; gap: 10px; align-items: center; justify-content: center; }
.share-note { color: var(--gfp-correct); font-weight: 600; min-width: 1px; }
.next { color: var(--gfp-muted); font-size: .9rem; }
.next time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--gfp-text); }

/* ads: label only shows once a creative actually rendered */
.ad { margin: 16px auto; text-align: center; min-height: 0; }
.ad-top { min-height: 50px; margin-top: 0; }
.ad-result { min-height: 250px; }
.ad-label { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gfp-muted); visibility: hidden; margin-bottom: 4px; }
.ad.is-filled .ad-label { visibility: visible; }
.ad > div[id] { display: inline-block; }
.ad-placeholder { margin: 0 auto; display: grid; place-items: center; padding: 6px; font: 600 .75rem/1.3 system-ui, sans-serif;
  color: var(--gfp-muted); border: 2px dashed var(--gfp-border); border-radius: 4px; background: repeating-linear-gradient(45deg, transparent 0 8px, rgb(0 0 0 / .03) 8px 16px); }

@media (prefers-reduced-motion: reduce) { .card { transition: none; } .card:hover { transform: none; } }
