/* Football Grid v2. Everything is scoped to .fg / body.fg-page so it can't leak into other pages. */
body.fg-page {
  background:
    radial-gradient(70% 38% at 12% 0%, rgba(110, 160, 255, 0.14), transparent 70%),
    radial-gradient(70% 38% at 88% 0%, rgba(255, 150, 80, 0.12), transparent 70%),
    #060a13;
  background-attachment: fixed;
}
@media (max-width: 640px) { body.fg-page .site-header, body.fg-page .circuit-bar { position: static; } }
.fg-h1 { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.fg {
  --panel: #0e1526; --panel2: #131c33; --line: rgba(255, 255, 255, 0.1);
  --acc: #ff7a2e; --txt: #f3f5fa; --dim: #9aa6bd; --ok: #38c977; --bad: #e5484d;
  max-width: 460px; margin: 0 auto; padding: 6px 0 28px; color: var(--txt);
}
.fg button { font-family: inherit; }
.fg [hidden], .fg-sheet[hidden] { display: none !important; }
.fg-dim { color: var(--dim); text-align: center; }

.fg-preview { background: rgba(255, 122, 46, .12); border: 1px dashed rgba(255, 122, 46, .6); color: #ffd2b5; border-radius: 8px; padding: 8px 12px; font-size: 12px; line-height: 1.4; margin: 4px 0 10px; }

/* Title + date */
.fg-hud { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 2px 12px; }
.fg-brand { font-family: var(--font-display, 'Jersey 15', sans-serif); font-size: 30px; line-height: 1; text-align: center; }
.fg-brand small { display: block; font-family: var(--font-body, Inter, sans-serif); font-size: 9.5px; letter-spacing: .22em; font-weight: 700; color: var(--acc); margin-top: 5px; }
.fg-datenav { display: flex; align-items: center; justify-content: center; gap: 12px; }
.fg-datenav button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--txt); font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.fg-datenav button:disabled { opacity: .3; cursor: not-allowed; }
.fg-datenav button:not(:disabled):hover { border-color: var(--acc); }
.fg-datenav span { font-family: var(--font-display, 'Jersey 15', sans-serif); font-size: 15px; color: var(--acc); min-width: 110px; text-align: center; }

/* Buttons */
.fg-btn { font-weight: 800; font-size: 14px; padding: 13px 18px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; text-align: center; display: inline-block; }
.fg-btn.primary { background: var(--acc); color: #0a0a0a; }
.fg-btn.ghost { background: transparent; border-color: rgba(255, 255, 255, .3); color: var(--txt); }
.fg-btn.ghost.armed { border-color: var(--bad); color: #f0868a; }

/* Start card */
.fg-start { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px 18px 20px; text-align: center; }
.fg-kick { font-size: 10.5px; letter-spacing: .22em; font-weight: 800; color: var(--acc); text-transform: uppercase; }
.fg-bigtitle { font-family: var(--font-display, 'Jersey 15', sans-serif); font-weight: 400; font-size: 32px; line-height: 1.08; margin: 10px 0 8px; text-wrap: balance; }
.fg-blurb { font-size: 13.5px; color: var(--dim); margin: 0 0 12px; }
.fg-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.fg-chips span { font-size: 11.5px; font-weight: 700; color: var(--dim); border: 1px solid var(--line); background: var(--panel2); border-radius: 999px; padding: 4px 11px; }
.fg-chips span.par { color: var(--acc); border-color: rgba(255, 122, 46, .55); background: rgba(255, 122, 46, .08); }
.fg-rules { list-style: none; margin: 18px 0; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.fg-rules li { font-size: 13px; color: var(--dim); line-height: 1.4; padding-left: 22px; position: relative; }
.fg-rules li::before { content: "⚽"; position: absolute; left: 0; top: 0; font-size: 12px; }
.fg-startbtn { width: 100%; font-size: 16px; padding: 15px; }

/* Status bar */
.fg-bar { display: flex; justify-content: space-between; align-items: center; margin: 0 2px 10px; }
.fg-lives { font-size: 18px; letter-spacing: 2px; min-width: 110px; }
.fg-timer { font-family: var(--font-display, 'Jersey 15', sans-serif); font-size: 24px; color: #35b3e0; }
.fg-score { font-family: var(--font-display, 'Jersey 15', sans-serif); font-size: 20px; color: var(--acc); min-width: 110px; text-align: right; }

/* The grid */
.fg-grid { display: grid; grid-template-columns: 74px repeat(3, minmax(0, 1fr)); gap: 6px; }
.fg-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 5px; min-width: 0; }
.fg-head.col { justify-content: flex-end; padding: 2px 0 4px; min-height: 66px; }
.fg-head.row { justify-content: center; }
.fg-head-name { font-size: 11px; font-weight: 800; line-height: 1.15; color: var(--dim); overflow-wrap: anywhere; }
.fg-head.on .fg-head-name { color: var(--acc); }
.fg-head.on .fg-chip, .fg-head.on .fg-ico, .fg-head.on .fg-flag { box-shadow: 0 0 0 2px var(--acc); }

.fg-chip { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 10.5px; letter-spacing: .02em; flex: none; border: 1.5px solid rgba(255, 255, 255, .28); }
.fg-chip.sm { width: 22px; height: 22px; font-size: 7px; border-width: 1px; }
.fg-flag { width: 36px; height: 24px; object-fit: cover; border-radius: 4px; flex: none; background: var(--panel2); }
.fg-flag.sm { width: 24px; height: 16px; border-radius: 3px; }
.fg-flag-none { display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: var(--dim); }
.fg-ico { width: 34px; height: 34px; border-radius: 50%; background: var(--panel2); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 17px; flex: none; }
.fg-ico.sm { width: 22px; height: 22px; font-size: 12px; }

.fg-tile { aspect-ratio: 1; min-width: 0; border-radius: 12px; background: var(--panel); border: 1.5px solid var(--line); position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--txt); padding: 4px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.fg-tile:not(.correct):not(.wrong):not(.revealed):hover { border-color: rgba(255, 122, 46, .6); }
.fg-plus { font-size: 30px; line-height: 1; color: rgba(255, 255, 255, .35); font-weight: 300; }
.fg-count { position: absolute; right: 5px; bottom: 4px; font-size: 10px; font-weight: 800; color: var(--dim); background: rgba(255, 255, 255, .07); border-radius: 8px; padding: 1px 6px; }
.fg-tile.sel { border-color: var(--acc); background: #17203a; box-shadow: 0 0 0 2px rgba(255, 122, 46, .35); }
.fg-tile.correct { background: rgba(56, 201, 119, .16); border-color: var(--ok); cursor: default; }
.fg-tn { font-size: 12px; font-weight: 800; line-height: 1.15; text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fg-tick { position: absolute; top: 3px; right: 6px; font-size: 11px; color: var(--ok); font-weight: 900; }
.fg-tile.wrong { background: rgba(229, 72, 77, .13); border-color: var(--bad); }
.fg-tx { color: var(--bad); font-weight: 900; font-size: 15px; line-height: 1; }
.fg-tg { font-size: 10.5px; font-weight: 700; line-height: 1.15; text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fg-ta { font-size: 9.5px; font-style: italic; color: var(--dim); line-height: 1.15; text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fg-ta.only { font-size: 10.5px; }
.fg-tile.revealed { background: transparent; border-style: dashed; cursor: default; }
.fg-tile.flash-correct { animation: fg-green .5s ease; }
.fg-tile.flash-wrong { animation: fg-shake .4s ease; }
@keyframes fg-green { 0% { background: rgba(56, 201, 119, .55); } 100% { background: rgba(56, 201, 119, .16); } }
@keyframes fg-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.fg-note { min-height: 40px; margin: 10px 2px 0; padding: 0; font-size: 13px; line-height: 1.4; text-align: center; color: var(--dim); }
.fg-note.good { color: #8be0b0; }
.fg-note.bad { color: #f0868a; }
.fg-legend { text-align: center; font-size: 11.5px; color: var(--dim); margin: 4px 0 0; }
.fg-actions { display: flex; justify-content: center; margin-top: 14px; }

/* Search sheet (sits just above the keyboard) */
.fg-sheet { position: fixed; left: 0; right: 0; bottom: var(--kb, 0px); z-index: 400; max-width: 520px; margin: 0 auto; background: #0e1526; border: 1px solid var(--line); border-bottom: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, .55); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); color: #f3f5fa; font-family: var(--font-body, Inter, sans-serif); }
.fg-sheet-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.fg-ctx { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; font-size: 13px; }
.fg-ctx { flex-wrap: wrap; row-gap: 4px; }
.fg-ctx b { font-weight: 800; font-size: 14px; }
.fg-sheet-sub { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.fg-ctx i { color: var(--acc, #ff7a2e); font-style: normal; font-weight: 800; }
.fg-count-pill { font-size: 11px; font-weight: 800; color: #9aa6bd; background: rgba(255, 255, 255, .07); border-radius: 8px; padding: 2px 8px; white-space: nowrap; }
.fg-hintbtn { font-size: 11.5px; font-weight: 800; padding: 6px 9px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .25); background: transparent; color: #f3f5fa; cursor: pointer; white-space: nowrap; }
.fg-hintbtn:disabled { opacity: .4; cursor: not-allowed; }
.fg-x { width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); background: transparent; color: #f3f5fa; cursor: pointer; font-size: 13px; flex: none; }
.fg-hintline { font-size: 12.5px; color: #ffd9a8; background: rgba(255, 180, 80, .1); border: 1px solid rgba(255, 180, 80, .35); border-radius: 8px; padding: 7px 10px; margin-bottom: 8px; line-height: 1.35; }
.fg-sheet-msg { font-size: 12.5px; line-height: 1.35; border-radius: 8px; padding: 7px 10px; margin-bottom: 8px; background: rgba(255, 255, 255, .06); color: #cfd6e6; }
.fg-sheet-msg.good { background: rgba(56, 201, 119, .14); color: #8be0b0; }
.fg-sheet-msg.bad { background: rgba(229, 72, 77, .15); color: #f4a0a3; }
.fg-sugg { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column-reverse; gap: 4px; }
.fg-sg { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .1); background: #131c33; color: #f3f5fa; font-size: 15px; font-weight: 600; text-align: left; cursor: pointer; }
.fg-sg small { color: #9aa6bd; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.fg-sg:hover, .fg-sg.active { border-color: #ff7a2e; background: #1a2644; }
.fg-sg.used { opacity: .45; }
.fg-inputrow { display: flex; gap: 8px; }
.fg-inputrow input { flex: 1; min-width: 0; font-size: 16px; padding: 12px 14px; border-radius: 10px; border: 1.5px solid rgba(255, 255, 255, .25); background: #070b16; color: #f3f5fa; outline: none; font-family: inherit; }
.fg-inputrow input:focus { border-color: #ff7a2e; }
.fg-gobtn { font-weight: 800; font-size: 14px; padding: 0 16px; border-radius: 10px; border: 0; background: #ff7a2e; color: #0a0a0a; cursor: pointer; }
body.fg-sheet-open .fg { padding-bottom: calc(var(--fg-sheet-h, 220px) + 24px); }

/* Result */
.fg-result { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 14px; margin-top: 14px; text-align: center; }
.fg-res-score { font-family: var(--font-display, 'Jersey 15', sans-serif); font-size: 54px; line-height: 1; color: var(--acc); }
.fg-res-label { font-size: 14px; color: var(--txt); margin-top: 6px; }
.fg-res-meta { font-size: 12.5px; color: var(--dim); margin-top: 4px; }
.fg-emoji { white-space: pre; font-size: 24px; line-height: 1.25; margin-top: 10px; letter-spacing: 2px; }
.fg-res-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.fg-share-status { font-size: 12px; color: var(--dim); margin-top: 8px; white-space: pre-line; }
.fg-bd-title { font-family: var(--font-display, 'Jersey 15', sans-serif); font-size: 20px; color: var(--acc); margin: 20px 0 8px; text-align: left; }
.fg-breakdown { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.fg-breakdown li { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
.bd-top { display: flex; align-items: center; gap: 6px; font-size: 12.5px; flex-wrap: wrap; }
.bd-top i { color: var(--acc); font-style: normal; font-weight: 800; }
.bd-top em { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 800; color: var(--dim); }
.bd-row { font-size: 12.5px; margin-top: 5px; line-height: 1.35; }
.bd-row.dim { color: var(--dim); }
.you { font-weight: 800; }
.you.good { color: #8be0b0; }
.you.bad { color: #f0868a; }

@media (max-width: 380px) { .fg-grid { grid-template-columns: 62px repeat(3, minmax(0, 1fr)); gap: 5px; } .fg-tn { font-size: 11px; } .fg-head-name { font-size: 10.5px; } }
@media (prefers-reduced-motion: reduce) { .fg-tile.flash-correct, .fg-tile.flash-wrong { animation: none; } }

/* The floating "claim your XP" pill and the cookie banner would sit on top of the search box, so they step aside while searching and come back when it closes. */
body.fg-sheet-open .bkc-pill, body.fg-sheet-open #bk-claim-pill, body.fg-sheet-open .bk-cookie-banner { display: none !important; }

/* Link to the members-only Expert game */
.fg-expert-teaser { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(160, 92, 240, .5); background: rgba(160, 92, 240, .1); color: var(--dim); text-decoration: none; text-align: left; font-size: 12.5px; line-height: 1.4; }
.fg-expert-teaser b { color: var(--txt); }
.fg-expert-teaser:hover { border-color: #a05cf0; }
.fg-expert-tag { flex: none; font-size: 10px; font-weight: 800; letter-spacing: .14em; color: #fff; background: #a05cf0; border-radius: 6px; padding: 4px 7px; }
