/* ═══════════════════════════════════════
   MARK: CLICKBAIT — Neon Dark Theme
   ═══════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Rajdhani:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Core palette */
    --bg-primary: #08080f;
    --bg-secondary: #0e0e1a;
    --bg-card: #12121f;
    --bg-card-hover: #1a1a2e;
    --bg-panel: rgba(14, 14, 26, 0.95);

    /* Neon accents */
    --neon-cyan: #00f0ff;
    --neon-lime: #a0ff00;
    --neon-yellow: #ffe600;
    --neon-violet: #b44aff;
    --neon-pink: #ff2a6d;
    --neon-orange: #ff6a00;
    --neon-gold: #ffd700;

    /* Glow variants */
    --glow-cyan: 0 0 20px rgba(0, 240, 255, 0.4);
    --glow-lime: 0 0 20px rgba(160, 255, 0, 0.4);
    --glow-violet: 0 0 20px rgba(180, 74, 255, 0.4);
    --glow-gold: 0 0 20px rgba(255, 215, 0, 0.4);
    --glow-pink: 0 0 20px rgba(255, 42, 109, 0.4);

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #8888aa;
    --text-muted: #555577;

    /* Rarity colors */
    --rarity-common: #8899aa;
    --rarity-rare: #3399ff;
    --rarity-epic: #aa44ff;
    --rarity-legendary: #ffd700;
    --rarity-mythic: #ff3377;

    /* Fonts */
    --font-display: 'Orbitron', monospace;
    --font-ui: 'Rajdhani', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-med: 0.3s ease;
    --transition-slow: 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow: hidden;
    position: fixed;
    width: 100%;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-ui);
    overflow: hidden;
    overscroll-behavior: none;
    width: 100%;
    height: 100%;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    position: fixed;
    top: 0;
    left: 0;
}

/* ═══════════ SCREENS ═══════════ */

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--app-height, 100%);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
    opacity: 0;
    transition: opacity var(--transition-slow);
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: border-box;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: manipulation;
}

.screen.active {
    display: flex;
    opacity: 1;
    z-index: 10;
}

/* ═══════════ BACKGROUND EFFECTS ═══════════ */

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    animation: orbFloat 20s ease-in-out infinite;
    pointer-events: none;
}

.orb1 {
    width: 600px;
    height: 600px;
    background: var(--neon-violet);
    top: -200px;
    left: -100px;
    animation-delay: 0s;
}

.orb2 {
    width: 500px;
    height: 500px;
    background: var(--neon-cyan);
    bottom: -150px;
    right: -100px;
    animation-delay: -7s;
}

.orb3 {
    width: 400px;
    height: 400px;
    background: var(--neon-lime);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
    opacity: 0.08;
}

.game-orb {
    opacity: 0.08;
}

@keyframes orbFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -40px) scale(1.05);
    }

    50% {
        transform: translate(-20px, 30px) scale(0.95);
    }

    75% {
        transform: translate(40px, 20px) scale(1.02);
    }
}

/* ═══════════ BUTTONS ═══════════ */

.btn {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 14px 36px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-icon {
    font-size: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-violet));
    color: #fff;
    border: none;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--glow-cyan), var(--glow-violet);
    filter: brightness(1.15);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-glow {
    animation: btnPulse 2s ease-in-out infinite;
}

@keyframes btnPulse {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
    }

    50% {
        box-shadow: 0 0 30px rgba(0, 240, 255, 0.4), 0 0 60px rgba(180, 74, 255, 0.2);
    }
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--neon-cyan);
    box-shadow: var(--glow-cyan);
    transform: translateY(-1px);
}

.btn-danger {
    background: rgba(255, 42, 109, 0.15);
    color: var(--neon-pink);
    border-color: rgba(255, 42, 109, 0.3);
}

.btn-danger:hover {
    background: rgba(255, 42, 109, 0.3);
    box-shadow: var(--glow-pink);
}

.btn-small {
    padding: 8px 20px;
    font-size: 13px;
    letter-spacing: 1px;
}

.btn-back {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-back:hover {
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
}

/* ═══════════ TITLE SCREEN ═══════════ */

#titleScreen {
    justify-content: flex-start;
    overflow-y: auto;
}

.title-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 2;
    width: 100%;
    max-width: 500px;
    padding: 20px 0 32px;
}

.title-logo-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.title-m-glow {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.2), transparent 70%);
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.4;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

.title-m {
    font-family: var(--font-display);
    font-size: 90px;
    font-weight: 900;
    color: var(--neon-cyan);
    text-shadow: 0 0 30px var(--neon-cyan), 0 0 60px rgba(0, 240, 255, 0.3);
    z-index: 1;
    animation: titleLetterPulse 4s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes titleLetterPulse {

    0%,
    100% {
        text-shadow: 0 0 30px var(--neon-cyan), 0 0 60px rgba(0, 240, 255, 0.3);
    }

    50% {
        text-shadow: 0 0 50px var(--neon-cyan), 0 0 100px rgba(0, 240, 255, 0.5), 0 0 150px rgba(180, 74, 255, 0.2);
    }
}

.title-name {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--text-primary);
    white-space: nowrap;
}

.title-colon {
    color: var(--neon-violet);
}

.title-clickbait {
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-lime));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-tagline {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text-secondary);
    letter-spacing: 3px;
    margin-bottom: 20px;
}

.title-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 280px;
    margin-top: 10px;
}

.title-stats-bar {
    margin-top: 30px;
    font-size: 13px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.title-version {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 2px;
    margin-top: 16px;
    padding-bottom: 24px;
    text-align: center;
}

/* ═══════════ GAME SCREEN ═══════════ */

#gameScreen {
    background: var(--bg-primary);
    touch-action: none;
    /* Prevent ALL scroll/zoom during gameplay */
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}

/* Screens that need scrolling */
#resultsScreen,
#shopScreen,
#settingsScreen,
#prestigeScreen,
#achievementsScreen,
#pvpLobbyScreen {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* HUD */
.hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 16px 30px;
    z-index: 20;
    background: linear-gradient(180deg, rgba(8, 8, 15, 0.9), transparent);
}

.hud-left,
.hud-right {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hud-right {
    align-items: flex-end;
}

.hud-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.hud-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hud-label {
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.hud-value {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.hud-timer {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 900;
    color: var(--neon-cyan);
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
    transition: color 0.3s;
}

.hud-timer.warning {
    color: var(--neon-yellow);
    text-shadow: 0 0 20px rgba(255, 230, 0, 0.4);
    animation: timerPulse 0.5s ease-in-out infinite;
}

.hud-timer.critical {
    color: var(--neon-pink);
    text-shadow: 0 0 20px rgba(255, 42, 109, 0.5);
    animation: timerPulse 0.25s ease-in-out infinite;
}

@keyframes timerPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.hud-credits-value {
    color: var(--neon-lime);
    font-size: 22px;
}

.hud-combo {
    transition: transform 0.1s ease;
}

.hud-session-credits {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Combo Bar */
.combo-bar-wrapper {
    position: absolute;
    top: 110px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    z-index: 15;
    overflow: hidden;
}

.combo-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-lime));
    border-radius: 3px;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.combo-bar-label {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 2px;
    font-family: var(--font-ui);
}

/* Click Area */
.click-area {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    touch-action: none;
    /* Critical: prevent scroll on rapid tap */
}

.logo-button {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 3px solid rgba(0, 240, 255, 0.4);
    background: radial-gradient(circle at 30% 30%, rgba(0, 240, 255, 0.15), rgba(14, 14, 26, 0.9));
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.08s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    z-index: 5;
    position: relative;
}

.logo-button:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.3), inset 0 0 30px rgba(0, 240, 255, 0.05);
}

.logo-button:active {
    transform: scale(0.92);
}

.logo-button.pulse {
    animation: logoPulse 0.15s ease-out;
}

@keyframes logoPulse {
    0% {
        transform: scale(1.15);
        box-shadow: 0 0 60px rgba(0, 240, 255, 0.5);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
    }
}

.logo-button.crit-pulse {
    animation: critPulse 0.25s ease-out;
}

@keyframes critPulse {
    0% {
        transform: scale(1.3);
        box-shadow: 0 0 80px rgba(255, 215, 0, 0.7), 0 0 120px rgba(255, 106, 0, 0.3);
        border-color: var(--neon-gold);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
        border-color: rgba(0, 240, 255, 0.4);
    }
}

.logo-m {
    font-family: var(--font-display);
    font-size: 90px;
    font-weight: 900;
    color: var(--neon-cyan);
    text-shadow: 0 0 30px rgba(0, 240, 255, 0.5);
    pointer-events: none;
}

/* Logo rings */
.logo-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(0, 240, 255, 0.15);
    pointer-events: none;
}

.logo-ring-outer {
    width: 260px;
    height: 260px;
    animation: ringRotate 15s linear infinite;
    border-style: dashed;
}

.logo-ring-inner {
    width: 230px;
    height: 230px;
    animation: ringRotate 10s linear infinite reverse;
    border-style: dotted;
    border-color: rgba(180, 74, 255, 0.15);
}

@keyframes ringRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Floating Text */
.floating-text-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 30;
}

.floating-text {
    position: absolute;
    font-family: var(--font-display);
    font-weight: 700;
    pointer-events: none;
    white-space: nowrap;
    animation: floatUp 0.8s ease-out forwards;
    text-shadow: 0 0 10px currentColor;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    60% {
        opacity: 0.8;
        transform: translateY(-60px) scale(1.1);
    }

    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0.8);
    }
}

.floating-text.crit {
    font-size: 26px;
    animation: floatUpCrit 1s ease-out forwards;
}

@keyframes floatUpCrit {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1.5);
    }

    30% {
        transform: translateY(-30px) scale(1.8);
    }

    100% {
        opacity: 0;
        transform: translateY(-120px) scale(0.6);
    }
}

.floating-text.combo {
    font-size: 22px;
    animation: floatUpCombo 1.2s ease-out forwards;
    color: var(--neon-lime) !important;
}

@keyframes floatUpCombo {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1.2) rotate(-5deg);
    }

    100% {
        opacity: 0;
        transform: translateY(-130px) scale(0.5) rotate(5deg);
    }
}

/* Booster Panel */
.booster-panel {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    z-index: 20;
    max-width: 90%;
}

.booster-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(20, 20, 35, 0.9);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-ui);
    min-width: 90px;
    position: relative;
    overflow: hidden;
}

.booster-btn.ready {
    border-color: rgba(0, 240, 255, 0.3);
}

.booster-btn.ready:hover {
    border-color: var(--neon-cyan);
    box-shadow: var(--glow-cyan);
    transform: translateY(-2px);
}

.booster-btn.active {
    border-color: var(--neon-lime);
    box-shadow: 0 0 15px rgba(160, 255, 0, 0.3);
    background: rgba(160, 255, 0, 0.1);
}

.booster-btn.cooldown {
    opacity: 0.4;
    cursor: not-allowed;
}

.booster-btn-name {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.booster-btn-timer {
    font-size: 10px;
    color: var(--neon-lime);
    font-family: var(--font-display);
    margin-top: 2px;
}

.booster-btn-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--neon-lime);
    transition: width 0.1s linear;
}

/* Game Bottom Bar */
.game-bottom-bar {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
    z-index: 20;
}

/* ═══════════ RESULTS SCREEN ═══════════ */

#resultsScreen {
    background: rgba(8, 8, 15, 0.95);
    backdrop-filter: blur(20px);
}

.results-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 600px;
    width: 90%;
    animation: resultsSlideIn 0.5s ease-out;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    padding-top: 20px;
}

@keyframes resultsSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.results-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--text-secondary);
}

.results-grade {
    font-family: var(--font-display);
    font-size: 80px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 0 40px currentColor;
    animation: gradeAppear 0.6s ease-out;
}

@keyframes gradeAppear {
    from {
        transform: scale(3);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.results-credits-total {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.results-credits-label {
    font-size: 13px;
    color: var(--text-muted);
    letter-spacing: 3px;
}

.results-credits-value {
    font-family: var(--font-display);
    font-size: 52px;
    font-weight: 900;
    color: var(--neon-lime);
    text-shadow: 0 0 30px rgba(160, 255, 0, 0.4);
}

.results-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    margin: 8px 0;
}

.results-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.rs-label {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.rs-value {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 4px;
}

.results-formula {
    width: 100%;
    padding: 16px;
    background: rgba(0, 240, 255, 0.03);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: 10px;
    font-family: var(--font-display);
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-secondary);
    white-space: pre-line;
}

.results-buttons {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

/* ═══════════ SHOP SCREEN ═══════════ */

#shopScreen {
    background: var(--bg-primary);
    display: none;
    flex-direction: column;
    padding: 0;
}

#shopScreen.active {
    display: flex;
}

.shop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 30px;
    background: rgba(14, 14, 26, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    width: 100%;
}

.shop-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--neon-cyan);
}

.shop-credits {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--neon-lime);
}

.shop-credits-icon {
    font-size: 20px;
}

.shop-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 30px;
    width: 100%;
    overflow-x: auto;
}

.shop-tab {
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 8px 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.shop-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.shop-tab.active {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(180, 74, 255, 0.15));
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    padding: 16px 30px;
    flex: 1;
    overflow-y: auto;
    width: 100%;
    align-content: start;
}

/* Shop Card */
.shop-card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 16px 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    min-height: 120px;
}

.shop-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 12px 12px 0 0;
}

.shop-card.rarity-Common::before {
    background: var(--rarity-common);
}

.shop-card.rarity-Rare::before {
    background: var(--rarity-rare);
}

.shop-card.rarity-Epic::before {
    background: var(--rarity-epic);
}

.shop-card.rarity-Legendary::before {
    background: var(--rarity-legendary);
}

.shop-card.rarity-Mythic::before {
    background: var(--rarity-mythic);
}

.shop-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.15);
}

.shop-card.selected {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
}

.shop-card.insufficient {
    opacity: 0.5;
}

.shop-card.equipped {
    border-color: var(--neon-lime);
    box-shadow: 0 0 15px rgba(160, 255, 0, 0.1);
}

.shop-card-icon {
    font-size: 32px;
    text-align: center;
    margin-bottom: 4px;
}

.shop-card-name {
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
}

.shop-card-price {
    font-family: var(--font-display);
    font-size: 14px;
    text-align: center;
    color: var(--neon-lime);
}

.shop-card-state {
    font-size: 10px;
    text-align: center;
    letter-spacing: 0.5px;
    font-weight: 700;
    padding: 2px 0;
    border-radius: 4px;
    white-space: nowrap;
}

.shop-card-state.owned {
    color: var(--neon-cyan);
}

.shop-card-state.equipped {
    color: var(--neon-lime);
}

.shop-card-state.maxlevel {
    color: var(--neon-gold);
}

.shop-card-state.insufficient {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.12);
}

.shop-card-level {
    font-size: 11px;
    text-align: center;
    color: var(--text-muted);
    font-family: var(--font-display);
}

/* Shop Detail Panel */
.shop-detail-panel {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    max-width: 95vw;
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px 16px 0 0;
    padding: 20px 24px;
    z-index: 50;
    backdrop-filter: blur(20px);
    transition: all var(--transition-med);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

.shop-detail-panel.hidden {
    transform: translateX(-50%) translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.shop-detail-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 49;
    backdrop-filter: blur(2px);
    animation: fadeIn 0.15s ease;
}

.shop-detail-backdrop.hidden {
    display: none;
}

.shop-detail-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    line-height: 1;
}

.shop-detail-close:hover {
    background: rgba(255, 80, 80, 0.2);
    border-color: rgba(255, 80, 80, 0.5);
    color: #ff5050;
}

.detail-rarity-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 16px 16px 0 0;
}

.detail-name {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
}

.detail-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.detail-info {
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.6;
}

.detail-price {
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--neon-lime);
    margin-bottom: 14px;
}

.detail-buttons {
    display: flex;
    gap: 10px;
}

/* ═══════════ SETTINGS SCREEN ═══════════ */

#settingsScreen {
    background: rgba(8, 8, 15, 0.97);
    backdrop-filter: blur(20px);
}

.settings-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 400px;
    width: 90%;
}

.settings-title {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 4px;
    text-align: center;
    color: var(--neon-cyan);
    margin-bottom: 10px;
}

.settings-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 120px;
    letter-spacing: 1px;
}

/* Language Dropdown */
.lang-select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2300f0ff' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    padding: 8px 36px 8px 14px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    min-width: 160px;
}

.lang-select:hover {
    border-color: rgba(0, 240, 255, 0.4);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
}

.lang-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.2);
}

.lang-select option {
    background: #1a1a2e;
    color: var(--text-primary);
    font-size: 14px;
    padding: 6px;
}

.settings-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.settings-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--neon-cyan);
    cursor: pointer;
    box-shadow: var(--glow-cyan);
}

.settings-value {
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--text-primary);
    min-width: 40px;
    text-align: right;
}

/* ═══════════ SCROLLBAR ═══════════ */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ═══════════ TOUCH & MOBILE BASE ═══════════ */

/* Prevent tap highlight on mobile */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Safe area padding for notch devices */
body {
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Ensure touch targets are at least 44px (Apple HIG) */
@media (pointer: coarse) {
    .btn {
        min-height: 44px;
    }

    .btn-small {
        min-height: 40px;
        padding: 10px 20px;
    }

    .shop-tab {
        min-height: 40px;
        padding: 10px 16px;
    }

    .settings-slider::-webkit-slider-thumb {
        width: 28px;
        height: 28px;
    }

    .booster-btn {
        min-width: 80px;
        padding: 10px 12px;
    }
}

/* ═══════════ RESPONSIVE — TABLETS & SMALL SCREENS ═══════════ */

@media (max-width: 768px) {

    /* --- Title / Auth --- */
    .title-name {
        font-size: 28px;
        letter-spacing: 3px;
    }

    .title-m {
        font-size: 80px;
    }

    .title-logo-wrapper {
        width: 140px;
        height: 140px;
        margin-bottom: 6px;
    }

    .title-m-glow {
        width: 160px;
        height: 160px;
    }

    .title-tagline {
        font-size: 13px;
        letter-spacing: 2px;
        margin-bottom: 14px;
    }

    .title-buttons {
        width: 260px;
        gap: 10px;
    }

    .title-stats-bar {
        font-size: 11px;
        margin-top: 20px;
    }

    .auth-buttons {
        width: 280px;
    }

    .auth-subtitle {
        font-size: 14px;
    }

    /* --- HUD --- */
    .hud {
        padding: 10px 12px;
        padding-top: calc(10px + env(safe-area-inset-top));
    }

    .hud-label {
        font-size: 10px;
        letter-spacing: 1px;
    }

    .hud-value {
        font-size: 14px;
    }

    .hud-timer {
        font-size: 32px;
    }

    .hud-credits-value {
        font-size: 18px;
    }

    .combo-bar-wrapper {
        top: 90px;
        width: 220px;
    }

    /* --- Click Area --- */
    .logo-button {
        width: 160px;
        height: 160px;
    }

    .logo-m {
        font-size: 65px;
    }

    .logo-ring-outer {
        width: 210px;
        height: 210px;
    }

    .logo-ring-inner {
        width: 190px;
        height: 190px;
    }

    /* --- Boosters --- */
    .booster-panel {
        bottom: 70px;
        gap: 6px;
    }

    .booster-btn {
        min-width: 75px;
        padding: 8px 10px;
    }

    .booster-btn-name {
        font-size: 10px;
    }

    .game-bottom-bar {
        bottom: 12px;
        padding-bottom: env(safe-area-inset-bottom);
    }

    /* --- Results --- */
    .results-overlay {
        gap: 12px;
        width: 95%;
        padding: 0 10px;
    }

    .results-title {
        font-size: 22px;
    }

    .results-grade {
        font-size: 60px;
    }

    .results-credits-value {
        font-size: 40px;
    }

    .results-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .results-stat {
        padding: 10px 8px;
    }

    .rs-value {
        font-size: 18px;
    }

    .results-formula {
        font-size: 11px;
        padding: 12px;
        line-height: 1.6;
    }

    .results-buttons {
        gap: 8px;
    }

    .results-buttons .btn {
        padding: 12px 20px;
        font-size: 13px;
    }

    /* --- Shop --- */
    .shop-header {
        padding: 12px 16px;
        padding-top: calc(12px + env(safe-area-inset-top));
    }

    .shop-title {
        font-size: 22px;
    }

    .shop-credits {
        font-size: 18px;
    }

    .shop-tabs {
        padding: 8px 12px;
        gap: 4px;
    }

    .shop-tab {
        font-size: 12px;
        padding: 8px 12px;
    }

    .shop-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
        padding: 12px 12px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

    .shop-card {
        padding: 12px;
    }

    .shop-card-icon {
        font-size: 26px;
    }

    .shop-card-name {
        font-size: 13px;
    }

    .shop-card-price {
        font-size: 12px;
    }

    .shop-detail-panel {
        width: 100%;
        max-width: 100vw;
        border-radius: 16px 16px 0 0;
        padding: 16px 16px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }

    .detail-name {
        font-size: 18px;
    }

    .detail-desc {
        font-size: 13px;
    }

    .detail-price {
        font-size: 20px;
    }

    .detail-buttons {
        flex-wrap: wrap;
    }

    .detail-buttons .btn {
        flex: 1;
        min-width: 100px;
    }

    /* --- Settings --- */
    .settings-panel {
        gap: 16px;
        width: 95%;
    }

    .settings-title {
        font-size: 26px;
    }

    .settings-label {
        min-width: 90px;
        font-size: 14px;
    }
}

/* ═══════════ RESPONSIVE — SMALL PHONES (≤ 380px) ═══════════ */

@media (max-width: 380px) {
    .title-name {
        font-size: 22px;
        letter-spacing: 2px;
    }

    .title-m {
        font-size: 64px;
    }

    .title-logo-wrapper {
        width: 110px;
        height: 110px;
    }

    .title-m-glow {
        width: 130px;
        height: 130px;
    }

    .title-tagline {
        font-size: 11px;
    }

    .title-buttons {
        width: 230px;
    }

    .title-buttons .btn {
        padding: 12px 24px;
        font-size: 14px;
    }

    .auth-buttons {
        width: 240px;
    }

    .btn-google {
        font-size: 13px;
        padding: 12px 20px;
    }

    .hud-label {
        font-size: 9px;
    }

    .hud-value {
        font-size: 12px;
    }

    .hud-timer {
        font-size: 26px;
    }

    .hud-credits-value {
        font-size: 15px;
    }

    .combo-bar-wrapper {
        top: 80px;
        width: 180px;
    }

    .logo-button {
        width: 130px;
        height: 130px;
    }

    .logo-m {
        font-size: 52px;
    }

    .logo-ring-outer {
        width: 175px;
        height: 175px;
    }

    .logo-ring-inner {
        width: 155px;
        height: 155px;
    }

    .booster-btn {
        min-width: 65px;
        padding: 6px 8px;
    }

    .booster-btn-name {
        font-size: 9px;
    }

    .results-grade {
        font-size: 48px;
    }

    .results-credits-value {
        font-size: 32px;
    }

    .results-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .rs-label {
        font-size: 9px;
    }

    .rs-value {
        font-size: 16px;
    }

    .results-formula {
        font-size: 10px;
        padding: 10px;
    }

    .shop-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 10px;
    }

    .shop-card-icon {
        font-size: 22px;
    }

    .settings-title {
        font-size: 22px;
    }

    .settings-group {
        gap: 8px;
    }

    .settings-label {
        min-width: 75px;
        font-size: 13px;
    }
}

/* ═══════════ LANDSCAPE PHONE ═══════════ */

@media (max-height: 500px) and (orientation: landscape) {
    .title-logo-wrapper {
        width: 80px;
        height: 80px;
        margin-bottom: 4px;
    }

    .title-m {
        font-size: 50px;
    }

    .title-m-glow {
        width: 100px;
        height: 100px;
    }

    .title-name {
        font-size: 22px;
    }

    .title-tagline {
        font-size: 11px;
        margin-bottom: 8px;
    }

    .title-buttons {
        flex-direction: row;
        width: auto;
        gap: 8px;
    }

    .title-buttons .btn {
        padding: 10px 20px;
        font-size: 12px;
    }

    .title-stats-bar {
        margin-top: 10px;
    }

    .auth-content {
        gap: 6px;
    }

    .auth-buttons {
        flex-direction: row;
        width: auto;
        gap: 10px;
    }

    .auth-subtitle {
        margin-bottom: 10px;
    }

    .hud {
        padding: 6px 12px;
    }

    .hud-timer {
        font-size: 28px;
    }

    .logo-button {
        width: 120px;
        height: 120px;
    }

    .logo-m {
        font-size: 48px;
    }

    .logo-ring-outer {
        width: 160px;
        height: 160px;
    }

    .logo-ring-inner {
        width: 140px;
        height: 140px;
    }

    .combo-bar-wrapper {
        top: 70px;
    }

    .booster-panel {
        bottom: 50px;
    }

    .game-bottom-bar {
        bottom: 6px;
    }

    .results-overlay {
        gap: 8px;
    }

    .results-grade {
        font-size: 48px;
    }

    .results-credits-value {
        font-size: 32px;
    }

    .results-stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .settings-panel {
        gap: 12px;
    }

    .settings-title {
        font-size: 22px;
        margin-bottom: 4px;
    }
}

.hidden {
    display: none !important;
}

/* ═══════════ AUTH SCREEN ═══════════ */

#authScreen {
    background: var(--bg-primary);
}

.auth-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 2;
}

.auth-subtitle {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text-secondary);
    letter-spacing: 2px;
    margin-bottom: 24px;
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 320px;
}

.btn-google {
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 14px 28px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

.btn-google:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.btn-google:active {
    transform: translateY(0);
}

.google-icon {
    flex-shrink: 0;
}

.btn-guest {
    text-transform: uppercase;
}

.auth-hint {
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-top: 16px;
}

/* ═══════════ USER INFO ═══════════ */

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 12px;
    backdrop-filter: blur(10px);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(0, 240, 255, 0.4);
    object-fit: cover;
}

.user-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 240, 255, 0.1);
    font-size: 16px;
}

.user-name {
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 1px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-signout {
    width: 100%;
}

/* ═══════════ PHASE 1: LEVEL BAR ═══════════ */
.level-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 90%;
    max-width: 400px;
    margin: 10px auto 5px;
}

.level-label {
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--accent);
    font-weight: 700;
    min-width: 40px;
}

.level-progress {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.level-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #a855f7, #ec4899);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.level-xp {
    font-size: 11px;
    color: var(--text-secondary);
    min-width: 80px;
    text-align: right;
}

/* ═══════════ LEVEL UP NOTIFICATION ═══════════ */
.level-up-notif {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    background: linear-gradient(135deg, rgba(10, 10, 30, 0.95), rgba(20, 10, 40, 0.95));
    border: 2px solid var(--accent);
    border-radius: 16px;
    padding: 30px 40px;
    text-align: center;
    z-index: 10000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 50px rgba(0, 240, 255, 0.3), 0 0 100px rgba(168, 85, 247, 0.2);
}

.level-up-notif.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.level-up-star {
    font-size: 48px;
    animation: starPulse 0.6s ease infinite alternate;
}

@keyframes starPulse {
    from {
        transform: scale(1) rotate(0deg);
    }

    to {
        transform: scale(1.2) rotate(15deg);
    }
}

.level-up-title {
    font-family: var(--font-display);
    font-size: 28px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 8px 0;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
}

.level-up-level {
    font-family: var(--font-display);
    font-size: 20px;
    color: #a855f7;
}

.level-up-reward {
    font-size: 14px;
    color: #4ade80;
    margin-top: 10px;
}

/* ═══════════ GAME TOAST ═══════════ */
.game-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: linear-gradient(135deg, rgba(20, 20, 40, 0.95), rgba(30, 15, 50, 0.95));
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 12px;
    padding: 12px 24px;
    font-family: var(--font-display);
    font-size: 14px;
    color: #fff;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

.game-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ═══════════ SHOP TAB LOCKS ═══════════ */
.shop-tab.locked {
    opacity: 0.35;
    position: relative;
    cursor: not-allowed;
}

.shop-tab.locked::after {
    content: '🔒';
    position: absolute;
    top: -6px;
    right: -4px;
    font-size: 10px;
}

/* ═══════════ SHOP CURRENCY BAR ═══════════ */
.shop-currency-bar {
    display: flex;
    gap: 12px;
    align-items: center;
}

.shop-currency {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--text-primary);
}

.currency-icon {
    font-size: 16px;
}

/* ═══════════ PHASE 2: DAILY MISSIONS ═══════════ */
.daily-missions-panel {
    width: 90%;
    max-width: 400px;
    margin: 12px auto;
}

.daily-title {
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--accent);
    margin-bottom: 8px;
    text-align: center;
    letter-spacing: 2px;
}

.daily-mission {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 6px;
    transition: all 0.3s ease;
}

.daily-mission.completed {
    border-color: rgba(74, 222, 128, 0.3);
    background: rgba(74, 222, 128, 0.06);
}

.daily-icon {
    font-size: 20px;
}

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

.daily-name {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 3px;
}

.daily-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.daily-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #a855f7);
    border-radius: 2px;
    transition: width 0.4s ease;
}

.daily-progress-text {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.daily-reward {
    font-size: 13px;
    font-weight: 700;
    min-width: 50px;
    text-align: right;
}

/* ═══════════ STREAK NOTIFICATION ═══════════ */
.streak-notif {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    background: linear-gradient(135deg, rgba(15, 10, 25, 0.97), rgba(30, 10, 20, 0.97));
    border: 2px solid #ff6b35;
    border-radius: 16px;
    padding: 30px 40px;
    text-align: center;
    z-index: 10000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 50px rgba(255, 107, 53, 0.3);
}

.streak-notif.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.streak-fire {
    font-size: 48px;
    animation: firePulse 0.5s ease infinite alternate;
}

@keyframes firePulse {
    from {
        transform: scale(1);
        filter: brightness(1);
    }

    to {
        transform: scale(1.15);
        filter: brightness(1.3);
    }
}

.streak-title {
    font-family: var(--font-display);
    font-size: 24px;
    color: #ff6b35;
    margin: 8px 0;
    text-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
}

.streak-reward {
    font-size: 16px;
    color: #4ade80;
    margin: 8px 0 16px;
}

.streak-close {
    min-width: 80px;
}

/* ═══════════ ACHIEVEMENTS ═══════════ */
.btn-achievements {
    margin: 16px auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ach-count-badge {
    background: rgba(0, 240, 255, 0.2);
    color: var(--accent);
    border-radius: 8px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
}

.achievements-overlay {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

.ach-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ach-screen-title {
    font-family: var(--font-display);
    font-size: 16px;
    color: var(--accent);
    letter-spacing: 1px;
    white-space: nowrap;
}

.ach-counter {
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--accent);
    white-space: nowrap;
    background: rgba(0, 240, 255, 0.1);
    padding: 3px 10px;
    border-radius: 8px;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    padding-bottom: 40px;
}

.achievement-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 10px;
    text-align: center;
    transition: all 0.3s ease;
}

.achievement-card.unlocked {
    border-color: rgba(0, 240, 255, 0.3);
    background: rgba(0, 240, 255, 0.05);
}

.achievement-card.locked {
    opacity: 0.4;
}

.ach-icon {
    font-size: 28px;
    margin-bottom: 6px;
}

.ach-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.ach-desc {
    font-size: 10px;
    color: var(--text-secondary);
}

.ach-reward {
    font-size: 11px;
    color: #4ade80;
    margin-top: 4px;
    font-weight: 600;
}

/* ═══════════ PHASE 3: SHOP & RESULTS UX ═══════════ */

/* Results Goals & Near-miss */
.results-goals {
    margin: 10px 0;
}

.results-near-miss {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    padding: 8px 14px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #ffd700;
    text-align: center;
    animation: nearMissPulse 1.5s ease infinite;
}

@keyframes nearMissPulse {

    0%,
    100% {
        border-color: rgba(255, 215, 0, 0.3);
    }

    50% {
        border-color: rgba(255, 215, 0, 0.7);
    }
}

.results-goals-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.results-goal {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
}

.goal-icon {
    font-size: 16px;
}

.goal-name {
    flex: 1;
    color: var(--text-primary);
}

.goal-cost {
    color: var(--accent);
    font-weight: 700;
    font-size: 12px;
}

/* Shop Toolbar */
.shop-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 15px;
    gap: 8px;
}

.shop-sort {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 11px;
    padding: 5px 10px;
    cursor: pointer;
}

.shop-sort option {
    background: #1a1a2e;
    color: var(--text-primary);
}

.btn-mystery {
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    border: none;
    font-size: 11px;
    white-space: nowrap;
    padding: 5px 12px;
}

.btn-mystery:hover {
    filter: brightness(1.2);
}

/* Recommended Badge */
.shop-recommended-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #1a1a2e;
    font-size: 9px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.shop-card {
    position: relative;
}

/* Mystery Box Reveal */
.mystery-reveal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    background: linear-gradient(135deg, rgba(10, 10, 30, 0.97), rgba(25, 10, 40, 0.97));
    border: 2px solid #7c3aed;
    border-radius: 16px;
    padding: 30px 40px;
    text-align: center;
    z-index: 10000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 60px rgba(124, 58, 237, 0.4);
}

.mystery-reveal.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.mystery-box-icon {
    font-size: 48px;
    animation: boxShake 0.5s ease;
}

@keyframes boxShake {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-10deg);
    }

    75% {
        transform: rotate(10deg);
    }
}

.mystery-item-icon {
    font-size: 56px;
    margin: 10px 0;
    animation: itemReveal 0.6s ease 0.5s both;
}

@keyframes itemReveal {
    from {
        transform: scale(0) rotate(180deg);
        opacity: 0;
    }

    to {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.mystery-item-name {
    font-family: var(--font-display);
    font-size: 18px;
    margin: 8px 0 4px;
}

.mystery-rarity {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
}

/* ═══════════ PHASE 4: ENDGAME & POLISH ═══════════ */

/* Event Banner */
.event-banner {
    width: 90%;
    max-width: 400px;
    margin: 16px auto;
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.15), rgba(236, 72, 153, 0.15));
    border: 1px solid rgba(124, 58, 237, 0.4);
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-primary);
    text-align: center;
    animation: eventPulse 3s ease infinite;
}

.event-banner.hidden {
    display: none;
}

@keyframes eventPulse {

    0%,
    100% {
        border-color: rgba(124, 58, 237, 0.4);
    }

    50% {
        border-color: rgba(236, 72, 153, 0.6);
    }
}

/* Prestige Button (title screen) */
.btn-prestige {
    margin: 16px auto;
    display: flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 140, 0, 0.15));
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* Prestige Screen */
.prestige-overlay {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

.prestige-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.prestige-title {
    font-family: var(--font-display);
    font-size: 20px;
    color: #ffd700;
    letter-spacing: 2px;
}

.prestige-info {
    background: rgba(255, 215, 0, 0.06);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.prestige-stat {
    font-size: 14px;
    color: var(--text-primary);
    margin: 6px 0;
}

.btn-prestige-action {
    width: 100%;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #1a1a2e;
    font-weight: 900;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.prestige-hint {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 20px;
}

/* Token Shop */
.token-shop-title {
    font-family: var(--font-display);
    font-size: 16px;
    color: var(--accent);
    text-align: center;
    margin-bottom: 12px;
}

.token-shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    padding-bottom: 30px;
}

.token-shop-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 10px;
    text-align: center;
}

.token-shop-card.owned {
    border-color: rgba(74, 222, 128, 0.3);
    background: rgba(74, 222, 128, 0.06);
}

.token-card-icon {
    font-size: 28px;
    margin-bottom: 6px;
}

.token-card-name {
    font-size: 11px;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 4px;
}

.token-card-price {
    font-size: 13px;
    color: #ffd700;
    font-weight: 700;
    margin-bottom: 8px;
}

/* Combo Burst */
.combo-burst {
    position: absolute;
    font-size: 24px;
    pointer-events: none;
    animation: comboBurst 0.8s ease forwards;
    z-index: 100;
}

@keyframes comboBurst {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.8;
    }

    100% {
        transform: scale(2) translateY(-30px);
        opacity: 0;
    }
}

/* ═══════════════════════════════════════
   PvP MODE STYLES
   ═══════════════════════════════════════ */

/* ─── PvP Title Button ─── */
.btn-pvp-title {
    background: linear-gradient(135deg, rgba(255, 42, 109, 0.15), rgba(180, 74, 255, 0.15));
    border-color: rgba(255, 42, 109, 0.3);
    color: var(--neon-pink);
}

.btn-pvp-title:hover {
    background: linear-gradient(135deg, rgba(255, 42, 109, 0.25), rgba(180, 74, 255, 0.25));
    border-color: var(--neon-pink);
    box-shadow: var(--glow-pink), var(--glow-violet);
    transform: translateY(-1px);
}

/* ─── PvP LOBBY ─── */
.pvp-lobby-overlay {
    width: 100%;
    max-width: 460px;
    padding: 24px;
    z-index: 2;
}

.pvp-lobby-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.pvp-lobby-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 3px;
    background: linear-gradient(90deg, var(--neon-pink), var(--neon-violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pvp-lobby-card {
    background: rgba(14, 14, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.pvp-rating-display {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--neon-gold);
    letter-spacing: 2px;
    padding: 8px 20px;
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    width: 100%;
    text-align: center;
}

.pvp-btn-quick {
    width: 100%;
    font-size: 18px;
    padding: 16px;
}

.pvp-divider {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: 14px;
    letter-spacing: 3px;
}

.pvp-divider::before,
.pvp-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.pvp-btn-create {
    width: 100%;
}

/* Room Code Display */
.pvp-room-code-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px;
    background: rgba(180, 74, 255, 0.08);
    border: 1px solid rgba(180, 74, 255, 0.25);
    border-radius: 12px;
    width: 100%;
}

.pvp-room-code-display.hidden {
    display: none;
}

.pvp-room-code-label {
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

.pvp-room-code {
    font-family: var(--font-display);
    font-size: 40px;
    font-weight: 900;
    letter-spacing: 8px;
    color: var(--neon-violet);
    text-shadow: 0 0 20px rgba(180, 74, 255, 0.5);
}

.pvp-room-code-hint {
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--text-muted);
}

/* Join Row */
.pvp-join-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

.pvp-join-input {
    flex: 1;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-align: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast);
}

.pvp-join-input:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
}

.pvp-join-input::placeholder {
    color: var(--text-muted);
    letter-spacing: 1px;
    font-size: 13px;
    text-transform: none;
}

.pvp-btn-join {
    padding: 12px 24px;
    font-size: 14px;
}

/* Status Block */
.pvp-status-block {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(0, 240, 255, 0.06);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 10px;
    width: 100%;
    justify-content: center;
}

.pvp-status-block.hidden {
    display: none;
}

.pvp-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--neon-cyan);
    animation: statusPulse 1.5s ease-in-out infinite;
}

.pvp-status-dot.searching {
    background: var(--neon-cyan);
}

.pvp-status-dot.waiting {
    background: var(--neon-yellow);
}

.pvp-status-dot.found {
    background: var(--neon-lime);
    animation: none;
}

.pvp-status-dot.error {
    background: var(--neon-pink);
    animation: none;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.8);
    }
}

.pvp-status-text {
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.pvp-btn-cancel {
    width: 100%;
}

.pvp-btn-cancel.hidden {
    display: none;
}

/* ─── PvP MATCH SCREEN ─── */
#pvpMatchScreen {
    background: var(--bg-primary);
}

.pvp-match-layout {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
    position: relative;
    z-index: 2;
}

/* Timer Bar */
.pvp-match-timer-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
    padding-bottom: 16px;
}

.pvp-match-timer {
    font-family: var(--font-display);
    font-size: 52px;
    font-weight: 900;
    color: var(--neon-cyan);
    text-shadow: 0 0 30px rgba(0, 240, 255, 0.4);
}

/* Connection Status */
.pvp-connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.pvp-connection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.pvp-connection-dot.connected {
    background: #00ff66;
    box-shadow: 0 0 8px rgba(0, 255, 102, 0.5);
}

.pvp-connection-dot.reconnecting {
    background: var(--neon-yellow);
    animation: statusPulse 1s ease-in-out infinite;
}

.pvp-connection-dot.disconnected {
    background: var(--neon-pink);
}

.pvp-connection-text {
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

/* Players Row */
.pvp-players-row {
    display: flex;
    align-items: stretch;
    gap: 16px;
    width: 100%;
    max-width: 700px;
    flex: 1;
    min-height: 0;
}

.pvp-player-panel {
    flex: 1;
    background: rgba(14, 14, 26, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.pvp-you {
    border-color: rgba(0, 240, 255, 0.2);
    box-shadow: inset 0 0 30px rgba(0, 240, 255, 0.03);
}

.pvp-opponent {
    border-color: rgba(255, 42, 109, 0.2);
    box-shadow: inset 0 0 30px rgba(255, 42, 109, 0.03);
}

.pvp-panel-label {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 3px;
}

.pvp-you .pvp-panel-label {
    color: var(--neon-cyan);
}

.pvp-opponent .pvp-panel-label {
    color: var(--neon-pink);
}

.pvp-panel-score {
    font-family: var(--font-display);
    font-size: 56px;
    font-weight: 900;
    color: var(--text-primary);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
    line-height: 1;
}

.pvp-you .pvp-panel-score {
    color: var(--neon-cyan);
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.pvp-panel-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.pvp-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.pvp-stat-label {
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.pvp-stat-value {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

/* VS Divider */
.pvp-vs {
    display: flex;
    align-items: center;
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 900;
    color: var(--text-muted);
    letter-spacing: 3px;
    padding: 0 4px;
}

/* ─── PvP COUNTDOWN ─── */
.pvp-countdown-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 8, 15, 0.85);
    z-index: 100;
}

.pvp-countdown-overlay.hidden {
    display: none;
}

.pvp-countdown-number {
    font-family: var(--font-display);
    font-size: 120px;
    font-weight: 900;
    color: var(--neon-cyan);
    text-shadow: 0 0 60px rgba(0, 240, 255, 0.5), 0 0 120px rgba(0, 240, 255, 0.2);
    animation: countdownPop 1s ease-out;
}

@keyframes countdownPop {
    0% {
        transform: scale(2);
        opacity: 0;
    }

    30% {
        transform: scale(1);
        opacity: 1;
    }

    90% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
}

/* ─── PvP RESULT OVERLAY ─── */
.pvp-result-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: rgba(8, 8, 15, 0.92);
    backdrop-filter: blur(10px);
    z-index: 100;
    animation: resultFadeIn 0.5s ease;
}

.pvp-result-overlay.hidden {
    display: none;
}

@keyframes resultFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.pvp-result-banner {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 900;
    letter-spacing: 6px;
    text-shadow: 0 0 40px currentColor;
}

.pvp-result-banner.win {
    color: var(--neon-gold);
    text-shadow: 0 0 40px rgba(255, 215, 0, 0.5);
}

.pvp-result-banner.lose {
    color: var(--neon-pink);
    text-shadow: 0 0 40px rgba(255, 42, 109, 0.4);
}

.pvp-result-banner.draw {
    color: var(--neon-cyan);
    text-shadow: 0 0 40px rgba(0, 240, 255, 0.4);
}

.pvp-result-scores {
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 700;
}

.pvp-result-sep {
    color: var(--text-muted);
    font-size: 24px;
}

.pvp-result-reason {
    font-family: var(--font-ui);
    font-size: 15px;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

.pvp-result-reward {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--neon-lime);
    letter-spacing: 1px;
}

.pvp-result-rating {
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.pvp-result-rating .rating-up {
    color: var(--neon-lime);
}

.pvp-result-rating .rating-down {
    color: var(--neon-pink);
}

/* ─── PvP RESPONSIVE ─── */
@media (max-width: 600px) {
    .pvp-players-row {
        flex-direction: column;
    }

    .pvp-vs {
        padding: 4px 0;
        font-size: 20px;
    }

    .pvp-panel-score {
        font-size: 40px;
    }

    .pvp-match-timer {
        font-size: 36px;
    }

    .pvp-result-banner {
        font-size: 32px;
    }

    .pvp-room-code {
        font-size: 28px;
    }
}