/* ==========================================================================
   BONGO BRAIN BATTLE x CRDB BANK — GREEN, GOLD & WHITE CLASSIC UI
   ========================================================================== */

:root {
    --logo-forest: #036735;       /* Exact match with system_logo.jpg */
    --crdb-green-dark: #024c27;
    --crdb-lime: #43b02a;
    --crdb-lime-bright: #5ce63d;
    --bbb-gold: #ffd100;
    --bbb-gold-soft: #fff9db;

    --bg-canvas: #f8fbf9;
    --surface-white: #ffffff;
    --text-main: #0f2419;
    --text-muted: #4a6356;
    --border-subtle: rgba(3, 103, 53, 0.14);
    --shadow-soft: 0 22px 44px -15px rgba(2, 76, 39, 0.14);
    --shadow-card: 0 6px 24px rgba(0, 0, 0, 0.04);
    --radius-lg: 20px;
    --radius-md: 12px;
}

body[data-page="home-landing"] {
    background: var(--bg-canvas);
    color: var(--text-main);
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    display: block !important;
}

body[data-page="home-landing"] .app-bg {
    z-index: 0 !important;
    pointer-events: none;
    background:
        radial-gradient(circle at 90% 14%, rgba(255, 209, 0, 0.12) 0%, transparent 38%),
        radial-gradient(circle at 8% 45%, rgba(3, 103, 53, 0.08) 0%, transparent 45%),
        var(--bg-canvas);
}

body[data-page="home-landing"] .player-shell {
    position: relative !important;
    z-index: 5 !important;
    max-width: 100% !important;
    width: 100% !important;
    min-height: 100vh;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
}

.bbb-landing-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    min-height: 100vh;
}

.bbb-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

/* ---------------- Clean Glass Navbar (Compact Logo) ---------------- */
.bbb-navbar {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 50;
}

.bbb-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.bbb-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Compact Leaf Badge in Navbar with Muted Gold + Green Gradient Sweep */
.logo-leaf-cut {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--logo-forest);
    padding: 0.3rem 0.9rem 0.3rem 0.75rem;
    border-radius: 4px 20px 4px 20px;
    box-shadow: -3px 3px 0 0 var(--bbb-gold);
    text-decoration: none;
    transition: transform 0.2s ease;
}

.logo-leaf-cut:hover {
    transform: translateY(-1px);
}



.bbb-nav-logo {
    height: 30px;
    width: auto;
    display: block;
}

.bbb-partner-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: #eef7f1;
    border: 1px solid rgba(3, 103, 53, 0.16);
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--crdb-green-dark);
}

.bbb-partner-pill strong {
    color: var(--logo-forest);
}

.dot-live {
    width: 8px;
    height: 8px;
    background: var(--crdb-lime);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(67, 176, 42, 0.22);
}

.bbb-nav-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.bbb-nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.bbb-nav-link:hover {
    color: var(--logo-forest);
}

/* Language Switcher */
.lang-switch {
    display: inline-flex;
    background: #edf5ef;
    border: 1px solid rgba(3, 103, 53, 0.18);
    border-radius: 999px;
    padding: 2px;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-btn.active {
    background: var(--logo-forest);
    color: var(--bbb-gold);
}

.btn-nav-cta {
    text-decoration: none;
    padding: 0.5rem 1.15rem;
    border-radius: 999px;
    background: var(--bbb-gold);
    color: var(--crdb-green-dark);
    font-weight: 800;
    font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(255, 209, 0, 0.35);
    transition: transform 0.2s ease;
}

.btn-nav-cta:hover {
    transform: translateY(-1px);
}

/* ---------------- Hero Section & Large Hero Logo ---------------- */
.bbb-main {
    position: relative;
    z-index: 10;
}

.bbb-hero {
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    gap: clamp(2rem, 4.5vw, 3.75rem);
    align-items: center;
    padding: clamp(2rem, 4.5vw, 3.5rem) 0;
}

.hero-brand-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-bottom: 1.35rem;
}

/* Prominent Hero Crest with Muted Gold + Green Gradient Sweep */
.hero-petal-cut {
    background: var(--logo-forest);
    padding: 0.9rem 2.25rem 0.9rem 1.75rem;
    border-radius: 10px 48px 10px 48px;
    border: 2px solid rgba(255, 209, 0, 0.45);
    box-shadow:
        -7px 7px 0 0 var(--bbb-gold),
        0 18px 34px -10px rgba(3, 103, 53, 0.32);
    display: inline-flex;
    align-items: center;
}


.hero-logo-img {
    height: 138px;
    width: auto;
    display: block;
}

.crdb-live-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--bbb-gold-soft);
    border: 1px solid rgba(255, 209, 0, 0.65);
    color: var(--crdb-green-dark);
    font-weight: 800;
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--logo-forest);
}

.bbb-title {
    font-size: clamp(2.25rem, 4.4vw, 3.6rem);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0 0 1.1rem 0;
    color: var(--text-main);
}

.text-gradient {
    background: linear-gradient(120deg, var(--logo-forest) 0%, var(--crdb-lime) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bbb-subtitle {
    font-size: clamp(1rem, 1.3vw, 1.1rem);
    line-height: 1.65;
    color: var(--text-muted);
    margin: 0 0 1.75rem 0;
    max-width: 55ch;
}

/* Join Box Card */
.join-box-card {
    background: var(--surface-white);
    border: 1.5px solid rgba(3, 103, 53, 0.16);
    border-radius: var(--radius-lg);
    padding: 1.15rem;
    box-shadow: var(--shadow-soft);
}

.join-form {
    display: flex;
    gap: 0.75rem;
}

.input-group {
    flex: 1;
}

.input-group input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.95rem 1.15rem;
    border: 2px solid #dfe9e3;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group input::placeholder {
    text-transform: none;
    font-weight: 500;
    letter-spacing: normal;
    color: #8ba195;
}

.input-group input:focus {
    outline: none;
    border-color: var(--logo-forest);
    box-shadow: 0 0 0 4px rgba(3, 103, 53, 0.12);
}

.btn-crdb-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--logo-forest) 0%, var(--crdb-green-dark) 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 209, 0, 0.35);
    border-radius: var(--radius-md);
    padding: 0.95rem 1.65rem;
    font-family: inherit;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn-crdb-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(3, 103, 53, 0.28);
}

/* Active Rooms Strip */
.active-rooms-strip {
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px dashed #dfe9e3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.65rem;
    font-size: 0.85rem;
}

.strip-label {
    color: var(--text-muted);
    font-weight: 600;
}

.room-chips {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.room-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    background: #eef7f1;
    color: var(--crdb-green-dark);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.82rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.room-chip:hover {
    background: var(--bbb-gold);
    color: var(--crdb-green-dark);
}

.pulse-ring {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--crdb-lime);
}

.create-link {
    color: var(--logo-forest);
    font-weight: 700;
    text-decoration: none;
}

/* ---------------- Interactive Static 4-Mode Demo Arena ---------------- */
.arena-card {
    background: linear-gradient(160deg, var(--logo-forest) 0%, #032b17 100%);
    color: #ffffff;
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 28px 50px -15px rgba(2, 56, 29, 0.38);
    border: 2px solid rgba(255, 209, 0, 0.35);
}

.arena-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.9rem;
    gap: 0.5rem;
}

.demo-label {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--bbb-gold);
}

.guest-score-pill {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 209, 0, 0.4);
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
}

.guest-score-pill strong {
    color: var(--bbb-gold);
    margin-left: 0.25rem;
}

/* 4 Mode Toggle Tabs */
.mode-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
    background: rgba(0, 0, 0, 0.28);
    padding: 0.3rem;
    border-radius: 12px;
    margin-bottom: 0.9rem;
}

.mode-tab {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.78);
    font-family: inherit;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 0.48rem 0.35rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.mode-tab:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.mode-tab.active {
    background: var(--bbb-gold);
    color: var(--crdb-green-dark);
    box-shadow: 0 3px 10px rgba(255, 209, 0, 0.3);
}

/* Rule Explanation Banner */
.mode-rule-box {
    background: rgba(255, 255, 255, 0.08);
    border-left: 3px solid var(--bbb-gold);
    padding: 0.55rem 0.75rem;
    border-radius: 0 8px 8px 0;
    font-size: 0.78rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
}

.arena-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
}

.badge-round {
    background: rgba(255, 255, 255, 0.12);
    color: var(--crdb-lime-bright);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
}

.badge-timer {
    background: var(--bbb-gold);
    color: #052e1b;
    font-weight: 800;
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
}

/* Wager Selector */
.wager-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: rgba(255, 209, 0, 0.12);
    border: 1px solid rgba(255, 209, 0, 0.35);
    padding: 0.45rem 0.7rem;
    border-radius: 10px;
    margin-bottom: 0.85rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.wager-btns {
    display: flex;
    gap: 0.35rem;
}

.wager-chip {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.22rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
}

.wager-chip.active {
    background: var(--bbb-gold);
    color: var(--crdb-green-dark);
    border-color: var(--bbb-gold);
}

.arena-question p {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.42;
    margin: 0 0 1rem 0;
}

.arena-options {
    display: grid;
    gap: 0.55rem;
}

.arena-options .opt-btn {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-family: inherit;
    padding: 0.68rem 0.9rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}

.arena-options .opt-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.16);
    border-color: var(--bbb-gold);
    transform: translateX(3px);
}

.arena-options .opt-btn span {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: inline-grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 800;
}

.arena-options .opt-btn.selected {
    background: rgba(67, 176, 42, 0.35);
    border-color: var(--crdb-lime-bright);
}

.arena-options .opt-btn.wrong {
    background: rgba(239, 68, 68, 0.28);
    border-color: #f87171;
}

.arena-options .opt-btn small {
    margin-left: auto;
    color: var(--bbb-gold);
    font-weight: 800;
    font-size: 0.85rem;
}

.demo-feedback {
    margin-top: 0.75rem;
    padding: 0.55rem 0.8rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
}

.demo-feedback.is-correct {
    background: rgba(67, 176, 42, 0.25);
    border: 1px solid var(--crdb-lime-bright);
    color: #d9ffcf;
}

.demo-feedback.is-wrong {
    background: rgba(239, 68, 68, 0.22);
    border: 1px solid #f87171;
    color: #fee2e2;
}

.arena-footer {
    margin-top: 1.1rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.82);
    gap: 0.5rem;
}

.players-online {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.avatar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bbb-gold);
}

.btn-next-sample {
    background: var(--bbb-gold);
    color: var(--crdb-green-dark);
    border: none;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 800;
    padding: 0.38rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.btn-next-sample:hover {
    transform: translateY(-1px);
}

/* ---------------- Upcoming Event Showcase ---------------- */
.bbb-event-section {
    padding: 1.5rem 0 2.5rem 0;
}

.event-card {
    background: var(--surface-white);
    border: 1.5px solid rgba(3, 103, 53, 0.16);
    border-radius: 26px;
    padding: clamp(1.35rem, 3vw, 2.25rem);
    box-shadow: var(--shadow-soft);
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: clamp(1.5rem, 3.5vw, 2.75rem);
    align-items: center;
}

.event-poster-wrap {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: var(--logo-forest);
    box-shadow: 0 18px 36px -12px rgba(3, 103, 53, 0.35);
    border: 2px solid rgba(3, 103, 53, 0.2);
}

.event-poster-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.event-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #eef7f1;
    color: var(--logo-forest);
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    margin-bottom: 0.85rem;
}

.event-heading {
    font-size: clamp(1.65rem, 3vw, 2.3rem);
    line-height: 1.15;
    font-weight: 800;
    margin: 0 0 1rem 0;
    color: var(--text-main);
}

.prize-banner {
    background: linear-gradient(135deg, var(--logo-forest) 0%, var(--crdb-green-dark) 100%);
    border-radius: 16px;
    padding: 0.95rem 1.25rem;
    margin-bottom: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    border-left: 5px solid var(--bbb-gold);
}

.prize-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    color: var(--crdb-lime-bright);
}

.prize-amount {
    font-size: clamp(1.55rem, 2.8vw, 2.1rem);
    font-weight: 800;
    color: var(--bbb-gold);
    letter-spacing: -0.02em;
}

.event-summary {
    font-size: 0.98rem;
    line-height: 1.65;
    color: var(--text-muted);
    margin: 0 0 1.25rem 0;
}

.event-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.4rem;
}

.meta-tile {
    background: #f4f9f6;
    border: 1px solid rgba(3, 103, 53, 0.12);
    border-radius: 14px;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.meta-kicker {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    color: var(--logo-forest);
}

.meta-tile strong {
    font-size: 0.96rem;
    font-weight: 800;
    color: var(--text-main);
}

.meta-tile small {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.event-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.btn-event-secondary {
    text-decoration: none;
    padding: 0.92rem 1.35rem;
    border-radius: var(--radius-md);
    border: 1.5px solid rgba(3, 103, 53, 0.25);
    color: var(--logo-forest);
    font-weight: 700;
    font-size: 0.94rem;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-event-secondary:hover {
    background: #eef7f1;
    border-color: var(--logo-forest);
}

/* ---------------- About Bongo Brain Battle Section ---------------- */
.bbb-about-section {
    padding: 2rem 0;
}

.about-grid {
    background: var(--surface-white);
    border: 1.5px solid var(--border-subtle);
    border-radius: 26px;
    padding: clamp(1.5rem, 3.5vw, 2.5rem);
    box-shadow: var(--shadow-card);
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: clamp(1.75rem, 4vw, 3rem);
    align-items: center;
}

.about-copy h2 {
    font-size: clamp(1.6rem, 2.8vw, 2.15rem);
    line-height: 1.2;
    font-weight: 800;
    margin: 0.4rem 0 1rem 0;
    color: var(--text-main);
}

.about-lead {
    font-size: 1.02rem;
    line-height: 1.68;
    color: var(--text-main);
    margin: 0 0 0.9rem 0;
}

.about-body {
    font-size: 0.95rem;
    line-height: 1.68;
    color: var(--text-muted);
    margin: 0;
}

.about-pillars {
    display: grid;
    gap: 0.9rem;
}

.pillar-card {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    background: #f6faf7;
    border: 1px solid rgba(3, 103, 53, 0.12);
    border-radius: 16px;
    padding: 1rem 1.15rem;
}

.pillar-badge {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--logo-forest);
    color: var(--bbb-gold);
    font-weight: 800;
    font-size: 0.82rem;
    display: grid;
    place-items: center;
}

.pillar-card h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--text-main);
}

.pillar-card p {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--text-muted);
}

/* ---------------- Game Modes Bento Grid ---------------- */
.bbb-modes {
    padding: 2.5rem 0;
}

.section-head {
    text-align: center;
    margin-bottom: 2.25rem;
}

.eyebrow-tag {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--logo-forest);
}

.section-head h2 {
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    margin: 0.35rem 0 0 0;
    font-weight: 800;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.bento-card {
    background: var(--surface-white);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.65rem;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.bento-card:hover {
    transform: translateY(-4px);
    border-color: var(--bbb-gold);
    box-shadow: 0 14px 28px -10px rgba(3, 103, 53, 0.16);
}

.mode-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.icon-green { background: #e3f5ea; color: var(--logo-forest); }
.icon-gold  { background: var(--bbb-gold-soft); color: #8c6d00; border: 1px solid rgba(255, 209, 0, 0.5); }
.icon-lime  { background: #eaf9e6; color: #2b8217; }
.icon-dark  { background: var(--logo-forest); color: var(--bbb-gold); }

.bento-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.15rem;
    font-weight: 800;
}

.bento-card p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--text-muted);
}

/* ---------------- Official Sponsors & Partners ---------------- */
.bbb-sponsors-section {
    padding: 2rem 0 2.75rem 0;
}

.main-sponsor-feature {
    background: linear-gradient(155deg, var(--logo-forest) 0%, #032b17 100%);
    color: #ffffff;
    border-radius: 24px;
    padding: clamp(1.25rem, 3vw, 2rem);
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    gap: clamp(1.25rem, 3vw, 2.5rem);
    align-items: center;
    margin-bottom: 1.5rem;
    border: 2px solid rgba(255, 209, 0, 0.35);
    box-shadow: 0 20px 40px -15px rgba(2, 56, 29, 0.32);
}

.sponsor-art-box {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: var(--logo-forest);
}

.sponsor-banner-img {
    width: 100%;
    height: auto;
    display: block;
}

.tier-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 0.32rem 0.75rem;
    border-radius: 999px;
    background: #eef7f1;
    color: var(--logo-forest);
    margin-bottom: 0.65rem;
}

.tier-badge.tier-main {
    background: var(--bbb-gold);
    color: var(--crdb-green-dark);
}

.sponsor-feature-copy h3 {
    font-size: clamp(1.35rem, 2.4vw, 1.85rem);
    font-weight: 800;
    margin: 0 0 0.75rem 0;
    color: #ffffff;
}

.sponsor-feature-copy p {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.88);
}

.sponsors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.sponsor-card {
    background: var(--surface-white);
    border: 1.5px solid var(--border-subtle);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.sponsor-card:hover {
    transform: translateY(-4px);
    border-color: var(--logo-forest);
}

.sponsor-thumb {
    background: var(--logo-forest);
    aspect-ratio: 1 / 1;
    max-height: 240px;
    overflow: hidden;
}

.sponsor-thumb img {
    width: 100%;
    height: 100%;
    object-fit: scale-down;
    display: block;
}

.sponsor-info {
    padding: 1.35rem;
    flex: 1;
}

.sponsor-info h4 {
    margin: 0 0 0.45rem 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
}

.sponsor-info p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-muted);
}

.ecosystem-strip {
    margin-top: 1.35rem;
    background: var(--surface-white);
    border: 1px dashed rgba(3, 103, 53, 0.25);
    border-radius: 16px;
    padding: 0.9rem 1.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.eco-label {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-muted);
}

.eco-pills {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.eco-pill {
    background: #eef7f1;
    color: var(--crdb-green-dark);
    font-weight: 800;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(3, 103, 53, 0.16);
}

/* ---------------- How It Works ---------------- */
.bbb-steps {
    background: var(--surface-white);
    border: 1.5px solid var(--border-subtle);
    border-radius: 24px;
    padding: 2rem;
    margin: 1rem 0 3rem 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.75rem;
}

.step-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.step-num {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--logo-forest);
    color: var(--bbb-gold);
    font-weight: 800;
    display: grid;
    place-items: center;
    font-size: 0.9rem;
}

.step-item h4 {
    margin: 0 0 0.3rem 0;
    font-size: 1rem;
    font-weight: 800;
}

.step-item p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ---------------- Footer ---------------- */
.bbb-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 1.75rem 0 2.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.footer-right a {
    color: var(--logo-forest);
    font-weight: 700;
    text-decoration: none;
}

.footer-right a:hover {
    text-decoration: underline;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

/* ---------------- Mobile Responsiveness ---------------- */
@media (max-width: 960px) {
    .bbb-hero,
    .event-card,
    .about-grid,
    .main-sponsor-feature {
        grid-template-columns: 1fr;
    }
    .bbb-nav-link,
    .bbb-partner-pill {
        display: none;
    }
    .hero-logo-img {
        height: 88px;
    }
}

@media (max-width: 600px) {
    .event-meta-grid {
        grid-template-columns: 1fr;
    }
    .join-form {
        flex-direction: column;
    }
    .btn-crdb-primary {
        width: 100%;
    }
    .mode-tabs {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   LOBBY PAGE EXTENSION (SEAMLESS CONTINUITY WITH LANDING PAGE)
   ========================================================================== */

body[data-page="lobby-landing"] {
    background: var(--bg-canvas);
    color: var(--text-main);
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    display: block !important;
}

body[data-page="lobby-landing"] .app-bg {
    z-index: 0 !important;
    pointer-events: none;
    background:
        radial-gradient(circle at 90% 14%, rgba(255, 209, 0, 0.12) 0%, transparent 38%),
        radial-gradient(circle at 8% 45%, rgba(3, 103, 53, 0.08) 0%, transparent 45%),
        var(--bg-canvas);
}

body[data-page="lobby-landing"] .player-shell {
    position: relative !important;
    z-index: 5 !important;
    max-width: 100% !important;
    width: 100% !important;
    min-height: 100vh;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
}

.lobby-player-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: #eef7f1;
    border: 1px solid rgba(3, 103, 53, 0.18);
    color: var(--crdb-green-dark);
    padding: 0.38rem 0.85rem;
    border-radius: 999px;
    font-size: 0.82rem;
}

.bbb-lobby-main {
    padding-top: clamp(1.75rem, 4vw, 3rem);
    padding-bottom: 1rem;
}

.lobby-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: clamp(1.5rem, 3.5vw, 2.75rem);
    align-items: stretch;
    margin-bottom: 2.5rem;
}

.lobby-primary-card {
    background: var(--surface-white);
    border: 1.5px solid rgba(3, 103, 53, 0.16);
    border-radius: 24px;
    padding: clamp(1.5rem, 3vw, 2.35rem);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.lobby-petal-size {
    padding: 0.65rem 1.65rem 0.65rem 1.35rem;
}

.lobby-hero-logo {
    height: 76px;
}

.lobby-heading {
    font-size: clamp(2rem, 3.8vw, 3rem);
    margin-bottom: 0.75rem;
}

.lobby-copy {
    margin-bottom: 1.5rem;
}

.lobby-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.35rem;
}

.lobby-stat-card {
    background: #f5faf7;
    border: 1px solid rgba(3, 103, 53, 0.14);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.lobby-stat-card.stat-highlight {
    background: linear-gradient(145deg, #eef8f1 0%, #fdfbe8 100%);
    border-color: rgba(154, 217, 30, 0.55);
}

.stat-kicker {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--logo-forest);
}

.lobby-stat-card strong {
    font-size: clamp(1.2rem, 2.1vw, 1.55rem);
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.lobby-stat-card small {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}

.lobby-sync-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #eef7f1;
    border: 1px dashed rgba(3, 103, 53, 0.25);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--crdb-green-dark);
}

.sync-spinner {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border: 2.5px solid rgba(3, 103, 53, 0.2);
    border-top-color: var(--logo-forest);
    border-radius: 50%;
    animation: bbbSpin 0.9s linear infinite;
}

@keyframes bbbSpin {
    to { transform: rotate(360deg); }
}

.lobby-arena-side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.lobby-checklist {
    display: grid;
    gap: 0.8rem;
    margin: 0.5rem 0;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    padding: 0.85rem 1rem;
}

.check-badge {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #d8c456 0%, #9ec45a 55%, #67a860 100%);
    color: #03331a;
    font-weight: 800;
    font-size: 0.78rem;
    display: grid;
    place-items: center;
}

.check-row strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.15rem;
}

.check-row small {
    display: block;
    font-size: 0.8rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.78);
}

@media (max-width: 960px) {
    .lobby-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .lobby-meta-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   LEADERBOARD PAGE EXTENSION (MATCHES LANDING & LOBBY UI)
   ========================================================================== */

body[data-page="leaderboard-landing"] {
    background:
        radial-gradient(circle at 90% 10%, rgba(255, 209, 0, 0.12) 0%, transparent 38%),
        radial-gradient(circle at 8% 45%, rgba(3, 103, 53, 0.08) 0%, transparent 45%),
        var(--bg-canvas);
    color: var(--text-main);
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.lb-room-chip {
    background: #eef7f1;
    border: 1px solid rgba(3, 103, 53, 0.2);
    color: var(--crdb-green-dark);
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}

.lb-room-chip strong {
    color: var(--logo-forest);
    margin-left: 0.25rem;
    letter-spacing: 0.05em;
}

.lb-main {
    padding-top: 1.5rem;
    padding-bottom: 2.5rem;
}

.lb-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.lb-split-grid {
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    gap: 1.5rem;
    align-items: stretch;
}

.lb-stage-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 460px;
}

.lb-waiting-box {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    padding: 1rem;
}

.lb-waiting-box h2 {
    margin: 0;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 800;
}

.lb-qr-box {
    background: #ffffff;
    padding: 0.85rem;
    border-radius: 18px;
    box-shadow: -5px 5px 0 0 #9ec45a, 0 12px 24px rgba(0, 0, 0, 0.25);
}

.lb-qr-box img {
    width: 200px;
    height: 200px;
    display: block;
}

.lb-code-display {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: var(--bbb-gold);
    background: rgba(0, 0, 0, 0.28);
    border: 1.5px solid rgba(255, 209, 0, 0.45);
    padding: 0.45rem 1.5rem;
    border-radius: 12px;
}

.lb-stage-note {
    margin: 0;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.82);
}

.lb-live-box {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.lb-timer-pill {
    font-size: 1.25rem;
    padding: 0.35rem 0.9rem;
}

.lb-timer-pill.is-urgent {
    background: #ef4444;
    color: #ffffff;
}

.lb-question-body {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    padding: 1.75rem 1.35rem;
    margin: 1rem 0;
    text-align: center;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lb-question-body p {
    margin: 0;
    font-size: clamp(1.35rem, 2.2vw, 1.95rem);
    font-weight: 800;
    line-height: 1.38;
}

/* Right White Card: Live Rankings Table */
.lb-board-card {
    background: var(--surface-white);
    border: 1.5px solid rgba(3, 103, 53, 0.16);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
}

.lb-board-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 0.75rem;
}

.lb-board-head h2 {
    margin: 0.2rem 0 0 0;
    font-size: 1.45rem;
    font-weight: 800;
}

.lb-table-wrap {
    overflow-y: auto;
    max-height: 440px;
}

.lb-table {
    width: 100%;
    border-collapse: collapse;
}

.lb-table th {
    text-align: left;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
}

.lb-table td {
    padding: 0.85rem 0.75rem;
    border-bottom: 1px solid #edf4ef;
    vertical-align: middle;
}

.lb-table tr.is-first {
    background: linear-gradient(90deg, #fffbe6 0%, #f1faf4 100%);
}

.lb-rank {
    width: 44px;
    font-weight: 800;
    font-size: 1rem;
    color: var(--logo-forest);
}

.lb-player-info {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.lb-player-info strong {
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--text-main);
}

.lb-bar-track {
    width: 100%;
    max-width: 220px;
    height: 6px;
    background: #e6f0ea;
    border-radius: 999px;
    overflow: hidden;
}

.lb-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--logo-forest) 0%, var(--crdb-lime) 100%);
    border-radius: 999px;
    transition: width 0.35s ease;
}

.lb-score {
    font-weight: 800;
    font-size: 1rem;
    color: var(--logo-forest);
    white-space: nowrap;
}

.text-right {
    text-align: right !important;
}

.lb-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2.5rem 1rem !important;
    font-weight: 600;
}

@media (max-width: 960px) {
    .lb-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .lb-split-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .lb-stats-grid {
        grid-template-columns: 1fr;
    }
}



/* ==========================================================================
   CENTERED CARD PAGES (JOIN, AUTH & SIMPLE VIEWS - MATCHES LANDING.CSS)
   ========================================================================== */

body[data-page="join-landing"] {
    background:
        radial-gradient(circle at 90% 14%, rgba(255, 209, 0, 0.12) 0%, transparent 38%),
        radial-gradient(circle at 8% 45%, rgba(3, 103, 53, 0.08) 0%, transparent 45%),
        var(--bg-canvas);
    color: var(--text-main);
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
    display: block !important;
}

body[data-page="join-landing"] .app-bg {
    z-index: 0 !important;
    pointer-events: none;
}

body[data-page="join-landing"] .player-shell {
    position: relative !important;
    z-index: 5 !important;
    max-width: 100% !important;
    width: 100% !important;
    min-height: 100vh;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
}

.auth-center-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0;
}

.auth-center-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
}

.auth-center-card {
    width: 100%;
    max-width: 620px; /* Pana zaidi kwenye desktop */
    background: var(--surface-white);
    border: 1.5px solid rgba(3, 103, 53, 0.16);
    border-radius: 26px;
    padding: clamp(1.75rem, 4vw, 2.75rem);
    box-shadow: var(--shadow-soft);
    text-align: left;
}

.auth-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
    padding-bottom: 1.25rem;
    margin-bottom: 1.35rem;
    border-bottom: 1px dashed #dfe9e3;
}

.auth-petal {
    padding: 0.75rem 1.85rem 0.75rem 1.5rem;
}

.auth-logo-img {
    height: 88px;
}

.auth-room-badge .crdb-live-tag {
    font-size: 0.85rem;
    padding: 0.55rem 1.15rem;
}

.auth-header {
    margin-bottom: 1.35rem;
}

.auth-title {
    font-size: clamp(1.65rem, 3vw, 2.15rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 0.45rem 0;
    color: var(--text-main);
}

.auth-subtitle {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--text-muted);
}

@media (max-width: 520px) {
    .auth-top-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

.auth-error-box {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    font-size: 0.86rem;
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    text-align: left;
}

.auth-form {
    display: grid;
    gap: 1rem;
    text-align: left;
}

.auth-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--crdb-green-dark);
    margin-bottom: 0.4rem;
}

.auth-form .input-group input {
    text-transform: none;
    letter-spacing: normal;
}

.auth-submit-btn {
    width: 100%;
    padding: 1rem 1.5rem;
}

.auth-footer-link {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px dashed #dfe9e3;
    font-size: 0.85rem;
}

.auth-footer-link a {
    color: var(--logo-forest);
    font-weight: 700;
    text-decoration: none;
}

.auth-footer-link a:hover {
    text-decoration: underline;
}


/* ==========================================================================
   QUIZ PLAY ARENA PAGE (MATCHES LANDING.CSS)
   ========================================================================== */

body[data-page="quiz-landing"] {
    background:
        radial-gradient(circle at 90% 14%, rgba(255, 209, 0, 0.12) 0%, transparent 38%),
        radial-gradient(circle at 8% 45%, rgba(3, 103, 53, 0.08) 0%, transparent 45%),
        var(--bg-canvas);
    color: var(--text-main);
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
    display: block !important;
}

body[data-page="quiz-landing"] .app-bg {
    z-index: 0 !important;
    pointer-events: none;
}

body[data-page="quiz-landing"] .player-shell {
    position: relative !important;
    z-index: 5 !important;
    max-width: 100% !important;
    width: 100% !important;
    min-height: 100vh;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
}

.quiz-arena-shell {
    max-width: 720px;
}

.quiz-hud-pills {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.quiz-score-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--logo-forest);
    color: #ffffff;
    padding: 0.48rem 0.95rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.quiz-score-chip strong {
    color: var(--bbb-gold);
    font-size: 0.92rem;
}

.score-delta {
    position: absolute;
    right: 0.5rem;
    top: -1.35rem;
    background: var(--bbb-gold);
    color: var(--crdb-green-dark);
    font-weight: 800;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.score-delta.show {
    opacity: 1;
    transform: translateY(0);
}

.quiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.quiz-header .eyebrow-tag {
    margin: 0 0 0.2rem 0;
}

.progress-copy {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 600;
}

.progress-copy strong {
    color: var(--text-main);
}

/* Circular SVG Countdown Timer */
.timer {
    position: relative;
    width: 60px;
    height: 60px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.timer-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-track {
    fill: #eef7f1;
    stroke: #d7e8de;
    stroke-width: 5;
}

.timer-ring {
    fill: none;
    stroke: var(--logo-forest);
    stroke-width: 5;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.2s linear, stroke 0.2s ease;
}

.timer.warning .timer-ring {
    stroke: #e0a800;
}

.timer.danger .timer-ring {
    stroke: #dc2626;
}

.timer strong {
    position: relative;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-main);
}

.timer.danger strong {
    color: #dc2626;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e6f0ea;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.progress-bar > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--logo-forest) 0%, var(--crdb-lime) 100%);
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* Question Display Card (Forest Green Arena Theme) */
.question-wrap {
    background: linear-gradient(155deg, var(--logo-forest) 0%, #032b17 100%);
    color: #ffffff;
    border-radius: 20px;
    padding: 1.35rem 1.5rem;
    border: 1.5px solid rgba(255, 209, 0, 0.35);
    margin-bottom: 1.15rem;
}

.question-label {
    margin: 0 0 0.45rem 0;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bbb-gold);
}

.question-text {
    margin: 0;
    font-size: clamp(1.15rem, 2.2vw, 1.45rem);
    font-weight: 800;
    line-height: 1.4;
    color: #ffffff;
}

/* Answer Options Buttons */
.answer-grid {
    display: grid;
    gap: 0.65rem;
}

.answer-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-align: left;
    background: #f6faf7;
    border: 1.5px solid rgba(3, 103, 53, 0.18);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    font-family: inherit;
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.answer-btn:hover:not(:disabled) {
    background: #eef7f1;
    border-color: var(--logo-forest);
    transform: translateX(3px);
}

.answer-btn .opt-key {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--logo-forest);
    color: var(--bbb-gold);
    font-weight: 800;
    font-size: 0.82rem;
    display: grid;
    place-items: center;
}

.answer-btn.is-picked {
    background: var(--bbb-gold-soft);
    border-color: #d9b100;
    box-shadow: 0 4px 14px rgba(255, 209, 0, 0.25);
}

.answer-btn.is-picked .opt-key {
    background: var(--bbb-gold);
    color: var(--crdb-green-dark);
}

.answer-btn:disabled {
    opacity: 0.68;
    cursor: not-allowed;
}

/* Feedback Message Box */
.quiz-feedback-box {
    margin-top: 0.95rem;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 12px;
}

.quiz-feedback-box:not(:empty) {
    padding: 0.75rem 1rem;
    background: #f4f9f6;
    border: 1px solid rgba(3, 103, 53, 0.16);
}

.quiz-feedback-box.is-success {
    background: #e7f8ed;
    border-color: #43b02a;
    color: #024c27;
}

.quiz-feedback-box.is-error {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.quiz-feedback-box.is-warning {
    background: var(--bbb-gold-soft);
    border-color: #facc15;
    color: #713f12;
}

.quiz-feedback-box.is-info {
    background: #eef7f1;
    border-color: var(--logo-forest);
    color: var(--logo-forest);
}

/* Mini Live Leaderboard at Bottom of Card */
.quiz-mini-lb {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px dashed #dfe9e3;
}

.quiz-mini-lb-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.55rem;
    font-size: 0.88rem;
    color: var(--text-main);
}

.mini-live-pill {
    background: #eef7f1;
    color: var(--logo-forest);
    border: 1px solid rgba(3, 103, 53, 0.2);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}

.quiz-mini-lb-list {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.mini-lb-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0.65rem;
    border-radius: 10px;
    border-bottom: 1px solid #edf4ef;
    color: var(--text-main);
}

.mini-lb-row.is-you {
    background: #eef7f1;
    font-weight: 800;
}

.you-tag {
    font-style: normal;
    color: var(--logo-forest);
    font-size: 0.78rem;
}


/* ==========================================================================
   RESULTS PAGE (MATCHES LANDING.CSS & QUIZ ARENA)
   ========================================================================== */

body[data-page="results"] {
    background:
        radial-gradient(circle at 90% 14%, rgba(255, 209, 0, 0.12) 0%, transparent 38%),
        radial-gradient(circle at 8% 45%, rgba(3, 103, 53, 0.08) 0%, transparent 45%),
        var(--bg-canvas);
    color: var(--text-main);
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
    display: block !important;
}

body[data-page="results"] .app-bg {
    z-index: 0 !important;
    pointer-events: none;
}

body[data-page="results"] .player-shell {
    position: relative !important;
    z-index: 5 !important;
    max-width: 100% !important;
    width: 100% !important;
    min-height: 100vh;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
}

.results-arena-card {
    max-width: 680px;
}

.results-top-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.results-rank-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--logo-forest);
    color: #ffffff;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.results-rank-pill strong {
    color: var(--bbb-gold);
    font-size: 0.95rem;
}

/* Forest Green Score Summary Banner */
.results-hero-box {
    background: linear-gradient(155deg, var(--logo-forest) 0%, #032b17 100%);
    color: #ffffff;
    border-radius: 20px;
    padding: 1.45rem 1.65rem;
    border: 1.5px solid rgba(255, 209, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.15rem;
}

.results-kicker {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--crdb-lime-bright);
    margin-bottom: 0.25rem;
}

.results-score {
    margin: 0;
    font-size: clamp(2.1rem, 4vw, 2.85rem);
    font-weight: 800;
    line-height: 1.05;
    color: var(--bbb-gold);
}

.results-score small {
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.75);
    margin-left: 0.3rem;
}

.results-msg {
    margin: 0.45rem 0 0 0;
    font-size: 0.96rem;
    font-weight: 700;
    color: #ffffff;
}

.results-percent-ring {
    flex-shrink: 0;
    min-width: 92px;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 209, 0, 0.45);
    text-align: center;
}

.results-percent-ring span {
    display: block;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--bbb-gold);
    line-height: 1.1;
}

.results-percent-ring small {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.2rem;
}

/* 3 Stats Cards */
.results-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.res-stat-tile {
    background: #f5faf7;
    border: 1.5px solid rgba(3, 103, 53, 0.14);
    border-radius: 16px;
    padding: 0.9rem 1rem;
    text-align: center;
}

.res-stat-tile span {
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.res-stat-tile strong {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-main);
}

.res-stat-tile.is-correct {
    background: #eef9f2;
    border-color: rgba(67, 176, 42, 0.35);
}

.res-stat-tile.is-correct strong {
    color: var(--logo-forest);
}

.res-stat-tile.is-incorrect {
    background: #fef6f6;
    border-color: rgba(220, 38, 38, 0.22);
}

.res-stat-tile.is-incorrect strong {
    color: #b91c1c;
}

.res-stat-tile.is-unanswered {
    background: #fdfbec;
    border-color: rgba(255, 209, 0, 0.45);
}

.res-stat-tile.is-unanswered strong {
    color: #856404;
}

/* Action Buttons Row */
.results-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.results-actions .btn-crdb-primary,
.results-actions .btn-event-secondary {
    text-align: center;
    justify-content: center;
}

.results-lb-box {
    margin-top: 1.25rem;
}

@media (max-width: 560px) {
    .results-top-badges {
        align-items: flex-start;
    }
    .results-hero-box {
        flex-direction: column;
        align-items: flex-start;
    }
    .results-percent-ring {
        width: 100%;
    }
    .results-stats-grid,
    .results-actions {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================================
   ANSWER REVIEW PAGE (MATCHES LANDING.CSS & RESULTS PAGE)
   ========================================================================== */

body[data-page="review"] {
    background:
        radial-gradient(circle at 90% 14%, rgba(255, 209, 0, 0.12) 0%, transparent 38%),
        radial-gradient(circle at 8% 45%, rgba(3, 103, 53, 0.08) 0%, transparent 45%),
        var(--bg-canvas);
    color: var(--text-main);
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
    display: block !important;
}

body[data-page="review"] .app-bg {
    z-index: 0 !important;
    pointer-events: none;
}

body[data-page="review"] .player-shell {
    position: relative !important;
    z-index: 5 !important;
    max-width: 100% !important;
    width: 100% !important;
    min-height: 100vh;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
}

.review-arena-card {
    max-width: 720px;
}

.review-list {
    display: grid;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.review-list:empty::after {
    content: "Inapakia uchambuzi wa majibu yako...";
    display: block;
    text-align: center;
    padding: 1.75rem 1rem;
    background: #f5faf7;
    border: 1px dashed rgba(3, 103, 53, 0.22);
    border-radius: 16px;
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 600;
}

.review-list > article,
.review-list > div,
.review-item {
    background: #f6faf7;
    border: 1.5px solid rgba(3, 103, 53, 0.15);
    border-radius: 16px;
    padding: 1.1rem 1.25rem;
    line-height: 1.55;
    color: var(--text-main);
}

.review-list > article h3,
.review-list > div h3,
.review-item h3,
.review-list > article strong,
.review-list > div strong {
    color: var(--text-main);
}

.review-list > article p,
.review-list > div p,
.review-item p {
    margin: 0.35rem 0 0 0;
    font-size: 0.92rem;
    color: var(--text-muted);
}

.review-list .is-correct,
.review-list .correct {
    background: #eef9f2;
    border-color: rgba(67, 176, 42, 0.42);
}

.review-list .is-incorrect,
.review-list .incorrect,
.review-list .wrong {
    background: #fef6f6;
    border-color: rgba(220, 38, 38, 0.28);
}

.review-actions {
    padding-top: 1rem;
    border-top: 1px dashed #dfe9e3;
}




/* ==========================================================================
   MOBILE VIEWPORT OPTIMIZATION FOR QUIZ.HTML (<= 640px)
   Desktop (> 640px) remains completely unchanged!
   ========================================================================== */
@media (max-width: 640px) {
    body[data-page="quiz-landing"] .auth-center-shell {
        align-items: flex-start;
        padding: 0.5rem 0 1.25rem 0;
    }

    body[data-page="quiz-landing"] .bbb-container {
        width: 95%;
    }

    body[data-page="quiz-landing"] .quiz-arena-shell {
        padding: 0.85rem 0.9rem 1.15rem 0.9rem;
        border-radius: 20px;
    }

    /* 1. Compact Top Bar: Logo + Room + Score in one clean row */
    body[data-page="quiz-landing"] .quiz-brand-bar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        padding-bottom: 0.65rem;
        margin-bottom: 0.65rem;
    }

    body[data-page="quiz-landing"] .quiz-brand-bar .auth-petal {
        padding: 0.3rem 0.75rem 0.3rem 0.6rem;
        border-radius: 12px 4px 12px 4px;
    }

    body[data-page="quiz-landing"] .quiz-brand-bar .auth-logo-img {
        height: 36px;
    }

    body[data-page="quiz-landing"] .quiz-hud-pills {
        gap: 0.4rem;
        justify-content: flex-end;
    }

    body[data-page="quiz-landing"] .quiz-hud-pills .crdb-live-tag {
        padding: 0.35rem 0.65rem;
        font-size: 0.68rem;
    }

    body[data-page="quiz-landing"] .quiz-score-chip {
        padding: 0.35rem 0.7rem;
        font-size: 0.7rem;
    }

    body[data-page="quiz-landing"] .quiz-score-chip strong {
        font-size: 0.82rem;
    }

    /* 2. Compact Round Info + Crisp Timer */
    body[data-page="quiz-landing"] .quiz-header {
        margin-bottom: 0.45rem;
        gap: 0.65rem;
    }

    body[data-page="quiz-landing"] .quiz-header .eyebrow-tag {
        font-size: 0.68rem;
        padding: 0.22rem 0.6rem;
    }

    body[data-page="quiz-landing"] .progress-copy {
        font-size: 0.84rem;
    }

    body[data-page="quiz-landing"] .timer {
        width: 48px;
        height: 48px;
    }

    body[data-page="quiz-landing"] .timer strong {
        font-size: 0.95rem;
    }

    body[data-page="quiz-landing"] .progress-bar {
        height: 6px;
        margin-bottom: 0.7rem;
    }

    /* 3. High-Clarity Question Card */
    body[data-page="quiz-landing"] .question-wrap {
        padding: 0.95rem 1rem;
        border-radius: 16px;
        margin-bottom: 0.75rem;
    }

    body[data-page="quiz-landing"] .question-label {
        font-size: 0.68rem;
        margin-bottom: 0.3rem;
    }

    body[data-page="quiz-landing"] .question-text {
        font-size: 1.12rem;
        line-height: 1.38;
        letter-spacing: -0.01em;
    }

    /* 4. 2x2 Matrix Grid for 4 MCQ Options (A, B, C, D all visible without scroll) */
    body[data-page="quiz-landing"] .answer-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
    }

    body[data-page="quiz-landing"] .answer-btn {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 0.4rem;
        padding: 0.7rem 0.75rem;
        min-height: 76px;
        border-radius: 13px;
        font-size: 0.88rem;
        line-height: 1.3;
    }

    body[data-page="quiz-landing"] .answer-btn:hover:not(:disabled) {
        transform: none;
    }

    body[data-page="quiz-landing"] .answer-btn:active:not(:disabled) {
        transform: scale(0.98);
    }

    body[data-page="quiz-landing"] .answer-btn .opt-key {
        width: 24px;
        height: 24px;
        border-radius: 7px;
        font-size: 0.74rem;
    }

    body[data-page="quiz-landing"] .answer-btn .opt-text {
        word-break: break-word;
    }

    /* 5. Compact Feedback + Live Leaderboard Below (Accessible by scrolling down) */
    body[data-page="quiz-landing"] .quiz-feedback-box {
        margin-top: 0.65rem;
        font-size: 0.84rem;
    }

    body[data-page="quiz-landing"] .quiz-feedback-box:not(:empty) {
        padding: 0.55rem 0.75rem;
    }

    body[data-page="quiz-landing"] .quiz-mini-lb {
        margin-top: 0.9rem;
        padding-top: 0.75rem;
    }
}