:root {
    --brand-green: #25D366;
    --sage-green: #25D366;
    --sage-charcoal: #3E3E3E;
    --sage-gold: #FFD700;
    --dark-bg: #090d14;
    --card-bg: rgba(20, 26, 36, 0.92);

    /* Spacing system used by every menu card (start / pause / game over) */
    --card-pad: 20px;       /* equal padding on all four sides of a card */
    --gap-group: 18px;      /* space between groups (head, text, actions, footer) */
    --gap-item: 8px;        /* space between related items inside a group */
    --logo-h: 40px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* Interactive elements: full touch responsiveness & instant tap response */
button, a, .btn, .hud-card, .sound-btn, .surfer-fab, .social-icon-btn {
    touch-action: manipulation !important;
    pointer-events: auto !important;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    background-color: var(--dark-bg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    touch-action: none;
    -webkit-font-smoothing: antialiased;
}

#canvasContainer {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
}

#canvasContainer canvas {
    display: block;
    outline: none;
}

/* ============================================================================
   1. TOP HUD — SYMMETRICAL BALANCED LAYOUT & UNIFORM METRIC CARDS
   ============================================================================ */
#hud {
    position: fixed;
    top: calc(16px + env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    width: 100%;
    max-width: 440px;
    padding: 0 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    z-index: 10;
    margin: 0 auto;
    box-sizing: border-box;
}

.hud-btn {
    pointer-events: auto;
    cursor: pointer;
    width: 44px;
    min-width: 44px;
    height: 44px;
    background: rgba(15, 20, 28, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    padding: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    transition: transform 0.12s ease;
    flex: 0 0 44px;
    box-sizing: border-box;
}

.hud-btn:active {
    transform: scale(0.92);
}

.hud-btn.hidden {
    visibility: hidden;
    pointer-events: none;
}

.hud-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    flex: 1 1 auto;
    max-width: 290px;
    box-sizing: border-box;
}

.hud-card {
    height: 44px;
    background: rgba(15, 20, 28, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-bottom: 2px solid var(--sage-green);
    padding: 3px 4px;
    border-radius: 12px;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    white-space: nowrap;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.hud-label {
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.45px;
    color: #94a3b8;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
    text-align: center;
}

.hud-val {
    font-size: 14px;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    white-space: nowrap;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-variant-numeric: tabular-nums;
}

/* ============================================================================
   CANONICAL ICON & CURRENCY ENGINE (Industry Best Practice)
   Guarantees 100% Optical Centering and Alignment with Digits and Text
   ============================================================================ */

/* 1. ATOMIC WRAPPERS: Keeps an icon and its text/number locked as one unbreakable aligned unit */
.coin-amount,
.ui-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    gap: 3.5px;
    flex-shrink: 0;
}

/* 2. BASE REPLACED ICON (SVG): Used in flex containers, chips, buttons, and tables */
.coin-icon,
.ui-icon {
    display: inline-block;
    width: 0.88em;
    height: 0.88em;
    vertical-align: middle;
    transform: translateY(-0.04em); /* Exact optical center with cap-height digits & uppercase text */
    margin: 0;
    flex-shrink: 0;
    pointer-events: none;
    user-select: none;
    object-fit: contain;
}

/* 3. INLINE FLOW ICON: Used inside continuous text, sentences, paragraphs, or toasts (Tailwind/Primer standard) */
.ui-icon-inline {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.15em; /* Aligns midpoint of 1em icon with midpoint of text */
    margin: 0 0.22em;
    flex-shrink: 0;
    pointer-events: none;
    user-select: none;
    object-fit: contain;
}

/* 4. BUTTONS & COMPACT CONTROLS: Scaled to match button typography */
.btn .ui-icon {
    width: 1.1em;
    height: 1.1em;
}

.btn-compact .ui-icon {
    width: 1.05em;
    height: 1.05em;
}

/* 5. DEDICATED CONTEXT SCALES */
.ui-icon-hud {
    width: 19px;
    height: 19px;
    display: block;
    margin: auto;
    object-fit: contain;
}

.ui-icon-fab {
    width: 22px;
    height: 22px;
    display: block;
    margin: auto;
    object-fit: contain;
}

.ui-icon-guide {
    width: 17px;
    height: 17px;
    display: block;
    margin: auto;
    object-fit: contain;
}

.ui-icon-upgrade {
    width: 26px;
    height: 26px;
    display: block;
    margin: auto;
    object-fit: contain;
}

.ui-icon-modal {
    display: block;
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.ui-icon-close {
    width: 14px;
    height: 14px;
    display: block;
    margin: auto;
    object-fit: contain;
}

.ui-icon-avatar {
    display: block;
    width: 17px;
    height: 17px;
    object-fit: contain;
}

.lb-medal-icon {
    width: 20px;
    height: 20px;
    display: block;
    margin: auto;
    object-fit: contain;
}

/* 6. UNIVERSAL EMOJI ALIGNMENT UTILITY: For any fallback emojis in text */
.emoji-align {
    display: inline-block;
    vertical-align: -0.08em;
    line-height: 1;
}

/* ============================================================================
   2. LOCATION BANNER, BUFF TAGS & ALERTS — EXACT HORIZONTAL CENTERING
   ============================================================================ */
#zoneBanner {
    position: fixed;
    top: calc(68px + env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
    max-width: calc(100% - 24px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.90);
    border: 1px solid rgba(37, 211, 102, 0.45);
    border-radius: 999px;
    padding: 3px 12px;
    color: #86efac;
    font-size: clamp(9px, 2.3vw, 11px);
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    text-align: center;
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    line-height: 1.2;
}

.zone-pin-icon {
    width: 13px;
    height: 13px;
    margin: 0;
    flex-shrink: 0;
}

#buffContainer {
    position: fixed;
    top: calc(98px + env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 5px;
    z-index: 10;
    pointer-events: none;
    width: calc(100% - 20px);
    max-width: 480px;
}

.buff-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.95), rgba(16, 185, 129, 0.95));
    color: #032212;
    padding: 3.5px 10px;
    border-radius: 12px;
    font-size: 10.5px;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.4);
    max-width: calc(100% - 16px);
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.buff-tag.gold {
    background: linear-gradient(135deg, #a855f7, #7e22ce);
    color: #fff;
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.5);
}

.buff-tag.blue {
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    color: #fff;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
}

/* Turn / Drift Interactive Prompt — Unified at Runner Back, Mutually Exclusive with City Alert */
#turnPrompt {
    position: fixed;
    bottom: calc(138px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    margin: 0 auto;
    background: rgba(15, 23, 42, 0.94);
    border: 1.5px solid var(--sage-gold);
    color: #fff;
    padding: 5.5px 14px;
    border-radius: 12px;
    font-weight: 900;
    font-size: 12px;
    text-align: center;
    pointer-events: none;
    z-index: 22;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    width: fit-content;
    max-width: min(300px, calc(100% - 32px));
    white-space: normal;
    line-height: 1.25;
    box-shadow: 0 0 22px rgba(255, 215, 0, 0.4);
}

#turnPrompt.show {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.turn-prompt-sub {
    display: inline-block;
    font-size: 11px;
    color: #ffd700;
    font-weight: 800;
    margin-top: 1px;
}

/* ============================================================================
   2. HORIZONTALLY CENTERED IN-GAME ALERTS (Below Sun/Clouds, Above Main Road)
   ============================================================================ */
#toastContainer {
    position: fixed;
    top: calc(188px + env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%);
    width: fit-content;
    max-width: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 10000;
    pointer-events: none;
}

.toast-card {
    width: fit-content;
    max-width: 210px;
    box-sizing: border-box;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-top: 2.5px solid var(--sage-green, #7F9183);
    border-radius: 10px;
    padding: 6px 12px;
    color: #ffffff;
    text-align: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55), 0 0 10px rgba(37, 211, 102, 0.18);
    animation: toastCenterIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.22s ease, transform 0.22s ease;
    transform: translateZ(0);
}

.toast-card.toast-leaving {
    opacity: 0;
    transform: translateY(-8px) scale(0.94);
}

.toast-title {
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: 0.2px;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    text-align: center;
}

.toast-title.single {
    font-size: 11.5px;
}

.toast-sub {
    font-size: 10px;
    font-weight: 600;
    line-height: 1.25;
    color: #cbd5e1;
    margin-top: 2px;
    text-align: center;
}

@keyframes toastCenterIn {
    0% {
        opacity: 0;
        transform: translateY(-8px) scale(0.94);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================================================
   2b. MID-SCREEN CITY TRANSITION LANDMARK BANNER (Unified at Runner Back, Mutually Exclusive with Turn Alert)
   ============================================================================ */
#cityAlert {
    position: fixed;
    bottom: calc(138px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%) scale(0.92) translateZ(0);
    width: fit-content;
    max-width: min(300px, calc(100% - 32px));
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(20, 32, 48, 0.98));
    border: 1.5px solid var(--sage-gold);
    box-shadow: 0 0 26px rgba(255, 215, 0, 0.42), 0 8px 30px rgba(0, 0, 0, 0.65);
    border-radius: 12px;
    padding: 5.5px 14px;
    color: #ffffff;
    text-align: center;
    z-index: 22;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

#cityAlert.show {
    opacity: 1;
    transform: translateX(-50%) scale(1) translateZ(0);
}

.city-alert-label {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.1px;
    color: var(--sage-gold);
    text-transform: uppercase;
    line-height: 1.2;
}

.city-alert-title {
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.5px;
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    text-transform: uppercase;
    line-height: 1.25;
    margin-top: 1px;
}

/* ============================================================================
   2b. PRESS-AND-HOLD FREEZE — everything stops so alerts can be read
   ============================================================================ */
#freezeFrame {
    position: fixed;
    inset: 0;
    z-index: 14;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    box-shadow: inset 0 0 0 3px rgba(56, 189, 248, 0.6), inset 0 0 70px rgba(56, 189, 248, 0.22);
}

#freezeBadge {
    position: fixed;
    bottom: calc(52px + env(safe-area-inset-bottom, 0px));
    right: calc(14px + env(safe-area-inset-right, 0px));
    left: auto !important;
    transform: translateY(8px) translateZ(0);
    z-index: 25;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(12, 74, 110, 0.94);
    border: 1.5px solid rgba(56, 189, 248, 0.85);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55), 0 0 16px rgba(56, 189, 248, 0.3);
    color: #f0f9ff;
    text-align: left;
    white-space: nowrap;
    max-width: 240px;
}

#freezeBadge .freeze-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 10px #38bdf8;
    animation: freezePulse 1.2s infinite ease-in-out;
    flex-shrink: 0;
}

@keyframes freezePulse {
    0%, 100% { transform: scale(1); opacity: 0.95; }
    50% { transform: scale(1.35); opacity: 0.55; }
}

.freeze-content {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.freeze-title {
    font-size: 10.5px;
    font-weight: 900;
    letter-spacing: 0.4px;
    color: #ffffff;
    line-height: 1.2;
}

.freeze-hint {
    font-size: 9px;
    font-weight: 600;
    color: #7dd3fc;
    letter-spacing: 0.2px;
    line-height: 1.2;
}

body.is-frozen #freezeFrame {
    opacity: 1;
}

body.is-frozen #freezeBadge {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================================
   3. IN-GAME ACTION BUTTONS: SLEEK LEFT-SIDE VERTICAL COLUMN (PAD, SHIELD, BAZOOKA)
   Ergonomically tuned for dominant right-hand mobile gameplay
   ============================================================================ */
.hud-action-column {
    position: fixed;
    left: calc(14px + env(safe-area-inset-left, 0px));
    right: auto !important;
    bottom: calc(52px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 30;
    pointer-events: auto;
    transform: translateZ(0);
}

.hud-action-fab {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.94);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
    padding: 0;
    transform: translateZ(0);
    will-change: transform;
}

.hud-action-fab:active {
    transform: scale(0.91);
}

.hud-action-fab .action-fab-icon {
    font-size: 22px;
    line-height: 1;
    pointer-events: none;
}

.hud-action-fab .action-fab-key {
    font-size: 7.5px;
    font-weight: 800;
    letter-spacing: 0.4px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 1px;
    line-height: 1;
    pointer-events: none;
}

.hud-action-fab .action-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #0f172a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

/* Individual Styles */
.hud-action-fab.fab-pad {
    border-color: var(--sage-green);
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
}
.hud-action-fab.fab-pad .action-fab-badge {
    background: var(--sage-green);
    color: #022c22;
}
.hud-action-fab.fab-pad.surfing-active {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.75);
    animation: pulsePad 1s infinite alternate ease-in-out;
}

.hud-action-fab.fab-shield {
    border-color: #a855f7;
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.35);
}
.hud-action-fab.fab-shield .action-fab-badge {
    background: #a855f7;
    color: #ffffff;
}
.hud-action-fab.fab-shield.shield-active {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.85);
    animation: pulseShield 1s infinite alternate ease-in-out;
}

.hud-action-fab.fab-bazooka {
    border-color: #f59e0b;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
}
.hud-action-fab.fab-bazooka .action-fab-badge {
    background: #ef4444;
    color: #ffffff;
}

@keyframes pulsePad {
    0% { transform: scale(1); box-shadow: 0 0 14px rgba(37, 211, 102, 0.6); }
    100% { transform: scale(1.06); box-shadow: 0 0 24px rgba(255, 215, 0, 0.9); }
}

@keyframes pulseShield {
    0% { transform: scale(1); box-shadow: 0 0 14px rgba(168, 85, 247, 0.6); }
    100% { transform: scale(1.06); box-shadow: 0 0 24px rgba(255, 215, 0, 0.9); }
}

/* FAB pickup highlight / shine animation when collecting ammo (zero text clutter) */
.hud-action-fab.fab-highlight-pulse,
.surfer-fab.fab-highlight-pulse {
    animation: fabPickupShine 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards !important;
}

@keyframes fabPickupShine {
    0% { transform: scale(1); filter: brightness(1); }
    35% { transform: scale(1.3); filter: brightness(1.6); box-shadow: 0 0 28px rgba(255, 215, 0, 0.95), 0 0 16px rgba(37, 211, 102, 0.8); }
    100% { transform: scale(1); filter: brightness(1); }
}

@media (max-width: 480px) {
    /* 0. Top HUD, Zone Banner & Buff Container — Symmetrical, Consistent Vertical Rhythm */
    #hud {
        top: calc(12px + env(safe-area-inset-top, 0px));
    }
    #zoneBanner {
        top: calc(59px + env(safe-area-inset-top, 0px));
        padding: 3px 10px;
    }
    #buffContainer {
        top: calc(86px + env(safe-area-inset-top, 0px));
    }

    /* 1. Left-anchored in-game action buttons, aligned horizontally with freeze badge above voiceover */
    .hud-action-column {
        left: calc(10px + env(safe-area-inset-left, 0px));
        right: auto !important;
        bottom: calc(48px + env(safe-area-inset-bottom, 0px));
        gap: 8px;
    }
    .hud-action-fab {
        width: 44px;
        height: 44px;
    }
    .hud-action-fab .action-fab-icon {
        font-size: 18px;
    }
    .hud-action-fab .ui-icon-fab {
        width: 22px;
        height: 22px;
    }
    .hud-action-fab .action-fab-key {
        display: none;
    }

    /* 2. Sleek, compact freeze badge anchored at right, exact same bottom baseline as action buttons */
    #freezeBadge {
        right: calc(10px + env(safe-area-inset-right, 0px));
        left: auto !important;
        bottom: calc(48px + env(safe-area-inset-bottom, 0px));
        padding: 4px 9px;
        gap: 6px;
        border-radius: 8px;
        max-width: 170px;
        transform: none !important;
    }
    #freezeBadge .freeze-pulse-dot {
        width: 7px;
        height: 7px;
    }
    .freeze-title {
        font-size: 9.5px;
        letter-spacing: 0.2px;
    }
    .freeze-title .ui-icon {
        width: 11px;
        height: 11px;
    }
    .freeze-hint {
        font-size: 8px;
    }

    /* 3. Sleek, compact runner back alerts on mobile (Unified position, Mutually Exclusive, zero screen clutter) */
    #turnPrompt {
        bottom: calc(122px + env(safe-area-inset-bottom, 0px));
        left: 50%;
        transform: translateX(-50%) scale(1);
        padding: 3.5px 10px;
        font-size: 10px;
        border-radius: 9px;
        border-width: 1.5px;
        max-width: min(220px, calc(100% - 32px));
        box-shadow: 0 0 14px rgba(255, 215, 0, 0.35);
    }
    .turn-prompt-sub {
        font-size: 9px;
    }

    #cityAlert {
        bottom: calc(122px + env(safe-area-inset-bottom, 0px));
        left: 50%;
        transform: translateX(-50%) scale(1) translateZ(0);
        padding: 3.5px 10px;
        border-radius: 9px;
        max-width: min(220px, calc(100% - 32px));
    }
    .city-alert-label {
        font-size: 8px;
        letter-spacing: 0.6px;
    }
    .city-alert-title {
        font-size: 11px;
        letter-spacing: 0.2px;
        margin-top: 1px;
    }
    .city-alert-bonus {
        font-size: 8.5px;
        padding: 1px 6px;
        margin-top: 2px;
    }

    .tutorial-cue {
        bottom: calc(122px + env(safe-area-inset-bottom, 0px));
        left: 50%;
        transform: translateX(-50%) scale(1);
        padding: 3.5px 10px;
        font-size: 9.5px;
        border-radius: 9px;
        max-width: min(220px, calc(100% - 32px));
    }
    .tutorial-cue span img,
    .tutorial-cue .ui-icon-modal {
        width: 16px;
        height: 16px;
        vertical-align: middle;
        margin-bottom: 2px;
    }

    /* 4. Roadside Toast alerts lowered merely below sun/clouds, elevated high above road on mobile */
    #toastContainer {
        top: calc(186px + env(safe-area-inset-top, 0px));
        max-width: min(210px, calc(100% - 40px));
    }

    /* 5. Voiceover caption centered at very bottom */
    .speaker-indicator {
        bottom: calc(14px + env(safe-area-inset-bottom, 0px));
        max-width: min(92vw, 360px);
    }

    /* 6. Leaderboard Tabs — 100% Mobile Responsive without Overflow */
    .lb-tabs {
        padding: 2.5px;
        gap: 3px;
    }
    .lb-tab {
        padding: 6px 3px;
        font-size: clamp(9px, 2.4vw, 10.5px);
        gap: 3px;
    }
    .lb-tab .ui-icon,
    .lb-tab .coin-icon {
        width: 12px;
        height: 12px;
    }
}

/* ============================================================================
   4. OVERLAYS & MENU CARDS — one spacing system, optically balanced
   ============================================================================ */
.overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(20, 28, 40, 0.84), rgba(6, 9, 15, 0.96));
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 14px calc(14px + env(safe-area-inset-bottom, 0px)) 14px;
    z-index: 30;
    color: #fff;
    text-align: center;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    pointer-events: auto;
}

.modal-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--gap-group);
    background: linear-gradient(180deg, #1e242e 0%, #0f141c 100%);
    border: 1px solid rgba(255, 215, 0, 0.28);
    border-radius: 22px;
    padding: var(--card-pad);
    width: 100%;
    max-width: 420px;
    margin: auto;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.9);
    flex-shrink: 0;
    text-align: center;
    touch-action: pan-y;
    pointer-events: auto;
    contain: paint;
}

/* Head group: logo, title, chip — equal rhythm between each */
.card-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    height: var(--logo-h);
    width: auto;
    max-width: 82%;
    object-fit: contain;
    display: block;
    margin: 0;
}

.modal-pause,
.modal-over {
    --logo-h: 32px;
}

.brand-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 211, 102, 0.14);
    color: var(--sage-green);
    border: 1px solid rgba(37, 211, 102, 0.45);
    font-size: 10.5px;
    font-weight: 900;
    letter-spacing: 1px;
    padding: 5px 12px;
    border-radius: 30px;
    text-transform: uppercase;
    line-height: 1.2;
}

h1 {
    margin: 0;
    font-size: clamp(22px, 6vw, 27px);
    font-weight: 900;
    letter-spacing: -0.3px;
    color: #ffffff;
    line-height: 1.15;
    text-align: center;
}

.modal-over h1 {
    font-size: clamp(18px, 5vw, 21px);
    line-height: 1.25;
}

.over-main-col {
    display: flex;
    flex-direction: column;
    gap: var(--gap-item, 10px);
    width: 100%;
}

.title-gradient {
    background: linear-gradient(90deg, #ffffff, #86efac, #FFD700);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.crash-tip {
    margin: -4px 0 0 0;
    font-size: 12px;
    line-height: 1.4;
    color: #94a3b8;
}

.crash-tip:empty {
    display: none;
}

.best-chip {
    width: 100%;
    min-height: 44px;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 12px;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.4);
    color: #fde68a;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    line-height: 1.2;
    box-sizing: border-box;
    text-align: center;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.12s ease, background 0.12s ease;
    white-space: nowrap;
}

.best-chip:active {
    transform: scale(0.96);
    background: rgba(255, 215, 0, 0.18);
}

.best-chip strong {
    color: var(--sage-gold);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.coins-chip {
    width: 100%;
    min-height: 44px;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 12px;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.4);
    color: #fde68a;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    line-height: 1.2;
    box-sizing: border-box;
    text-align: center;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.12s ease, background 0.12s ease;
    white-space: nowrap;
}

.coins-chip:active {
    transform: scale(0.96);
    background: rgba(255, 215, 0, 0.18);
}

.coins-chip strong {
    color: var(--sage-gold);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.sub {
    margin: 0;
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.45;
    text-align: center;
}

.sub strong {
    color: #fff;
}

/* Stats (pause + game over) */
.stat-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap-item);
}

.stat {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 10px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stat-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: #94a3b8;
    text-transform: uppercase;
    line-height: 1.2;
}

.stat-val {
    margin-top: 3px;
    font-size: 22px;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3.5px;
}

.stat-val.gold {
    color: var(--sage-gold);
}

/* Controls & power-ups guide */
.guide-box {
    background: #161c26;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 14px;
    text-align: left;
    font-size: 12px;
    line-height: 1.4;
    color: #e2e8f0;
    contain: paint;
}

.guide-box strong {
    color: var(--sage-gold);
    font-weight: 800;
}

.guide-section-title {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1px;
    color: #94a3b8;
    text-transform: uppercase;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.guide-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.guide-row {
    display: grid;
    grid-template-columns: 24px 1fr;
    column-gap: 10px;
    align-items: start;
}

.guide-icon {
    width: 24px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
}

.guide-txt {
    min-width: 0;
}

.guide-keys {
    color: #94a3b8;
    font-size: 11px;
}

/* Keyboard hint only where a keyboard/mouse is likely */
@media (hover: none), (pointer: coarse) {
    .guide-keys {
        display: none;
    }
}

.guide-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.09);
    margin: 12px 0;
}

/* Buttons: equal height & spacing in every card */
.card-actions {
    display: flex;
    flex-direction: column;
    gap: var(--gap-item);
}

.card-actions-pause {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.card-actions-pause .btn {
    width: 100%;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border: none;
    border-radius: 14px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.4px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.1s ease, filter 0.1s ease;
    margin: 0;
    line-height: 1.2;
    text-align: center;
}

.btn:active,
.btn:focus-visible {
    transform: scale(0.97);
    filter: brightness(1.1);
}

.btn-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 55%, #15803d 100%);
    color: #ffffff !important;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 1.2px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 6px 24px rgba(34, 197, 94, 0.42), 0 0 14px rgba(34, 197, 94, 0.25);
    transition: transform 0.12s ease, filter 0.15s ease, box-shadow 0.18s ease;
}

.btn-play .ui-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

.btn-play:hover,
.btn-play:focus-visible {
    filter: brightness(1.12);
    box-shadow: 0 8px 30px rgba(34, 197, 94, 0.65), 0 0 20px rgba(255, 215, 0, 0.4);
}

.btn-play:active {
    transform: scale(0.96);
    filter: brightness(1.05);
}

.btn-play:disabled {
    background: linear-gradient(135deg, #1e293b, #0f172a) !important;
    color: #94a3b8 !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    opacity: 0.72;
    pointer-events: none;
}

.btn-play.btn-ready {
    animation: btnReadyPulse 1.4s infinite alternate ease-in-out;
}

@keyframes btnReadyPulse {
    0% {
        box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4), 0 0 10px rgba(34, 197, 94, 0.2);
        transform: scale(1);
    }
    100% {
        box-shadow: 0 8px 32px rgba(34, 197, 94, 0.75), 0 0 22px rgba(255, 215, 0, 0.45);
        transform: scale(1.015);
    }
}

.btn-wa {
    background: #128C7E;
    color: #fff;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

.btn-shop {
    background: linear-gradient(135deg, #FFD700, #f59e0b);
    color: #111;
}

/* Reward spotlight */
.spotlight-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(37, 211, 102, 0.08));
    border: 1px solid rgba(255, 215, 0, 0.5);
    border-radius: 16px;
    padding: 12px;
    text-align: left;
}

.spot-header-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.spot-thumb {
    width: 64px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
    border: 1.5px solid var(--sage-gold);
    background: #fff;
    flex-shrink: 0;
}

.spot-info {
    flex: 1;
    min-width: 0;
}

.spot-tag {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.5px;
    color: var(--sage-gold);
    text-transform: uppercase;
    margin-bottom: 3px;
    line-height: 1.25;
}

.spot-name {
    font-size: 13px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 3px;
    line-height: 1.25;
}

.spot-desc {
    font-size: 11px;
    color: #cbd5e1;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.reward-note {
    font-size: 12px;
    font-weight: 800;
    color: #fde68a;
    line-height: 1.35;
    text-align: center;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.22);
}

.reward-note:empty {
    display: none;
}

.guarantees-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 8px;
    font-size: 10px;
    color: #86efac;
    font-weight: 800;
    line-height: 1.3;
}

/* ============================================================================
   5. FOOTER: sound toggle + 7-icon social bar (centred, equal margins)
   ============================================================================ */
.card-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding-top: var(--gap-group);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sound-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 16px;
    height: 38px;
    min-height: 38px;
    box-sizing: border-box;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
}

.sound-toggle:active {
    transform: scale(0.96);
}

.social-section {
    width: 100%;
    text-align: center;
}

.social-heading {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #94a3b8;
    margin: 0 auto 8px auto;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.2;
}

.social-heading span {
    color: var(--sage-gold);
    font-weight: 900;
}

.social-icon-row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: clamp(4px, 1.2vw, 6px);
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.social-icon-btn {
    flex: 1 1 0;
    max-width: 38px;
    min-width: 28px;
    height: auto;
    aspect-ratio: 1;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.07);
    border: 1.5px solid rgba(255, 255, 255, 0.16);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
    box-sizing: border-box;
}

.social-icon-btn svg {
    width: 52%;
    height: 52%;
}

.social-icon-btn.website-icon {
    background: rgba(37, 211, 102, 0.18);
    border-color: var(--sage-green);
    box-shadow: 0 0 10px rgba(37, 211, 102, 0.26);
}

.social-icon-btn.website-icon img {
    width: 62%;
    height: 62%;
    object-fit: contain;
    border-radius: 4px;
}

.social-icon-btn:hover,
.social-icon-btn:active {
    background: rgba(255, 215, 0, 0.22);
    border-color: var(--sage-gold);
    color: var(--sage-gold);
    transform: translateY(-2px);
}

.hidden {
    display: none !important;
}

/* ============================================================================
   6. STATE-AWARE HUD — shown ONLY while running; hidden behind menus/pause/game over
   ============================================================================ */
body:not(.is-playing) #hud,
body:not(.is-playing) #zoneBanner,
body:not(.is-playing) #buffContainer,
body:not(.is-playing) #cityAlert,
body:not(.is-playing) #freezeFrame,
body:not(.is-playing) #freezeBadge {
    visibility: hidden;
    pointer-events: none !important;
}

/* ============================================================================
   7. RESPONSIVE
   ============================================================================ */

/* Short portrait phones (iPhone SE, small Androids): tighter rhythm so menus fit */
@media (max-height: 720px) and (orientation: portrait) {
    :root {
        --card-pad: 16px;
        --gap-group: 14px;
        --logo-h: 34px;
    }
    .modal-pause,
    .modal-over {
        --logo-h: 28px;
    }
    .card-head {
        gap: 10px;
    }
    .guide-box {
        padding: 12px;
    }
    .guide-divider {
        margin: 10px 0;
    }
    .guide-list {
        gap: 6px;
    }
}

/* Ultra-Compact Screens (<355px width) */
@media (max-width: 355px) {
    #hud {
        gap: 4px;
        padding: 0 4px;
    }
    .hud-card {
        height: 40px;
        min-width: 56px;
        padding: 3px 6px;
    }
    .hud-label {
        font-size: 7.5px;
    }
    .hud-val {
        font-size: 12.5px;
    }
    .hud-btn { width: 38px; min-width: 38px; height: 40px; flex: 0 0 38px; font-size: 14px; }
    .social-icon-row {
        gap: 3px;
        flex-wrap: nowrap;
    }
    .social-icon-btn {
        max-width: 30px;
        min-width: 22px;
        border-radius: 8px;
    }
}

/* Tablet / Desktop HUD & card sizing */
@media (min-width: 600px) {
    #hud {
        top: 22px;
        gap: 10px;
    }
    .hud-card {
        height: 48px;
        min-width: 90px;
        padding: 6px 14px;
        border-radius: 14px;
    }
    .hud-label {
        font-size: 9px;
    }
    .hud-val {
        font-size: 17px;
    }
    .hud-btn { width: 48px; min-width: 48px; height: 48px; flex: 0 0 48px; font-size: 18px; }
    #zoneBanner {
        top: 78px;
        padding: 6px 16px;
    }
    #buffContainer {
        top: 113px;
    }
    #toastContainer {
        top: 188px;
        max-width: 250px;
    }
    .toast-card {
        max-width: 250px;
        padding: 7px 14px;
    }
    .toast-title {
        font-size: 12px;
    }
    .toast-sub {
        font-size: 10.5px;
    }
    .modal-card {
        --card-pad: 24px;
        max-width: 460px;
    }
    .social-icon-row {
        gap: 8px;
    }
    .social-icon-btn {
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
        border-radius: 12px;
    }
}

/* Landscape (phones on their side, laptops, desktops): two-column cards so nothing
   needs scrolling and the content never feels stretched. */
@media (orientation: landscape) and (min-width: 700px) {
    .overlay {
        padding: calc(10px + env(safe-area-inset-top, 0px)) 14px calc(10px + env(safe-area-inset-bottom, 0px)) 14px;
    }
    .modal-start,
    .modal-pause,
    .modal-over {
        --card-pad: 22px;
        --gap-group: 16px;
        max-width: 880px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        column-gap: 26px;
        row-gap: var(--gap-group);
        align-items: start;
    }
    .modal-dialog .modal-card,
    .modal-share,
    .modal-leaderboard,
    .modal-profile,
    .modal-stats {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        max-width: 520px !important;
        width: 94% !important;
        margin: auto !important;
    }
    .modal-pause {
        max-width: 700px;
    }

    .card-footer {
        grid-area: footer;
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-end;
        gap: 18px;
    }
    .card-footer .sound-toggle {
        margin: 0;
        align-self: flex-end;
        height: 38px;
    }
    .card-footer .social-section {
        width: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    .card-footer .social-heading {
        margin: 0;
        text-align: center;
        white-space: nowrap;
    }
    .card-footer .social-icon-row {
        width: auto;
        justify-content: center;
        gap: 6px;
    }
    .card-footer .social-icon-btn {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
    }

    /* Start: head + text + button on the left, guide on the right */
    .modal-start {
        grid-template-areas:
            "head guide"
            "sub guide"
            "actions guide"
            "footer footer";
        grid-template-rows: auto auto 1fr auto;
    }
    .modal-start .card-head { grid-area: head; }
    .modal-start .sub { grid-area: sub; }
    .modal-start .guide-box { grid-area: guide; }
    .modal-start .card-actions { grid-area: actions; align-self: end; }

    /* Pause: info on the left, actions on the right */
    .modal-pause {
        grid-template-areas:
            "head actions"
            "stats actions"
            "footer footer";
        grid-template-rows: auto 1fr auto;
    }
    .modal-pause .card-head { grid-area: head; }
    .modal-pause .stat-row { grid-area: stats; align-self: start; }
    .modal-pause .card-actions { grid-area: actions; align-self: center; }

    /* Game over: left column (over-main-col) for results/actions, right column (spot) for product reward */
    .modal-over {
        grid-template-areas:
            "main spot"
            "footer footer";
        grid-template-rows: 1fr auto;
    }
    .modal-over .over-main-col {
        grid-area: main;
        display: flex;
        flex-direction: column;
        gap: var(--gap-item, 10px);
        width: 100%;
        min-width: 0;
    }
    .modal-over .spotlight-box { grid-area: spot; align-self: start; }
}

/* Phones on their side: shrink the rhythm a little more */
@media (orientation: landscape) and (max-height: 520px) {
    :root {
        --gap-group: 10px;
        --gap-item: 6px;
    }
    .modal-card {
        --card-pad: 14px;
        --gap-group: 10px;
        --logo-h: 28px;
        column-gap: 20px;
    }
    .modal-pause,
    .modal-over {
        --logo-h: 26px;
    }
    .card-head { gap: 8px; }
    h1 { font-size: 20px; }
    .modal-over h1 { font-size: 17px; }
    .sub { font-size: 12px; line-height: 1.4; }
    .guide-box { padding: 10px 12px; font-size: 11.5px; }
    .guide-list { gap: 4px; }
    .guide-divider { margin: 8px 0; }
    .guide-section-title { margin-bottom: 5px; }
    .btn { min-height: 42px; padding: 9px 14px; font-size: 13px; }
    .stat { padding: 7px 6px; }
    .stat-val { font-size: 19px; }
    .spotlight-box { padding: 10px; gap: 8px; }
    .spot-thumb { width: 52px; height: 58px; }
    .spot-name { font-size: 12px; }
    .spot-desc { -webkit-line-clamp: 2; line-clamp: 2; }
    .guarantees-grid { font-size: 9.5px; gap: 3px 8px; }
    .card-footer { padding-top: 10px; }
    .social-icon-btn { width: 34px; height: 34px; flex: 0 0 34px; }
    .sound-toggle { min-height: 34px; }
    .brand-pill { padding: 3px 10px; font-size: 9.5px; }
    .best-chip {
    width: 100%;
    min-height: 44px;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 12px;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.4);
    color: #fde68a;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    line-height: 1.2;
    box-sizing: border-box;
    text-align: center;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.12s ease, background 0.12s ease;
    white-space: nowrap;
}

.best-chip:active {
    transform: scale(0.96);
    background: rgba(255, 215, 0, 0.18);
}
}


/* ============================================================================
   LEADERBOARD, PROFILES, ADOPTION DASHBOARD & MULTI-CHANNEL SHARE
   ============================================================================ */

/* Chips row on start screen - Symmetrical 2-Column Grid (50% / 50%) */
.head-chips-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    width: 100%;
    margin: 8px 0 2px 0;
    box-sizing: border-box;
}

.profile-chip {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 12px;
    background: rgba(37, 211, 102, 0.12);
    border: 1px solid rgba(37, 211, 102, 0.45);
    color: #e2e8f0;
    font-size: 11.5px;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.12s ease, background 0.12s ease;
    box-sizing: border-box;
    text-align: left;
}

.profile-chip:active {
    transform: scale(0.96);
    background: rgba(37, 211, 102, 0.22);
}

.profile-avatar {
    font-size: 15px;
    line-height: 1;
    flex-shrink: 0;
}

.profile-info-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
    flex: 1;
    text-align: left;
    line-height: 1.15;
}

.profile-name {
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-link-sub {
    color: #fde68a;
    font-size: 9.5px;
    font-weight: 600;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.9;
    margin-top: 1px;
}

.profile-edit-icon {
    font-size: 11px;
    opacity: 0.75;
    flex-shrink: 0;
}

/* Secondary Action Buttons (Grid 2-col) */
.secondary-btn-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
}

.btn-compact {
    min-height: 44px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 800;
}

.share-earn-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #0f172a;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 999px;
    margin-left: 5px;
    letter-spacing: 0.4px;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.55);
    animation: sharePillPulse 2.4s ease-in-out infinite;
    vertical-align: middle;
}

.share-earn-pill.claimed {
    background: rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    box-shadow: none;
    animation: none;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 5px;
}

@keyframes sharePillPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 8px rgba(251, 191, 36, 0.45);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 0 14px rgba(251, 191, 36, 0.75);
    }
}

/* Modal Dialogs (Overlay that defaults to display: none and toggles .show) */
.modal-dialog {
    display: none;
    z-index: 50;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-dialog.show {
    display: flex;
}

.modal-leaderboard,
.modal-profile,
.modal-stats,
.modal-share {
    max-width: 440px;
    gap: 14px;
    text-align: left;
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Modal Header */
.modal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    text-align: left;
}

.modal-header-title > div {
    min-width: 0;
    text-align: left;
}

.modal-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.modal-header-title h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.3px;
    color: #ffffff;
    line-height: 1.2;
    text-align: left;
}

.modal-sub {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.3;
    text-align: left;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.12s ease;
}

.btn-icon:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.95);
}

/* Segmented Control Tabs — Fluid, Responsive & Resilient on all Mobile Viewports */
.lb-tabs {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 3px;
    gap: 4px;
}

.lb-tab {
    flex: 1 1 0;
    min-width: 0;
    padding: 7px 4px;
    border-radius: 9px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-family: inherit;
    font-size: clamp(9.5px, 2.5vw, 11.5px);
    font-weight: 800;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.lb-tab .ui-icon,
.lb-tab .coin-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.lb-tab.active {
    background: var(--sage-green);
    color: #042f1a;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

/* Leaderboard Timeframe Filter Pills — Modern Segmented Control Bar */
.lb-timeframe-pills {
    display: flex;
    width: 100%;
    max-width: 360px;
    justify-content: center;
    align-items: center;
    align-self: center;
    margin: 8px auto 6px auto;
    padding: 3px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9999px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.2);
    gap: 3px;
    box-sizing: border-box;
}

.timeframe-pill {
    flex: 1 1 0;
    min-width: 0;
    padding: 5.5px 8px;
    border-radius: 9999px;
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeframe-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}

.timeframe-pill.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transform: scale(1.02);
}

@media (max-width: 480px) {
    .lb-timeframe-pills {
        max-width: 100%;
        padding: 2.5px;
        gap: 2px;
    }
    .timeframe-pill {
        padding: 4.5px 4px;
        font-size: clamp(9.5px, 2.7vw, 10.5px);
        letter-spacing: 0.2px;
    }
}

.city-alert-bonus {
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.6px;
    color: #fde047;
    background: rgba(234, 179, 8, 0.18);
    border: 1px solid rgba(250, 204, 21, 0.4);
    padding: 2px 10px;
    border-radius: 12px;
    text-transform: uppercase;
}

/* Leaderboard List */
.lb-list-container {
    max-height: 330px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lb-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.12s ease;
}

.lb-row.lb-podium.gold {
    border-color: rgba(255, 215, 0, 0.55);
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.14) 0%, rgba(20, 26, 36, 0.6) 100%);
}

.lb-row.lb-podium.silver {
    border-color: rgba(203, 213, 225, 0.45);
    background: linear-gradient(90deg, rgba(203, 213, 225, 0.12) 0%, rgba(20, 26, 36, 0.6) 100%);
}

.lb-row.lb-podium.bronze {
    border-color: rgba(217, 119, 6, 0.45);
    background: linear-gradient(90deg, rgba(217, 119, 6, 0.12) 0%, rgba(20, 26, 36, 0.6) 100%);
}

.lb-row.is-me {
    border-color: var(--sage-green);
    box-shadow: 0 0 12px rgba(37, 211, 102, 0.28);
}

.lb-rank {
    width: 26px;
    text-align: center;
    font-weight: 900;
    font-size: 13.5px;
    color: #94a3b8;
    flex-shrink: 0;
}

.lb-rank.gold { color: var(--sage-gold); font-size: 16px; }
.lb-rank.silver { color: #e2e8f0; font-size: 16px; }
.lb-rank.bronze { color: #f59e0b; font-size: 16px; }

.lb-user {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lb-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lb-name {
    font-size: 13.5px;
    font-weight: 800;
    color: #ffffff;
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lb-link-row {
    display: flex;
    align-items: center;
    margin-top: 2px;
}

.lb-link-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 900;
    padding: 1.5px 6px;
    border-radius: 5px;
    background: rgba(37, 211, 102, 0.16);
    border: 1px solid var(--sage-green);
    color: #86efac;
    text-decoration: none;
    transition: background 0.12s ease;
}

.lb-link-badge:hover,
.lb-link-badge:active {
    background: rgba(37, 211, 102, 0.32);
}

.lb-you-tag {
    font-size: 9px;
    font-weight: 900;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--sage-green);
    color: #042f1a;
    letter-spacing: 0.5px;
}

.lb-sub-info {
    font-size: 10.5px;
    color: #94a3b8;
    line-height: 1.2;
}

.lb-score {
    text-align: right;
    flex-shrink: 0;
}

.lb-score-val {
    font-size: 14px;
    font-weight: 900;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2.5px;
}

.lb-score-val.gold {
    color: var(--sage-gold);
}

.lb-loading, .lb-empty {
    padding: 24px 10px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 700;
}

/* Sticky Player Standing Bar */
.player-standing-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(8, 47, 73, 0.88);
    border: 1px solid rgba(56, 189, 248, 0.6);
    color: #ffffff;
    font-size: 12.5px;
}

.standing-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.standing-rank {
    font-weight: 900;
    color: #38bdf8;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.standing-name {
    font-weight: 800;
    font-size: 13px;
}

.standing-right strong {
    font-size: 16px;
    font-weight: 900;
    color: #ffffff;
}

/* Profile Form */
.profile-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 12px;
    font-weight: 800;
    color: #e2e8f0;
}

.form-group input {
    background: rgba(0, 0, 0, 0.4);
    border: 1.5px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    padding: 11px 14px;
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease;
}

.form-group input:focus {
    border-color: var(--sage-green);
    box-shadow: 0 0 10px rgba(37, 211, 102, 0.25);
}

.form-hint {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.35;
}

/* Adoption Stats KPI Grid */
.stats-container {
    width: 100%;
}

.kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
}

.kpi-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.kpi-card.highlight {
    grid-column: span 2;
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.12), rgba(15, 20, 28, 0.6));
    border-color: rgba(37, 211, 102, 0.45);
}

.kpi-card.highlight.gold {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.12), rgba(15, 20, 28, 0.6));
    border-color: rgba(255, 215, 0, 0.45);
}

.kpi-card.green {
    border-color: var(--sage-green);
    background: rgba(37, 211, 102, 0.08);
}

.kpi-label {
    font-size: 10.5px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.kpi-val {
    font-size: 21px;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.15;
}

.kpi-val small {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 700;
}

.kpi-sub {
    font-size: 10px;
    color: #64748b;
}

/* Cross-Device Sync Card (Profile Modal) */
.sync-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 10px 12px;
    margin-top: 12px;
}

.sync-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.sync-tag {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: #e2e8f0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sync-pin-val {
    font-family: monospace;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 2px;
    background: rgba(37, 211, 102, 0.2);
    color: var(--brand-green);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid rgba(37, 211, 102, 0.4);
}

.sync-desc {
    font-size: 10.5px;
    line-height: 1.35;
    color: #94a3b8;
    margin-bottom: 8px;
}

.sync-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sync-actions-row .btn {
    flex: 1 1 calc(50% - 6px);
}

.sync-actions-row .btn-full {
    flex: 1 1 100%;
}

.sync-link-drawer {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.15);
}

.sync-link-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #cbd5e1;
    margin-bottom: 5px;
}

.btn.copied {
    border-color: #38bdf8 !important;
    color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.18) !important;
}

.restore-drawer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.15);
}

.restore-title {
    font-size: 11px;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 6px;
}

.restore-inputs-row {
    display: flex;
    gap: 6px;
}

.restore-input {
    flex: 1;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12px;
    color: #fff;
    outline: none;
    min-width: 0;
}

.restore-input.pin {
    flex: 0 0 90px;
    text-align: center;
    font-family: monospace;
    letter-spacing: 1px;
}

.restore-input:focus {
    border-color: var(--brand-green);
}

/* Multi-Channel Share Modal */
.modal-share {
    max-width: 480px;
    width: 92%;
}

/* Gear Salvage Bonus Row (Game Over) */
.salvage-bonus-row {
    background: linear-gradient(90deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: 12px;
    padding: 10px 14px;
    margin: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.salvage-bonus-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.salvage-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.salvage-title {
    flex: 1;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #f1f5f9;
}

.salvage-amount {
    font-size: 15px;
    font-weight: 900;
    color: var(--brand-gold);
}

.salvage-desc {
    font-size: 11px;
    line-height: 1.4;
    color: #94a3b8;
    padding-left: 28px;
}

/* Dual-Track Viral & Share Rewards Hub */
.share-earn-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(37, 211, 102, 0.35);
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.share-reward-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.reward-track {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.track-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 4px;
}

.track-tag {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #e2e8f0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.track-badge {
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(37, 211, 102, 0.18);
    color: var(--brand-green);
    border: 1px solid rgba(37, 211, 102, 0.35);
    white-space: nowrap;
}

.track-badge.gold {
    background: rgba(251, 191, 36, 0.18);
    color: var(--brand-gold);
    border-color: rgba(251, 191, 36, 0.35);
}

.track-desc {
    font-size: 10px;
    line-height: 1.35;
    color: #94a3b8;
}

.referral-link-box {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 8px 10px;
}

.ref-link-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #cbd5e1;
    margin-bottom: 6px;
}

.ref-recruited-label {
    color: var(--brand-green);
    font-weight: 800;
}

.ref-input-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.ref-link-input {
    flex: 1;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 11px;
    font-family: monospace;
    color: #e2e8f0;
    outline: none;
    min-width: 0;
}

.ref-link-input:focus {
    border-color: var(--brand-green);
}

.btn-ref-copy {
    background: linear-gradient(135deg, #25D366, #16a34a);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 11.5px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.35);
    transition: transform 0.1s ease, filter 0.15s ease, background 0.15s ease;
    flex-shrink: 0;
}

.btn-ref-copy:hover {
    filter: brightness(1.15);
}

.btn-ref-copy:active {
    transform: scale(0.96);
}

.btn-ref-copy.copied {
    background: linear-gradient(135deg, #38bdf8, #0284c7) !important;
    color: #ffffff !important;
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.35);
}

/* Manual Referral Entry Card & Status Badges */
.ref-manual-claim-box {
    margin-top: 10px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px dashed rgba(255, 215, 0, 0.4);
    border-radius: 10px;
    padding: 10px 12px;
}

.ref-claim-header {
    margin-bottom: 8px;
}

.ref-claim-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    color: #ffd700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.ref-claim-sub {
    display: block;
    font-size: 10px;
    color: #cbd5e1;
    margin-top: 2px;
}

.ref-claim-input-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.ref-claim-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 11.5px;
    font-weight: 700;
    color: #ffffff;
    outline: none;
    min-width: 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ref-claim-input:focus {
    border-color: #ffd700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.25);
}

.btn-ref-claim {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 11.5px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
    transition: transform 0.1s ease, filter 0.15s ease;
    flex-shrink: 0;
}

.btn-ref-claim:hover {
    filter: brightness(1.12);
}

.btn-ref-claim:active {
    transform: scale(0.96);
}

.ref-claim-feedback {
    margin-top: 6px;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.3;
}

.ref-claim-feedback.success {
    color: #4ade80;
}

.ref-claim-feedback.error {
    color: #f87171;
}

.ref-status-box {
    margin-top: 10px;
    background: rgba(37, 211, 102, 0.12);
    border: 1px solid rgba(37, 211, 102, 0.4);
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 11px;
    font-weight: 700;
    color: #86efac;
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 380px) {
    .share-reward-row {
        grid-template-columns: 1fr;
    }
}

.share-promo-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(90deg, rgba(37, 211, 102, 0.15), rgba(255, 215, 0, 0.1));
    border: 1px solid rgba(37, 211, 102, 0.35);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #e2e8f0;
}

.share-promo-badge .badge-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.share-promo-badge .badge-text {
    line-height: 1.35;
}

.share-promo-badge a {
    color: var(--brand-green);
    text-decoration: underline;
    font-weight: 700;
}

.promo-code-pill {
    background: rgba(255, 215, 0, 0.2);
    color: var(--brand-gold);
    border: 1px solid rgba(255, 215, 0, 0.4);
    padding: 2px 7px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.share-preview-wrapper {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 14px;
}

.share-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.btn-micro {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.btn-micro:hover {
    background: rgba(37, 211, 102, 0.25);
    border-color: var(--brand-green);
}

.btn-micro:active {
    transform: scale(0.96);
}

.share-preview-box {
    font-size: 12px;
    line-height: 1.45;
    color: #cbd5e1;
    white-space: pre-line;
    max-height: 100px;
    overflow-y: auto;
    word-break: break-word;
}

.share-channels-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.share-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.share-channel-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 50px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
    color: #ffffff;
    text-align: left;
    box-sizing: border-box;
    width: 100%;
}

.share-channel-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.share-channel-btn:active {
    transform: translateY(1px) scale(0.98);
}

.share-channel-btn .ch-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.share-channel-btn .ch-icon svg {
    display: block;
}

.share-channel-btn .ch-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.share-channel-btn .ch-name {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    color: #ffffff;
    white-space: normal;
}

.share-channel-btn .ch-sub {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.85;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.82);
    white-space: normal;
}

.share-channel-btn .ch-action {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Individual Channel Palettes */
.share-channel-btn.wa {
    background: linear-gradient(135deg, #25D366, #128C7E);
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.25);
}

.share-channel-btn.threads {
    background: linear-gradient(135deg, #171717, #000000);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.share-channel-btn.x {
    background: linear-gradient(135deg, #181d29, #0a0e17);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.share-channel-btn.fb {
    background: linear-gradient(135deg, #1877F2, #0d5cb6);
    box-shadow: 0 4px 14px rgba(24, 119, 242, 0.25);
}

.share-channel-btn.tg {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    border-color: rgba(56, 189, 248, 0.35);
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
}

.share-channel-btn.copy {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.share-channel-btn.copy.copied {
    background: rgba(37, 211, 102, 0.25);
    border-color: var(--brand-green);
    color: var(--brand-green);
}

.share-channel-btn.more {
    grid-column: 1 / -1;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1, #4338ca);
    border-color: rgba(129, 140, 248, 0.35);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.28);
}

.card-actions-hero {
    margin: 14px 0 10px 0;
    width: 100%;
}

/* Responsive adjustments for modal dialogs on small & landscape screens */
@media (orientation: landscape) and (min-width: 700px) {
    .modal-leaderboard,
    .modal-stats {
        max-width: 620px;
    }
    .kpi-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .kpi-card.highlight {
        grid-column: span 2;
    }
}

@media (orientation: landscape) and (max-height: 520px) {
    .modal-dialog .modal-card {
        padding: 14px;
        max-height: calc(100vh - 20px);
    }
    .lb-list-container {
        max-height: 180px;
    }
    .share-preview-box {
        max-height: 80px;
        font-size: 11px;
    }
    .share-channel-btn {
        min-height: 38px;
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* ============================================================================
   RUNNER IDENTITY, TAG SHUFFLE & VALIDATION FEEDBACK
   ============================================================================ */
.profile-identity-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-icon-tag {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: transform 0.15s ease, background 0.15s ease;
}

.btn-icon-tag:active {
    transform: scale(0.92) rotate(45deg);
    background: rgba(37, 211, 102, 0.25);
}

.label-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.btn-link-action {
    background: none;
    border: none;
    color: var(--sage-green);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    text-decoration: underline;
}

.btn-link-action:hover {
    color: #fff;
}

.form-feedback {
    font-size: 11.5px;
    margin-top: 5px;
    min-height: 16px;
    line-height: 1.3;
}

.form-feedback.success {
    color: var(--sage-green);
    font-weight: 700;
}

.form-feedback.error {
    color: #f87171;
    font-weight: 700;
}

.form-feedback .use-suggest {
    color: var(--sage-gold);
    text-decoration: underline;
    cursor: pointer;
    margin-left: 4px;
    font-weight: 800;
}

.over-runner-strip {
    width: 100%;
    margin: 2px 0 8px 0;
    text-align: center;
}

.over-profile-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 6px 14px;
    font-size: 12px;
    color: #e2e8f0;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s ease;
    max-width: 100%;
}

.over-profile-icon {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}

.over-profile-info-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    line-height: 1.15;
    min-width: 0;
    flex: 1;
}

.over-profile-name {
    color: var(--sage-gold);
    font-size: 13px;
    font-weight: 800;
}

.over-profile-btn:active {
    transform: scale(0.96);
    background: rgba(37, 211, 102, 0.15);
}

.over-profile-btn strong {
    color: var(--sage-gold);
}

.over-profile-btn .edit-pill {
    font-size: 10px;
    background: rgba(37, 211, 102, 0.2);
    color: var(--sage-green);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
}


/* ============================================================================
   8. RETENTION & PROGRESSION: SHOP, REVIVES, DAILY STREAK & TUTORIALS
   ============================================================================ */

/* First-Run Contextual Tutorial Floating Cue — Unified at Runner Back */
.tutorial-cue {
    position: fixed;
    bottom: calc(138px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    z-index: 22;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.22s ease, transform 0.22s ease;
    background: rgba(15, 23, 42, 0.94);
    border: 1.5px solid var(--sage-gold);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.55), 0 0 16px rgba(255, 215, 0, 0.35);
    border-radius: 12px;
    padding: 5.5px 14px;
    text-align: center;
    color: #fff;
    font-size: 11.5px;
    line-height: 1.25;
    width: fit-content;
    max-width: min(300px, calc(100% - 32px));
    white-space: normal;
}

.tutorial-cue.show {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    animation: tutorialBounce 1.5s infinite ease-in-out;
}

.tutorial-cue span {
    display: inline-block;
    line-height: 1;
}

.tutorial-cue span img {
    width: 22px;
    height: 22px;
}

@keyframes tutorialBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-6px); }
}

/* Streak Chip in Start Header (Row 1 Right) */
.streak-chip {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 12px;
    background: rgba(249, 115, 22, 0.12);
    border: 1px solid rgba(249, 115, 22, 0.45);
    color: #fb923c;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.2px;
    line-height: 1.2;
    box-sizing: border-box;
    text-align: center;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.12s ease, background 0.12s ease;
    white-space: nowrap;
}

.streak-chip:active {
    transform: scale(0.96);
    background: rgba(249, 115, 22, 0.2);
}

/* Button variants: Gear Shop & PWA Install */
.btn-shop-action {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #0f172a !important;
    font-weight: 900;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.btn-shop-action:hover, .btn-shop-action:active {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.btn-pwa {
    background: rgba(37, 211, 102, 0.18);
    border: 1px solid var(--sage-green);
    color: #fff !important;
    font-weight: 800;
}

/* Second Chance Revive Modal */
.modal-revive {
    max-width: 400px;
    width: 92%;
    text-align: center;
    border-color: rgba(245, 158, 11, 0.7);
    box-shadow: 0 0 40px rgba(245, 158, 11, 0.35);
}

#reviveSubText {
    text-wrap: balance;
    line-height: 1.45;
}

.revive-balance-tag {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    vertical-align: middle;
}

.revive-timer-badge {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    margin: 0 auto 12px;
    background: rgba(15, 23, 42, 0.95);
    border: 3px solid #f59e0b;
    box-shadow: 0 0 20px #f59e0b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 900;
    color: #f59e0b;
    animation: revivePulse 1s infinite alternate ease-in-out;
}

@keyframes revivePulse {
    0% { transform: scale(0.95); }
    100% { transform: scale(1.08); box-shadow: 0 0 28px #f59e0b; }
}

.btn-revive {
    background: linear-gradient(135deg, #25D366 0%, #16a34a 100%);
    color: #052e16 !important;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.5px;
    padding: 13px 18px;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.45);
}

/* Daily Login Streak Rewards Modal */
.modal-streak {
    max-width: 440px;
}

.streak-hero-card {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.16), rgba(239, 68, 68, 0.12));
    border: 1px solid rgba(249, 115, 22, 0.45);
    border-radius: 14px;
    padding: 12px 14px;
    text-align: center;
    margin-bottom: 12px;
}

.streak-hero-badge {
    font-size: 14px;
    font-weight: 900;
    color: #fb923c;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.streak-hero-sub {
    font-size: 11px;
    color: #cbd5e1;
    line-height: 1.4;
    margin: 0;
}

.streak-grid-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.streak-calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
    gap: 8px;
    margin-bottom: 4px;
}

.streak-day-card {
    background: rgba(15, 20, 28, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 8px 6px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.streak-day-card.claimed {
    background: rgba(37, 211, 102, 0.1);
    border-color: rgba(37, 211, 102, 0.45);
}

.streak-day-card.active {
    background: rgba(249, 115, 22, 0.2);
    border-color: rgba(249, 115, 22, 0.7);
    box-shadow: 0 0 12px rgba(249, 115, 22, 0.35);
    transform: scale(1.03);
}

.streak-day-num {
    font-size: 10px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
}

.streak-day-card.active .streak-day-num {
    color: #fb923c;
}

.streak-day-card.claimed .streak-day-num {
    color: var(--sage-green);
}

.streak-day-reward {
    font-size: 12px;
    font-weight: 900;
    color: var(--sage-gold);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.streak-day-status {
    font-size: 9.5px;
    font-weight: 700;
    color: #64748b;
}

.streak-day-card.claimed .streak-day-status {
    color: var(--sage-green);
}

.streak-day-card.active .streak-day-status {
    color: #fb923c;
    font-weight: 900;
}

/* Gear Shop Modal */
.modal-upgrade,
.modal-streak {
    max-width: 480px;
    max-height: 88vh;
    overflow-y: auto;
    text-align: left;
}

.shop-wallet-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 14px;
    padding: 10px 16px;
    margin-bottom: 8px;
}

.shop-wallet-label {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: #94a3b8;
    text-transform: uppercase;
}

.shop-wallet-val {
    font-size: 18px;
    font-weight: 900;
    color: var(--sage-gold);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.upgrade-list-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 8px 0;
}

.upgrade-item-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(15, 20, 28, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 14px;
    transition: border-color 0.15s ease;
}

.upgrade-item-card:hover {
    border-color: rgba(37, 211, 102, 0.35);
}

.upgrade-card-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.upgrade-item-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}

.upgrade-item-info {
    flex: 1;
    min-width: 0;
}

.upgrade-item-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.upgrade-item-title-row strong {
    font-size: 13.5px;
    font-weight: 800;
    color: #fff;
}

.upgrade-pips-row {
    display: flex;
    gap: 4px;
}

.upgrade-pip {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.upgrade-pip.filled {
    background: var(--sage-gold);
    border-color: var(--sage-gold);
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.6);
}

.upgrade-item-desc {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.3;
    margin-bottom: 4px;
}

.upgrade-item-effect {
    font-size: 11px;
    font-weight: 700;
    color: #38bdf8;
}

.upgrade-card-action {
    display: flex;
    justify-content: flex-end;
}

.btn-upgrade {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 800;
    border-radius: 10px;
    cursor: pointer;
    border: none;
    transition: transform 0.12s ease;
}

.btn-upgrade.affordable {
    background: linear-gradient(135deg, #25D366 0%, #16a34a 100%);
    color: #052e16;
    box-shadow: 0 3px 10px rgba(37, 211, 102, 0.35);
}

.btn-upgrade.affordable:active {
    transform: scale(0.95);
}

.btn-upgrade.locked {
    background: rgba(255, 255, 255, 0.08);
    color: #64748b;
    cursor: not-allowed;
}

.btn-upgrade.maxed {
    background: rgba(255, 215, 0, 0.12);
    border: 1px solid rgba(255, 215, 0, 0.4);
    color: var(--sage-gold);
    cursor: default;
}

.shop-footer-note {
    font-size: 10.5px;
    color: #94a3b8;
    text-align: center;
    margin-top: 8px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* ============================================================================
   9. LIVE MULTI-CHARACTER SPEAKER INDICATOR PILL (AAA Subtitle / Radio HUD)
   ============================================================================ */
.speaker-indicator {
    position: fixed;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%) translateY(10px) scale(0.95);
    z-index: 18;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: min(92vw, 430px);
    width: fit-content;
    padding: 5.5px 12px 5.5px 9px;
    border-radius: 999px;
    background: rgba(9, 13, 20, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s ease;
}

.speaker-indicator.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
}

.speaker-wave-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    animation: speakerWavePulse 0.7s infinite alternate ease-in-out;
}

@keyframes speakerWavePulse {
    0% { transform: scale(0.92); opacity: 0.82; }
    100% { transform: scale(1.12); opacity: 1; }
}

.speaker-role-badge {
    font-size: 9.5px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2.5px 7px;
    border-radius: 999px;
    background: rgba(37, 211, 102, 0.2);
    color: #4ade80;
    border: 1px solid rgba(37, 211, 102, 0.45);
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.1;
}

.speaker-indicator[data-role="runner"] .speaker-role-badge {
    background: rgba(37, 211, 102, 0.2);
    color: #4ade80;
    border-color: rgba(37, 211, 102, 0.5);
}

.speaker-indicator[data-role="conductor"] .speaker-role-badge,
.speaker-indicator[data-role="driver"] .speaker-role-badge {
    background: rgba(245, 158, 11, 0.22);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.55);
}

.speaker-indicator[data-role="passenger"] .speaker-role-badge {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.5);
}

.speaker-indicator[data-role="passerby"] .speaker-role-badge {
    background: rgba(168, 85, 247, 0.22);
    color: #c084fc;
    border-color: rgba(168, 85, 247, 0.5);
}

.speaker-indicator[data-role="police"] {
    border-color: rgba(239, 68, 68, 0.65);
    box-shadow: 0 6px 22px rgba(239, 68, 68, 0.35), 0 0 14px rgba(59, 130, 246, 0.35);
}

.speaker-indicator[data-role="police"] .speaker-role-badge {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.3), rgba(59, 130, 246, 0.3));
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.65);
}

.speaker-quote-text {
    font-size: 11px;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 420px) {
    .speaker-indicator {
        padding: 4.5px 10px 4.5px 8px;
        gap: 5px;
    }
    .speaker-role-badge {
        font-size: 8.5px;
        padding: 2px 6px;
    }
    .speaker-quote-text {
        font-size: 10px;
    }
}

