/* ============================================================================
   Bertrand — Blazor WebClient Theme
   Mirrors the MAUI app's visual design using CSS
   ============================================================================ */

/* Inter (UI) + Raleway (tile titles / wordmark) are loaded via a render-blocking <link> in
   index.html <head> (matches the design mockups; avoids the @import system-font flash). */

/* ── CSS Variables (from NTDesignTokens.cs) ─────────────────────────────────── */
:root {
    /* Background */
    --bg-app: #1a1a1a;
    --bg-gradient: url('../images/topicbackground.png') center/cover no-repeat;

    /* Card gradients */
    --card-gradient: linear-gradient(135deg, #082a52 0%, #0b3468 50%, #0e3d78 100%);
    --action-tile-gradient: linear-gradient(135deg, #0f4280 0%, #1456a0 50%, #1a68b8 100%);

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: rgba(255,255,255,0.72);
    --text-dimmed: rgba(255,255,255,0.45);
    --text-disabled: rgba(255,255,255,0.55);

    /* Surfaces */
    --surface-light: rgba(255,255,255,0.10);
    --surface-lighter: rgba(255,255,255,0.18);

    /* Borders */
    --border-light: rgba(255,255,255,0.15);
    --border-subtle: rgba(255,255,255,0.10);

    /* Breadcrumbs */
    --bc-active: rgba(255,255,255,0.14);
    --bc-inactive: rgba(255,255,255,0.07);

    /* Level pill colors — canonical palette (mirrors MAUI LevelOps.LevelColor) */
    --level-entry-bg: #3ddc84;
    --level-entry-border: #2ec971;
    --level-entry-text: #0b5c31;
    --level-expert-bg: #ffb020;
    --level-expert-border: #e09400;
    --level-expert-text: #6b4400;
    --level-guru-bg: #f26a5a;
    --level-guru-border: #e0503f;
    --level-guru-text: #7a1e14;

    /* Match tile accent colors */
    --match-gold: #f2c15e;
    --match-winner-name: #ffe9b0;
    --match-play-green: #6ee7a0;
    --match-forfeit-red: #ff7777;

    /* Validation colors */
    --valid-green: #4CAF50;
    --invalid-red: #F87171;

    /* Button glass fills (from NTButtonStyles) */
    --btn-normal-bg: rgba(255,255,255,0.72);
    --btn-normal-stroke: rgba(255,255,255,0.55);
    --btn-disabled-bg: rgba(255,255,255,0.38);
    --btn-disabled-stroke: rgba(255,255,255,0.35);
    --btn-error-bg: rgba(255,246,248,0.86);
    --btn-error-stroke: rgba(220,30,60,0.55);
    --btn-pressed-bg: rgba(200,238,216,0.92);
    --btn-pressed-stroke: rgba(34,168,97,0.45);

    /* Answer button */
    --answer-bg: rgba(255,255,255,0.20);
    --answer-right-bg: #0B4126;
    --answer-right-stroke: #66FF8C;
    --answer-wrong-bg: #44171D;
    --answer-wrong-stroke: #F53D5C;
    --answer-done-bg: rgba(0,0,0,0.40);

    /* Correct/Wrong gradients */
    --correct-gradient: linear-gradient(90deg, #050505 0%, #18CC4C 100%);
    --wrong-gradient: linear-gradient(90deg, #050505 0%, #CC1818 100%);

    /* Radii */
    --radius-card: 16px;
    --radius-button: 10px;
    --radius-pill: 20px;
    --radius-answer: 10px;

    /* Sizing */
    --phone-width: 430px;
    --btn-height: 48px;
}

/* ── Global Reset ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-app);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── App Shell ───────────────────────────────────────────────────────────────── */
.app-shell {
    width: 100%;
    max-width: var(--phone-width);
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-gradient);
    position: relative;
    overflow-x: hidden;
}

/* ── Menu Overlay ────────────────────────────────────────────────────────────── */
.menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99;
}
.menu-dropdown {
    /* Anchored to .app-shell (position:relative), not the viewport, so it drops from the menu icon's
       top-left corner (overlaying it) on both mobile and centered-desktop layouts. */
    position: absolute;
    top: 8px;
    left: 8px;
    min-width: 180px;
    background: #16213e;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-button);
    padding: 6px 0;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.menu-item {
    display: block;
    padding: 10px 24px;
    cursor: pointer;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
}
.menu-item:hover { background: var(--surface-lighter); color: var(--text-primary); }
.menu-user { color: var(--text-dimmed); cursor: default; font-size: 13px; }
.menu-user:hover { background: transparent; color: var(--text-dimmed); }
.menu-divider { height: 1px; background: var(--border-light); margin: 4px 0; }
/* Avatar dropdown (top-right, anchored to the header avatar button) */
.avatar-dropdown {
    position: fixed;
    top: 64px;
    right: 12px;
    min-width: 160px;
    background: #16213e;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-button);
    padding: 6px 0;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

/* ── Page Container ──────────────────────────────────────────────────────────── */
.page { padding: 16px; }

/* ── Page Header ─────────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 4px 0;
}
.page-header .menu-logo {
    width: 36px;
    height: 36px;
    cursor: pointer;
    border-radius: 7px;
    flex-shrink: 0;
    transition: opacity 0.2s;
}
.page-header .menu-logo:hover { opacity: 0.8; }
.page-header h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
    flex: 1;
}
.page-header .header-icon {
    font-family: 'Georgia', serif;
    font-style: italic;
    font-size: 32px;
    color: var(--text-secondary);
}
/* ── Header Bar (variant A: single full-bleed row + accent underline) ──────── */
.header-bar {
    position:relative; display:flex; align-items:center; gap:12px;
    margin:0; padding:14px 16px 16px;
    background:linear-gradient(180deg, rgba(5,13,18,0.96), rgba(6,16,22,0.86));
}
.header-bar::after {
    content:""; position:absolute; left:0; right:0; bottom:0; height:2px;
    background:linear-gradient(90deg, transparent, var(--header-accent,#63D2EA) 50%, transparent);
}
.header-bar-top { display:flex; align-items:center; justify-content:space-between; }
.header-bar-menu {
    width:48px; height:48px; background:rgba(255,255,255,0.07);
    border:1px solid rgba(255,255,255,0.12); border-radius:13px;
    display:flex; align-items:center; justify-content:center;
    flex-shrink:0; cursor:pointer; transition:opacity 0.2s;
    box-shadow:inset 0 1px 0 rgba(255,255,255,0.15);
}
.header-bar-menu:hover { opacity:0.8; }
.header-bar-b { width:32px; height:32px; border-radius:4px; }
.header-help-icon {
    font-size:20px; font-weight:700; color:rgba(255,255,255,0.8);
}
.header-bar-mid { flex:1; min-width:0; text-align:center; }
.header-bar-title {
    font-size:22px; font-weight:700; color:white; letter-spacing:0.2px;
    line-height:1.1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
/* Compact variant — inviting landing title kept for compatibility (Topics now uses ContextLine). */
.header-bar-title.header-bar-title-compact {
    font-size:16px; font-weight:600; letter-spacing:normal; line-height:1.3;
}
.header-bar-context {
    font-size:16px; color:rgba(255,255,255,0.82); margin-top:2px;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.header-bar-right { flex-shrink:0; display:flex; align-items:center; }
.header-bar-spacer { width:48px; height:48px; }
.header-bar-user { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.header-bar-username { font-size:13px; font-weight:600; color:rgba(255,255,255,0.7); }
.header-bar-avatar {
    width:48px; height:48px; border-radius:13px;
    border:2px solid var(--header-accent,#63D2EA); object-fit:cover;
    cursor:pointer; transition:opacity 0.2s;
}
.header-bar-avatar:hover { opacity:0.85; }

/* User badge in header */
.challenge-badge {
    display:flex; align-items:center; gap:5px; cursor:pointer;
    padding:4px 12px; border-radius:20px; flex-shrink:0;
    background:rgba(74,222,128,0.15); border:1px solid rgba(74,222,128,0.5);
    transition:background 0.15s;
    animation:challenge-pulse 2s ease-in-out infinite;
}
.challenge-badge:hover { background:rgba(74,222,128,0.25); }
.challenge-badge-count {
    font-family:'Inter',sans-serif; font-weight:800; font-size:14px;
    color:#4ADE80; min-width:18px; text-align:center;
}
.challenge-badge-text {
    font-family:'Inter',sans-serif; font-weight:600; font-size:12px;
    color:#4ADE80;
}
@keyframes challenge-pulse {
    0%, 100% { border-color:rgba(74,222,128,0.5); }
    50% { border-color:rgba(74,222,128,0.9); }
}
.your-turn-badge {
    display:flex; align-items:center; gap:5px; cursor:pointer;
    padding:4px 12px; border-radius:20px; flex-shrink:0;
    background:rgba(164,201,255,0.15); border:1px solid rgba(164,201,255,0.5);
    transition:background 0.15s;
    animation:turn-pulse 2s ease-in-out infinite;
}
.your-turn-badge:hover { background:rgba(164,201,255,0.25); }
.your-turn-badge .challenge-badge-count { color:#a4c9ff; }
.your-turn-badge .challenge-badge-text { color:#a4c9ff; }
@keyframes turn-pulse {
    0%, 100% { border-color:rgba(164,201,255,0.5); }
    50% { border-color:rgba(164,201,255,0.9); }
}
.user-badge {
    display:flex; align-items:center; gap:8px; cursor:pointer;
    padding:4px 10px 4px 4px; border-radius:20px;
    background:rgba(255,255,255,0.06); border:0.5px solid rgba(255,255,255,0.12);
    transition:background 0.15s; flex-shrink:0;
}
.user-badge:hover { background:rgba(255,255,255,0.12); }
.user-badge-avatar {
    width:32px; height:32px; border-radius:50%; object-fit:cover;
}
.user-badge-placeholder {
    width:32px; height:32px; border-radius:50%;
    background:rgba(164,201,255,0.2); color:#a4c9ff;
    display:flex; align-items:center; justify-content:center;
    font-weight:700; font-size:14px;
}
.user-badge-name {
    font-size:13px; color:#c1c7d3; font-weight:500;
}

/* ── Breadcrumbs ─────────────────────────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 4px;
    margin-bottom: 16px;
    scrollbar-width: none;
}
.breadcrumb::-webkit-scrollbar { display: none; }
.breadcrumb .bc-pill {
    display: inline-flex;
    align-items: center;
    height: 52px;
    padding: 0 16px;
    background: var(--bc-active);
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}
.breadcrumb .bc-pill:hover { background: var(--surface-lighter); color: var(--text-primary); }
.breadcrumb .bc-sep {
    color: var(--text-dimmed);
    font-size: 12px;
    flex-shrink: 0;
}

/* ── Glass Buttons (3D rim effect via CSS) ───────────────────────────────────── */
.nt-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: var(--btn-height);
    padding: 10px 16px;
    border-radius: var(--radius-button);
    border: 1px solid var(--btn-normal-stroke);
    background: var(--btn-normal-bg);
    color: rgba(10,10,10,0.88);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.1s, box-shadow 0.15s;
    text-align: center;
    line-height: 1.3;
}
/* 3D rim up (convex — normal state) */
.nt-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        180deg,
        rgba(255,255,255,0.42) 0%,
        rgba(255,255,255,0.18) 30%,
        rgba(255,255,255,0.04) 58%,
        transparent 75%,
        transparent 82%,
        rgba(0,0,0,0.06) 92%,
        rgba(0,0,0,0.15) 100%
    );
    pointer-events: none;
}
.nt-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.nt-btn:active {
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}
/* 3D rim down (concave — pressed) override */
.nt-btn:active::before {
    background: linear-gradient(
        180deg,
        rgba(0,0,0,0.28) 0%,
        rgba(0,0,0,0.12) 30%,
        transparent 58%,
        transparent 75%,
        rgba(255,255,255,0.14) 88%,
        rgba(255,255,255,0.30) 100%
    );
}

.nt-btn.disabled {
    background: var(--btn-disabled-bg);
    border-color: var(--btn-disabled-stroke);
    color: rgba(20,20,20,0.55);
    cursor: not-allowed;
    pointer-events: none;
}
.nt-btn.error-state {
    background: var(--btn-error-bg);
    border-color: var(--btn-error-stroke);
    color: #D9213C;
}
.nt-btn.pressed-valid {
    background: var(--btn-pressed-bg);
    border-color: var(--btn-pressed-stroke);
    color: rgba(10,10,10,0.88);
}

/* ── Action Tiles (Daily Challenge, Play a Favorite) ─────────────────────────── */
.action-tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
.action-tile {
    background: var(--action-tile-gradient);
    border-radius: var(--radius-card);
    padding: 16px;
    border: 1px solid var(--border-light);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s;
}
.action-tile::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 120px; height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    pointer-events: none;
}
.action-tile:hover { transform: translateY(-2px); }
.action-tile .tile-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.action-tile .tile-subtitle { font-size: 13px; color: rgba(255,255,255,0.7); }

/* ── Topic Cards ─────────────────────────────────────────────────────────────── */
.topic-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
/* Daily Challenge hero (teal) */
.daily-hero {
    display: flex; align-items: center; gap: 14px; width: 100%;
    margin-bottom: 12px; padding: 16px 18px; border: none; cursor: pointer;
    border-radius: 16px; text-align: left; color: #fff;
    background: linear-gradient(135deg, #0e8f8f, #0a5560);
    box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}
.daily-hero .daily-icon { font-size: 28px; line-height: 1; }
.daily-hero .daily-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.daily-hero .daily-title { font-size: 20px; font-weight: 800; }
.daily-hero .daily-sub { font-size: 13px; color: rgba(255,255,255,0.85); }
.daily-hero .daily-go { font-size: 28px; color: rgba(255,255,255,0.8); }
/* My Favorites | All Topics toggle (neutral active — green reserved for Play) */
.fav-all-toggle { display: flex; gap: 8px; margin-bottom: 14px; }
.fa-seg {
    flex: 1; min-height: 52px; border-radius: 10px; cursor: pointer;
    background: transparent; border: 1px solid rgba(255,255,255,0.2); color: #fff;
    font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.fa-seg.active { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.4); }
.fa-seg .fa-icon { font-size: 15px; }
/* Compact search icon at the right of the Favorites/All row (replaces the old floating FAB). */
.fa-search {
    flex: 0 0 52px; min-height: 52px; border-radius: 10px; cursor: pointer;
    background: transparent; border: 1px solid rgba(255,255,255,0.2); color: #fff;
    font-size: 20px; display: flex; align-items: center; justify-content: center;
}
.fa-search:hover { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.4); }
/* Search FAB (removed from markup; kept for any lingering reference) */
.search-fab {
    position: fixed; right: 20px; bottom: 20px; z-index: 40;
    width: 60px; height: 60px; border-radius: 50%; cursor: pointer;
    background: #1e2a38; border: 1px solid rgba(255,255,255,0.22);
    box-shadow: 0 8px 22px rgba(0,0,0,0.5); color: #fff; font-size: 26px;
}
.topic-card {
    background: var(--card-gradient);
    border-radius: var(--radius-card);
    padding: 20px;
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}
.topic-card::before {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 100px; height: 100px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    pointer-events: none;
}
.topic-card::after {
    content: '';
    position: absolute;
    bottom: -50px; left: 30%;
    width: 140px; height: 140px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    pointer-events: none;
}
.topic-card .card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}
.topic-card .card-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}
.topic-card .card-heart {
    font-size: 20px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.topic-card .card-heart:hover { opacity: 1; }
.topic-card .card-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 14px;
    min-height: calc(14px * 1.5 * 4); /* Reserve 4 lines */
}
.topic-card .card-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── Obsidian Stage Topic Cards ──────────────────────────────────────────────── */
.obsidian-card {
    background: rgba(19, 19, 19, 0.85);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    overflow: hidden;
    border: 0.5px solid rgba(255, 255, 255, 0.1);
}
.obsidian-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 7;   /* shorter banner for single-column (was 9/5) */
    overflow: hidden;
    background: #1b1b1b;
    min-height: 120px;
}
.obsidian-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.obsidian-card-colorwash {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0.25;
    pointer-events: none;
}
.obsidian-card-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(transparent, rgba(19,19,19,0.7));
    pointer-events: none;
}
.obsidian-card-overlay {
    position: absolute;
    bottom: 8px;
    left: 14px;
    /* Small reserve on the right for the bare "›" chevron; the narrow chevron leaves the title most
       of the width (was 88px for the wider "Explore ›" pill, which truncated titles too early). */
    right: 44px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}
.obsidian-level-pill {
    background: rgba(0, 0, 0, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    padding: 5px 14px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    border-radius: 6px !important;
    position: absolute;
    top: 10px;
    left: 12px;
    z-index: 2;
}
.obsidian-level-prefix { color: #fff !important; font-weight: 700; }
.obsidian-level-pill.entry { color: #3ddc84 !important; }
.obsidian-level-pill.expert { color: #ffb020 !important; }
.obsidian-level-pill.guru { color: #f26a5a !important; }
.obsidian-level-cycle {
    opacity: 0.55;
    font-weight: 400;
    margin-left: 2px;
}
.obsidian-card-title {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}
/* Immediate-parent caption above the title, so same-named sub-topics under different parents
   (e.g. British-TV vs U.S.-TV "1970s Sitcoms") read differently in text, not just via the art. */
.obsidian-card-parent {
    display: block;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: rgba(255,255,255,0.72);
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.obsidian-card-heart {
    position: absolute;
    top: 4px;
    right: 6px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 27px;
    line-height: 1;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    z-index: 2;
}
.obsidian-card-heart:hover { color: rgba(255,255,255,0.9); }
.obsidian-card-heart.favorited { color: #ff5050; opacity: 1; }
/* Remove-favorite confirmation overlay — covers the whole card; Yes removes + drops the tile, No dismisses. */
.obsidian-card { position: relative; }
.obsidian-card-confirm {
    position: absolute; inset: 0; z-index: 10;
    background: rgba(0,0,0,0.82); border-radius: 16px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 20px;
}
.occ-msg { color: #fff; font: 700 16px 'Inter', sans-serif; text-align: center; }
.occ-btns { display: flex; gap: 14px; }
.occ-btn { min-width: 84px; padding: 8px 20px; border-radius: 10px; cursor: pointer; font: 700 16px 'Inter', sans-serif; color: #fff; border: 0.5px solid rgba(255,255,255,0.25); }
.occ-no { background: #3A3A3A; }
.occ-yes { background: #C0392B; }
.obsidian-card-explore {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 2px;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    z-index: 2;
    pointer-events: none;
}
/* Redesign: two-button row (Explore + Play); leaf topics / Daily use .solo (Play only). */
.obsidian-card-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px 8px 10px;
}
.obsidian-card-buttons.solo { grid-template-columns: 1fr; }
/* ☰ overflow menu (Leaderboard / Start a Match) on the image */
.obsidian-card-menu {
    position: absolute; bottom: 8px; right: 8px; z-index: 3;
    width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
    font-size: 17px; color: #fff; background: rgba(0,0,0,0.48);
    border: 1px solid rgba(255,255,255,0.3); border-radius: 9px; cursor: pointer;
}
.obsidian-card-imgquiz {
    position: absolute; bottom: 8px; right: 50px; z-index: 3;
    width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
    font-size: 17px; color: #2dd4bf; background: rgba(0,0,0,0.48);
    border: 1px solid rgba(255,255,255,0.3); border-radius: 9px; cursor: pointer;
}
.obsidian-card-menuinfo {
    position: absolute; inset: 0; z-index: 6;
    background: rgba(4,12,20,0.9);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; padding: 16px;
}
.obsidian-card-menuinfo .mi-btn {
    width: 100%; max-width: 260px; min-height: 46px; border-radius: 11px; cursor: pointer;
    border: 1px solid rgba(255,255,255,0.22); background: rgba(255,255,255,0.07); color: #fff;
    font: 600 16px 'Inter', sans-serif; display: flex; align-items: center; justify-content: center; gap: 10px;
}
.obsidian-card-menuinfo .mi-icon { width: 20px; height: 20px; }
.obsidian-card-menuinfo .mi-glyph { display: flex; align-items: center; justify-content: center; font-size: 18px; color: #2dd4bf; }
.obsidian-card-descinfo {
    position: absolute; inset: 0; z-index: 5;
    background: linear-gradient(to bottom, transparent 0%, transparent 35%, rgba(6,10,20,0.95) 100%);
    display: flex; align-items: flex-end; justify-content: center; text-align: center;
    padding: 0 16px 14px; color: #fff; font-size: 15px; line-height: 1.4; cursor: pointer;
}
/* Play is the primary action → filled green; Explore stays the dark ghost button. */
.obsidian-btn-play { background: rgba(52,211,153,0.22); border-color: #34d399; }
.obsidian-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 12px;
    min-height: 56px;
    background: #2a2a2a;
    border: 0.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    white-space: nowrap;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
    text-align: left;
}
.obsidian-btn:hover {
    background: #353535;
    border-color: rgba(255, 255, 255, 0.25);
}
.obsidian-btn:active {
    background: rgba(164, 201, 255, 0.15);
    border-color: rgba(164, 201, 255, 0.4);
    box-shadow: 0 0 8px rgba(164, 201, 255, 0.1);
    transform: scale(0.98);
}
.btn-icon {
    width: 18px;
    height: 18px;
    opacity: 0.7;
    flex-shrink: 0;
}

/* ── Level Pill ──────────────────────────────────────────────────────────────── */
.level-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.level-pill.entry { background: var(--level-entry-bg); border: 1px solid var(--level-entry-border); color: var(--level-entry-text); font-weight: 700; }
.level-pill.expert { background: var(--level-expert-bg); border: 1px solid var(--level-expert-border); color: var(--level-expert-text); font-weight: 700; }
.level-pill.guru { background: var(--level-guru-bg); border: 1px solid var(--level-guru-border); color: var(--level-guru-text); font-weight: 700; }
.level-pill.clickable { cursor: pointer; transition: opacity 0.2s; }
.level-pill.clickable:hover { opacity: 0.8; }

/* ── Obsidian Quiz Page ──────────────────────────────────────────────────────── */
.oq-page { background-color:#000; max-width:430px; height:100vh; max-height:932px; margin:0 auto; padding-bottom:16px; display:flex; flex-direction:column; position:relative; overflow:hidden; border-radius:16px; }
.oq-page > * { position:relative; z-index:1; }
.oq-bg { position:absolute; bottom:0; left:0; right:0; height:100%; background-size:cover; background-position:bottom center; pointer-events:none; z-index:0; transition:opacity 0.4s ease; }
/* .obsidian-splash / .splash-bg removed — Quiz.razor and Leaderboard.razor now use .nt-splash. */

/* ── Bertrand splash / status composite ───────────────────────────────────────
   Web counterpart of NTTypesMAUI.NTSplashFactory. Same tokens, same geometry:
   radial ground, cyan halo behind the head, line-art portrait, wordmark or
   status word, accent rule or sweeping bar, vignette.

   Markup:
     <div class="nt-splash">                          full brand splash
       <img class="nt-splash-portrait" src="images/bertrandtransparent.png" alt="" />
       <div class="nt-splash-type">
         <div class="nt-splash-wordmark">Bertrand</div>
         <div class="nt-splash-rule"></div>
         <div class="nt-splash-tagline">Know What You Know</div>
       </div>
     </div>

     <div class="nt-splash nt-splash--status">     status screen
       <img class="nt-splash-portrait" src="images/bertrandtransparent.png" alt="" />
       <div class="nt-splash-type">
         <div class="nt-splash-status">Preparing</div>
         <div class="nt-splash-bar"><i></i></div>
       </div>
     </div>
   ─────────────────────────────────────────────────────────────────────────── */
:root {
    --splash-ground-centre:#172833;
    --splash-ground-mid:#101B23;
    --splash-ground-edge:#0A1116;
    --splash-accent:#63D2EA;
    --splash-accent-deep:#2B94AD;
    --splash-bone:#F0F9FB;
    --splash-muted:#93AAB2;
}
.nt-splash {
    position:relative; width:100%; height:100%; min-height:60vh; overflow:hidden;
    display:flex; flex-direction:column; align-items:center;
    background:radial-gradient(92% 54% at 50% 34%,
        var(--splash-ground-centre) 0%, var(--splash-ground-mid) 50%, var(--splash-ground-edge) 100%);
}
/* cyan halo behind the head — the layer that stops the line-art reading as a cut-out */
.nt-splash::before {
    content:""; position:absolute; inset:0; pointer-events:none;
    background:radial-gradient(46% 30% at 50% 31%, rgba(99,210,234,0.24), transparent 72%);
}
/* edge vignette */
.nt-splash::after {
    content:""; position:absolute; inset:0; pointer-events:none;
    background:radial-gradient(120% 80% at 50% 40%, transparent 46%, rgba(0,0,0,0.50) 100%);
}
/* Vertical values are svh, not %: percentage margins resolve against the container's *inline*
   size, which would put the portrait at ~3% of height instead of 6.5% and float the whole
   composition higher than the MAUI build. svh also survives hosts whose parent has no resolved
   height (Leaderboard's .app-shell is min-height only), where a % max-height computes to none. */
/* An <img>, not a masked div: the mask approach needed the source aspect ratio hardcoded, which
   silently letterboxes whenever the asset is recropped. object-fit:contain derives it from the
   file, and rendering the raw white line art matches what MAUI's Image does rather than diverging
   from it by tinting. */
.nt-splash-portrait {
    position:relative; z-index:1; display:block;
    margin-top:6.5svh; width:84%; flex:0 1 auto; max-height:71svh;
    object-fit:contain; object-position:center; opacity:1;
}
.nt-splash--status .nt-splash-portrait { margin-top:5svh; width:76%; opacity:0.68; }
.nt-splash-type {
    position:relative; z-index:1; flex:1 1 auto; width:100%;
    display:flex; flex-direction:column; align-items:center; justify-content:center;
}
.nt-splash-wordmark {
    font-family:"Space Grotesk", system-ui, sans-serif; font-weight:500; font-size:17px;
    letter-spacing:0.30em; text-indent:0.30em; text-transform:uppercase; color:var(--splash-bone);
}
.nt-splash-rule { width:34px; height:1px; margin-top:12px; background:var(--splash-accent); }
.nt-splash-tagline {
    margin-top:14px; font-family:"Space Grotesk", system-ui, sans-serif; font-weight:400;
    font-size:9.5px; letter-spacing:0.18em; text-indent:0.18em; text-transform:uppercase;
    color:var(--splash-muted);
}
.nt-splash-status {
    font-family:"Space Grotesk", system-ui, sans-serif; font-weight:500; font-size:14px;
    letter-spacing:0.34em; text-indent:0.34em; text-transform:uppercase; color:var(--splash-bone);
}
.nt-splash-bar {
    position:relative; width:96px; height:2px; margin-top:18px; border-radius:2px;
    background:rgba(240,249,251,0.14); overflow:hidden;
}
.nt-splash-bar i {
    position:absolute; top:0; height:100%; width:38%; border-radius:2px;
    background:var(--splash-accent); animation:nt-splash-sweep 1.6s ease-in-out infinite;
}
@keyframes nt-splash-sweep { 0% { left:-40%; } 100% { left:100%; } }
@media (prefers-reduced-motion: reduce) {
    .nt-splash-bar i { animation:none; left:31%; }
}
.oq-header {
    position:relative; display:flex; align-items:center; gap:12px;
    padding:12px 16px 14px;
    background:linear-gradient(180deg, rgba(5,13,18,0.96), rgba(6,16,22,0.86));
}
/* 2px accent underline, tinted with the current level (uses the existing .oq-topic palette). */
.oq-header::after {
    content:""; position:absolute; left:0; right:0; bottom:0; height:2px;
    background:linear-gradient(90deg, transparent, var(--oq-accent,#4db6ff) 50%, transparent);
}
.oq-header.entry  { --oq-accent:#3ddc84; }
.oq-header.expert { --oq-accent:#ffb020; }
.oq-header.guru   { --oq-accent:#f26a5a; }
/* "No topics found" bar shown over the Daily/Favorites/All row when a search returns nothing. */
.no-results-bar {
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    margin:4px 12px 10px; padding:12px 16px;
    background:#0e0e0e; border:1px solid rgba(255,255,255,0.2); border-radius:10px;
    color:#fff; font-weight:700; font-size:15px;
}
.no-results-bar .no-results-ok { width:auto; min-height:0; padding:8px 20px; font-size:14px; }
.oq-logo { width:36px; height:36px; border-radius:8px; cursor:pointer; }
/* In-game menu box: 48x48 rounded variant-A box (faint fill + hairline + inset highlight) with a
   32px glyph. Scoped so the decorative .oq-logo on the shareable ScoreTile stays 36px. */
.oq-menu-btn { width:48px; height:48px; border-radius:13px; background:rgba(255,255,255,0.07);
    border:1px solid rgba(255,255,255,0.12); box-shadow:inset 0 1px 0 rgba(255,255,255,0.15);
    display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0; }
.oq-menu-btn .oq-logo { width:32px; height:32px; }
.oq-title { font-size:22px; font-weight:700; color:#e2e2e2; letter-spacing:-0.3px; margin-left:auto; }
/* Consolidated header topic: the game topic tinted its level colour, tappable to cycle the level.
   The caption above names the current level with a ⟳ cycle glyph (also level-coloured, inherited).
   min-width:0 + ellipsis so a long topic can't push the header off a narrow screen. */
.oq-topic { flex:1; min-width:0; display:flex; flex-direction:column; cursor:pointer; }
.oq-topic.entry  { color:#3ddc84; }
.oq-topic.expert { color:#ffb020; }
.oq-topic.guru   { color:#f26a5a; }
.oq-topic-cap  { font-size:13px; font-weight:700; letter-spacing:1px; text-transform:uppercase; color:inherit; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.oq-topic-name-row { display:flex; align-items:baseline; gap:6px; min-width:0; }
.oq-topic-parent { font-size:12px; font-weight:700; letter-spacing:1px; text-transform:uppercase; color:rgba(255,255,255,0.7); white-space:nowrap; flex-shrink:0; }
.oq-topic-name { font-size:16px; font-weight:700; color:inherit; line-height:1.1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.oq-topic-name-row.t-long .oq-topic-name { font-size:13px; } .oq-topic-name-row.t-long .oq-topic-parent { font-size:11px; }
.oq-topic-name-row.t-xlong .oq-topic-name { font-size:11px; } .oq-topic-name-row.t-xlong .oq-topic-parent { font-size:10px; }
.oq-topic-points { flex-shrink:0; text-align:right; display:flex; flex-direction:column; }
.oq-topic-points-lbl { font-size:11px; font-weight:700; letter-spacing:1.5px; text-transform:uppercase; color:rgba(255,255,255,0.55); }
.oq-topic-points-val { font-size:22px; font-weight:700; color:#fff; line-height:1.1; }
.oq-progress {
    display:flex; gap:4px; padding:6px 16px 10px; justify-content:space-evenly;
}
.oq-progress-seg {
    flex:1; height:6px; border-radius:3px; background:#333;
}
.oq-topic-image {
    position:relative; aspect-ratio:9/5; overflow:hidden; margin:0 12px 8px;
    border-radius:12px; max-height:160px;
}
.oq-topic-image img { width:100%; height:100%; object-fit:cover; }
.oq-topic-wash { position:absolute; top:0; left:0; right:0; bottom:0; opacity:0.2; pointer-events:none; }
.oq-topic-gradient {
    position:absolute; bottom:0; left:0; right:0; height:50%;
    background:linear-gradient(transparent, #000); pointer-events:none;
}
/* Topic badge: top-left (relayout 2026-08-15, matches MAUI). Capped + ellipsised so a long leaf never
   runs across the image; the bottom band belongs to the action cluster. */
.oq-topic-badge { position:absolute; top:8px; left:12px; max-width:72%; }
.oq-topic-badge-2 .g, .oq-topic-badge-2 .s { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* Bottom-right action cluster: Hint (pre-answer) / Learn More (post-answer) share the slot, heart beside them. */
.oq-action-cluster { position:absolute; bottom:8px; right:12px; z-index:10;
    display:flex; align-items:center; gap:10px; }
.oq-action-cluster .oq-hint-pill,
.oq-action-cluster .oq-learn-more-pill,
.oq-action-cluster .oq-question-like { position:static; inset:auto; }
.oq-category-label {
    font-size:11px; font-weight:700; letter-spacing:0.5px;
    border:0.5px solid rgba(255,255,255,0.5); border-radius:6px;
    padding:4px 12px; background:transparent;
}
.oq-category-label.entry { color:#3ddc84; }
.oq-category-label.expert { color:#ffb020; }
.oq-category-label.guru { color:#f26a5a; }
/* Centered topic overlay: game topic bold white + question sub-topic in the level colour */
.oq-topic-veil { position:absolute; inset:0; pointer-events:none;
    background:radial-gradient(ellipse at center, rgba(6,10,20,0.28), rgba(6,10,20,0.58)); }
.oq-topic-center { position:absolute; inset:0; display:flex; flex-direction:column;
    align-items:center; justify-content:center; text-align:center; padding:0 20px; pointer-events:none; }
/* Primary = the question's specific topic in the level colour; secondary = its parent in white. */
.oq-topic-game { font-size:22px; font-weight:700; color:#fff; line-height:1.2;
    text-shadow:0 2px 12px rgba(0,0,0,0.7); }
.oq-topic-game.entry  { color:#3ddc84; }
.oq-topic-game.expert { color:#ffb020; }
.oq-topic-game.guru   { color:#f26a5a; }
.oq-topic-sub { font-size:12px; font-weight:700; letter-spacing:1.4px; text-transform:uppercase;
    margin-top:4px; color:rgba(255,255,255,0.92); text-shadow:0 2px 8px rgba(0,0,0,0.55); }
/* Two-tier corner badge for image questions (content image stays the focus) */
.oq-topic-badge-2 { display:flex; flex-direction:column; gap:1px; }
.oq-topic-badge-2 .g { font-size:12px; font-weight:700; color:#fff; text-shadow:0 1px 5px rgba(0,0,0,0.8); }
.oq-topic-badge-2 .g.entry  { color:#3ddc84; }
.oq-topic-badge-2 .g.expert { color:#ffb020; }
.oq-topic-badge-2 .g.guru   { color:#f26a5a; }
.oq-topic-badge-2 .s { font-size:10px; font-weight:700; letter-spacing:1px; text-transform:uppercase; color:rgba(255,255,255,0.92); text-shadow:0 1px 5px rgba(0,0,0,0.8); }
/* ── Non-image question: the QUESTION overlaid on the decorative topic image ──────
   Strong scrim for legibility; the specific topic drops to a small top-left corner chip.
   A level-tinted radial background stands in when there is no topic photo. */
.oq-question-on-image {
    position:relative; margin:0 12px 8px; border-radius:14px; overflow:hidden;
    min-height:190px; max-height:230px;
    display:flex; align-items:center; justify-content:center;
    border:0.5px solid rgba(255,255,255,0.14); box-shadow:0 16px 34px rgba(0,0,0,0.5);
    background:radial-gradient(ellipse at 52% 60%, #4a4f63 0%, #2c2f3d 46%, #16171f 100%);
}
.oq-question-on-image.entry-bg  { background:radial-gradient(ellipse at 52% 60%, #2d5c42 0%, #1c3a2a 46%, #0e1d15 100%); }
.oq-question-on-image.expert-bg { background:radial-gradient(ellipse at 52% 60%, #6e5428 0%, #3f3018 46%, #221a0d 100%); }
.oq-question-on-image.guru-bg   { background:radial-gradient(ellipse at 52% 60%, #6e3830 0%, #3f211c 46%, #22100e 100%); }
.oq-question-on-image img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.oq-qimg-scrim { position:absolute; inset:0; pointer-events:none;
    background:linear-gradient(180deg, rgba(6,10,20,0.35) 0%, rgba(6,10,20,0.62) 55%, rgba(6,10,20,0.78) 100%); }
.oq-qimg-topic { position:absolute; top:10px; left:12px; z-index:2; display:flex; align-items:baseline; gap:6px;
    text-shadow:0 2px 8px rgba(0,0,0,0.7); }
.oq-qimg-topic .t { font-size:13px; font-weight:700; color:#fff; }
.oq-qimg-topic .t.entry  { color:#3ddc84; }
.oq-qimg-topic .t.expert { color:#ffb020; }
.oq-qimg-topic .t.guru   { color:#f26a5a; }
.oq-qimg-topic .p { font-size:11px; font-weight:600; letter-spacing:1px; text-transform:uppercase; color:rgba(255,255,255,0.7); }
.oq-qimg-question { position:relative; z-index:2; padding:0 22px; text-align:center;
    font-weight:600; font-size:20px; line-height:1.32; color:#fff; text-shadow:0 2px 14px rgba(0,0,0,0.8); }
.oq-question-image {
    position:relative; margin:0 12px 8px; border-radius:12px; overflow:hidden;
    background:rgba(26,26,26,0.85);
}
.oq-question-image .oq-question-text {
    padding:10px 16px 6px;
}
.oq-question-image img {
    width:100%; max-height:40vh; object-fit:contain;
}
.oq-question-image .oq-topic-badge { position:absolute; top:8px; left:12px; }
.oq-question {
    background:rgba(26,26,26,0.85); border-radius:12px; padding:12px 16px; margin:0 12px 8px;
    max-height:160px; overflow:hidden;
}
.oq-question-text {
    font-size:16px; font-weight:500; color:#fff; text-align:center; line-height:1.45;
}
.oq-answers {
    display:flex; flex-direction:column; gap:6px; padding:0 12px;
}
.oq-answer {
    padding:12px 16px; background:rgba(31,31,31,0.7); border:1px solid rgba(255,255,255,0.2);
    border-radius:16px; color:#e2e2e2; font-size:16px; font-weight:500;
    font-family:'Inter',sans-serif; cursor:pointer; text-align:center;
    transition:all 0.15s; width:100%; min-height:56px; max-height:120px;
    display:flex; align-items:center; justify-content:center;
}
.oq-answer:hover { background:rgba(42,42,42,0.8); border-color:rgba(255,255,255,0.3); }
.oq-answer:active { background:rgba(164,201,255,0.15); border-color:rgba(164,201,255,0.4); transform:scale(0.98); }
.oq-answer.correct { background:linear-gradient(to right, #050505, #18CC4C); border:1px solid #66FF8C; color:#66FF8C; }
.oq-answer.flash-correct { background:linear-gradient(to right, #050505, #18CC4C); border:2px solid #00FF00; color:#66FF8C; animation:flash-pulse 0.5s; }
.oq-answer.wrong { background:linear-gradient(to right, #050505, #CC1818); border:2px solid #F53D5C; color:#F53D5C; }
.oq-answer.revealed { background:rgba(255,255,255,0.05); border-color:transparent; color:#999; }
@keyframes flash-pulse { 0%{opacity:1} 50%{opacity:0.5} 100%{opacity:1} }

/* Answer row: answer button + like heart */
.oq-answer { position:relative; }
.oq-answer-like { position:absolute; bottom:6px; left:10px; font-size:22px; }

/* Like/heart buttons */
.oq-like-btn {
    background:transparent; border:none; cursor:pointer;
    font-size:20px; padding:0 8px; color:#555;
    transition: color 0.15s, transform 0.15s;
    display:flex; align-items:center;
}
.oq-like-btn:hover { transform:scale(1.2); }
.oq-like-btn.liked { color:#e74c3c; }
.oq-like-btn.disliked { color:#888; }

/* Question-level heart — bottom-right of question area */
.oq-question { position:relative; }
.oq-question-like { position:absolute; bottom:6px; left:10px; font-size:22px; }

.oq-learn-more-pill {
    position:absolute; bottom:10px; right:12px;
    background:transparent; border:0.5px solid rgba(255,255,255,0.5);
    border-radius:6px; padding:3px 10px;
    color:#fff; font-size:14px; font-weight:700; font-family:'Inter',sans-serif;
    cursor:pointer; z-index:10;
}
.oq-learn-more-pill:hover { background:rgba(255,255,255,0.1); }
/* Hint lozenge — bottom-left of the question area, shown only pre-answer (mirrors Learn More on the right). */
.oq-hint-pill {
    position:absolute; bottom:10px; left:12px;
    background:rgba(0,0,0,0.65); border:0.5px solid rgba(255,255,255,0.6);
    border-radius:6px; padding:3px 10px;
    color:#fff; font-size:14px; font-weight:700; font-family:'Inter',sans-serif;
    cursor:pointer; z-index:6;
}
.oq-hint-pill:hover { background:rgba(255,255,255,0.12); }
/* Hint overlay — dark panel over the four answers, centered text, x to dismiss (Learn More look/feel). */
.oq-answers-wrap { position:relative; }
.oq-hint-overlay {
    position:absolute; inset:0; margin:0 12px;
    background:rgba(16,20,24,0.96); border:0.5px solid rgba(255,255,255,0.2);
    border-radius:12px;
    display:flex; align-items:center; justify-content:center;
    z-index:8;
}
.oq-hint-text { color:#fff; font:500 18px 'Inter',sans-serif; text-align:center; padding:28px; line-height:1.4; }
.oq-hint-close {
    position:absolute; top:8px; right:8px;
    width:32px; height:32px; border:none; border-radius:16px;
    background:rgba(255,255,255,0.2); color:#fff; font-size:16px; cursor:pointer;
    display:flex; align-items:center; justify-content:center;
}
.oq-hint-close:hover { background:rgba(255,255,255,0.32); }
.oq-nav {
    display:flex; justify-content:space-between; padding:12px 12px 0; margin-top:16px;
}

/* ── Score Tile ──────────────────────────────────────────────────────────────── */
.score-tile {
    position:relative; aspect-ratio:9/5; border-radius:12px; overflow:hidden;
    border:0.5px solid rgba(255,255,255,0.5); background:#0e0e0e;
    box-shadow:0 20px 40px rgba(0,0,0,0.6);
    max-width:640px;
}
.score-tile-bg {
    position:absolute; width:100%; height:100%; object-fit:cover; opacity:0.8;
}
.score-tile-colorwash {
    position:absolute; inset:0; z-index:0; opacity:0.15; pointer-events:none;
}
.score-tile-gradient {
    position:absolute; inset:0; z-index:1;
    background:linear-gradient(to right, rgba(0,0,0,0.80), rgba(0,0,0,0.40), rgba(0,0,0,0.20));
}
.score-tile-url-pill {
    position:absolute; bottom:6px; left:12px; z-index:4;
    background:rgba(0,0,0,0.45); border:0.5px solid rgba(255,255,255,0.35);
    border-radius:6px; padding:3px 8px;
    color:rgba(255,255,255,0.7); font-size:9px; font-weight:600; font-family:'Inter',sans-serif;
    letter-spacing:0.3px; pointer-events:none;
}
.score-tile-user {
    position:absolute; top:10px; right:12px; z-index:5;
    display:flex; align-items:center; gap:8px;
}
.score-tile-username {
    font-family:'Inter',sans-serif; font-weight:600; font-size:12px;
    color:rgba(255,255,255,0.9); text-shadow:0 1px 4px rgba(0,0,0,0.7);
}
.score-tile-avatar {
    width:45px; height:45px; border-radius:50%; object-fit:cover;
    border:1.5px solid rgba(255,255,255,0.5);
    box-shadow:0 2px 8px rgba(0,0,0,0.5);
}
.score-tile-avatar-placeholder {
    width:36px; height:36px; border-radius:50%;
    background:rgba(255,255,255,0.12); border:1.5px solid rgba(255,255,255,0.3);
    display:flex; align-items:center; justify-content:center;
    font-family:'Inter',sans-serif; font-weight:700; font-size:14px; color:#fff;
}
.score-tile-content {
    position:relative; display:flex; width:100%; height:100%; z-index:2;
}
.score-tile-user { z-index:5; }
.score-tile-url-pill { z-index:5; }
.score-tile-logo {
    width:30%; display:flex; align-items:flex-start; justify-content:center;
    padding-left:4px; padding-right:2px; padding-top:10px;
}
.score-tile-logo img {
    max-height:78%; max-width:92%; object-fit:contain; opacity:0.9;
    filter:drop-shadow(0 4px 16px rgba(0,0,0,0.7));
}
.score-tile-info {
    width:70%; display:flex; flex-direction:column; justify-content:center;
    padding:16px 12px 20px 6px; gap:4px;
}
/* Title block: leaf topic name (bold) over a small non-bold subcategory that runs the full
   width of the info area instead of the old cramped narrow column (max-width:60% removed). */
.score-tile-titles { display:flex; flex-direction:column; gap:2px; max-width:calc(100% - 48px); }
.score-tile-title {
    font-family:'Raleway','Inter',sans-serif; font-weight:700; font-size:15px;
    color:#fff; margin:0; line-height:1.1; letter-spacing:-0.3px;
    word-wrap:break-word; overflow-wrap:break-word;
}
.score-tile-subtitle {
    font-family:'Inter',sans-serif; font-weight:400; font-size:11px;
    color:rgba(255,255,255,0.78); line-height:1.2; letter-spacing:0.1px;
    word-wrap:break-word; overflow-wrap:break-word;
}
.score-tile-score {
    font-family:'Inter',sans-serif; font-weight:700; font-size:14px;
    color:#fff; margin:0; text-shadow:0 1px 4px rgba(0,0,0,0.6);
}
/* ── Status Tile (redesigned) ───────────────────────────────────────────────── */
.status-tile {
    position:relative; aspect-ratio:2/1; border-radius:12px; overflow:hidden;
    border:0.5px solid rgba(255,255,255,0.5); background:#0e0e0e;
    box-shadow:0 20px 40px rgba(0,0,0,0.6);
    max-width:640px;
}
.status-tile-bg {
    position:absolute; width:100%; height:100%; object-fit:cover; opacity:0.8;
}
.status-tile-content {
    position:relative; display:flex; width:100%; height:100%; z-index:2;
}
/* Portrait + "BERTRAND" wordmark lockup, centred vertically (relayout 2026-08-15, matches MAUI): supplies
   the brand name and fills the previously-empty lower band. */
.status-tile-logo {
    width:30%; display:flex; flex-direction:column; align-items:center; justify-content:center;
    padding:8px 2px 8px 4px; gap:4px;
}
.status-tile-logo img {
    max-height:62%; max-width:92%; object-fit:contain; opacity:0.9;
    filter:drop-shadow(0 4px 16px rgba(0,0,0,0.7));
}
.status-tile-wordmark {
    font-family:"Space Grotesk", system-ui, sans-serif; font-weight:500;
    font-size:12px; letter-spacing:3.5px; color:#F0F9FB;
    text-shadow:0 1px 3px rgba(0,0,0,0.6); white-space:nowrap;
}
.status-tile-info {
    width:70%; display:flex; flex-direction:column; justify-content:center;
    padding:16px 12px 20px 6px; gap:6px;
}
.status-tile-pill {
    display:flex; align-items:center; justify-content:space-between;
    padding:0 14px; height:32px; border-radius:6px;
    font-size:13px; font-weight:600; color:#fff; white-space:nowrap;
}
.status-tile-pill:first-of-type {
    width:auto; justify-content:flex-start; white-space:nowrap;
}
/* Level-pill hues are the ObsidianTokens/NTDesignTokens.LevelColors set (Entry #3ddc84,
   Expert #ffb020, Guru #f26a5a) — canonical. Alpha normalised to 0.4/0.25 to match .score-tile-pill (was a
   hotter 0.55/0.35 here, the one real desync). */
.status-tile-pill.entry { background:linear-gradient(135deg, rgba(61,220,132,0.4), rgba(43,154,92,0.25)); }
.status-tile-pill.expert { background:linear-gradient(135deg, rgba(255,176,32,0.4), rgba(178,123,22,0.25)); }
.status-tile-pill.guru { background:linear-gradient(135deg, rgba(242,106,90,0.4), rgba(169,74,63,0.25)); }
.status-tile-mastery { color:#fff; }
/* ── Score Tile Pills ──────────────────────────────────────────────────────── */
.score-tile-pill {
    display:flex; align-items:center; justify-content:flex-start;
    padding:0 14px; height:32px; border-radius:6px;
    font-size:14px; font-weight:600; color:#fff; width:75%;
}
.score-tile-pill.entry { background:linear-gradient(135deg, rgba(61,220,132,0.4), rgba(43,154,92,0.25)); }
.score-tile-pill.expert { background:linear-gradient(135deg, rgba(255,176,32,0.4), rgba(178,123,22,0.25)); }
.score-tile-pill.guru { background:linear-gradient(135deg, rgba(242,106,90,0.4), rgba(169,74,63,0.25)); }
.score-tile-grid-pill {
    display:flex; align-items:center; justify-content:center;
    padding:8px 10px; border-radius:6px; width:100%; box-sizing:border-box;
    /* Flat dark backing (matches MAUI NTResultViewFactory): emerald blocks on a level-tinted (green) pill
       were invisible on-device, so the grid pill is neutral-dark, NOT level-coloured. The @LevelClass on the
       element is a no-op here now (kept for markup symmetry); the level tint stays on .score-tile-pill only. */
    background:rgba(0,0,0,0.35); border:0.5px solid rgba(255,255,255,0.08);
}
.score-grid {
    display:grid; grid-template-columns:repeat(5,1fr); grid-template-rows:1fr 1fr;
    gap:2px; width:100%;
}
.score-block {
    height:14px; border-radius:3px; min-width:0;
}
.score-block.correct {
    background:#2E9E6B;
}
.score-block.wrong {
    background:#C24C42;
}
.score-block.empty {
    background:rgba(255,255,255,0.10);
}

/* ── Minimal "Wordle" share tile (MinimalTileView.razor) ─────────────────────────
   Self-sizing share card; same layered background as the score tile, Bertrand as a faint
   watermark, no username/avatar/score pill. 5×2 grid; emerald = correct, faint outline = wrong. */
.min-tile {
    --blk:24px; position:relative; display:inline-block; vertical-align:top;
    border-radius:12px; overflow:hidden; border:0.5px solid rgba(255,255,255,0.5);
    background:#0e0e0e; box-shadow:0 18px 36px rgba(0,0,0,0.6);
}
.min-bg { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; opacity:0.8; z-index:0; }
.min-colorwash { position:absolute; inset:0; z-index:1; opacity:0.15; pointer-events:none; }
/* Strong left->right dark gradient (matches MAUI NTMinimalTileFactory) — replaces the old radial/vertical
   scrim. The dark left third makes the fine WHITE Bertrand line-art read crisply instead of washing to muddy
   grey on a light topic photo; watermark opacity is raised to 0.85 to match. */
.min-scrim {
    position:absolute; inset:0; z-index:2; pointer-events:none;
    background:linear-gradient(to right, rgba(0,0,0,0.80), rgba(0,0,0,0.40) 50%, rgba(0,0,0,0.20));
}
.min-watermark { position:absolute; z-index:3; top:50%; left:10px; height:88%; transform:translateY(-50%); opacity:0.85; pointer-events:none; object-fit:contain; }
.min-content { position:relative; z-index:4; display:flex; flex-direction:column; align-items:flex-end; gap:9px; padding:15px 17px 15px 120px; }
.min-title { font:700 20px 'Raleway','Inter',sans-serif; color:#fff; margin:0; line-height:1.1; letter-spacing:-0.3px; text-shadow:0 1px 8px rgba(0,0,0,0.6); white-space:nowrap; text-align:right; }
.min-subtitle { font:400 12px 'Inter'; color:rgba(255,255,255,0.8); margin-top:2px; text-shadow:0 1px 6px rgba(0,0,0,0.6); text-align:right; }
.min-grid { display:grid; grid-template-columns:repeat(5, var(--blk)); gap:3px; }
.min-grid .blk { width:var(--blk); height:var(--blk); border-radius:3px; box-sizing:border-box; }
.min-grid .blk.c { background:#2E9E6B; box-shadow:0 1px 2px rgba(0,0,0,0.3); }
.min-grid .blk.w { background:rgba(255,255,255,0.10); border:1px solid rgba(255,255,255,0.45); }
.min-url { align-self:flex-end; margin-top:1px; background:rgba(0,0,0,0.45); border:0.5px solid rgba(255,255,255,0.35); border-radius:6px; padding:3px 9px; color:rgba(255,255,255,0.72); font:600 9px 'Inter'; letter-spacing:0.3px; white-space:nowrap; }
.min-tile-wrap { display:flex; justify-content:center; margin:4px 0; }

/* Leaderboard level pill — no fill, border + text in level color */
.lb-level-pill {
    font-size:13px; font-weight:600; padding:2px 10px; border-radius:10px;
    background:rgba(0,0,0,0.5); display:inline-block;
}
.lb-level-pill.entry { color:#3ddc84; border:1px solid #3ddc84; }
.lb-level-pill.expert { color:#ffb020; border:1px solid #ffb020; }
.lb-level-pill.guru { color:#f26a5a; border:1px solid #f26a5a; }
.score-tile-toast {
    position:absolute; bottom:12px; left:50%; transform:translateX(-50%);
    background:rgba(0,0,0,0.8); color:#4CAF50; font-size:13px; font-weight:600;
    padding:6px 18px; border-radius:20px; z-index:10;
    animation:toast-fade 1.5s ease-in-out;
    pointer-events:none;
}
@keyframes toast-fade {
    0% { opacity:0; transform:translateX(-50%) translateY(4px); }
    15% { opacity:1; transform:translateX(-50%) translateY(0); }
    75% { opacity:1; }
    100% { opacity:0; }
}

/* ── Deep Dive Section ───────────────────────────────────────────────────────── */
/* ── Deep Dive full-screen overlay (matches MAUI RPage) ──────────────────── */
.dd-overlay {
    position:fixed; top:0; left:0; right:0; bottom:0; z-index:100;
    background:#000; overflow:hidden;
}
.dd-scroll { height:100%; overflow-y:auto; }
.dd-hero {
    position:relative; height:168px; overflow:hidden;
}
.dd-hero-img { width:100%; height:100%; object-fit:cover; }
.dd-hero-gradient {
    position:absolute; bottom:0; left:0; right:0; height:120px;
    background:linear-gradient(to bottom, transparent 0%, transparent 30%, rgba(0,0,0,0.8) 65%, #000 100%);
    pointer-events:none;
}
.dd-topbar {
    position:absolute; top:0; left:0; right:0;
    display:flex; align-items:center; justify-content:space-between;
    padding:12px 16px; background:rgba(0,0,0,0.6); z-index:10;
}
.dd-close {
    width:36px; height:36px; border-radius:18px;
    background:rgba(255,255,255,0.2); border:none;
    color:rgba(255,255,255,0.8); font-size:22px; cursor:pointer;
    display:flex; align-items:center; justify-content:center;
}
.dd-close:hover { background:rgba(255,255,255,0.3); }
.dd-title { font-size:16px; font-weight:700; color:#fff; letter-spacing:3px; }
/* Answer sits in its own solid-black band below the image (not overlaid on it) — room to breathe. */
.dd-answer-overlay {
    background:#000; padding:16px 18px 8px;
}
.dd-answer-label { font-size:10px; color:#a4c9ff; letter-spacing:2px; display:block; margin-bottom:6px; }
.dd-answer-text { font-size:22px; font-weight:700; color:#fff; margin:0; line-height:1.15; }
.dd-body { padding:14px 18px 24px; background:#000; }
.dd-divider { display:flex; align-items:center; gap:8px; margin-bottom:16px; }
.dd-divider-line { width:32px; height:2px; background:#a4c9ff; }
.dd-divider span { font-size:12px; color:#c1c7d3; letter-spacing:3px; font-weight:700; }
.dd-explanation { font-size:14px; color:#e2e2e2; line-height:1.55; margin-bottom:18px; }
/* Buttons match the EndGame green-outline (#34d399); primary CTA filled. */
.dd-cta {
    width:100%; height:44px; border:1px solid #34d399; border-radius:10px; font-size:14px; font-weight:500;
    color:#fff; cursor:pointer; margin-bottom:18px;
    background:rgba(52,211,153,0.2);
}
.dd-cta:hover { background:rgba(52,211,153,0.28); }
.dd-cta:active { transform:scale(0.98); }
.dd-platforms-label { font-size:10px; color:#c1c7d3; letter-spacing:2px; text-align:center; margin-bottom:10px; }
.dd-platforms { display:flex; gap:8px; margin-bottom:24px; }
.dd-platform {
    flex:1; display:flex; flex-direction:column; align-items:center; gap:6px;
    padding:12px 0; background:transparent; border:1px solid #34d399;
    border-radius:10px; color:#fff; text-decoration:none; font-size:9px; letter-spacing:1px; font-weight:500;
}
.dd-platform:hover { background:rgba(52,211,153,0.1); }
.dd-chat { margin-top:16px; }
.dd-chat-messages { max-height:300px; overflow-y:auto; display:flex; flex-direction:column; gap:8px; }

/* ── Help icon (first-visit "?" replacing B logo) ───────────────────────────── */
.help-icon {
    width:38px; height:38px; border-radius:10px;
    background:rgba(164,201,255,0.25); border:none;
    color:#fff; font-size:20px; font-weight:700; cursor:pointer;
    display:flex; align-items:center; justify-content:center;
    flex-shrink:0;
}
.help-icon:hover { background:rgba(164,201,255,0.4); }
.oq-help-icon {
    width:56px; height:56px; border-radius:8px;
    background:rgba(164,201,255,0.25); border:none;
    color:#fff; font-size:22px; font-weight:700; cursor:pointer;
    display:flex; align-items:center; justify-content:center;
    flex-shrink:0;
}
.oq-help-icon:hover { background:rgba(164,201,255,0.4); }

/* ── Quiz Page (legacy, kept for explain/chat) ──────────────────────────────── */
.quiz-header {
    text-align: center;
    margin-bottom: 16px;
}
.quiz-header .quiz-topic { font-size: 14px; color: var(--text-secondary); }
.quiz-header .quiz-meta { font-size: 13px; color: var(--text-dimmed); margin-top: 4px; }

.question-box {
    background: #282828;
    border: 1px solid #3C3C3C;
    border-radius: var(--radius-button);
    padding: 16px 20px;
    margin-bottom: 16px;
}
.question-text {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
}

/* ── Answer Buttons ──────────────────────────────────────────────────────────── */
.answer-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}
.answer-btn {
    position: relative;
    width: 100%;
    padding: 16px 16px;
    min-height: 56px;
    border-radius: var(--radius-answer);
    border: none;
    background: var(--answer-bg);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.answer-btn:hover { background: rgba(255,255,255,0.28); }
.answer-btn.selected {
    background: var(--answer-bg);
    border: 2px solid white;
    padding: 12px 14px; /* compensate for border */
}
.answer-btn.correct {
    background: var(--correct-gradient);
    border: 2px solid var(--answer-right-stroke);
    padding: 12px 14px;
    color: var(--answer-right-stroke);
}
.answer-btn.wrong {
    background: var(--wrong-gradient);
    border: 2px solid var(--answer-wrong-stroke);
    padding: 12px 14px;
    color: var(--answer-wrong-stroke);
}
.answer-btn.revealed {
    background: var(--answer-done-bg);
    color: var(--text-primary);
}
.answer-btn.flash-correct {
    background: var(--correct-gradient);
    border: 2px solid var(--answer-right-stroke);
    padding: 12px 14px;
    color: var(--answer-right-stroke);
    animation: flash-pulse 0.4s ease-in-out 3;
    animation-fill-mode: forwards;
}
@keyframes flash-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ── Progress Bar ────────────────────────────────────────────────────────────── */
.progress-bar {
    display: flex;
    gap: 3px;
    margin: 12px 0;
    justify-content: center;
}
.progress-dot {
    width: 24px;
    height: 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.15);
    transition: background 0.3s;
}
.progress-dot.correct { background: #22c55e; }
.progress-dot.wrong { background: #ef4444; }
.progress-dot.current { background: rgba(255,255,255,0.5); }

/* ── Score Display (EndGame) ─────────────────────────────────────────────────── */
.endgame-container { text-align: center; padding-top: 24px; }
.score-display {
    margin: 32px 0;
}
.score-display .score-value {
    font-size: 48px;
    font-weight: 700;
    color: #22c55e;
    line-height: 1;
}
.score-display .score-label {
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: 8px;
}
.endgame-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

/* ── Leaderboard ─────────────────────────────────────────────────────────────── */
.leaderboard-header {
    text-align: center;
    margin-bottom: 16px;
}
.leaderboard-topic {
    display: inline-block;
    background: rgba(255,255,255,0.12);
    border-radius: var(--radius-button);
    padding: 8px 24px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 8px;
}
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
/* ── Compact leaderboard rows (mirror MAUI CreateLeaderboardRow) ────────────── */
.lb-sep {
    text-align: center;
    padding: 4px 0;
    color: rgba(255,255,255,0.4);
    font-size: 18px;
    letter-spacing: 4px;
}
.lb-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 0 12px;
    border-radius: 12px;
    background: rgba(31,31,31,0.7);
    border: 0.5px solid rgba(255,255,255,0.06);
}
.lb-row.current {
    background: rgba(99,210,234,0.14);
    border: 2px solid #63D2EA;
}
.lb-rank {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.lb-rank.gold   { background: #FFD24A; color: #1A1400; }
.lb-rank.silver { background: #C8D0DC; color: #1A1D22; }
.lb-rank.bronze { background: #D8934A; color: #241300; }
.lb-row-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.25);
}
.lb-row-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.lb-row-name {
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lb-row-sub {
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lb-row-stats {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}
.lb-row-points {
    color: #fff;
    font-weight: 600;
    font-size: 18px;
}
.lb-row-mastery {
    color: rgba(255,255,255,0.55);
    font-size: 11px;
}
.lb-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card-gradient);
    border-radius: var(--radius-card);
    padding: 14px;
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}
.lb-card.top-user {
    border-color: rgba(34,168,97,0.4);
    box-shadow: 0 0 20px rgba(34,168,97,0.1);
}
.lb-card .lb-avatar {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--surface-light);
    flex-shrink: 0;
}
.lb-card .lb-info { flex: 1; min-width: 0; }
.lb-card .lb-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.lb-card .lb-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}
.lb-card .lb-rating { margin-left: auto; font-size: 15px; font-weight: 600; }
.lb-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: #f59e0b;
    color: #000;
    font-size: 12px;
    font-weight: 700;
}

/* ── EndGame Result/Status Cards ─────────────────────────────────────────────── */
.result-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card-gradient);
    border-radius: var(--radius-card);
    padding: 16px;
    border: 1px solid var(--border-light);
    min-height: 126px;
    position: relative;
    overflow: hidden;
}
.result-card::before {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 100px; height: 100px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    pointer-events: none;
}
.result-card-left {
    width: 80px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.result-card-right {
    flex: 1;
    min-width: 0;
}
.result-topic {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
}
.result-score-box {
    background: rgba(0,0,0,0.25);
    border-radius: 8px;
    padding: 12px 14px;
}
.result-score-label {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
}
.score-block-legacy {
    width: 20px;
    height: 20px;
    border-radius: 3px;
}
.result-status-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0,0,0,0.25);
    border-radius: 8px;
    padding: 10px 12px;
}

/* ── Login Page ──────────────────────────────────────────────────────────────── */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 24px;
    text-align: center;
}
.login-container h2 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}
.login-container .login-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin-top: -12px;
}
.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 300px;
}
.auth-input, .login-form input[type="text"] {
    padding: 12px 16px;
    border-radius: var(--radius-button);
    border: 1px solid var(--border-light);
    background: var(--surface-light);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}
.auth-input:focus, .login-form input[type="text"]:focus { border-color: rgba(255,255,255,0.35); }
.auth-input::placeholder, .login-form input[type="text"]::placeholder { color: var(--text-dimmed); }
.field-label { color: var(--text-secondary); font-size: 12px; margin-bottom: 2px; text-align: left; }
.status-valid { color: #4CAF50; font-size: 12px; text-align: left; margin: 2px 0; }
.status-error { color: #F44336; font-size: 12px; text-align: left; margin: 2px 0; }
.mode-toggle { display: flex; gap: 8px; }
.mode-toggle button { padding: 8px 20px; border-radius: 20px; border: 1px solid var(--border-light); background: transparent; color: var(--text-secondary); font-family: 'Inter', sans-serif; font-size: 14px; cursor: pointer; transition: all 0.2s; }
.mode-toggle button.active { background: rgba(255,255,255,0.15); color: var(--text-primary); border-color: rgba(255,255,255,0.3); }

/* ── Obsidian Auth Page ─────────────────────────────────────────────────────── */
.auth-page {
    /* Top-anchored so the form sits just under the header (no big vertical gap). */
    display:flex; flex-direction:column; align-items:center; justify-content:flex-start;
    padding:26px 20px 40px; text-align:center; color:#e2e2e2;
}
/* MAUI-parity auth header — chosen variant A (Designs/Header Page .h-a): glassy contrasting
   bar, centered accent-fade underline (blue = identity), 48px glassy logo box, Raleway title. */
.auth-header {
    position:relative; display:flex; align-items:center; gap:12px; padding:15px 16px 17px;
    background:linear-gradient(180deg, rgba(5,13,18,0.96), rgba(6,16,22,0.86));
    backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px);
    box-shadow:0 6px 18px rgba(0,0,0,0.45);
}
.auth-header::after {
    content:''; position:absolute; left:0; right:0; bottom:0; height:2px;
    background:linear-gradient(90deg, transparent, #63D2EA 50%, transparent);
}
.auth-header-avatar {
    width:48px; height:48px; flex:0 0 48px; border-radius:13px; overflow:hidden; padding:5px;
    background:rgba(255,255,255,0.07); border:1px solid rgba(255,255,255,0.12);
    box-shadow:inset 0 1px 0 rgba(255,255,255,0.15);
    display:flex; align-items:center; justify-content:center;
}
.auth-header-avatar img { width:100%; height:100%; object-fit:contain; }
.auth-header-title {
    flex:1; text-align:center; margin-right:48px;
    font-family:'Raleway','Inter',sans-serif; font-size:22px; font-weight:700; letter-spacing:0.2px; color:#fff;
}
.auth-toggle {
    display:flex; gap:0; justify-content:space-between; background:transparent; padding:0; margin-bottom:0;
    position:relative; z-index:2; width:100%; max-width:340px; align-self:center;
}
.auth-toggle button {
    padding:12px 28px; border-radius:16px 16px 0 0; border:none;
    background:transparent; color:rgba(255,255,255,0.5); font-family:'Inter',sans-serif; font-size:16px;
    font-weight:600; cursor:pointer; transition:all 0.2s;
}
.auth-toggle button.active {
    color:#63D2EA; background:rgba(0,0,0,0.35);
}
.auth-form {
    display:flex; flex-direction:column; gap:14px; width:100%; max-width:340px;
    background:rgba(0,0,0,0.35); border-radius:0 16px 16px 16px;
    padding:24px 20px; position:relative; z-index:1; margin-top:0;
    min-height:320px;
}
.auth-form.signup { border-radius:16px 0 16px 16px; }
.auth-field-group {
    border:0.5px solid rgba(255,255,255,0.35); border-radius:12px;
    padding:10px 14px 12px; background:rgba(255,255,255,0.08);
    min-height:90px;
}
.auth-field-group:has(.auth-group-btn) {
    min-height:150px;
}
.auth-label { display:block; font-size:13px; color:#e2e2e2; margin-bottom:6px; text-align:left; }
.auth-field-group .auth-input,
.auth-field-group input {
    border:1px solid rgba(255,255,255,0.35) !important; background:rgba(0,0,0,0.55) !important;
    padding:10px 12px !important;
    width:100%; font-size:17px; color:#fff; border-radius:8px !important;
}
.auth-field-group .auth-input:focus,
.auth-field-group input:focus { border-color:rgba(255,255,255,0.5) !important; }
.auth-field-group .auth-input:focus,
.auth-field-group input:focus { outline:none; }
.auth-field-group .auth-input::placeholder,
.auth-field-group input::placeholder { color:rgba(255,255,255,0.5); }
/* Suppress browser autofill yellow/white background. The box-shadow trick fails
   when the desired background is transparent (a transparent shadow covers nothing),
   so clip the autofill paint to the text glyph shape and re-paint the text white. */
.auth-field-group input:-webkit-autofill,
.auth-field-group input:-webkit-autofill:hover,
.auth-field-group input:-webkit-autofill:focus,
.auth-field-group input:-webkit-autofill:active {
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: #fff !important;
    caret-color: #fff;
    transition: background-color 600000s 0s, color 600000s 0s;
}
.auth-status-valid { color:#4CAF50; font-size:12px; text-align:left; margin:4px 0 0; line-height:1.2; }
.auth-status-error { color:#F44336; font-size:12px; text-align:left; margin:4px 0 0; line-height:1.2; }
.auth-action-btn, .auth-group-btn {
    width:100%; justify-content:center; font-size:14px; font-weight:500;
    padding:12px 16px !important; margin-top:10px;
    background:transparent; border:1px solid #34D399; border-radius:10px;
    color:#fff; cursor:pointer; transition:all 0.15s;
    font-family:'Inter',sans-serif; letter-spacing:0.01em;
}
.auth-action-btn:hover, .auth-group-btn:hover {
    background:rgba(74,222,128,0.08);
}
.auth-action-btn:active, .auth-group-btn:active {
    transform:scale(0.97);
}
.auth-action-btn:disabled, .auth-group-btn:disabled {
    border-color:#808080; color:#808080; cursor:not-allowed; opacity:0.8;
}
.auth-action-btn:disabled:hover, .auth-group-btn:disabled:hover {
    background:transparent;
}
.nt-btn-secondary { background: var(--surface-light) !important; color: #4A90E2 !important; border: 1px solid rgba(74,144,226,0.3) !important; }

/* ── EndGame buttons + section labels (from EndGame Page design) ─────────────── */
.eg-section-label {
    font-size:13px; font-weight:600; color:rgba(255,255,255,0.5);
    text-transform:uppercase; letter-spacing:1px; margin:12px 0 8px;
}
.btn-primary {
    width:100%; height:44px; border-radius:10px;
    border:1px solid #34d399; background:transparent; color:#fff;
    font-family:'Inter',sans-serif; font-size:14px; font-weight:500;
    cursor:pointer; transition:background 0.15s;
}
.btn-primary:hover { background:rgba(52,211,153,0.1); }
.btn-primary.filled { background:rgba(52,211,153,0.2); }
.btn-primary:disabled { border-color:rgba(255,255,255,0.2); color:rgba(255,255,255,0.35); cursor:not-allowed; background:transparent; }
.btn-row { display:flex; gap:8px; }
.btn-row .btn-primary { flex:1; }

/* ── Loading State ───────────────────────────────────────────────────────────── */
.loading {
    text-align: center;
    color: var(--text-dimmed);
    font-size: 15px;
    padding: 32px 0;
}

/* ── Error Message ───────────────────────────────────────────────────────────── */
.error {
    color: #ef4444;
    font-size: 14px;
    text-align: center;
}

/* ── Star Rating ─────────────────────────────────────────────────────────────── */
.stars { color: #f59e0b; font-size: 16px; letter-spacing: 2px; }

/* ── Explain / Learn More ─────────────────────────────────────────────────────── */
.explain-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-light);
    background: var(--surface-light);
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.explain-btn:hover { background: var(--surface-lighter); color: var(--text-primary); }
.explain-box {
    background: #1a1a1a;
    border: 0.5px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 16px;
    margin: 10px 12px 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}
.explain-loading { color: var(--text-dimmed); font-style: italic; }
.explain-text { white-space: pre-wrap; }

/* Search link buttons (Google, YouTube, Amazon, Chat) */
.explain-links { display:flex; flex-direction:column; gap:8px; margin-top:14px; }
.explain-links-row { display:flex; gap:8px; justify-content:space-between; }
.explain-links-row .search-link-btn { flex:1; text-align:center; justify-content:center; }
.search-link-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
}
.search-link-btn:hover { opacity: 0.8; }
.search-link-btn.google { background: #4285F4; color: white; }
.search-link-btn.youtube { background: #FF0000; color: white; }
.search-link-btn.amazon { background: #FF9900; color: #111; }
.search-link-btn.explore { background: var(--surface-lighter); color: var(--text-primary); width:100%; text-align:center; justify-content:center; }

/* Chat interface */
.chat-box {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-button);
    padding: 12px;
    margin-top: 8px;
}
.chat-messages {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.chat-msg {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.6;
}
.chat-user {
    background: #3B82F6;
    color: white;
    align-self: flex-end;
    max-width: 85%;
}
.chat-user .chat-content { color: white; }
.chat-user .chat-role { color: rgba(255,255,255,0.7); }
.chat-assistant {
    background: white;
    align-self: flex-start;
    max-width: 85%;
}
.chat-assistant .chat-content { color: #1A1A1A; }
.chat-assistant .chat-role { color: #666; }
.chat-role {
    font-size: 11px;
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}
.chat-content { white-space: pre-wrap; font-size:16px; line-height:1.6; }

/* ── Search Input ────────────────────────────────────────────────────────────── */
.search-input {
    flex: 1;
    height: 52px;
    padding: 0 14px;
    border-radius: var(--radius-button);
    border: 1px solid var(--border-light);
    background: var(--surface-light);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.search-input:focus { border-color: rgba(255,255,255,0.35); }
.search-input::placeholder { color: var(--text-dimmed); }

/* ── Heart Favorite ──────────────────────────────────────────────────────────── */
.card-heart.favorited { color: #ff5050; opacity: 1; }

/* ── Utility ─────────────────────────────────────────────────────────────────── */
/* ── User Stats / Scoreboard ────────────────────────────────────────────────── */
.stats-empty { text-align: center; padding: 40px 16px; color: var(--text-secondary); }
.stats-empty p { margin-bottom: 16px; font-size: 15px; }
.stats-summary { padding: 4px 0 8px; color: var(--text-secondary); font-size: 13px; }
.stats-count { font-weight: 600; }
.stats-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.stats-card {
    background: var(--surface-light);
    border-radius: var(--radius-card);
    overflow: hidden;
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: transform 0.15s, border-color 0.2s;
}
.stats-card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.25); }
.stats-card-image { position: relative; height: 120px; overflow: hidden; }
.stats-card-image img { width: 100%; height: 100%; object-fit: cover; }
.stats-card-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 8px 12px; }
.stats-card-title { font-weight: 700; font-size: 15px; color: var(--text-primary); text-shadow: 0 1px 4px rgba(0,0,0,0.7); }
.stats-card-image .level-pill { position: absolute; top: 8px; right: 8px; }
.stats-card-body { padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; }
.stats-card-score { font-size: 13px; color: var(--text-secondary); font-weight: 600; }

/* ── Matches ────────────────────────────────────────────────────────────────── */
.match-toast {
    padding: 8px 14px; border-radius: var(--radius-button); margin-bottom: 10px;
    background: rgba(74, 222, 128, 0.15); border: 1px solid rgba(74, 222, 128, 0.3);
    color: #4ADE80; font-size: 13px; font-weight: 600;
}
.match-toast.error { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.3); color: #EF4444; }
.match-empty { text-align: center; padding: 24px 16px; color: var(--text-secondary); font-size: 14px; }

/* Page scaffolding — Create button + section headers + filter chips */
.create-match-btn { margin-bottom: 18px; }
.create-match-btn .obsidian-btn { width: 100%; }
.section-header { display: flex; align-items: center; gap: 8px; margin: 18px 2px 10px; }
.section-title { font-size: 15px; font-weight: 700; color: rgba(255,255,255,0.85); }
.count-badge { font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.45); }
.filter-row { display: flex; gap: 8px; margin: 0 2px 12px; }
.filter-chip { font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.55); padding: 5px 12px;
    border-radius: 999px; border: 1px solid rgba(255,255,255,0.15); cursor: pointer;
    background: transparent; font-family: 'Inter', sans-serif; }
.filter-chip.on { color: #fff; background: rgba(52,211,153,0.15); border-color: #34d399; }

/* Match tile — level-shaded landscape card with layered background */
.match-tile {
    position: relative; border-radius: 12px; overflow: hidden;
    border: 0.5px solid rgba(255,255,255,0.5); background: #0e0e0e;
    box-shadow: 0 16px 34px rgba(0,0,0,0.55); max-width: 640px; margin-bottom: 14px;
}
.match-tile-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }
.match-tile-colorwash { position: absolute; inset: 0; z-index: 0; opacity: 0.35; pointer-events: none; }
.match-tile-colorwash.student { background: linear-gradient(135deg, rgba(61,220,132,0.7), rgba(0,130,0,0.4)); }
.match-tile-colorwash.entry   { background: linear-gradient(135deg, rgba(61,220,132,0.7), rgba(0,130,0,0.4)); }
.match-tile-colorwash.expert  { background: linear-gradient(135deg, rgba(255,176,32,0.7), rgba(220,120,0,0.4)); }
.match-tile-colorwash.guru    { background: linear-gradient(135deg, rgba(242,106,90,0.7), rgba(180,30,20,0.4)); }
.match-tile-gradient { position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(to right, rgba(0,0,0,0.82), rgba(0,0,0,0.50), rgba(0,0,0,0.25)); }
.match-tile-watermark { position: absolute; z-index: 2; right: 8%; top: 50%; transform: translateY(-50%);
    max-height: 80%; max-width: 25%; object-fit: contain; opacity: 0.18;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,0.5)); pointer-events: none; }
.match-tile-body { position: relative; z-index: 3; display: flex; flex-direction: column;
    padding: 12px 14px; gap: 6px; }

/* Header: title + chips */
.match-tile-head { display: flex; flex-direction: column; gap: 3px; }
.match-tile-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.match-tile-title { font-family: 'Raleway','Inter',sans-serif; font-weight: 700; font-size: 17px;
    color: #fff; margin: 0; line-height: 1.15; letter-spacing: -0.3px;
    flex: 1; min-width: 0; overflow-wrap: break-word; word-wrap: break-word; }
.match-tile-subtitle { font-family: 'Inter',sans-serif; font-weight: 400; font-size: 11px;
    color: rgba(255,255,255,0.78); line-height: 1.2; }
.match-tile-chips { display: flex; gap: 6px; flex-shrink: 0; align-items: flex-start; }

/* Action chips — compact obsidian buttons in the header chip row */
.action-chip { flex-shrink: 0; display: inline-flex; align-items: center; height: 26px; padding: 0 12px;
    border-radius: 8px; font-size: 11px; font-weight: 600; white-space: nowrap; cursor: pointer;
    background: #2a2a2a; border: 0.5px solid rgba(255,255,255,0.15);
    transition: all 0.15s; font-family: 'Inter', sans-serif; }
.action-chip:hover { background: #353535; border-color: rgba(255,255,255,0.25); }
.action-chip:active { transform: scale(0.95); box-shadow: 0 0 8px rgba(164,201,255,0.1); }
.action-chip.play { color: var(--match-play-green); border-color: rgba(74,222,128,0.35); }
.action-chip.play:active { background: rgba(74,222,128,0.15); border-color: rgba(74,222,128,0.5); }
.action-chip.play.disabled { opacity: 0.35; cursor: default; pointer-events: none; }
.action-chip.forfeit { color: var(--match-forfeit-red); border-color: rgba(244,63,94,0.35); }
.action-chip.forfeit:active { background: rgba(244,63,94,0.15); border-color: rgba(244,63,94,0.5); }

/* Completed chip — display-only status indicator */
.status-chip { flex-shrink: 0; display: inline-flex; align-items: center; height: 22px; padding: 0 9px;
    border-radius: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.status-chip.done { background: rgba(242,197,94,0.16); color: var(--match-gold); border: 1px solid rgba(242,197,94,0.40); }

/* Round / timer */
.match-tile-round { font-size: 11px; color: rgba(255,255,255,0.6); padding: 2px 0; }
.match-tile-round .timer { color: var(--match-gold); }

/* Roster — full width, capped at 4 rows */
.roster { display: flex; flex-direction: column; gap: 3px; margin-top: auto; padding-top: 4px; }
.roster-row { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 8px;
    border-radius: 8px; background: rgba(0,0,0,0.45); border: 0.5px solid rgba(255,255,255,0.12); }
.roster-rank { width: 16px; text-align: center; font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.45); }
.roster-avatar { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
    border: 1.5px solid rgba(255,255,255,0.35); background: rgba(255,255,255,0.15); }
.roster-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.9);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roster-name .you { font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.5); margin-left: 4px; }
.roster-score { font-size: 14px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.roster-score.pending { color: rgba(255,255,255,0.4); font-weight: 600; font-size: 11px; }
.roster-overflow { font-size: 11px; color: rgba(255,255,255,0.4); padding: 2px 8px; }

/* Winner emphasis */
.roster-row.winner {
    background: linear-gradient(135deg, rgba(242,197,94,0.22), rgba(242,197,94,0.06));
    border: 0.5px solid rgba(242,197,94,0.55);
    box-shadow: 0 0 14px rgba(242,197,94,0.18);
}
.roster-row.winner .roster-avatar { border-color: var(--match-gold); box-shadow: 0 0 8px rgba(242,197,94,0.8); }
.roster-row.winner .roster-name  { color: var(--match-winner-name); font-weight: 700; }
.roster-row.winner .roster-score { color: var(--match-gold); }
.roster-row.winner .roster-rank  { color: var(--match-gold); }
.crown { font-size: 12px; margin-left: 4px; filter: drop-shadow(0 0 4px rgba(242,197,94,0.6)); }

/* Active-match leader */
.roster-row.leading { border-color: rgba(255,255,255,0.22); background: rgba(255,255,255,0.08); }

/* Invitation cards */
.invitation-card {
    background: rgba(19,19,19,0.85); border: 0.5px solid rgba(255,255,255,0.10);
    border-radius: 12px; padding: 14px; margin-bottom: 10px;
}
.invitation-text { font-size: 14px; color: var(--text-primary); line-height: 1.4; margin-bottom: 6px; }
.invitation-text strong { color: #fff; font-weight: 700; }
.invitation-details { font-size: 12px; color: rgba(255,255,255,0.5); margin-bottom: 12px; }
.invitation-buttons { display: flex; gap: 8px; }
.inv-btn { flex: 1; height: 36px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
    background: transparent; font-family: 'Inter', sans-serif; }
.inv-btn.accept { border: 1px solid var(--valid-green); color: var(--match-play-green); }
.inv-btn.decline { border: 1px solid #f43f5e; color: var(--match-forfeit-red); }

/* Create Match form */
.create-match-form { max-width: 480px; }
.create-match-topic {
    font-size: 16px; font-weight: 700; color: var(--text-primary);
    padding: 10px 14px; background: var(--surface-light);
    border-radius: var(--radius-button); border: 1px solid var(--border-light);
}
.create-match-levels { display: flex; gap: 8px; flex-wrap: wrap; }
.create-match-levels .level-pill {
    cursor: pointer; transition: opacity 0.2s;
    flex: 1; display: flex; align-items: center; justify-content: center;
    height: 24px; border-radius: 12px; padding: 0 8px; margin-bottom: 0;
    border: 2px solid transparent; box-sizing: border-box;
}
.create-match-levels .level-pill.selected { border-color: white; }
.create-match-summary { font-size: 13px; color: var(--text-secondary); margin: 8px 0; font-style: italic; }
.create-match-actions { display: flex; gap: 8px; margin-top: 12px; }
.create-match-actions .action-btn {
    flex: 1; display: flex; align-items: center; justify-content: center;
    height: 44px; border-radius: 10px; background: transparent;
    border: 1px solid #34d399; color: white;
    font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 500;
    cursor: pointer; transition: all 0.15s;
}
.create-match-actions .action-btn:hover { background: rgba(52,211,153,0.1); }
.create-match-actions .action-btn:disabled { opacity: 0.4; cursor: default; }
.player-chip-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.player-chip {
    display: flex; align-items: center; gap: 6px; padding: 4px 10px;
    background: var(--surface-light); border: 1px solid var(--border-light);
    border-radius: 16px; font-size: 13px; color: var(--text-primary);
}
.player-chip-remove {
    background: none; border: none; color: var(--text-dimmed);
    font-size: 16px; cursor: pointer; padding: 0 2px; line-height: 1;
}
.player-chip-remove:hover { color: #EF4444; }

/* ── Topic Mode Toggle (Favorites plan §C3 — replaces .filter-toggle-*) ──── */
/* Three buttons: Daily (launcher) + My Favorites / Explore All (binary toggle).
   .label-wide shows at ≥360px, .label-narrow below — keeps the bar 1-line. */
.topic-mode-toggle {
    display: flex;
    gap: 8px;
    padding: 8px 12px 12px;
}
/* Green-outline buttons matching the EndGame design (#34d399); active view filled; equal thirds
   (min-width:0 lets nowrap buttons shrink below their text so all three are the same width). */
.mode-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    padding: 6px 6px;
    border-radius: 10px;
    border: 1px solid #34d399;
    background: transparent;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    overflow: hidden;
    line-height: 1.1;
}
.mode-btn:hover { background: rgba(52,211,153,0.10); }
.mode-btn.launcher:hover { background: rgba(52,211,153,0.10); }
.mode-btn.active {
    background: rgba(52,211,153,0.20);
    border-color: #34d399;
    color: #fff;
}
.mode-btn .mode-icon { font-size: 12px; }
.mode-btn .label-narrow { display: none; }
.mode-btn .label-wide   { display: inline; }
@media (max-width: 359px) {
    .mode-btn .label-narrow { display: inline; }
    .mode-btn .label-wide   { display: none; }
    .topic-mode-toggle      { gap: 6px; padding: 8px 8px 10px; }
    .mode-btn               { font-size: 12px; padding: 6px 4px; }
}

/* ── Favorites view, zero favorites: view-only Daily tile (Favorites plan §1.3) */
.empty-favorites {
    margin: 0 12px;
    padding: 20px 16px;
    background: rgba(0,0,0,0.30);
    border-radius: 14px;
    border: 0.5px solid rgba(255,255,255,0.10);
    text-align: center;
    display: flex; flex-direction: column; gap: 12px;
}
.empty-favorites .daily-tile {
    background: var(--card-gradient, linear-gradient(135deg,#082a52,#0e3d78));
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.10);
    position: relative;
    overflow: hidden;
}
.empty-favorites .daily-tile::before {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 100px; height: 100px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    pointer-events: none;
}
.empty-favorites .daily-tile .tile-title {
    font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 4px;
}
.empty-favorites .daily-tile .tile-subtitle {
    font-size: 12px; color: rgba(255,255,255,0.75);
}
.empty-favorites .empty-help {
    color: rgba(255,255,255,0.65);
    font-size: 13px;
    margin: 0;
}
.empty-favorites .empty-cta {
    padding: 10px 14px;
    border-radius: 8px;
    background: transparent;
    border: 0.5pt solid #4ADE80;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
}

/* ── Signup Favorites picker chips (Favorites plan §C3) ──────────────────── */
.auth-label-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 6px;
}
.auth-help-icon {
    width: 20px; height: 20px;
    border-radius: 50%;
    background: rgba(74, 144, 226, 0.20);
    border: 1px solid rgba(74, 144, 226, 0.6);
    color: #a4c9ff;
    font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}
.fav-search-row { margin-top: 4px; }
.fav-candidates {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-top: 12px;
}
.fav-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.06);
    font-size: 13px; color: #e2e2e2;
    cursor: pointer; user-select: none;
    transition: all 0.15s;
}
.fav-chip:hover { background: rgba(255,255,255,0.12); }
.fav-chip.selected {
    border-color: #4ADE80;
    background: rgba(74,222,128,0.18);
    color: #fff;
}
.fav-chip .chip-mark { font-size: 11px; opacity: 0.7; }
.fav-chip.selected .chip-mark { opacity: 1; color: #4ADE80; }
.fav-summary {
    font-size: 12px; color: rgba(255,255,255,0.7);
    text-align: left; margin-top: 10px;
}

/* ── Find New Topics overlay (Topics page) — reuses the signup .fav-chip picker styling ── */
.find-overlay-web {
    position: fixed; inset: 0; z-index: 90;
    display: flex; flex-direction: column;
    background: rgba(6,14,22,0.975);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.fow-top {
    display: flex; align-items: center; gap: 12px; flex: 0 0 auto;
    padding: 14px; border-bottom: 0.5px solid rgba(255,255,255,0.10);
}
.fow-close {
    width: 42px; height: 42px; border-radius: 11px; cursor: pointer;
    background: rgba(255,255,255,0.08); border: 0.5px solid rgba(255,255,255,0.20);
    color: #fff; font-size: 24px; line-height: 1;
}
.fow-title { color: #fff; font: 800 20px 'Raleway', sans-serif; }
.fow-body { flex: 1 1 auto; overflow-y: auto; padding: 14px; max-width: 640px; width: 100%; margin: 0 auto; }
.fow-footer {
    flex: 0 0 auto; padding: 12px 14px 16px;
    border-top: 0.5px solid rgba(255,255,255,0.10); background: rgba(6,14,22,0.92);
    max-width: 640px; width: 100%; margin: 0 auto;
}
.find-add-btn { width: 100%; min-height: 56px; }
.find-add-btn:disabled { opacity: 0.5; cursor: default; }
.fav-chip .chip-parent { color: rgba(255,255,255,0.5); font-size: 12px; }

/* Flat Topics doors — two side-by-side teal action buttons (match "Play This Topic" / MAUI act-primary). */
.topic-doors { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.topic-door {
    min-height: 54px; border-radius: 13px; cursor: pointer;
    color: #fff; font: 700 14px 'Inter', sans-serif;
    background: rgba(52,211,153,0.22); border: 1px solid #34d399;
    transition: background 0.12s, transform 0.06s;
}
.topic-door:hover { background: rgba(52,211,153,0.30); }
.topic-door:active { background: rgba(52,211,153,0.40); transform: translateY(1px); }
/* Themes overlay results preview (a teaser of the first couple of matches; the full set drives the game). */
.theme-teaser-caption { margin: 14px 0 0; color: #fff; font: 700 15px 'Inter', sans-serif; }
.theme-results { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.theme-prev-web { color: rgba(255,255,255,0.85); font: 500 13.5px 'Inter', sans-serif; line-height: 1.35; }

/* ── Help overlay (signup Favorites field) ──────────────────────────────── */
.help-overlay-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 100;
    padding: 24px;
}
.help-overlay-card {
    max-width: 320px; width: 100%;
    background: rgba(20,37,48,0.97);
    border: 1px solid rgba(74,144,226,0.4);
    border-radius: 14px;
    padding: 18px 20px;
    color: #e2e2e2;
    text-align: left;
}
.help-overlay-card h4 {
    margin: 0 0 8px; font-size: 15px; color: #a4c9ff;
}
.help-overlay-card p {
    margin: 0 0 12px; font-size: 13px; line-height: 1.45;
}
.help-overlay-close {
    background: transparent; border: 0.5pt solid #4ADE80;
    color: #fff; padding: 8px 14px;
    border-radius: 8px; font-family: 'Inter', sans-serif; font-size: 13px;
    cursor: pointer; font-weight: 600;
}

.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }

/* Modal overlay */
.modal-overlay {
    position:fixed; top:0; left:0; right:0; bottom:0;
    background:rgba(0,0,0,0.7); z-index:1000;
    display:flex; align-items:center; justify-content:center;
}
.modal-dialog {
    background:#1a1a2e; border:1px solid rgba(255,255,255,0.15);
    border-radius:12px; padding:24px; max-width:360px; margin:0 16px;
}
