/* FlickFinders Games - shared visual identity for the dashboard and all
   four games. Built on top of hd-theme.css's tokens (--bg, --surface,
   --accent, --text, --text-dim, --line) so it matches the rest of the
   site instead of inventing a second palette. Class prefix: fg- (FlickFinders Games). */

.fg-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---- Dashboard ---- */
.fg-stats-row { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; max-width: 900px; margin: 0 auto 36px; }
.fg-stat { flex: 1 1 140px; background: var(--surface); padding: 16px; text-align: center; }
.fg-stat .hd-eyebrow { overflow-wrap: normal; } /* the sitewide "break long pasted text anywhere" safety net otherwise breaks short labels like GAMES COMPLETED mid-word in a narrow stat box */
.fg-stat-value { display: block; font-family: "Archivo Black", "Arial Narrow", Impact, sans-serif; font-size: 1.5rem; color: var(--text); margin-top: 6px; font-variant-numeric: tabular-nums; }

.fg-guest-banner { max-width: 720px; margin: 0 auto 32px; padding: 14px 20px; border: 1px dashed var(--line); border-radius: 6px; color: var(--text-dim); text-align: center; font-size: 0.94rem; }
.fg-guest-banner a { color: var(--accent); font-weight: 600; text-decoration: none; margin-left: 4px; }
.fg-guest-banner.fg-yesterday { border-style: solid; }

.fg-game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; max-width: 1080px; margin: 0 auto 32px; }
.fg-game-card {
    position: relative; display: flex; flex-direction: column; gap: 10px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
    padding: 48px 20px 20px; text-decoration: none; color: var(--text);
    transition: transform .15s ease, border-color .15s ease;
}
.fg-game-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.fg-game-card.fg-disabled { opacity: .5; pointer-events: none; }
.fg-game-head { display: flex; align-items: center; gap: 12px; }
.fg-game-icon { font-size: 1.8rem; line-height: 1; flex: 0 0 auto; }
.fg-game-title { font-weight: 700; font-size: 1.05rem; }
.fg-game-blurb { color: var(--text-dim); font-size: 0.88rem; line-height: 1.45; }
/* Status badge sits in its own reserved strip at the top of the card
   (padding-top: 48px above) rather than squeezed into the same row as
   the icon/title, which used to leave almost no width for the text and
   forced it to wrap letter-by-letter on anything but a very wide card. */
.fg-game-status { position: absolute; top: 14px; right: 16px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 5px 10px; border-radius: 20px; border: 1px solid var(--line); text-align: center; white-space: nowrap; }
.fg-status-not_started { color: var(--accent); border-color: var(--accent); }
.fg-status-in_progress { color: #6ea8fe; border-color: #6ea8fe; }
.fg-status-won { color: #4caf50; border-color: #4caf50; }
.fg-status-lost { color: var(--text-dim); }
.fg-status-unavailable { color: var(--text-faint); }
.fg-game-score { display: block; margin-top: 4px; font-size: 0.72rem; color: var(--text-dim); font-weight: 400; }

.fg-actions-row { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; }

/* ---- Shared in-game layout (Quote Challenge / Scene Reveal / Actor Chain) ---- */
.fg-game-wrap { max-width: 560px; margin: 0 auto 48px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 28px 24px; }
.fg-game-header { text-align: center; margin-bottom: 20px; }
.fg-game-header h1 { font-size: 1.6rem; margin: 6px 0 4px; }
.fg-game-header .fg-sub { color: var(--text-dim); font-size: 0.9rem; }
.fg-progress-dots { display: flex; gap: 6px; justify-content: center; margin: 14px 0; }
.fg-progress-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.fg-progress-dots span.fg-dot-ok { background: #4caf50; }
.fg-progress-dots span.fg-dot-no { background: var(--accent-2, #7d2233); }
.fg-progress-dots span.fg-dot-current { background: var(--accent); }

.fg-answer-row { display: flex; gap: 10px; margin-top: 16px; position: relative; }
.fg-answer-row input[type="text"] { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 13px 14px; font-size: 1rem; }
.fg-answer-row input[type="text"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.fg-answer-row button { background: var(--accent); border: none; border-radius: 8px; color: #1a1200; font-weight: 700; padding: 0 22px; font-size: 0.98rem; cursor: pointer; min-height: 46px; }
.fg-answer-row button:disabled { opacity: .6; cursor: not-allowed; }
.fg-suggestions { position: absolute; top: 100%; left: 0; right: 90px; background: var(--surface-2, var(--surface)); border: 1px solid var(--line); border-radius: 8px; margin-top: 4px; z-index: 5; max-height: 240px; overflow-y: auto; }
.fg-suggestions div[role="option"] { padding: 10px 14px; font-size: 0.92rem; cursor: pointer; }
.fg-suggestions div[role="option"]:hover, .fg-suggestions div[role="option"].fg-active { background: var(--line); }

.fg-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
@media (max-width: 480px) { .fg-choice-grid { grid-template-columns: 1fr; } }
.fg-choice-btn { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 14px 16px; font-size: 0.98rem; cursor: pointer; text-align: left; min-height: 48px; transition: border-color .15s ease, background .15s ease; }
.fg-choice-btn:hover:not(:disabled) { border-color: var(--accent); }
.fg-choice-btn:disabled { cursor: default; }
.fg-choice-btn.fg-correct { border-color: #4caf50; background: rgba(76,175,80,.12); }
.fg-choice-btn.fg-incorrect { border-color: var(--accent-2, #7d2233); background: rgba(125,34,51,.15); }

.fg-feedback { min-height: 22px; margin-top: 10px; font-size: 0.9rem; color: var(--text-dim); }
.fg-feedback[data-tone="good"] { color: #4caf50; font-weight: 600; }
.fg-feedback[data-tone="bad"] { color: #e08585; font-weight: 600; }

.fg-hint-btn { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 1px dashed var(--line); color: var(--text-dim); border-radius: 20px; padding: 8px 16px; font-size: 0.85rem; cursor: pointer; margin-top: 14px; min-height: 40px; }
.fg-hint-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.fg-hint-btn:disabled { opacity: .5; cursor: not-allowed; }

.fg-scene-frame { position: relative; width: 100%; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; background: var(--bg); margin-bottom: 6px; border: 1px solid var(--line); }
.fg-scene-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

.fg-chain-path { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0; font-size: 0.9rem; }
.fg-chain-node { background: var(--bg); border: 1px solid var(--line); border-radius: 20px; padding: 7px 14px; }
.fg-chain-node.fg-target { border-color: var(--accent); color: var(--accent); }
.fg-chain-arrow { color: var(--text-faint); }

.fg-end-panel { text-align: center; margin-top: 20px; }
.fg-end-panel h2 { font-size: 1.5rem; margin: 6px 0 8px; }
.fg-end-panel .fg-score-line { color: var(--accent); font-weight: 700; margin-bottom: 4px; }
.fg-sharebox { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 14px 0; font-family: ui-monospace, monospace; font-size: 0.88rem; white-space: pre-wrap; text-align: left; }
.fg-end-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.fg-end-btns a, .fg-end-btns button { flex: 1; min-width: 140px; text-align: center; text-decoration: none; padding: 13px 0; border-radius: 8px; font-size: 0.95rem; font-weight: 600; cursor: pointer; border: 1px solid var(--line); background: transparent; color: var(--text); }
.fg-end-btns .fg-primary { background: var(--accent); color: #1a1200; border-color: var(--accent); }

.fg-footer-link { display: block; text-align: center; margin-top: 26px; color: var(--text-dim); font-size: 0.85rem; text-decoration: none; }
.fg-footer-link:hover { color: var(--accent); }

.fg-empty-state, .fg-error-state { text-align: center; color: var(--text-dim); padding: 30px 10px; }

@media (max-width: 600px) {
    /* The mobile nav is three stacked rows (logo, search bar, social+login)
       - noticeably taller than the 120px .hd-page assumes sitewide, hiding
       the top of every game page's own header behind it. Scoped to
       .hd-page.fg-page (higher specificity than the plain .hd-page rule)
       so this doesn't affect any other page that uses .hd-page. */
    .hd-page.fg-page { margin-top: 190px; }
    .fg-page .hd-title.hd-display { font-size: 1.5rem !important; }
    .fg-game-wrap { padding: 22px 16px; margin: 0 12px 40px; }
    .fg-stats-row { max-width: 100%; margin: 0 12px 28px; }
    .fg-stat { padding: 10px 8px; flex-basis: 30%; }
    .fg-stat-value { font-size: 1.2rem; }
    .fg-game-grid { grid-template-columns: 1fr; margin: 0 12px 28px; gap: 14px; }
    .fg-game-card { padding: 44px 16px 16px; }
    .fg-guest-banner { margin: 0 12px 24px; }
    .fg-actions-row { padding: 0 12px; }
    .fg-actions-row a, .fg-actions-row button { flex: 1 1 auto; }

    .fg-lb-table th, .fg-lb-table td { padding: 9px 8px; font-size: 0.85rem; }
    .fg-lb-tabs { padding: 0 12px; }
    .fg-lb-tabs a { padding: 6px 12px; font-size: 0.8rem; }

    .fg-chain-path { font-size: 0.82rem; }
    .fg-choice-btn { padding: 12px 14px; font-size: 0.92rem; }
    .fg-suggestions { right: 0; }
    .fg-answer-row button { padding: 0 16px; font-size: 0.9rem; }
}

@media (max-width: 360px) {
    .fg-stat { flex-basis: 45%; }
}

@media (prefers-reduced-motion: reduce) {
    .fg-game-card, .hd-page.fg-page { animation: none !important; transition: none !important; }
}
