/* ============================================================================
   Civic Trust — public design system (index + draw)
   Scoped under .page-shell so Sonata /admin is never affected.
   ========================================================================== */

.page-shell {
    /* ── Accent (blue by default; per-game themes override the ramp) ── */
    --accent-50:  #eff5ff;
    --accent-100: #dbe7ff;
    --accent-200: #bcd3ff;
    --accent-300: #8fb4ff;
    --accent-500: #3b6fe0;
    --accent-600: #1d4ed8;
    --accent-700: #1e40af;

    /* ── Ink / neutrals ── */
    --ink-900: #0f172a;
    --ink-700: #334155;
    --ink-500: #64748b;
    --ink-400: #94a3b8;
    --line:        #e6eaf2;
    --line-strong: #d6dce8;
    --surface:   #ffffff;
    --surface-2: #f8fafc;

    /* ── Confirmation (official result) ── */
    --ok-50:  #ecfdf5;
    --ok-200: #a7f3d0;
    --ok-600: #059669;
    --ok-700: #047857;

    /* ── Joker / bonus ball (gold — independent of the per-game accent) ── */
    --joker-50:  #fffaeb;
    --joker-200: #fde68a;
    --joker-400: #fbbf24;
    --joker-500: #f59e0b;
    --joker-600: #d97706;
    --joker-700: #b45309;

    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, system-ui, sans-serif;

    --radius:      18px;
    --radius-sm:   12px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 6px 16px rgba(15, 23, 42, 0.07), 0 18px 40px rgba(15, 23, 42, 0.06);

    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: var(--font-sans);
    color: var(--ink-900);
    background:
        radial-gradient(1200px 520px at 50% -220px, rgba(29, 78, 216, 0.06), transparent 70%),
        linear-gradient(180deg, #f6f8fc 0%, #eef1f8 100%);
    -webkit-font-smoothing: antialiased;
}

/* Per-game accent themes (applied to the shell and to index cards) */
.theme-joker {
    --accent-50:  #f6f3ff;
    --accent-100: #e9e2ff;
    --accent-200: #d6c9ff;
    --accent-300: #b69dff;
    --accent-500: #7c53e6;
    --accent-600: #6d28d9;
    --accent-700: #5b21b6;
}

.page-shell *,
.page-shell *::before,
.page-shell *::after {
    box-sizing: border-box;
}

/* Tabular figures everywhere numbers matter */
.page-shell .num {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    letter-spacing: 0.01em;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.site-header {
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1120px;
    margin: 0 auto;
    padding: 14px 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius-sm);
    padding: 4px;
    margin: -4px;
    transition: background-color 0.18s ease;
}

.brand:hover { background: rgba(15, 23, 42, 0.035); }

.brand__emblem {
    display: inline-flex;
    line-height: 0;
    filter: drop-shadow(0 2px 4px rgba(29, 78, 216, 0.18));
}

.brand__text { display: flex; flex-direction: column; line-height: 1.15; }

.brand__name {
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink-900);
}

.brand__tagline {
    font-size: 0.74rem;
    font-weight: 500;
    color: var(--ink-500);
}

.site-header__meta { display: flex; align-items: center; }

/* ── Status pill (header + draw status) ─────────────────────────────────── */

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink-700);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}

.status-pill__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ink-400);
    flex-shrink: 0;
}

.status-pill--idle .status-pill__dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16); }
.status-pill--live { color: var(--accent-700); border-color: var(--accent-200); background: var(--accent-50); }
.status-pill--live .status-pill__dot { background: var(--accent-600); box-shadow: 0 0 0 3px var(--accent-100); animation: pulse-dot 1.1s ease-in-out infinite; }
.status-pill--done { color: var(--ok-700); border-color: var(--ok-200); background: var(--ok-50); }
.status-pill--done .status-pill__dot { background: var(--ok-600); box-shadow: 0 0 0 3px var(--ok-200); }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}

/* Header meta line on the draw page */
.header-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--ink-500);
}
.header-meta__value { color: var(--ink-900); font-weight: 600; }
.header-meta__sep { width: 1px; height: 16px; background: var(--line-strong); }

/* ── Main / Footer shell ────────────────────────────────────────────────── */

.site-main { flex: 1 0 auto; display: flex; }

.site-main__inner {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 40px 24px 56px;
}

.site-footer {
    flex: 0 0 auto;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.6);
}

.site-footer__inner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    max-width: 1120px;
    margin: 0 auto;
    padding: 18px 24px;
    font-size: 0.78rem;
    color: var(--ink-500);
}

.site-footer__mark { font-weight: 700; color: var(--ink-700); }
.site-footer__note { position: relative; padding-left: 13px; }
.site-footer__note::before {
    content: "";
    position: absolute; left: 0; top: 50%;
    width: 4px; height: 4px; margin-top: -2px;
    border-radius: 50%; background: var(--line-strong);
}

/* ── Shared button ──────────────────────────────────────────────────────── */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 34px;
    font-family: var(--font-sans);
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #fff;
    background: linear-gradient(180deg, var(--accent-500), var(--accent-600));
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 6px 16px color-mix(in srgb, var(--accent-600) 34%, transparent);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.04); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 10px 24px color-mix(in srgb, var(--accent-600) 40%, transparent); }
.btn-primary:active { transform: translateY(0) scale(0.99); }
.btn-primary__icon { font-size: 0.82em; line-height: 1; }

/* ========================================================================== */
/*  INDEX — game selection                                                    */
/* ========================================================================== */

.index-intro { margin-bottom: 32px; }

.index-intro__eyebrow {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--accent-700);
    margin-bottom: 10px;
}

.index-intro__title {
    margin: 0 0 8px;
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ink-900);
}

.index-intro__lead {
    margin: 0;
    max-width: 46ch;
    font-size: 1rem;
    line-height: 1.55;
    color: var(--ink-500);
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    max-width: 760px;
}

.game-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 24px 24px 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.game-card::before {
    content: "";
    position: absolute; inset: 0 0 auto 0; height: 4px;
    background: linear-gradient(90deg, var(--accent-500), var(--accent-600));
}
.game-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-200);
    box-shadow: var(--shadow-md);
}

.game-card__head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }

.game-card__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    color: #fff;
    font-weight: 800;
    font-size: 0.92rem;
    background: linear-gradient(135deg, var(--accent-500), var(--accent-700));
    box-shadow: 0 4px 12px color-mix(in srgb, var(--accent-600) 30%, transparent);
    flex-shrink: 0;
}
.game-card__badge--symbol { font-size: 1.5rem; }

.game-card__name {
    margin: 0;
    font-size: 1.22rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink-900);
}
.game-card__spec { margin: 2px 0 0; font-size: 0.84rem; color: var(--ink-500); }

.game-card__stats {
    display: flex;
    gap: 0;
    padding: 12px 0 4px;
    margin-top: auto;
    border-top: 1px solid var(--line);
}
.game-card__stat { display: flex; flex-direction: column; gap: 2px; padding-right: 22px; }
.game-card__stat + .game-card__stat { padding-left: 22px; border-left: 1px solid var(--line); }
.game-card__stat-label {
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--ink-400);
}
.game-card__stat-value { font-size: 1.05rem; font-weight: 700; color: var(--ink-900); }

/* Joker (bonus) stat reads in gold to match the special ball */
.game-card__stat--joker .game-card__stat-label { color: var(--joker-600); }
.game-card__stat--joker .game-card__stat-value { color: var(--joker-700); }

.game-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--accent-700);
}
.game-card__cta-arrow { transition: transform 0.18s ease; }
.game-card:hover .game-card__cta-arrow { transform: translateX(3px); }

@media (max-width: 560px) {
    .site-header__inner { padding: 12px 16px; }
    .site-main__inner { padding: 28px 16px 40px; }
    .brand__tagline { display: none; }
    .index-intro__title { font-size: 1.55rem; }
    .game-grid { grid-template-columns: 1fr; }
}

/* ───────────────────────────────────────────────────────────
   Public desktop page shell
   Sticky-footer layout: header (full width) · centered main · footer
   pinned to the bottom of the viewport even when content is short.
   Header & footer are empty structural skeletons for now.
   ─────────────────────────────────────────────────────────── */

.page-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: linear-gradient(180deg, #f0f0f0 0%, #e0e0e0 100%);
}

/* ── Header (skeleton) ── */
.site-header {
    flex: 0 0 auto;
    width: 100%;
    height: 64px;
    background: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.site-header__inner {
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

/* ── Main content (centered, max-width) ── */
.site-main {
    flex: 1 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.site-main__inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
}

/* ── Footer (skeleton, pinned to bottom by the sticky-footer layout) ── */
.site-footer {
    flex: 0 0 auto;
    width: 100%;
    height: 72px;
    background: #1a1a2e;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
}

.site-footer__inner {
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .site-header__inner,
    .site-main__inner,
    .site-footer__inner {
        padding-left: 16px;
        padding-right: 16px;
    }

    .site-main__inner {
        padding-top: 20px;
        padding-bottom: 20px;
    }
}

/* ── Draw page inside the shell ──
   The draw page (.draw-page) declares min-height: 100vh for its standalone
   layout. Inside the desktop shell the surrounding .site-main already fills
   the available height, so neutralise the 100vh here to keep the sticky
   footer pinned correctly. Draw-specific styles in draw.css are untouched. */
.site-main__inner .draw-page {
    min-height: 0;
    flex: 1 0 auto;
    width: 100%;
}
