/* ==================== Global No-Select for Game Elements ==================== */
/* Prevents ugly blue selection box on interactive elements */
.monster,
.bot-army-entry,
.bot-army-icon,
.floating-bonus,
.sparkle-star,
.bg-orb,
.aurora,
.floating-number,
.upgrade-item,
.stat,
.btn,
button,
.compose-action,
#game-logo,
.rank-icon,
#pfp-emoji {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* ==================== Animated Background Effects ==================== */
#bg-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    contain: layout style paint;
}

/* Floating candy orbs */
.bg-orb {
    position: absolute;
    border-radius: 50%;
    opacity: 0.2;
    filter: blur(60px);
    animation: orb-float 30s linear infinite;
    transform: translateZ(0);
    will-change: transform;
    pointer-events: none;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--candy-pink), transparent 70%);
    top: 10%;
    left: 5%;
    animation-delay: 0s;
    animation-duration: 25s;
}

.orb-2 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, var(--candy-blue), transparent 70%);
    top: 60%;
    right: 10%;
    animation-delay: -5s;
    animation-duration: 22s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--candy-purple), transparent 70%);
    bottom: 20%;
    left: 30%;
    animation-delay: -10s;
    animation-duration: 28s;
}

@keyframes orb-float {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(20px, -15px, 0); }
}

/* Sparkle stars - simplified for performance */
.sparkle-star {
    position: absolute;
    color: var(--candy-yellow);
    font-size: 18px;
    opacity: 0;
    animation: star-twinkle 5s ease-in-out infinite;
    transform: translateZ(0);
    contain: strict;
}

.star-1 { top: 15%; left: 10%; animation-delay: 0s; }
.star-2 { top: 25%; right: 15%; animation-delay: 1s; color: var(--candy-cyan); }
.star-3 { top: 45%; left: 5%; animation-delay: 2s; }
.star-4 { top: 70%; right: 8%; animation-delay: 3s; color: var(--candy-pink); }

@keyframes star-twinkle {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.8; }
}

/* Aurora waves */
.aurora {
    position: absolute;
    width: 200%;
    height: 300px;
    opacity: 0.06;
    filter: blur(80px);
    animation: aurora-wave 25s linear infinite;
    transform: translateZ(0);
    will-change: transform;
    pointer-events: none;
}

.aurora-1 {
    top: -100px;
    left: -50%;
    background: linear-gradient(90deg, var(--candy-pink), var(--candy-purple), var(--candy-blue), var(--candy-cyan));
    animation-duration: 20s;
}

.aurora-2 {
    bottom: -100px;
    left: -50%;
    background: linear-gradient(90deg, var(--candy-green), var(--candy-yellow), var(--candy-orange), var(--candy-pink));
    animation-delay: -7s;
    animation-duration: 25s;
}

@keyframes aurora-wave {
    0%, 100% { transform: translateX(0) skewY(-2deg); }
    50% { transform: translateX(25%) skewY(2deg); }
}

/* ==================== Bot Army Display ==================== */
#bot-army-display {
    padding: var(--spacing-md);
    background:
        linear-gradient(180deg, rgba(155, 89, 255, 0.15) 0%, transparent 100%),
        rgba(10, 10, 26, 0.8);
    border-bottom: 2px solid rgba(155, 89, 255, 0.3);
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
}

.bot-army-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.bot-army-title {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--candy-purple);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#total-bots-count {
    font-family: var(--font-mono);
    font-size: var(--font-size-lg);
    font-weight: 800;
    color: var(--candy-cyan);
    text-shadow: 0 0 10px var(--candy-cyan);
}

#bot-army-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 50px;
    justify-content: center;
    align-items: center;
}

.bot-army-entry {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 8px;
    background: linear-gradient(135deg, rgba(155, 89, 255, 0.2), rgba(0, 212, 255, 0.1));
    border-radius: 20px;
    border: 1px solid rgba(155, 89, 255, 0.3);
    animation: bot-idle 2s ease-in-out infinite;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
    -webkit-user-select: none;
}

.bot-army-entry:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, rgba(155, 89, 255, 0.4), rgba(0, 212, 255, 0.2));
    border-color: rgba(155, 89, 255, 0.6);
    box-shadow: 0 0 15px rgba(155, 89, 255, 0.4);
}

.bot-army-icon {
    font-size: 18px;
    filter: drop-shadow(0 0 3px rgba(155, 89, 255, 0.5));
    cursor: default;
}

.bot-army-count {
    font-size: 12px;
    font-weight: 700;
    color: var(--candy-cyan);
    text-shadow: 0 0 5px var(--candy-cyan);
}

@keyframes bot-idle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.bot-army-empty {
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    text-align: center;
    padding: var(--spacing-sm);
    font-style: italic;
}

/* ==================== Monster Mini-Game ==================== */
#monster-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.monster {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
    cursor: pointer;
    transform-origin: center bottom;
    transition: transform 0.1s ease;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.5));
    will-change: transform;
    contain: layout style;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.monster-body {
    line-height: 1;
    animation: monster-idle 1.5s ease-in-out infinite;
    transition: transform 0.1s ease;
    will-change: transform;
}

@keyframes monster-idle {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.05); }
}

.monster:hover .monster-body {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.monster-hp-bar {
    width: 60px;
    height: 8px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 4px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.monster-hp-fill {
    height: 100%;
    background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, transparent 50%),
                linear-gradient(90deg, var(--candy-green), var(--candy-yellow));
    border-radius: 2px;
    transition: width 0.15s ease, background 0.3s ease;
    box-shadow: 0 0 8px var(--candy-green);
}

.monster-name {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Monster spawn animation */
.monster-spawn {
    animation: monster-spawn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes monster-spawn {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.3) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

/* Monster hit animation - more intense */
.monster-hit .monster-body {
    animation: monster-hit 0.15s ease;
}

@keyframes monster-hit {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(0.8) skewX(-10deg); filter: brightness(2.5) saturate(2); }
}

/* Monster slammed - impact squash */
.monster-slammed {
    animation: monster-slam 0.1s ease-out;
}

@keyframes monster-slam {
    0% { transform: scale(1, 1); }
    50% { transform: scale(1.2, 0.7) translateY(5px); }
    100% { transform: scale(1, 1); }
}

/* Flash effect on hit */
.monster-hit::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, transparent 70%);
    animation: hit-flash 0.15s ease-out;
    pointer-events: none;
}

@keyframes hit-flash {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}

/* Monster death animation - squish explosion */
.monster-death {
    animation: monster-death 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes monster-death {
    0% {
        transform: scale(1) rotate(0);
        opacity: 1;
        filter: brightness(1);
    }
    15% {
        transform: scale(1.4, 0.6) rotate(-5deg);
        filter: brightness(2);
    }
    30% {
        transform: scale(0.6, 1.4) rotate(5deg);
        filter: brightness(3);
    }
    50% {
        transform: scale(1.8) rotate(-10deg);
        opacity: 1;
        filter: brightness(2) saturate(2);
    }
    100% {
        transform: scale(0) rotate(360deg);
        opacity: 0;
        filter: brightness(5);
    }
}

/* Monster flee animation */
.monster-flee {
    animation: monster-flee 0.5s ease-in forwards;
    pointer-events: none;
}

@keyframes monster-flee {
    0% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    100% {
        transform: scale(0.5) translateY(-100px);
        opacity: 0;
    }
}

#bot-army-cps {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
    border-top: 1px solid rgba(155, 89, 255, 0.2);
}

#bot-army-cps .cps-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-transform: uppercase;
}

#bot-army-cps-value {
    font-family: var(--font-mono);
    font-size: var(--font-size-md);
    font-weight: 700;
    color: var(--candy-green);
    text-shadow: 0 0 8px rgba(0, 255, 135, 0.5);
}

/* Main Layout */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* ==================== Header Stats Bar ==================== */
#stats-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    background:
        linear-gradient(180deg, rgba(155, 89, 255, 0.15) 0%, transparent 100%),
        rgba(10, 10, 26, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 2px solid rgba(155, 89, 255, 0.4);
    box-shadow:
        0 4px 20px rgba(155, 89, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    gap: var(--spacing-md);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

#game-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 900;
    color: #1d9bf0; /* Fallback for browsers without background-clip: text */
    background: linear-gradient(135deg, #00d4ff 0%, #1d9bf0 25%, #a855f7 60%, #ff6b9d 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.02em;
    white-space: nowrap;
    justify-self: start;
    position: relative;
    text-transform: uppercase;
    animation: title-gradient 4s ease infinite;
    display: flex;
    align-items: center;
    gap: 8px;
}

#game-logo {
    font-size: 1.8rem;
    -webkit-text-fill-color: initial;
    background: none;
    filter: drop-shadow(0 0 8px rgba(139, 69, 19, 0.6));
    animation: logo-bounce 2s ease-in-out infinite;
}

@keyframes logo-bounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-3px) rotate(-5deg); }
    75% { transform: translateY(-3px) rotate(5deg); }
}

#game-title::after {
    content: '';
    position: absolute;
    left: 32px;
    right: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(135deg, #00d4ff 0%, #1d9bf0 25%, #a855f7 60%, #ff6b9d 100%);
    background-size: 200% 200%;
    filter: blur(10px);
    opacity: 0.5;
    animation: title-gradient 4s ease infinite;
    z-index: -1;
    border-radius: 4px;
}

@keyframes title-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.stat-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    justify-self: center;
}

.stat {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-md);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 50%),
        var(--bg-tertiary);
    border-radius: var(--radius-full);
    border: 2px solid var(--border-color);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.stat:hover {
    transform: scale(1.05);
}

.stat-icon {
    font-size: var(--font-size-md);
}

.stat-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
    min-width: 60px;
}

.stat-label {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#followers-stat {
    border-color: var(--candy-blue);
    background:
        linear-gradient(180deg, rgba(0, 212, 255, 0.2) 0%, rgba(0, 212, 255, 0.05) 100%),
        var(--bg-tertiary);
    box-shadow:
        0 4px 15px rgba(0, 212, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#followers-stat .stat-value {
    color: var(--candy-blue);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

#impressions-stat {
    border-color: var(--candy-pink);
    background:
        linear-gradient(180deg, rgba(255, 20, 147, 0.2) 0%, rgba(255, 20, 147, 0.05) 100%),
        var(--bg-tertiary);
    box-shadow:
        0 4px 15px rgba(255, 20, 147, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#impressions-stat .stat-value {
    color: var(--candy-pink);
    text-shadow: 0 0 10px rgba(255, 20, 147, 0.5);
}

#xcoins-stat {
    border-color: var(--candy-yellow);
    background:
        linear-gradient(180deg, rgba(255, 229, 0, 0.2) 0%, rgba(255, 229, 0, 0.05) 100%),
        var(--bg-tertiary);
    box-shadow:
        0 4px 15px rgba(255, 229, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#xcoins-stat .stat-value {
    color: var(--candy-yellow);
    text-shadow: 0 0 10px rgba(255, 229, 0, 0.5);
}

/* Rank Display with XP Progress */
#rank-stat {
    gap: var(--spacing-sm);
}

#rank-stat #rank-icon {
    font-size: 1.3rem;
}

.rank-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rank-info .stat-value {
    font-size: var(--font-size-sm);
    min-width: auto;
}

.rank-progress-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.rank-progress-bar {
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

#rank-progress-fill {
    height: 100%;
    width: 0%;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.4) 0%, transparent 50%),
        linear-gradient(90deg, var(--candy-blue), var(--candy-purple), var(--candy-pink));
    border-radius: 2px;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(155, 89, 255, 0.5);
}

#rank-xp {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    font-family: var(--font-mono);
    white-space: nowrap;
}

#fps-stat {
    font-size: var(--font-size-sm);
    color: var(--success-green);
    background: rgba(0, 186, 124, 0.1);
    border-color: rgba(0, 186, 124, 0.3);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-full);
}

.header-controls {
    display: flex;
    gap: var(--spacing-xs);
    flex-shrink: 0;
    justify-self: end;
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 50%),
        var(--bg-tertiary);
    border: 2px solid var(--border-color);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
    color: var(--text-secondary);
    position: relative;
    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.icon-btn::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    border-radius: var(--radius-full);
    background: var(--candy-purple);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.icon-btn:hover {
    color: var(--candy-cyan);
    transform: scale(1.1);
    border-color: var(--candy-purple);
    box-shadow:
        0 6px 20px rgba(155, 89, 255, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.icon-btn:hover::before {
    opacity: 0.2;
    transform: scale(1);
}

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

.icon-btn:active::before {
    opacity: 0.3;
    transform: scale(0.95);
}

/* Individual icon colors on hover - Candy bright */
#stats-btn:hover {
    color: var(--candy-blue);
    border-color: var(--candy-blue);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.5);
}
#stats-btn:hover::before { background: var(--candy-blue); }

#achievements-btn:hover {
    color: var(--candy-yellow);
    border-color: var(--candy-yellow);
    box-shadow: 0 6px 20px rgba(255, 229, 0, 0.5);
}
#achievements-btn:hover::before { background: var(--candy-yellow); }

#sound-toggle:hover {
    color: var(--candy-green);
    border-color: var(--candy-green);
    box-shadow: 0 6px 20px rgba(0, 255, 135, 0.5);
}
#sound-toggle:hover::before { background: var(--candy-green); }

#save-btn:hover {
    color: var(--candy-purple);
    border-color: var(--candy-purple);
    box-shadow: 0 6px 20px rgba(155, 89, 255, 0.5);
}
#save-btn:hover::before { background: var(--candy-purple); }

#settings-btn:hover {
    color: var(--candy-pink);
    border-color: var(--candy-pink);
    box-shadow: 0 6px 20px rgba(255, 20, 147, 0.5);
}
#settings-btn:hover::before { background: var(--candy-pink); }

/* ==================== Main Game Area ==================== */
#game-area {
    display: grid;
    grid-template-columns: 300px 1fr 340px;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
    flex: 1;
    min-height: 0;
    overflow: hidden;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
}

/* ==================== History Panel (Left) ==================== */
#history-panel {
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(180deg, rgba(0, 212, 255, 0.08) 0%, transparent 30%),
        rgba(10, 10, 26, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-xl);
    border: 2px solid rgba(0, 212, 255, 0.3);
    overflow: hidden;
    position: relative;
    box-shadow:
        0 8px 32px rgba(0, 212, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.panel-header {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 2px solid rgba(155, 89, 255, 0.3);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 100%),
        linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    justify-content: space-between;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.icon-btn.small {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
}

.panel-header::before {
    content: '📜';
    font-size: var(--font-size-md);
}

.panel-title {
    font-weight: 700;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#history-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-sm);
    background: var(--bg-secondary);
    position: relative;
}

/* Shadow gradient fade at bottom of history panel */
#history-panel::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, var(--bg-secondary) 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

.history-empty {
    padding: var(--spacing-xl);
    text-align: center;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-style: italic;
    opacity: 0.7;
}

/* Tweet-style history items - Twitter/X authentic look */
.history-item.tweet {
    padding: var(--spacing-md);
    background: transparent;
    border-radius: 0;
    margin-bottom: 0;
    border: none;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
    cursor: pointer;
}

.history-item.tweet:hover {
    background: rgba(255, 255, 255, 0.03);
}

.history-item.tweet.viral {
    background: rgba(255, 215, 0, 0.03);
}

.history-item.tweet.viral:hover {
    background: rgba(255, 215, 0, 0.06);
}

.history-item.tweet.perfect {
    background: rgba(0, 186, 124, 0.02);
}

/* Tweet layout - avatar left, content right */
.tweet-layout {
    display: flex;
    gap: 12px;
}

/* Tweet avatar - left column */
.tweet-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--x-blue), var(--premium-purple));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

/* Tweet body - right column */
.tweet-body {
    flex: 1;
    min-width: 0;
}

/* Tweet header - name, handle, time, menu */
.tweet-header {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
    flex-wrap: wrap;
}

.tweet-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.2;
}

.tweet-verified {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--x-blue);
    margin-left: 2px;
}

.tweet-verified svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.tweet-verified.gold {
    color: var(--x-premium-gold);
}

.tweet-handle {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 400;
}

.tweet-separator {
    color: var(--text-secondary);
    font-size: 15px;
}

.tweet-time {
    font-size: 15px;
    color: var(--text-secondary);
}

.tweet-menu {
    margin-left: auto;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.tweet-menu:hover {
    background: rgba(29, 155, 240, 0.1);
    color: var(--x-blue);
}

.tweet-menu svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Viral/Perfect badges */
.tweet-badges {
    display: flex;
    gap: 6px;
    margin-bottom: 4px;
}

.viral-badge {
    font-size: 12px;
    padding: 2px 8px;
    background: rgba(255, 107, 107, 0.15);
    color: var(--accent-coral);
    border-radius: var(--radius-full);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.perfect-badge {
    font-size: 12px;
    padding: 2px 8px;
    background: rgba(0, 186, 124, 0.15);
    color: var(--success-green);
    border-radius: var(--radius-full);
    font-weight: 700;
}

.accuracy-badge {
    font-size: 14px;
    padding: 2px 6px;
    background: rgba(255, 215, 0, 0.2);
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
}

/* Tweet content */
.tweet-content {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 12px;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Tweet engagement row - X style */
.tweet-engagement {
    display: flex;
    justify-content: space-between;
    max-width: 425px;
    margin-top: 4px;
}

.engagement-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
    cursor: pointer;
    min-width: 50px;
}

.engagement-item .icon-wrap {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--transition-fast);
    /* Explicit margins for cross-browser consistency (Chrome vs Firefox) */
    margin: -8px 0 -8px -8px;
}

.engagement-item svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.engagement-item .count {
    font-size: 13px;
    font-weight: 400;
    min-width: 20px;
}

/* Comment hover - blue */
.engagement-item.comments:hover {
    color: var(--x-blue);
}
.engagement-item.comments:hover .icon-wrap {
    background: rgba(29, 155, 240, 0.1);
}

/* Retweet hover - green */
.engagement-item.retweets:hover {
    color: var(--success-green);
}
.engagement-item.retweets:hover .icon-wrap {
    background: rgba(0, 186, 124, 0.1);
}

/* Like hover - pink */
.engagement-item.likes:hover {
    color: #f91880;
}
.engagement-item.likes:hover .icon-wrap {
    background: rgba(249, 24, 128, 0.1);
}

/* Views hover - subtle */
.engagement-item.views:hover {
    color: var(--x-blue);
}
.engagement-item.views:hover .icon-wrap {
    background: rgba(29, 155, 240, 0.1);
}

/* Engagement popup - floating +N numbers */
.engagement-popup {
    position: fixed;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-mono);
    pointer-events: none;
    z-index: 1000;
    transform: translateX(-50%);
    text-shadow: 0 0 4px currentColor;
    animation: engagement-popup-float 0.8s ease-out forwards;
}

@keyframes engagement-popup-float {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) translateY(-12px) scale(1.1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px) scale(0.8);
    }
}

/* Tweet stats bar - game stats below engagement */
.tweet-stats {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    font-family: var(--font-mono);
}

.tweet-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tweet-stat .label {
    color: var(--text-secondary);
}

.tweet-stat .value {
    font-weight: 600;
}

.tweet-stat.wpm .value {
    color: var(--x-blue);
}

.tweet-stat.accuracy .value {
    color: var(--success-green);
}

.tweet-stat.coins .value {
    color: var(--x-premium-gold);
}

/* ==================== Typing Section (Center) ==================== */
#typing-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: var(--spacing-md);
    position: relative;
    overflow-y: auto;
    width: calc(100% - 40px);
    max-width: 820px;
    margin: 0 auto;
    padding: var(--spacing-xl) 60px var(--spacing-lg);
}

/* ==================== Player Rank Display ==================== */
#player-rank-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
}

#rank-badge {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 107, 107, 0.1));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: var(--radius-full);
}

#rank-icon {
    font-size: var(--font-size-xl);
}

#rank-name {
    font-size: var(--font-size-md);
    font-weight: 700;
    color: var(--x-premium-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#rank-progress {
    width: 150px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

#rank-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--x-blue), var(--x-premium-gold));
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

#rank-xp {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* ==================== Heat Meter (in header) ==================== */
#heat-meter {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

#heat-meter.warm {
    border-color: var(--warning-orange);
    background: rgba(255, 149, 0, 0.1);
}

#heat-meter.hot {
    border-color: var(--accent-coral);
    background: rgba(255, 107, 107, 0.15);
}

#heat-meter.blazing {
    border-color: #ff4757;
    background: rgba(255, 71, 87, 0.2);
    animation: heat-pulse 0.5s ease-in-out infinite;
}

@keyframes heat-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

#heat-bar {
    width: 80px;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

#heat-fill {
    height: 100%;
    width: 0%;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.4) 0%, transparent 50%),
        linear-gradient(90deg, var(--candy-blue), var(--candy-green), var(--candy-yellow), var(--candy-orange), var(--candy-red), var(--candy-magenta));
    border-radius: var(--radius-full);
    transition: width 0.1s ease;
    box-shadow: 0 0 10px rgba(255, 107, 0, 0.5);
}

#heat-level {
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#heat-meter.warm #heat-level {
    color: var(--warning-orange);
}

#heat-meter.hot #heat-level {
    color: var(--accent-coral);
}

#heat-meter.blazing #heat-level {
    color: #ff4757;
    text-shadow: 0 0 10px rgba(255, 71, 87, 0.5);
}

/* ==================== Big Coin Display - CANDY NUMBER GO UP ==================== */
#big-coin-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg) var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    position: relative;
    z-index: 150;
    background:
        radial-gradient(ellipse 80% 50% at 50% 30%, rgba(255, 229, 0, 0.1), transparent 60%);
}

#big-coin-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
}

#big-coin-icon {
    font-family: var(--font-mono);
    font-size: 48px;
    font-weight: 800;
    color: var(--x-premium-gold);
    opacity: 0.9;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
    margin-right: 8px;
}

#big-coin-value {
    font-family: var(--font-mono);
    font-size: 56px;
    font-weight: 800;
    color: var(--candy-yellow);
    text-shadow:
        0 0 30px rgba(255, 229, 0, 0.6),
        0 0 60px rgba(255, 229, 0, 0.4),
        0 0 100px rgba(255, 229, 0, 0.2),
        0 4px 8px rgba(0, 0, 0, 0.5);
    line-height: 1;
    letter-spacing: -2px;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), text-shadow 0.2s ease;
}

/* Unit symbol now controlled by #big-coin-icon element via JavaScript */

#big-coin-value.bump {
    transform: scale(1.08);
    text-shadow:
        0 0 50px rgba(255, 229, 0, 0.8),
        0 0 100px rgba(255, 229, 0, 0.5),
        0 0 150px rgba(255, 229, 0, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.5);
}

#coin-per-sec {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-top: var(--spacing-sm);
    opacity: 0.8;
}

#big-cps-value {
    font-family: var(--font-mono);
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--success-green);
}

#coin-per-sec .cps-label {
    font-size: var(--font-size-sm);
    color: var(--success-green);
    opacity: 0.7;
}

/* Idle income active indicator */
#coin-per-sec.earning {
    animation: idle-earning-pulse 2s ease-in-out infinite;
}

@keyframes idle-earning-pulse {
    0%, 100% {
        opacity: 0.8;
        text-shadow: 0 0 5px rgba(0, 214, 143, 0.3);
    }
    50% {
        opacity: 1;
        text-shadow: 0 0 15px rgba(0, 214, 143, 0.6), 0 0 25px rgba(0, 214, 143, 0.3);
    }
}

#coin-per-sec.earning #big-cps-value {
    animation: cps-value-glow 2s ease-in-out infinite;
}

@keyframes cps-value-glow {
    0%, 100% {
        color: var(--success-green);
    }
    50% {
        color: #00ffaa;
        text-shadow: 0 0 10px rgba(0, 255, 170, 0.5);
    }
}

/* Notification Container - positioned to the left to avoid covering BTC number */
#notification-container {
    position: absolute;
    top: 120px; /* Below the big coin display */
    left: 5%;
    transform: translateX(0);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    pointer-events: none;
    z-index: 100;
}

.notification {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    animation: notification-float 4s ease-out forwards;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.notification.coins {
    border-color: var(--x-premium-gold);
    color: var(--x-premium-gold);
}

.notification.wpm {
    border-color: var(--x-blue);
    color: var(--x-blue);
}

.notification.perfect {
    border-color: var(--success-green);
    color: var(--success-green);
}

.notification.viral {
    border-color: var(--accent-coral);
    color: var(--accent-coral);
    font-size: var(--font-size-md);
}

.notification.record {
    border-color: var(--x-premium-gold);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
    color: var(--x-premium-gold);
    font-size: var(--font-size-md);
}

@keyframes notification-float {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.9);
    }
    5% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    85% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}

/* Candy Compose Box - Jelly style */
#compose-box {
    background:
        linear-gradient(180deg, rgba(155, 89, 255, 0.1) 0%, transparent 30%),
        rgba(10, 10, 26, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 3px solid rgba(155, 89, 255, 0.4);
    border-radius: var(--radius-xl);
    overflow: hidden;
    width: 100%;
    max-width: 700px;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    position: relative;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 8px 40px rgba(155, 89, 255, 0.2),
        0 0 60px rgba(155, 89, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

#compose-box:hover {
    border-color: rgba(155, 89, 255, 0.7);
    box-shadow:
        0 12px 50px rgba(155, 89, 255, 0.35),
        0 0 80px rgba(155, 89, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Hide any native cursor/caret in typing area */
#compose-box * {
    caret-color: transparent;
}

#compose-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.compose-title {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

#char-count {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

#compose-main {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    min-height: 200px;
}

.compose-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--x-blue), var(--premium-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.compose-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(29, 155, 240, 0.5);
}

.compose-avatar:hover::after {
    content: '✏️';
    position: absolute;
    bottom: -2px;
    right: -2px;
    font-size: 12px;
    background: var(--bg-secondary);
    border-radius: 50%;
    padding: 2px;
}

/* PFP Selection Modal */
.pfp-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    z-index: 300;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--spacing-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    min-width: 200px;
}

.pfp-option {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: background 0.15s ease, transform 0.15s ease;
}

.pfp-option:hover {
    background: rgba(29, 155, 240, 0.2);
    transform: scale(1.2);
}

.pfp-option.selected {
    background: rgba(29, 155, 240, 0.3);
    box-shadow: 0 0 0 2px var(--x-blue);
}

#compose-content {
    flex: 1;
    display: flex;
    align-items: flex-start;
    padding-top: var(--spacing-sm);
}

#post-text {
    font-size: var(--font-size-xl);
    line-height: 1.6;
    color: var(--text-primary);
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: none;
    cursor: default;
}

#post-text .word {
    display: inline-block;
    white-space: nowrap;
}

#post-text .char {
    display: inline;
    transition: all 0.05s ease;
    color: var(--text-secondary);
}

#post-text .char.typed {
    color: var(--candy-cyan);
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.4);
}

#post-text .char.current {
    color: var(--text-primary);
    background: linear-gradient(180deg, rgba(155, 89, 255, 0.5), rgba(155, 89, 255, 0.3));
    border-radius: 4px;
    padding: 0 3px;
    margin: 0 -3px;
    box-shadow: 0 0 15px rgba(155, 89, 255, 0.5);
}

/* Blazing cursor - glowing magenta when heat >= 80 */
#post-text.blazing .char.current {
    background: linear-gradient(180deg, rgba(255, 0, 255, 0.5), rgba(255, 0, 255, 0.3));
    box-shadow:
        0 0 15px rgba(255, 0, 255, 0.7),
        0 0 30px rgba(255, 0, 255, 0.4);
    animation: candy-glow 0.5s ease-in-out infinite;
}

#post-text .char.error {
    color: var(--candy-red);
    background: linear-gradient(180deg, rgba(255, 51, 102, 0.4), rgba(255, 51, 102, 0.2));
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(255, 51, 102, 0.5);
}

/* Golden character - special bonus character */
#post-text .char.golden {
    color: var(--x-premium-gold) !important;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.4);
    animation: golden-pulse 1s ease-in-out infinite;
    font-weight: 700;
}

#post-text .char.golden.current {
    background: rgba(255, 215, 0, 0.3);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

#post-text .char.golden-collected {
    animation: golden-collect 0.5s ease-out forwards;
}

@keyframes golden-pulse {
    0%, 100% {
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.4);
        transform: scale(1);
    }
    50% {
        text-shadow: 0 0 15px rgba(255, 215, 0, 1), 0 0 30px rgba(255, 215, 0, 0.6);
        transform: scale(1.1);
    }
}

@keyframes golden-collect {
    0% {
        transform: scale(1);
        color: var(--x-premium-gold);
    }
    50% {
        transform: scale(1.5);
        color: #fff;
        text-shadow: 0 0 30px rgba(255, 215, 0, 1);
    }
    100% {
        transform: scale(1);
        color: var(--x-premium-gold);
    }
}

#compose-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

#compose-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.compose-action {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
    cursor: default;
    padding: 0;
    background: transparent;
    border: none;
}

.compose-action svg {
    width: 20px;
    height: 20px;
    fill: var(--x-blue);
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.compose-action:hover {
    background: rgba(29, 155, 240, 0.1);
}

.compose-action:hover svg {
    opacity: 1;
}

#compose-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* Circular progress ring (like X's character limit) */
#progress-ring {
    width: 30px;
    height: 30px;
}

#progress-ring svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

#progress-ring .progress-bg {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 3;
}

#progress-ring .progress-fill-ring {
    fill: none;
    stroke: var(--x-blue);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 97.4; /* 2 * PI * 15.5 */
    stroke-dashoffset: 97.4;
    transition: stroke-dashoffset 0.1s ease, stroke 0.2s ease;
}

#progress-ring.warning .progress-fill-ring {
    stroke: var(--warning-orange);
}

#progress-ring.complete .progress-fill-ring {
    stroke: var(--success-green);
}

/* X-style Post button */
.x-button {
    background: var(--x-blue);
    color: white;
    font-weight: 700;
    font-size: var(--font-size-md);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
    opacity: 0.5;
    cursor: default;
}

.x-button.ready {
    opacity: 1;
    cursor: pointer;
}

.x-button.ready:hover {
    background: var(--x-blue-hover);
}

/* ==================== Inflating Balloon (10-post bonus) ==================== */
#balloon-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    z-index: 100;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#balloon-container:hover {
    transform: scale(1.1);
}

/* Balloon tooltip - appears to the left */
#balloon-container[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 12px;
    background: rgba(20, 20, 20, 0.95);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
    z-index: 1000;
}

#balloon-container[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

#balloon-visual {
    font-size: 35px;
    transition: font-size 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.3s ease, filter 0.3s ease;
    filter: drop-shadow(0 0 5px rgba(255, 100, 100, 0.3));
    /* Size will be controlled by JS based on progress */
}

#balloon-container.inflating #balloon-visual {
    animation: balloon-wobble 1s ease-in-out infinite;
}

#balloon-container.inflating.stage-2 #balloon-visual {
    animation: balloon-wobble-intense 0.6s ease-in-out infinite;
}

#balloon-container.about-to-pop #balloon-visual {
    animation: balloon-about-to-pop 0.25s ease-in-out infinite;
}

#balloon-container.critical #balloon-visual {
    animation: balloon-critical 0.12s ease-in-out infinite;
}

#balloon-container.ready #balloon-visual {
    animation: balloon-ready 0.1s ease-in-out infinite;
}

@keyframes balloon-wobble {
    0%, 100% { transform: rotate(-2deg) scale(1); }
    50% { transform: rotate(2deg) scale(1.03); }
}

@keyframes balloon-wobble-intense {
    0%, 100% { transform: rotate(-3deg) scale(1); }
    50% { transform: rotate(3deg) scale(1.05); }
}

@keyframes balloon-about-to-pop {
    0%, 100% { transform: rotate(-6deg) scale(1); }
    25% { transform: rotate(4deg) scale(1.08); }
    50% { transform: rotate(-5deg) scale(1.02); }
    75% { transform: rotate(5deg) scale(1.1); }
}

@keyframes balloon-critical {
    0%, 100% { transform: rotate(-8deg) scale(1); }
    25% { transform: rotate(6deg) scale(1.12); }
    50% { transform: rotate(-7deg) scale(0.98); }
    75% { transform: rotate(7deg) scale(1.15); }
}

@keyframes balloon-ready {
    0%, 100% { transform: scale(1) rotate(-5deg); }
    50% { transform: scale(1.2) rotate(5deg); }
}

#balloon-count {
    display: none; /* Hidden - balloon pop timing is now a surprise! */
}

#post-progress-count {
    color: var(--accent-coral);
}

/* Balloon Pop Animation */
.balloon-pop {
    position: fixed;
    z-index: 1000;
    font-size: 100px;
    pointer-events: none;
    animation: balloon-pop-anim 0.6s ease-out forwards;
}

@keyframes balloon-pop-anim {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    30% {
        transform: scale(1.5);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Confetti burst from balloon */
.balloon-confetti {
    position: fixed;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    pointer-events: none;
    animation: confetti-burst 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes confetti-burst {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 1;
    }
    20% {
        transform: translate(var(--x, 0), var(--y, 0)) rotate(180deg) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(var(--x, 0), calc(var(--y, 0) + 200px)) rotate(720deg) scale(0);
        opacity: 0;
    }
}

/* Coin burst from balloon pop */
.balloon-coin {
    position: fixed;
    pointer-events: none;
    z-index: 1001;
    animation: coin-burst 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes coin-burst {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(0.5);
        opacity: 1;
    }
    15% {
        transform: translate(calc(var(--x, 0) * 0.3), calc(var(--y, 0) * 0.3)) rotate(90deg) scale(1.2);
        opacity: 1;
    }
    50% {
        transform: translate(var(--x, 0), var(--y, 0)) rotate(360deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--x, 0), calc(var(--y, 0) + 100px)) rotate(720deg) scale(0.3);
        opacity: 0;
    }
}

/* Typing Stats Bar - Clean minimal design */
#typing-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg) var(--spacing-md);
    width: 100%;
    max-width: 600px;
}

/* Main stats row (WPM + Accuracy) - clean on background */
.main-stats-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xl);
}

/* WPM display - large clean number */
#wpm-display {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

#wpm-display .stat-number {
    font-family: var(--font-mono);
    font-size: 48px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -1px;
}

#wpm-display .stat-name {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

/* Accuracy display - next to WPM */
#accuracy-display {
    display: flex;
    align-items: baseline;
    gap: 2px;
    padding-left: var(--spacing-lg);
    border-left: 1px solid var(--border-color);
}

#accuracy-display .stat-number {
    font-family: var(--font-mono);
    font-size: 36px;
    font-weight: 700;
    color: var(--success-green);
    line-height: 1;
    transition: color var(--transition-fast);
}

#accuracy-display .stat-name {
    font-size: var(--font-size-lg);
    color: var(--success-green);
    font-weight: 600;
}

#accuracy-display.perfect .stat-number,
#accuracy-display.perfect .stat-name {
    color: var(--x-premium-gold);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

#accuracy-display.has-errors .stat-number,
#accuracy-display.has-errors .stat-name {
    color: var(--accent-coral);
}

/* Secondary stats row - unified pill with dividers */
.stats-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.typing-stat {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    position: relative;
}

.typing-stat:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 1px;
    background: var(--border-color);
}

.typing-stat .stat-icon {
    font-size: var(--font-size-sm);
}

.typing-stat .stat-number {
    font-family: var(--font-mono);
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.typing-stat .stat-name {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 4px;
}

/* WPM Best */
#wpm-best-display .stat-icon::before {
    content: '🏆';
}

#wpm-best-display .stat-number {
    color: var(--x-premium-gold);
}

/* Combo */
#combo-display .stat-icon::before {
    content: '🔥';
}

#combo-display .stat-number {
    color: var(--accent-coral);
}

/* Streak */
#streak-display .stat-icon::before {
    content: '⚡';
}

#streak-display .stat-number {
    color: var(--premium-purple);
}

#streak-display.hot .stat-number {
    color: var(--x-premium-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Posts count */
#posts-display .stat-number {
    color: var(--x-premium-blue);
}

/* Typing Feedback */
#typing-feedback {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
}

#combo-display, #multiplier-display {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    border: 1px solid var(--border-color);
}

#combo-display {
    border-color: rgba(255, 107, 107, 0.3);
    background: rgba(255, 107, 107, 0.1);
}

#combo-count {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--accent-coral);
    min-width: 30px;
    text-align: center;
}

#combo-label {
    font-size: var(--font-size-xs);
    color: var(--accent-coral);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

#multiplier-display {
    border-color: rgba(255, 230, 109, 0.3);
    background: rgba(255, 230, 109, 0.1);
}

#multiplier-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--highlight-yellow);
}

/* WPM color variants based on speed */
#wpm-value.wpm-good {
    color: var(--success-green);
}

#wpm-value.wpm-great {
    color: var(--highlight-yellow);
    text-shadow: 0 0 10px var(--highlight-yellow);
}

#wpm-value.wpm-excellent {
    color: var(--x-premium-gold);
    text-shadow: 0 0 15px var(--x-premium-gold);
}

/* Typing Progress */
#typing-progress {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

#progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

#progress-fill {
    height: 100%;
    width: 0%;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.4) 0%, transparent 50%),
        linear-gradient(90deg, var(--candy-blue), var(--candy-green), var(--candy-yellow));
    border-radius: var(--radius-full);
    transition: width var(--transition-fast);
    box-shadow:
        0 0 10px rgba(0, 212, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

#progress-text {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    min-width: 60px;
    text-align: right;
}

/* ==================== Upgrades Panel ==================== */
#upgrades-panel {
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(180deg, rgba(255, 20, 147, 0.08) 0%, transparent 30%),
        rgba(10, 10, 26, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-xl);
    border: 2px solid rgba(255, 20, 147, 0.3);
    overflow: hidden;
    box-shadow:
        0 8px 32px rgba(255, 20, 147, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--spacing-sm) var(--spacing-xs);
    font-weight: 700;
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    border-bottom: 4px solid transparent;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 100%);
}

.tab-icon {
    font-size: var(--font-size-lg);
    line-height: 1;
}

.tab-label {
    font-size: 10px;
}

.tab-indicator {
    display: none;
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--success-green);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--success-green);
    animation: pulse-indicator 1.5s ease-in-out infinite;
}

.tab-indicator.has-affordable {
    display: block;
}

@keyframes pulse-indicator {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

.tab:hover {
    color: var(--text-primary);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    transform: scale(1.05);
}

/* Bots tab - cyan candy theme */
.tab[data-tab="bots"].active {
    color: var(--candy-blue);
    border-bottom-color: var(--candy-blue);
    background:
        linear-gradient(180deg, rgba(0, 212, 255, 0.2) 0%, rgba(0, 212, 255, 0.05) 100%);
    box-shadow:
        inset 0 0 20px rgba(0, 212, 255, 0.2),
        0 4px 15px rgba(0, 212, 255, 0.3);
}

.tab[data-tab="bots"].active .tab-icon {
    filter: drop-shadow(0 0 8px var(--candy-blue));
    animation: jelly-float 3s ease-in-out infinite;
}

/* Upgrades tab - green candy theme */
.tab[data-tab="upgrades"].active {
    color: var(--candy-green);
    border-bottom-color: var(--candy-green);
    background:
        linear-gradient(180deg, rgba(0, 255, 135, 0.2) 0%, rgba(0, 255, 135, 0.05) 100%);
    box-shadow:
        inset 0 0 20px rgba(0, 255, 135, 0.2),
        0 4px 15px rgba(0, 255, 135, 0.3);
}

.tab[data-tab="upgrades"].active .tab-icon {
    filter: drop-shadow(0 0 8px var(--candy-green));
    animation: jelly-float 3s ease-in-out infinite;
}

/* Premium tab - yellow candy theme */
.tab[data-tab="premium"].active {
    color: var(--candy-yellow);
    border-bottom-color: var(--candy-yellow);
    background:
        linear-gradient(180deg, rgba(255, 229, 0, 0.2) 0%, rgba(255, 229, 0, 0.05) 100%);
    box-shadow:
        inset 0 0 20px rgba(255, 229, 0, 0.2),
        0 4px 15px rgba(255, 229, 0, 0.3);
}

.tab[data-tab="premium"].active .tab-icon {
    filter: drop-shadow(0 0 8px var(--candy-yellow));
    animation: jelly-float 3s ease-in-out infinite;
}

#tab-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.tab-pane {
    display: none;
    height: 100%;
    overflow-y: auto;
    padding: var(--spacing-md);
    background: var(--bg-secondary);
}

.tab-pane.active {
    display: block;
}

/* Bot/Upgrade Items - Candy Jelly Style */
.upgrade-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 50%),
        var(--bg-tertiary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-sm);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Override tooltip positioning for upgrade items */
.upgrade-item[data-tooltip]::after {
    bottom: auto;
    top: calc(100% + 4px);
    max-width: 250px;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
}

.upgrade-item[data-tooltip]::before {
    bottom: auto;
    top: calc(100% - 2px);
    border-top-color: transparent;
    border-bottom-color: rgba(0, 0, 0, 0.95);
}

/* Affordable indicator bar */
.upgrade-item .indicator-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: transparent;
    transition: background var(--transition-fast);
}

.upgrade-item:hover {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 50%),
        var(--bg-hover);
    border-color: var(--candy-purple);
    transform: translateX(4px) scale(1.02);
    box-shadow:
        0 6px 20px rgba(155, 89, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.upgrade-item.affordable {
    border-color: var(--candy-green);
    box-shadow:
        0 4px 15px rgba(0, 255, 135, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.upgrade-item.affordable:hover {
    border-color: var(--candy-green);
    box-shadow:
        0 6px 25px rgba(0, 255, 135, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.upgrade-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.upgrade-item.locked.fade-0 {
    opacity: 0.5;
}

.upgrade-item.locked.fade-1 {
    opacity: 0.3;
    filter: grayscale(0.7) blur(0.5px);
}

.upgrade-item.locked.fade-2 {
    opacity: 0.15;
    filter: grayscale(0.9) blur(1px);
}

.upgrade-item.locked:hover {
    transform: none;
    background: var(--bg-tertiary);
}

.upgrade-item.maxed {
    opacity: 0.6;
    border-color: var(--x-premium-gold);
    border-left: 3px solid var(--x-premium-gold);
}

.upgrade-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 50%),
        var(--bg-secondary);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xl);
    flex-shrink: 0;
    border: 2px solid var(--candy-purple);
    box-shadow:
        0 4px 10px rgba(155, 89, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.upgrade-item:hover .upgrade-icon {
    transform: scale(1.1) rotate(-5deg);
    box-shadow:
        0 6px 15px rgba(155, 89, 255, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.upgrade-item.affordable .upgrade-icon {
    /* No special styling for affordable items */
}

.locked-icon {
    background: var(--bg-hover);
    border-color: var(--x-gray-dark) !important;
}

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

.upgrade-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.upgrade-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.upgrade-owned {
    font-size: 11px;
    color: var(--x-blue);
    font-weight: 600;
}

.upgrade-stats {
    font-size: var(--font-size-xs);
    color: var(--x-blue);
    font-weight: 500;
}

.upgrade-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--spacing-xs);
    flex-shrink: 0;
}

/* Buy gain section - what you get */
.buy-gain {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(0, 186, 124, 0.15);
    border: 1px solid rgba(0, 186, 124, 0.3);
    border-radius: var(--radius-sm);
    min-width: 70px;
}

.gain-label {
    font-size: 9px;
    color: var(--success-green);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.gain-value {
    font-family: var(--font-mono);
    font-size: var(--font-size-md);
    font-weight: 700;
    color: var(--success-green);
}

/* Owned badge */
.owned-badge {
    display: inline-block;
    padding: 1px 6px;
    background: var(--x-blue);
    color: white;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    margin-left: var(--spacing-xs);
}

/* Current generation display */
.current-gen {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(255, 215, 0, 0.1);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--x-premium-gold);
}

.current-gen .gen-value {
    color: var(--x-premium-gold);
    font-weight: 700;
    font-family: var(--font-mono);
}

.upgrade-cost {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 50%),
        var(--bg-secondary);
    border-radius: var(--radius-md);
    min-width: 70px;
    justify-content: center;
    border: 2px solid var(--border-color);
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cost-value {
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
    font-size: var(--font-size-md);
}

.cost-icon {
    color: var(--x-premium-gold);
    font-size: var(--font-size-sm);
}

.cost-label {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.upgrade-cost.can-afford {
    background:
        linear-gradient(180deg, rgba(0, 255, 135, 0.2) 0%, rgba(0, 255, 135, 0.05) 100%);
    border-color: var(--candy-green);
    box-shadow:
        0 4px 15px rgba(0, 255, 135, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.upgrade-cost.can-afford .cost-value {
    color: var(--candy-green) !important;
    text-shadow: 0 0 8px rgba(0, 255, 135, 0.5);
}

.upgrade-cost.cant-afford .cost-value {
    color: var(--candy-red) !important;
    text-shadow: 0 0 8px rgba(255, 51, 102, 0.5);
}

.locked-cost {
    color: var(--x-gray) !important;
}

.maxed-text {
    color: var(--x-premium-gold) !important;
}

/* ==================== Bottom Panel ==================== */
#bottom-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

#event-ticker {
    flex: 1;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    max-width: 600px;
}

#event-text {
    display: inline-block;
    transition: opacity 0.2s ease;
}

#event-text.highlight {
    color: var(--candy-yellow);
    font-weight: 600;
    animation: pulse-micro 0.5s ease;
    text-shadow: 0 0 10px var(--candy-yellow);
}

#achievement-tray {
    display: flex;
    gap: var(--spacing-sm);
}

.achievement-badge {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    font-size: var(--font-size-md);
    border: 2px solid var(--x-premium-gold);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    transition: transform var(--transition-fast);
}

.achievement-badge:hover {
    transform: scale(1.1);
}

/* ==================== Canvas Overlay ==================== */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: var(--z-particles);
}

/* ==================== Floating Numbers ==================== */
#floating-numbers {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: var(--z-overlay);
    overflow: hidden;
}

.floating-number {
    position: absolute;
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: var(--font-size-lg);
    color: var(--candy-green);
    text-shadow:
        0 0 10px currentColor,
        0 0 20px currentColor,
        0 2px 4px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    white-space: nowrap;
}

.floating-number.followers {
    color: var(--candy-blue);
    text-shadow:
        0 0 15px var(--candy-blue),
        0 0 30px var(--candy-blue);
}

.floating-number.impressions {
    color: var(--candy-pink);
    text-shadow:
        0 0 15px var(--candy-pink),
        0 0 30px var(--candy-pink);
}

.floating-number.xcoins {
    color: var(--candy-yellow);
    text-shadow:
        0 0 15px var(--candy-yellow),
        0 0 30px var(--candy-yellow);
}

.floating-number.viral {
    color: var(--candy-magenta);
    font-size: var(--font-size-2xl);
    text-shadow:
        0 0 20px var(--candy-magenta),
        0 0 40px var(--candy-magenta);
}

.floating-number.error {
    color: var(--candy-red);
    font-size: var(--font-size-xl);
    text-shadow:
        0 0 15px var(--candy-red),
        0 0 30px var(--candy-red);
}

.floating-number.idle {
    color: var(--candy-green);
    font-size: var(--font-size-sm);
    opacity: 0.85;
    text-shadow:
        0 0 10px rgba(0, 255, 135, 0.6),
        0 0 20px rgba(0, 255, 135, 0.3);
}

.floating-number.rainbow {
    font-size: var(--font-size-2xl);
    font-weight: 900;
    animation: rainbow-text 0.3s linear infinite;
    text-shadow:
        0 0 20px currentColor,
        0 0 40px currentColor,
        0 0 60px currentColor;
}

@keyframes rainbow-text {
    0% { color: var(--candy-red); }
    17% { color: var(--candy-orange); }
    33% { color: var(--candy-yellow); }
    50% { color: var(--candy-green); }
    67% { color: var(--candy-blue); }
    83% { color: var(--candy-purple); }
    100% { color: var(--candy-red); }
}

/* ==================== Modal ==================== */
#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
}

#modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    max-width: 500px;
    width: 90%;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.modal-body {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

.modal-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
}

.btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-full);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--x-blue);
    color: var(--x-white);
}

.btn-primary:hover {
    background: var(--x-blue-hover);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

/* ==================== Username Modal ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.username-modal-content {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    max-width: 400px;
    width: 90%;
    border: 2px solid var(--candy-purple);
    box-shadow:
        0 0 40px rgba(155, 89, 255, 0.3),
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: modalBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalBounce {
    0% { transform: scale(0.5) translateY(50px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.username-modal-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.username-modal-logo {
    font-size: 64px;
    display: block;
    margin-bottom: var(--spacing-sm);
    animation: jelly-wobble 2s ease-in-out infinite;
}

.username-modal-header h2 {
    font-size: var(--font-size-xl);
    font-weight: 800;
    background: linear-gradient(135deg, var(--candy-pink), var(--candy-purple), var(--candy-cyan));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

.username-modal-body {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.username-modal-body p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.username-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border: 2px solid var(--candy-cyan);
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm) var(--spacing-md);
    transition: all 0.2s ease;
}

.username-input-wrapper:focus-within {
    border-color: var(--candy-pink);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.username-at {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--candy-cyan);
    margin-right: var(--spacing-xs);
}

#username-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: var(--font-size-lg);
    font-weight: 600;
    outline: none;
}

#username-input::placeholder {
    color: var(--text-muted);
}

.username-hint {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: var(--spacing-sm);
}

.username-modal-footer {
    text-align: center;
}

#username-submit {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--font-size-lg);
    font-weight: 700;
    background: linear-gradient(135deg, var(--candy-pink), var(--candy-purple));
    border: none;
    border-radius: var(--radius-full);
    color: white;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 15px rgba(255, 20, 147, 0.4);
}

#username-submit:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(255, 20, 147, 0.6);
}

#username-submit:active {
    transform: scale(0.98);
}

/* Settings Modal */
.setting-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item label {
    font-weight: 600;
    color: var(--text-primary);
}

.setting-item.danger label {
    color: var(--error-red);
}

.setting-item input[type="range"] {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--x-blue);
    border-radius: var(--radius-full);
    cursor: pointer;
}

/* Firefox range input styling */
.setting-item input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--x-blue);
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
}

.setting-item input[type="range"]::-moz-range-track {
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    border: none;
    height: 8px;
}

.setting-item input[type="text"] {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
}

.setting-item input[type="text"]:focus {
    border-color: var(--x-blue);
    outline: none;
}

.setting-item .btn {
    align-self: flex-start;
    margin-top: var(--spacing-xs);
}

.setting-item .btn.active {
    background: var(--x-blue);
    color: white;
}

.setting-item .toggle-group {
    display: flex;
    gap: var(--spacing-sm);
}

/* ==================== Tooltips ==================== */
/* Simple tooltips for header stats - appear below */
.stat[data-tooltip] {
    position: relative;
    cursor: help;
}

.stat[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: rgba(20, 20, 20, 0.95);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
    z-index: 1000;
}

.stat[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ==================== Achievements ==================== */

/* Achievement notification popup */
.achievement-notification {
    position: fixed;
    bottom: 100px;
    left: 30px;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.05));
    border: 2px solid var(--x-premium-gold);
    border-radius: var(--radius-lg);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3), 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 500;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: achievement-slide-in 0.4s ease-out;
}

@keyframes achievement-slide-in {
    0% {
        opacity: 0;
        transform: translateX(-100px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.achievement-notification-icon {
    font-size: 48px;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.5));
}

.achievement-notification-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.achievement-notification-title {
    font-size: var(--font-size-xs);
    color: var(--x-premium-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.achievement-notification-name {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
}

.achievement-notification-desc {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* Achievements modal */
.achievements-stats {
    margin-bottom: var(--spacing-lg);
}

.achievements-progress {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
}

.achievements-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--x-blue), var(--x-premium-gold));
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

.achievements-count {
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.achievements-modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

.achievement-category {
    margin-bottom: var(--spacing-lg);
}

.achievement-category-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--spacing-sm);
}

.category-icon {
    font-size: var(--font-size-lg);
}

.category-name {
    flex: 1;
    font-weight: 700;
    color: var(--text-primary);
}

.category-count {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.achievement-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.achievement-item.unlocked {
    background: rgba(255, 215, 0, 0.05);
    border-color: rgba(255, 215, 0, 0.2);
}

.achievement-item.locked {
    opacity: 0.5;
}

.achievement-icon {
    font-size: var(--font-size-xl);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.achievement-item.unlocked .achievement-icon {
    background: rgba(255, 215, 0, 0.1);
}

.achievement-info {
    flex: 1;
}

.achievement-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.achievement-item.locked .achievement-name {
    color: var(--text-secondary);
}

.achievement-desc {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.achievement-check {
    color: var(--success-green);
    font-size: var(--font-size-lg);
    font-weight: 700;
}

/* ==================== Event Notifications ==================== */
.event-notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg) var(--spacing-xl);
    background: linear-gradient(135deg, rgba(29, 155, 240, 0.2), rgba(162, 155, 254, 0.2));
    border: 2px solid var(--x-blue);
    border-radius: var(--radius-xl);
    box-shadow: 0 0 40px rgba(29, 155, 240, 0.4), 0 15px 50px rgba(0, 0, 0, 0.6);
    z-index: 600;
    min-width: 350px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.event-notification-icon {
    font-size: 56px;
    filter: drop-shadow(0 0 10px rgba(29, 155, 240, 0.6));
    animation: event-icon-bounce 0.6s ease-out;
}

@keyframes event-icon-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.event-notification-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.event-notification-title {
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(29, 155, 240, 0.5);
}

.event-notification-desc {
    font-size: var(--font-size-md);
    color: var(--text-secondary);
}

/* Animation for sliding in from top */
.animate-slide-in-top {
    animation: slide-in-top 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes slide-in-top {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-100px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* ==================== Floating Bonus (Golden Cookie style) ==================== */
.floating-bonus {
    position: fixed;
    z-index: 1000;
    cursor: pointer;
    animation: floating-bonus-pulse 1s ease-in-out infinite, floating-bonus-glow 2s ease-in-out infinite;
    transition: transform 0.2s ease;
}

.floating-bonus:hover {
    transform: scale(1.15);
}

.floating-bonus-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    background: radial-gradient(circle at 30% 30%, var(--bonus-color, #1d9bf0), rgba(29, 155, 240, 0.3));
    border: 3px solid var(--bonus-color, #1d9bf0);
    border-radius: 50%;
    box-shadow:
        0 0 30px var(--bonus-color, #1d9bf0),
        0 0 60px rgba(29, 155, 240, 0.5),
        inset 0 0 20px rgba(255, 255, 255, 0.2);
}

.floating-bonus-icon {
    font-size: 36px;
    filter: drop-shadow(0 0 10px white);
    line-height: 1;
}

.floating-bonus-text {
    font-size: 10px;
    font-weight: 800;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    margin-top: 4px;
}

@keyframes floating-bonus-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@keyframes floating-bonus-glow {
    0%, 100% {
        box-shadow: 0 0 30px var(--bonus-color, #1d9bf0), 0 0 60px rgba(29, 155, 240, 0.5);
    }
    50% {
        box-shadow: 0 0 50px var(--bonus-color, #1d9bf0), 0 0 100px rgba(29, 155, 240, 0.7);
    }
}

/* ==================== Bonus Mode Active ==================== */
body.bonus-mode-active {
    --border-glow: 0 0 0 2px rgba(29, 155, 240, 0.5), 0 0 40px rgba(29, 155, 240, 0.3);
}

body.bonus-mode-active #compose-box {
    border-color: var(--x-blue);
    box-shadow: 0 0 40px rgba(29, 155, 240, 0.4), 0 0 80px rgba(29, 155, 240, 0.2);
    animation: bonus-mode-border 1s ease-in-out infinite;
}

body.bonus-mode-active #big-coin-display {
    animation: bonus-mode-coins 1s ease-in-out infinite;
}

body.bonus-mode-active #big-coin-value {
    color: #00d4ff !important;
    text-shadow:
        0 0 20px rgba(0, 212, 255, 0.8),
        0 0 40px rgba(0, 212, 255, 0.5),
        0 0 60px rgba(0, 212, 255, 0.3) !important;
}

@keyframes bonus-mode-border {
    0%, 100% {
        box-shadow: 0 0 40px rgba(29, 155, 240, 0.4), 0 0 80px rgba(29, 155, 240, 0.2);
    }
    50% {
        box-shadow: 0 0 60px rgba(29, 155, 240, 0.6), 0 0 120px rgba(29, 155, 240, 0.4);
    }
}

@keyframes bonus-mode-coins {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Bonus Mode Timer */
#bonus-mode-timer {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    background: linear-gradient(135deg, rgba(29, 155, 240, 0.3), rgba(0, 212, 255, 0.2));
    border: 2px solid var(--x-blue);
    border-radius: var(--radius-full);
    padding: var(--spacing-sm) var(--spacing-xl);
    box-shadow: 0 0 30px rgba(29, 155, 240, 0.4);
    animation: timer-pulse 1s ease-in-out infinite;
}

#bonus-mode-timer .timer-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

#bonus-mode-timer .timer-icon {
    font-size: var(--font-size-xl);
    animation: timer-icon-spin 2s linear infinite;
}

@keyframes timer-icon-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#bonus-mode-timer .timer-label {
    font-size: var(--font-size-md);
    font-weight: 800;
    color: var(--x-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#bonus-mode-timer .timer-value {
    font-family: var(--font-mono);
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: white;
    min-width: 50px;
}

#bonus-mode-timer.urgent {
    border-color: var(--accent-coral);
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.3), rgba(255, 107, 107, 0.2));
    animation: timer-urgent 0.5s ease-in-out infinite;
}

#bonus-mode-timer.urgent .timer-label,
#bonus-mode-timer.urgent .timer-value {
    color: var(--accent-coral);
}

@keyframes timer-pulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.02); }
}

@keyframes timer-urgent {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
}

/* Bonus Mode Notification */
.bonus-mode-notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-xl) var(--spacing-2xl);
    background: linear-gradient(135deg, rgba(29, 155, 240, 0.3), rgba(0, 212, 255, 0.2));
    border: 3px solid var(--x-blue);
    border-radius: var(--radius-xl);
    box-shadow: 0 0 60px rgba(29, 155, 240, 0.6), 0 20px 60px rgba(0, 0, 0, 0.6);
    z-index: 700;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.bonus-mode-notification-icon {
    font-size: 72px;
    animation: bonus-icon-bounce 0.6s ease-out;
}

@keyframes bonus-icon-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.bonus-mode-notification-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.bonus-mode-notification-title {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: white;
    text-shadow: 0 0 20px rgba(29, 155, 240, 0.8);
}

.bonus-mode-notification-desc {
    font-size: var(--font-size-lg);
    color: var(--x-blue);
    font-weight: 700;
}

/* ==================== Responsive ==================== */
@media (max-width: 1400px) {
    #game-area {
        grid-template-columns: 280px 1fr 340px;
    }
}

@media (max-width: 1200px) {
    #game-area {
        grid-template-columns: 1fr 320px;
    }

    #history-panel {
        display: none;
    }
}

@media (max-width: 900px) {
    #game-area {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
        padding: var(--spacing-md);
    }

    #history-panel {
        display: none;
    }

    #upgrades-panel {
        max-height: 300px;
    }

    #compose-box {
        max-width: 100%;
    }

    #typing-stats {
        max-width: 100%;
    }
}

/* ==================== Stats Panel ==================== */
.stats-panel {
    max-width: 700px;
    width: 100%;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.stats-header h2 {
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.close-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    text-align: center;
}

.stat-card-value {
    font-family: var(--font-mono);
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--x-premium-gold);
    display: block;
}

.stat-card-label {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: var(--spacing-xs);
}

.stats-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.stats-column h3 {
    font-size: var(--font-size-md);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-md) 0;
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-xs) 0;
    font-size: var(--font-size-sm);
}

.stat-row span:first-child {
    color: var(--text-secondary);
}

.stat-row span:last-child {
    color: var(--text-primary);
    font-weight: 600;
    font-family: var(--font-mono);
}

.stats-graphs h3 {
    font-size: var(--font-size-md);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-md) 0;
}

.graph-tabs {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.graph-tab {
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.graph-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.graph-tab.active {
    background: var(--x-blue);
    color: white;
    border-color: var(--x-blue);
}

.graph-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
}

.graph-container canvas {
    width: 100%;
    height: auto;
}

/* Modal adjustments for stats panel */
#modal-content:has(.stats-panel) {
    max-width: 750px;
    padding: var(--spacing-xl);
}

/* ==================== Big Reward Display ==================== */
/* Dramatic reward popup positioned to the right of typing panel */
.big-reward {
    position: fixed;
    top: 50%;
    right: 40px;
    transform: translateY(-50%) translateX(30px) scale(0.5);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.big-reward.show {
    opacity: 1;
    transform: translateY(-50%) translateX(0) scale(1);
}

.big-reward.hide {
    opacity: 0;
    transform: translateY(-50%) translateX(30px) scale(0.8);
}

/* On smaller screens, position above the typing area */
@media (max-width: 1400px) {
    .big-reward {
        top: 120px;
        right: auto;
        left: 50%;
        transform: translateX(-50%) translateY(-20px) scale(0.5);
    }

    .big-reward.show {
        transform: translateX(-50%) translateY(0) scale(1);
    }

    .big-reward.hide {
        transform: translateX(-50%) translateY(-20px) scale(0.8);
    }
}

.reward-content {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(20, 20, 30, 0.95));
    border: 3px solid var(--success-green);
    border-radius: var(--radius-xl);
    padding: 32px 48px;
    box-shadow:
        0 0 60px rgba(0, 186, 124, 0.4),
        0 20px 60px rgba(0, 0, 0, 0.6),
        inset 0 0 30px rgba(0, 186, 124, 0.1);
    text-align: center;
    min-width: 320px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Variants */
.big-reward.personal-best .reward-content {
    border-color: var(--x-premium-gold);
    box-shadow:
        0 0 80px rgba(255, 215, 0, 0.5),
        0 20px 60px rgba(0, 0, 0, 0.6),
        inset 0 0 40px rgba(255, 215, 0, 0.15);
    animation: reward-glow-gold 0.5s ease-out;
}

.big-reward.viral .reward-content {
    border-color: var(--accent-coral);
    box-shadow:
        0 0 80px rgba(255, 107, 107, 0.5),
        0 20px 60px rgba(0, 0, 0, 0.6),
        inset 0 0 40px rgba(255, 107, 107, 0.15);
}

.big-reward.speed-bonus .reward-content {
    border-color: var(--x-blue);
    box-shadow:
        0 0 60px rgba(29, 155, 240, 0.4),
        0 20px 60px rgba(0, 0, 0, 0.6),
        inset 0 0 30px rgba(29, 155, 240, 0.1);
}

.big-reward.perfect .reward-content {
    border-color: var(--highlight-yellow);
    box-shadow:
        0 0 60px rgba(255, 230, 109, 0.4),
        0 20px 60px rgba(0, 0, 0, 0.6),
        inset 0 0 30px rgba(255, 230, 109, 0.1);
}

@keyframes reward-glow-gold {
    0% { box-shadow: 0 0 100px rgba(255, 215, 0, 0.8), 0 20px 60px rgba(0, 0, 0, 0.6); }
    100% { box-shadow: 0 0 80px rgba(255, 215, 0, 0.5), 0 20px 60px rgba(0, 0, 0, 0.6); }
}

/* Main coin display */
.reward-coins {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.reward-coins .coin-icon {
    font-size: 48px;
    color: var(--x-premium-gold);
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6));
    animation: coin-bounce 0.4s ease-out;
}

.reward-coins .coin-amount {
    font-family: var(--font-mono);
    font-size: 56px;
    font-weight: 900;
    color: var(--success-green);
    text-shadow: 0 0 30px rgba(0, 186, 124, 0.5);
    animation: number-pop 0.4s ease-out;
}

.big-reward.personal-best .coin-amount {
    color: var(--x-premium-gold);
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.big-reward.viral .coin-amount {
    color: var(--accent-coral);
    text-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
}

@keyframes coin-bounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

@keyframes number-pop {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* Bonus tags */
.reward-bonuses {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.bonus-tag {
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: tag-slide-in 0.3s ease-out backwards;
}

.bonus-tag:nth-child(1) { animation-delay: 0.1s; }
.bonus-tag:nth-child(2) { animation-delay: 0.15s; }
.bonus-tag:nth-child(3) { animation-delay: 0.2s; }
.bonus-tag:nth-child(4) { animation-delay: 0.25s; }

@keyframes tag-slide-in {
    0% { transform: translateY(-10px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.bonus-tag.record {
    background: rgba(255, 215, 0, 0.2);
    color: var(--x-premium-gold);
    border: 1px solid var(--x-premium-gold);
}

.bonus-tag.viral {
    background: rgba(255, 107, 107, 0.2);
    color: var(--accent-coral);
    border: 1px solid var(--accent-coral);
}

.bonus-tag.wpm {
    background: rgba(29, 155, 240, 0.2);
    color: var(--x-blue);
    border: 1px solid var(--x-blue);
}

.bonus-tag.perfect {
    background: rgba(255, 230, 109, 0.2);
    color: var(--highlight-yellow);
    border: 1px solid var(--highlight-yellow);
}

/* Stats row */
.reward-stats {
    display: flex;
    gap: 24px;
    justify-content: center;
    padding-top: 16px;
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

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

.reward-stats .label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reward-stats .value {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.reward-stats .stat.idle {
    padding-left: 24px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.reward-stats .stat.idle .value {
    color: var(--x-blue);
}


/* ==================== Bot Quantity Visual Effects ==================== */
/* Quantity indicator on icon */
.upgrade-icon {
    position: relative;
}

.icon-quantity {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 9px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-family: var(--font-mono);
    min-width: 16px;
    text-align: center;
}

/* Quantity bar under bot info */
.quantity-bar {
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1px;
    margin-top: 4px;
    overflow: hidden;
}

.quantity-fill {
    height: 100%;
    border-radius: 1px;
    transition: width 0.3s ease;
    background: var(--text-secondary);
}

/* Subtle tier colors - just left border and badge */
.upgrade-item.quantity-tier-1 { border-left: 2px solid rgba(29, 155, 240, 0.4); }
.upgrade-item.quantity-tier-2 { border-left: 2px solid rgba(0, 186, 124, 0.5); }
.upgrade-item.quantity-tier-3 { border-left: 2px solid rgba(255, 159, 67, 0.5); }
.upgrade-item.quantity-tier-4 { border-left: 2px solid rgba(255, 107, 107, 0.6); }
.upgrade-item.quantity-tier-5 { border-left: 2px solid rgba(168, 85, 247, 0.6); }
.upgrade-item.quantity-tier-6 { border-left: 2px solid rgba(255, 215, 0, 0.7); }

/* Quantity fill colors by tier */
.upgrade-item.quantity-tier-1 .quantity-fill { background: rgba(29, 155, 240, 0.6); }
.upgrade-item.quantity-tier-2 .quantity-fill { background: rgba(0, 186, 124, 0.6); }
.upgrade-item.quantity-tier-3 .quantity-fill { background: rgba(255, 159, 67, 0.6); }
.upgrade-item.quantity-tier-4 .quantity-fill { background: rgba(255, 107, 107, 0.6); }
.upgrade-item.quantity-tier-5 .quantity-fill { background: rgba(168, 85, 247, 0.6); }
.upgrade-item.quantity-tier-6 .quantity-fill { background: rgba(255, 215, 0, 0.7); }

/* Subtle badge colors */
.owned-badge.tier-1, .owned-badge.tier-2, .owned-badge.tier-3,
.owned-badge.tier-4, .owned-badge.tier-5, .owned-badge.tier-6 {
    background: var(--bg-secondary);
}

/* Distinct bot backgrounds by type */
.upgrade-item[data-id="replyGuy"] {
    background: linear-gradient(135deg, rgba(100, 149, 237, 0.15) 0%, rgba(100, 149, 237, 0.05) 100%);
    border-left: 3px solid rgba(100, 149, 237, 0.5);
}
.upgrade-item[data-id="lurker"] {
    background: linear-gradient(135deg, rgba(128, 128, 128, 0.15) 0%, rgba(128, 128, 128, 0.05) 100%);
    border-left: 3px solid rgba(128, 128, 128, 0.5);
}
.upgrade-item[data-id="shitposter"] {
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.15) 0%, rgba(255, 165, 0, 0.05) 100%);
    border-left: 3px solid rgba(255, 165, 0, 0.5);
}
.upgrade-item[data-id="burnerAccount"] {
    background: linear-gradient(135deg, rgba(255, 69, 0, 0.15) 0%, rgba(255, 69, 0, 0.05) 100%);
    border-left: 3px solid rgba(255, 69, 0, 0.5);
}
.upgrade-item[data-id="memeLord"] {
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.15) 0%, rgba(0, 200, 83, 0.05) 100%);
    border-left: 3px solid rgba(0, 200, 83, 0.5);
}
.upgrade-item[data-id="contentCreator"] {
    background: linear-gradient(135deg, rgba(255, 0, 80, 0.15) 0%, rgba(255, 0, 80, 0.05) 100%);
    border-left: 3px solid rgba(255, 0, 80, 0.5);
}
.upgrade-item[data-id="blueCheck"] {
    background: linear-gradient(135deg, rgba(29, 155, 240, 0.2) 0%, rgba(29, 155, 240, 0.08) 100%);
    border-left: 3px solid rgba(29, 155, 240, 0.6);
}
.upgrade-item[data-id="influencer"] {
    background: linear-gradient(135deg, rgba(255, 105, 180, 0.15) 0%, rgba(255, 105, 180, 0.05) 100%);
    border-left: 3px solid rgba(255, 105, 180, 0.5);
}
.upgrade-item[data-id="cryptoBro"] {
    background: linear-gradient(135deg, rgba(247, 147, 26, 0.18) 0%, rgba(247, 147, 26, 0.06) 100%);
    border-left: 3px solid rgba(247, 147, 26, 0.6);
}
.upgrade-item[data-id="grokAI"] {
    background: linear-gradient(135deg, rgba(0, 200, 200, 0.15) 0%, rgba(0, 200, 200, 0.05) 100%);
    border-left: 3px solid rgba(0, 200, 200, 0.5);
}
.upgrade-item[data-id="botFarm"] {
    background: linear-gradient(135deg, rgba(120, 120, 140, 0.2) 0%, rgba(120, 120, 140, 0.08) 100%);
    border-left: 3px solid rgba(120, 120, 140, 0.6);
}
.upgrade-item[data-id="elonsAlt"] {
    background: linear-gradient(135deg, rgba(255, 50, 50, 0.15) 0%, rgba(255, 50, 50, 0.05) 100%);
    border-left: 3px solid rgba(255, 50, 50, 0.5);
}
.upgrade-item[data-id="mediaEmpire"] {
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.2) 0%, rgba(218, 165, 32, 0.08) 100%);
    border-left: 3px solid rgba(218, 165, 32, 0.6);
}
.upgrade-item[data-id="digitalGod"] {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.18) 0%, rgba(138, 43, 226, 0.06) 100%);
    border-left: 3px solid rgba(138, 43, 226, 0.6);
}
.upgrade-item[data-id="realityWarper"] {
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.15) 0%, rgba(255, 0, 255, 0.05) 100%);
    border-left: 3px solid rgba(255, 0, 255, 0.5);
}

/* Bot tier background colors (15 bots per tier) */
.upgrade-item.bot-tier-1 {
    background: linear-gradient(135deg, rgba(128, 128, 128, 0.12) 0%, rgba(128, 128, 128, 0.04) 100%);
    border-left: 3px solid rgba(128, 128, 128, 0.5);
}
.upgrade-item.bot-tier-2 {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(59, 130, 246, 0.04) 100%);
    border-left: 3px solid rgba(59, 130, 246, 0.55);
}
.upgrade-item.bot-tier-3 {
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.12) 0%, rgba(0, 200, 83, 0.04) 100%);
    border-left: 3px solid rgba(0, 200, 83, 0.5);
}
.upgrade-item.bot-tier-4 {
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.12) 0%, rgba(255, 165, 0, 0.04) 100%);
    border-left: 3px solid rgba(255, 165, 0, 0.5);
}
.upgrade-item.bot-tier-5 {
    background: linear-gradient(135deg, rgba(255, 69, 0, 0.12) 0%, rgba(255, 69, 0, 0.04) 100%);
    border-left: 3px solid rgba(255, 69, 0, 0.5);
}
.upgrade-item.bot-tier-6 {
    background: linear-gradient(135deg, rgba(255, 105, 180, 0.12) 0%, rgba(255, 105, 180, 0.04) 100%);
    border-left: 3px solid rgba(255, 105, 180, 0.5);
}
.upgrade-item.bot-tier-7 {
    background: linear-gradient(135deg, rgba(0, 200, 200, 0.12) 0%, rgba(0, 200, 200, 0.04) 100%);
    border-left: 3px solid rgba(0, 200, 200, 0.5);
}
.upgrade-item.bot-tier-8 {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.15) 0%, rgba(138, 43, 226, 0.05) 100%);
    border-left: 3px solid rgba(138, 43, 226, 0.6);
}
.upgrade-item.bot-tier-9 {
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.18) 0%, rgba(218, 165, 32, 0.06) 100%);
    border-left: 3px solid rgba(218, 165, 32, 0.65);
}
.upgrade-item.bot-tier-10 {
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.15) 0%, rgba(255, 0, 255, 0.05) 100%);
    border-left: 3px solid rgba(255, 0, 255, 0.6);
}

/* ==================== Tier Separators ==================== */
.tier-separator {
    padding: 1rem;
    margin: 0.5rem 0;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--tier-color) 15%, transparent) 0%,
        color-mix(in srgb, var(--tier-color) 5%, transparent) 100%);
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--tier-color) 30%, transparent);
    position: relative;
    overflow: hidden;
}

.tier-separator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--tier-color) 20%,
        var(--tier-color) 80%,
        transparent 100%);
}

.tier-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tier-icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 0 8px var(--tier-color));
}

.tier-title {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tier-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--tier-color);
    text-transform: uppercase;
}

.tier-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 0 10px color-mix(in srgb, var(--tier-color) 50%, transparent);
}

.tier-progress {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--tier-color);
    background: color-mix(in srgb, var(--tier-color) 20%, transparent);
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    border: 1px solid color-mix(in srgb, var(--tier-color) 40%, transparent);
}

.tier-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-style: italic;
    padding-left: 2.8rem;
}

.tier-divider {
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        color-mix(in srgb, var(--tier-color) 40%, transparent) 50%,
        transparent 100%);
    margin-top: 0.75rem;
}

/* Tier status styling */
.tier-separator.tier-status-complete {
    border-color: color-mix(in srgb, var(--tier-color) 50%, transparent);
}

.tier-separator.tier-status-complete .tier-progress {
    background: color-mix(in srgb, var(--tier-color) 30%, transparent);
    color: var(--text-primary);
}

.tier-separator.tier-status-complete::after {
    content: '✓';
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    font-size: 1rem;
    color: var(--tier-color);
}

/* Higher tier visual intensity */
.tier-separator.tier-8,
.tier-separator.tier-9,
.tier-separator.tier-10 {
    animation: tier-glow 3s ease-in-out infinite;
}

.tier-separator.tier-10 {
    animation: tier-glow-intense 2s ease-in-out infinite;
}

@keyframes tier-glow {
    0%, 100% { box-shadow: 0 0 10px color-mix(in srgb, var(--tier-color) 20%, transparent); }
    50% { box-shadow: 0 0 20px color-mix(in srgb, var(--tier-color) 40%, transparent); }
}

@keyframes tier-glow-intense {
    0%, 100% {
        box-shadow: 0 0 15px color-mix(in srgb, var(--tier-color) 30%, transparent),
                    0 0 30px color-mix(in srgb, var(--tier-color) 15%, transparent);
    }
    50% {
        box-shadow: 0 0 25px color-mix(in srgb, var(--tier-color) 50%, transparent),
                    0 0 50px color-mix(in srgb, var(--tier-color) 25%, transparent);
    }
}

/* Specific tier accent colors for enhanced visibility */
.tier-separator.tier-1 { --tier-color: #808080; }
.tier-separator.tier-2 { --tier-color: #3b82f6; }
.tier-separator.tier-3 { --tier-color: #00c853; }
.tier-separator.tier-4 { --tier-color: #ffa500; }
.tier-separator.tier-5 { --tier-color: #ff4500; }
.tier-separator.tier-6 { --tier-color: #ff69b4; }
.tier-separator.tier-7 { --tier-color: #00c8c8; }
.tier-separator.tier-8 { --tier-color: #8a2be2; }
.tier-separator.tier-9 { --tier-color: #daa520; }
.tier-separator.tier-10 { --tier-color: #ff00ff; }

/* ==================== Bickering Challenge ==================== */
.bickering-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    animation: bickering-fadeIn 0.3s ease;
}

.bickering-overlay.active {
    display: flex;
}

@keyframes bickering-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.bickering-modal {
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 0 60px rgba(29, 155, 240, 0.15);
    animation: bickering-modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bickering-modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.bickering-header {
    padding: 6px 8px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    text-align: center;
}

.bickering-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.bickering-icon {
    font-size: 20px;
    animation: bickering-shake 0.4s ease-in-out infinite;
}

@keyframes bickering-shake {
    0%, 100% { transform: rotate(-10deg) scale(1); }
    50% { transform: rotate(10deg) scale(1.15); }
}

.bickering-subtitle {
    margin-top: 2px;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.bickering-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.bickering-close:hover {
    color: var(--text-primary);
    background: rgba(244, 33, 46, 0.15);
}

.bickering-thread {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    display: block;
    background: var(--bg-primary);
}

/* Thread connector line */
.bickering-thread::before {
    display: none;
}

.bickering-tweet {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    position: relative;
    animation: bickering-tweetSlideIn 0.3s ease;
    border-bottom: 1px solid var(--border-color);
}

.bickering-tweet:last-child {
    border-bottom: none;
}

/* Opponent tweet entrance - dramatic slam in */
.opponent-tweet {
    animation: bickering-opponentSlam 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bickering-opponentSlam {
    0% {
        opacity: 0;
        transform: translateX(-20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Player reply entrance - slide up ready to fight */
.player-tweet.typing {
    animation: bickering-playerReady 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bickering-playerReady {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bickering-tweetSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Thread connector between tweets */
.tweet-connector {
    position: absolute;
    left: 13px;
    top: -1px;
    width: 2px;
    height: 10px;
    background: var(--border-color);
}

.tweet-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    border: 2px solid transparent;
    position: relative;
    z-index: 1;
}

.opponent-tweet .tweet-avatar {
    background: var(--bg-secondary);
    border-color: var(--error-red);
    box-shadow: 0 0 8px rgba(244, 33, 46, 0.3);
}

.player-tweet .tweet-avatar {
    background: var(--bg-secondary);
    border-color: var(--x-blue);
    box-shadow: 0 0 8px rgba(29, 155, 240, 0.3);
}

.tweet-content {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.tweet-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.tweet-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
}

.tweet-handle {
    font-size: 14px;
    color: var(--text-muted);
}

.tweet-text {
    font-size: 17px;
    color: var(--text-primary);
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: none;
    margin: 0;
    padding: 0;
}

/* Opponent tweet styling */
.opponent-tweet .tweet-text {
    color: var(--text-primary);
}

/* Opponent typing animation */
.opponent-tweet.typing-active {
    background: rgba(244, 33, 46, 0.05);
    border-radius: var(--radius-sm);
    padding: 4px 6px;
    margin: 2px 0;
}

.typing-indicator {
    font-size: 10px;
    color: var(--text-muted);
    background: rgba(244, 33, 46, 0.15);
    padding: 1px 6px;
    border-radius: var(--radius-full);
    margin-left: auto;
    animation: typing-pulse 1s ease-in-out infinite;
}

@keyframes typing-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.typing-cursor {
    color: var(--error-red);
    animation: cursor-blink 0.5s ease-in-out infinite;
    font-weight: 400;
}

@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Player tweet states */
.player-tweet.typing {
    background: rgba(29, 155, 240, 0.05);
    border-radius: var(--radius-lg);
    padding: 8px;
    margin: 4px 0;
    border: 1px solid rgba(29, 155, 240, 0.3);
}

.player-tweet.typing .tweet-content {
    flex: 1 1 0%;
    min-width: 0;
}

.player-tweet.typing .tweet-header {
    justify-content: flex-start;
}

.player-tweet.completed {
    background: rgba(0, 186, 124, 0.08);
    border-radius: var(--radius-sm);
    padding: 4px 6px;
    margin: 2px 0;
    border: 1px solid rgba(0, 186, 124, 0.2);
}

.player-tweet.completed .tweet-avatar {
    border-color: var(--success-green);
    box-shadow: 0 0 8px rgba(0, 186, 124, 0.3);
}

/* Typing area - left aligned text display */
.typing-area {
    font-size: 17px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: normal;
    text-align: left;
    width: 100%;
    display: block;
}

/* Word containers prevent mid-word line breaks */
.typing-area .word {
    display: inline;
    white-space: nowrap;
}

/* Bickering typing characters - match main panel exactly */
.bicker-char {
    display: inline;
    transition: all 0.05s ease;
    color: var(--text-secondary);
}

.bicker-char.typed {
    color: var(--x-blue);
}

.bicker-char.current {
    color: var(--text-primary);
    background: rgba(29, 155, 240, 0.3);
    border-radius: 2px;
    padding: 0 2px;
    margin: 0 -2px;
    animation: bicker-cursor 1s ease-in-out infinite;
}

@keyframes bicker-cursor {
    0%, 100% { background: rgba(29, 155, 240, 0.3); }
    50% { background: rgba(29, 155, 240, 0.5); }
}

.bicker-char.error {
    color: var(--error-red);
    background: rgba(244, 33, 46, 0.2);
    border-radius: 2px;
}

.bicker-char.shake {
    animation: bicker-charShake 0.2s ease;
}

@keyframes bicker-charShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

/* === JUICE: Timer and Combo HUD === */
.bickering-hud {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

/* Timer progress bar */
.bickering-timer-bar {
    width: 100%;
    height: 8px;
    background: #333;
    border-radius: 4px;
    margin-top: 12px;
    position: relative;
    overflow: hidden;
}

.timer-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    min-height: 8px;
    background: #1d9bf0 !important;
    background-color: #1d9bf0 !important;
    border-radius: 4px;
    transition: width 0.1s linear, background 0.3s ease;
    display: block;
    z-index: 1;
}

/* Ensure timer fill gets width from inline style */
#timer-bar-fill {
    background: #1d9bf0 !important;
}

.timer-bar-text {
    position: absolute;
    right: 0;
    top: -18px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.bickering-timer-bar.urgent .timer-bar-fill {
    background: linear-gradient(90deg, #ffad00, #ff8c00);
    animation: timer-bar-pulse 0.5s ease-in-out infinite;
}

.bickering-timer-bar.urgent .timer-bar-text {
    color: #ffad00;
}

.bickering-timer-bar.critical .timer-bar-fill {
    background: linear-gradient(90deg, #f4212e, #cc0000);
    animation: timer-bar-critical 0.3s ease-in-out infinite;
}

.bickering-timer-bar.critical .timer-bar-text {
    color: #f4212e;
}

@keyframes timer-bar-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 173, 0, 0.5); }
    50% { box-shadow: 0 0 15px rgba(255, 173, 0, 0.8); }
}

@keyframes timer-bar-critical {
    0%, 100% { box-shadow: 0 0 8px rgba(244, 33, 46, 0.5); }
    50% { box-shadow: 0 0 20px rgba(244, 33, 46, 1); }
}

.bickering-combo {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    min-width: 28px;
    text-align: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.15s ease;
}

.bickering-combo.active {
    opacity: 1;
    transform: scale(1);
    background: linear-gradient(135deg, rgba(29, 155, 240, 0.2), rgba(29, 155, 240, 0.1));
    color: var(--x-blue);
    border: 1px solid rgba(29, 155, 240, 0.3);
}

.bickering-combo.hot {
    background: linear-gradient(135deg, rgba(255, 173, 0, 0.3), rgba(255, 140, 0, 0.2));
    color: #ffad00;
    border-color: rgba(255, 173, 0, 0.5);
    animation: combo-hot 0.4s ease-in-out infinite;
}

.bickering-combo.fire {
    background: linear-gradient(135deg, rgba(244, 33, 46, 0.4), rgba(255, 173, 0, 0.4));
    color: #ff6b35;
    border-color: rgba(255, 100, 50, 0.6);
    animation: combo-fire 0.2s ease-in-out infinite;
    text-shadow: 0 0 8px rgba(255, 107, 53, 0.5);
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.4);
}

@keyframes combo-hot {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@keyframes combo-fire {
    0%, 100% { transform: scale(1) rotate(-2deg); }
    50% { transform: scale(1.12) rotate(2deg); }
}

/* Reply counter - stylish pill */
.reply-counter {
    font-size: 10px;
    font-weight: 800;
    color: white;
    background: linear-gradient(135deg, var(--x-blue), #0a84ff);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    box-shadow: 0 0 8px rgba(29, 155, 240, 0.4);
    animation: none;
}

/* === JUICE: Screen Shake === */
.bickering-modal.shake {
    animation: modal-shake 0.3s ease;
}

@keyframes modal-shake {
    0%, 100% { transform: translateX(0) scale(1); }
    10% { transform: translateX(-8px) scale(1); }
    20% { transform: translateX(8px) scale(1); }
    30% { transform: translateX(-6px) scale(1); }
    40% { transform: translateX(6px) scale(1); }
    50% { transform: translateX(-4px) scale(1); }
    60% { transform: translateX(4px) scale(1); }
    70% { transform: translateX(-2px) scale(1); }
    80% { transform: translateX(2px) scale(1); }
    90% { transform: translateX(-1px) scale(1); }
}

/* === JUICE: Urgency States === */
.bickering-modal.urgent {
    box-shadow: 0 0 30px rgba(255, 173, 0, 0.3);
}

.bickering-modal.urgent .player-tweet.typing {
    border-color: rgba(255, 173, 0, 0.4);
    background: rgba(255, 173, 0, 0.08);
}

.bickering-modal.critical {
    box-shadow: 0 0 40px rgba(244, 33, 46, 0.4);
    animation: modal-critical-pulse 0.5s ease-in-out infinite;
}

.bickering-modal.critical .player-tweet.typing {
    border-color: rgba(244, 33, 46, 0.5);
    background: rgba(244, 33, 46, 0.1);
    animation: tweet-critical 0.3s ease-in-out infinite;
}

@keyframes modal-critical-pulse {
    0%, 100% { box-shadow: 0 0 40px rgba(244, 33, 46, 0.3); }
    50% { box-shadow: 0 0 60px rgba(244, 33, 46, 0.5); }
}

@keyframes tweet-critical {
    0%, 100% { border-color: rgba(244, 33, 46, 0.5); }
    50% { border-color: rgba(244, 33, 46, 0.8); }
}

.bickering-footer {
    padding: 4px 8px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    background: var(--bg-secondary);
}

.bickering-skip-btn {
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.bickering-skip-btn:hover {
    color: var(--error-red);
    border-color: var(--error-red);
    background: rgba(244, 33, 46, 0.1);
}

/* Victory UI */
.bickering-victory {
    text-align: center;
    padding: 12px;
    background: rgba(0, 186, 124, 0.1);
    border-radius: var(--radius-md);
    margin: 8px 0 0 0;
    border: 1px solid rgba(0, 186, 124, 0.25);
    animation: bickering-victoryPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bickering-victoryPop {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    60% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.victory-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--success-green);
    margin-bottom: 2px;
    text-shadow: 0 0 20px rgba(0, 186, 124, 0.5);
}

.victory-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.victory-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 4px;
    margin-bottom: 10px;
    padding: 6px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.victory-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 4px;
}

.victory-stat .stat-value {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--text-primary);
}

.victory-stat .stat-label {
    font-size: 8px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Highlight special stats */
.victory-stat.coins .stat-value {
    color: #ffd700;
}

.victory-stat.followers .stat-value {
    color: var(--x-blue);
}

.victory-stat.combo .stat-value {
    color: #ff6b35;
}

.bickering-done-btn {
    padding: 8px 20px;
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: white;
    background: var(--success-green);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.bickering-done-btn:hover {
    background: var(--success-green-dark);
    transform: scale(1.03);
    box-shadow: 0 4px 20px rgba(0, 186, 124, 0.4);
}

/* === DEFEAT UI === */
.bickering-defeat {
    text-align: center;
    padding: 12px;
    background: linear-gradient(135deg, rgba(244, 33, 46, 0.15), rgba(200, 0, 0, 0.1));
    border-radius: var(--radius-md);
    margin: 8px 0 0 0;
    border: 1px solid rgba(244, 33, 46, 0.35);
    animation: bickering-defeatShake 0.6s ease;
}

@keyframes bickering-defeatShake {
    0% { transform: translateX(0); opacity: 0; }
    10% { transform: translateX(-10px); opacity: 1; }
    20% { transform: translateX(10px); }
    30% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    50% { transform: translateX(-5px); }
    60% { transform: translateX(5px); }
    70% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
    90% { transform: translateX(-1px); }
    100% { transform: translateX(0); }
}

.defeat-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--error-red);
    margin-bottom: 4px;
    text-shadow: 0 0 20px rgba(244, 33, 46, 0.5);
    animation: defeat-pulse 0.5s ease-in-out infinite;
}

@keyframes defeat-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.defeat-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: 10px;
    font-style: italic;
}

.defeat-stats {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
    padding: 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
}

.defeat-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.defeat-stat .stat-value {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--error-red);
}

.defeat-stat .stat-label {
    font-size: 8px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.defeat-btn {
    background: linear-gradient(135deg, #666, #444) !important;
    color: var(--text-muted) !important;
    box-shadow: none !important;
}

.defeat-btn:hover {
    background: linear-gradient(135deg, #555, #333) !important;
    transform: scale(1.02);
}

/* Responsive adjustments for bickering */
@media (max-width: 480px) {
    .bickering-modal {
        max-height: 95vh;
        border-radius: var(--radius-md);
    }

    .bickering-header {
        padding: 4px 6px;
    }

    .bickering-title {
        font-size: 0.85rem;
        letter-spacing: 0.5px;
    }

    .bickering-thread {
        padding: 2px 4px;
    }

    .bickering-tweet {
        gap: 4px;
        padding: 2px 0;
    }

    .tweet-avatar {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }

    .tweet-name {
        font-size: 10px;
    }

    .tweet-text,
    .typing-area {
        font-size: var(--font-size-md);
        line-height: 1.25;
    }

    .player-tweet.typing,
    .player-tweet.completed {
        padding: 3px 4px;
        margin: 1px 0;
    }

    .victory-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .victory-stat .stat-value {
        font-size: var(--font-size-xs);
    }
}

/* ============================================
   MARKET / CRYPTO TRADE STYLES
   ============================================ */

/* Market Tab Styles */
.market-header {
    text-align: center;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--spacing-md);
}

.market-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--x-premium-gold);
    display: block;
    margin-bottom: 4px;
}

.market-subtitle {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.market-stats {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.market-stats .profit-positive {
    color: var(--success-green);
}

.market-stats .profit-negative {
    color: var(--error-red);
}

/* Loot Box Items */
.lootbox-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.lootbox-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--box-color) 0%, transparent 50%);
    opacity: 0.1;
    transition: opacity var(--transition-fast);
}

.lootbox-item:hover {
    border-color: var(--box-color);
    transform: translateX(4px);
    box-shadow: 0 0 20px color-mix(in srgb, var(--box-color) 30%, transparent);
}

.lootbox-item:hover::before {
    opacity: 0.2;
}

.lootbox-item.cannot-afford {
    opacity: 0.5;
    cursor: not-allowed;
}

.lootbox-item.cannot-afford:hover {
    transform: none;
    border-color: var(--border-color);
    box-shadow: none;
}

.lootbox-item-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 0 10px var(--box-color));
    animation: lootbox-float 3s ease-in-out infinite;
}

@keyframes lootbox-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.lootbox-item-info {
    flex: 1;
}

.lootbox-item-name {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.lootbox-item-desc {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-bottom: 6px;
}

.lootbox-item-prizes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.prize-preview {
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 2px 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.lootbox-item-cost {
    text-align: right;
}

.lootbox-item-cost .cost-amount {
    font-weight: 700;
    color: var(--x-premium-gold);
    font-size: var(--font-size-md);
}

/* Loot Box Opening Overlay */
.lootbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.lootbox-overlay.active {
    display: flex;
    animation: lootbox-fade-in 0.3s ease;
}

@keyframes lootbox-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lootbox-modal {
    text-align: center;
    padding: var(--spacing-xl);
    width: 100%;
    max-width: 800px;
}

/* CSGO-Style Roulette Container */
.roulette-container {
    position: relative;
    margin-bottom: var(--spacing-xl);
}

.roulette-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 16px solid var(--x-blue);
    z-index: 10;
    filter: drop-shadow(0 0 10px var(--x-blue));
}

.roulette-pointer::after {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: var(--x-blue);
    box-shadow: 0 0 20px var(--x-blue);
}

.roulette-window {
    position: relative;
    height: 140px;
    overflow: hidden;
    border: 3px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
}

/* Gradient fade on edges */
.roulette-window::before,
.roulette-window::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100px;
    z-index: 5;
    pointer-events: none;
}

.roulette-window::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-secondary), transparent);
}

.roulette-window::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-secondary), transparent);
}

/* Center line indicator */
.roulette-window::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-secondary), transparent);
}

.roulette-strip {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
}

.roulette-item {
    flex-shrink: 0;
    width: 120px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm);
    border-right: 2px solid var(--border-color);
    background: linear-gradient(180deg,
        var(--bg-tertiary) 0%,
        var(--bg-secondary) 50%,
        var(--bg-tertiary) 100%
    );
    position: relative;
    transition: transform 0.1s ease;
}

.roulette-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--rarity-color, var(--text-muted));
    box-shadow: var(--rarity-glow, none);
}

/* Rare items glow and pulse */
.roulette-item.rarity-rare {
    background: linear-gradient(180deg,
        rgba(59, 130, 246, 0.1) 0%,
        var(--bg-secondary) 50%,
        rgba(59, 130, 246, 0.1) 100%
    );
}

.roulette-item.rarity-epic {
    background: linear-gradient(180deg,
        rgba(168, 85, 247, 0.15) 0%,
        var(--bg-secondary) 50%,
        rgba(168, 85, 247, 0.15) 100%
    );
    animation: epic-pulse 1.5s ease-in-out infinite;
}

.roulette-item.rarity-legendary {
    background: linear-gradient(180deg,
        rgba(245, 158, 11, 0.2) 0%,
        var(--bg-secondary) 50%,
        rgba(245, 158, 11, 0.2) 100%
    );
    animation: legendary-pulse 1s ease-in-out infinite;
}

.roulette-item.rarity-mythic {
    background: linear-gradient(180deg,
        rgba(239, 68, 68, 0.25) 0%,
        var(--bg-secondary) 50%,
        rgba(239, 68, 68, 0.25) 100%
    );
    animation: mythic-pulse 0.5s ease-in-out infinite;
}

@keyframes epic-pulse {
    0%, 100% { box-shadow: inset 0 0 20px rgba(168, 85, 247, 0.3); }
    50% { box-shadow: inset 0 0 40px rgba(168, 85, 247, 0.5); }
}

@keyframes legendary-pulse {
    0%, 100% { box-shadow: inset 0 0 30px rgba(245, 158, 11, 0.4); }
    50% { box-shadow: inset 0 0 50px rgba(245, 158, 11, 0.7); }
}

@keyframes mythic-pulse {
    0%, 100% {
        box-shadow: inset 0 0 40px rgba(239, 68, 68, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: inset 0 0 60px rgba(239, 68, 68, 0.8);
        transform: scale(1.02);
    }
}

.roulette-item-icon {
    font-size: 2rem;
    margin-bottom: 4px;
    transition: transform 0.2s ease;
}

/* Bigger icons for rare+ items */
.roulette-item.rarity-rare .roulette-item-icon,
.roulette-item.rarity-epic .roulette-item-icon {
    font-size: 2.2rem;
}

.roulette-item.rarity-legendary .roulette-item-icon {
    font-size: 2.5rem;
    animation: icon-bounce 1s ease-in-out infinite;
}

.roulette-item.rarity-mythic .roulette-item-icon {
    font-size: 2.8rem;
    animation: icon-bounce 0.5s ease-in-out infinite;
}

@keyframes icon-bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-3px) scale(1.1); }
}

.roulette-item-amount {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--rarity-color, var(--text-primary));
    text-shadow: var(--rarity-glow, none);
    white-space: nowrap;
}

.roulette-item.rarity-legendary .roulette-item-amount,
.roulette-item.rarity-mythic .roulette-item-amount {
    font-size: var(--font-size-md);
    font-weight: 900;
}

.roulette-item-rarity {
    font-size: var(--font-size-xs);
    color: var(--rarity-color, var(--text-muted));
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Loot Box Result */
.lootbox-result {
    opacity: 0;
    transform: translateY(20px);
}

.lootbox-result.reveal {
    animation: lootbox-result-reveal 0.5s ease forwards;
}

/* Big win celebration classes */
.lootbox-result.reveal.win-rare {
    animation: lootbox-result-reveal 0.5s ease forwards, win-pulse-rare 1s ease-in-out 0.5s infinite;
}

.lootbox-result.reveal.win-epic {
    animation: lootbox-result-reveal 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.lootbox-result.reveal.win-legendary {
    animation: lootbox-result-legendary 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.lootbox-result.reveal.win-mythic {
    animation: lootbox-result-mythic 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes lootbox-result-reveal {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes win-pulse-rare {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes lootbox-result-legendary {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.5) rotate(-5deg);
    }
    50% {
        transform: translateY(-10px) scale(1.1) rotate(2deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
    }
}

@keyframes lootbox-result-mythic {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.3) rotate(-10deg);
        filter: blur(10px);
    }
    30% {
        filter: blur(0);
    }
    60% {
        transform: translateY(-20px) scale(1.2) rotate(3deg);
    }
    80% {
        transform: translateY(5px) scale(0.95) rotate(-1deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
    }
}

.result-label {
    font-size: var(--font-size-md);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.result-amount {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 0 30px currentColor;
}

/* Bigger text for big wins */
.lootbox-result.win-epic .result-amount {
    font-size: 3.5rem;
}

.lootbox-result.win-legendary .result-amount {
    font-size: 4rem;
    animation: legendary-text-glow 1s ease-in-out infinite;
}

.lootbox-result.win-mythic .result-amount {
    font-size: 5rem;
    animation: mythic-text-glow 0.3s ease-in-out infinite, rainbow-text 3s linear infinite;
}

@keyframes legendary-text-glow {
    0%, 100% {
        text-shadow: 0 0 30px #f59e0b, 0 0 60px #f59e0b;
        transform: scale(1);
    }
    50% {
        text-shadow: 0 0 50px #f59e0b, 0 0 100px #f59e0b, 0 0 150px #f59e0b;
        transform: scale(1.02);
    }
}

@keyframes mythic-text-glow {
    0%, 100% {
        text-shadow: 0 0 40px currentColor, 0 0 80px currentColor;
        transform: scale(1);
    }
    50% {
        text-shadow: 0 0 60px currentColor, 0 0 120px currentColor, 0 0 180px currentColor;
        transform: scale(1.03);
    }
}

@keyframes rainbow-text {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

.result-rarity {
    font-size: var(--font-size-lg);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.lootbox-result.win-legendary .result-rarity,
.lootbox-result.win-mythic .result-rarity {
    font-size: var(--font-size-xl);
    animation: rarity-flash 0.5s ease-in-out infinite alternate;
}

@keyframes rarity-flash {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

/* Screen shake for big wins */
.lootbox-overlay.shake {
    animation: screen-shake 0.5s ease-in-out;
}

.lootbox-overlay.shake-hard {
    animation: screen-shake-hard 0.8s ease-in-out;
}

@keyframes screen-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes screen-shake-hard {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    10% { transform: translate(-10px, -5px) rotate(-1deg); }
    20% { transform: translate(10px, 5px) rotate(1deg); }
    30% { transform: translate(-10px, 5px) rotate(-1deg); }
    40% { transform: translate(10px, -5px) rotate(1deg); }
    50% { transform: translate(-5px, 10px) rotate(-0.5deg); }
    60% { transform: translate(5px, -10px) rotate(0.5deg); }
    70% { transform: translate(-5px, -5px) rotate(-0.5deg); }
    80% { transform: translate(5px, 5px) rotate(0.5deg); }
    90% { transform: translate(-2px, -2px) rotate(0deg); }
}

/* Flash effect */
.lootbox-overlay.flash::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    animation: flash-effect 0.3s ease-out forwards;
    pointer-events: none;
    z-index: 100;
}

@keyframes flash-effect {
    from { opacity: 0.8; }
    to { opacity: 0; }
}

.lootbox-continue-btn {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--font-size-md);
    font-weight: 700;
    color: var(--x-black);
    background: var(--x-blue);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lootbox-continue-btn:hover {
    background: var(--x-blue-hover);
    transform: scale(1.05);
}

.lootbox-continue-btn.hidden,
.lootbox-result.hidden {
    display: none;
}

/* Rarity-specific animations */
.result-amount[style*="legendary"],
.result-amount[style*="#f59e0b"] {
    animation: legendary-glow 1s ease-in-out infinite;
}

@keyframes legendary-glow {
    0%, 100% { text-shadow: 0 0 30px #f59e0b, 0 0 60px #f59e0b; }
    50% { text-shadow: 0 0 50px #f59e0b, 0 0 100px #f59e0b, 0 0 150px #f59e0b; }
}

.result-amount[style*="mythic"],
.result-amount[style*="#ef4444"] {
    animation: mythic-glow 0.5s ease-in-out infinite, rainbow-shift 2s linear infinite;
}

@keyframes mythic-glow {
    0%, 100% { text-shadow: 0 0 40px #ef4444, 0 0 80px #ef4444; }
    50% { text-shadow: 0 0 60px #ef4444, 0 0 120px #ef4444, 0 0 180px #ef4444; }
}

@keyframes rainbow-shift {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* ==================== Frenzy Mode System ==================== */
#frenzy-container {
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

#frenzy-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

#frenzy-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff6b6b, #ff9f43, #ffd93d);
    border-radius: var(--radius-full);
    transition: width 0.1s linear;
}

#frenzy-fill.active {
    background: linear-gradient(90deg, #ff0000, #ff6600, #ffcc00);
    animation: frenzy-pulse 0.3s ease-in-out infinite;
}

#frenzy-fill.cooldown {
    background: #666;
}

@keyframes frenzy-pulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.5); }
}

#frenzy-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 80px;
}

#frenzy-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

#frenzy-timer {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--x-premium-gold);
}

/* Frenzy active body effects */
body.frenzy-active {
    animation: frenzy-screen 0.5s ease-in-out infinite;
}

body.frenzy-active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: radial-gradient(circle at center, transparent 30%, rgba(255, 100, 0, 0.15) 100%);
    z-index: 9999;
    animation: frenzy-overlay 1s ease-in-out infinite;
}

@keyframes frenzy-screen {
    0%, 100% { filter: saturate(1.2); }
    50% { filter: saturate(1.4); }
}

@keyframes frenzy-overlay {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

/* ==================== Critical Hit Effects ==================== */
.char.crit-hit {
    animation: crit-pop 0.4s ease-out forwards;
    color: var(--crit-cyan) !important;
    text-shadow: 0 0 10px var(--crit-cyan), 0 0 20px var(--crit-cyan), 0 0 30px var(--crit-cyan-dark);
}

@keyframes crit-pop {
    0% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.8);
        color: var(--crit-cyan);
    }
    100% {
        transform: scale(1);
    }
}

/* Mega Crit - magenta burst */
.char.mega-crit {
    animation: mega-crit-pop 0.5s ease-out forwards;
    color: var(--crit-mega) !important;
    text-shadow: 0 0 15px var(--crit-mega), 0 0 30px var(--crit-mega), 0 0 45px var(--crit-mega-dark);
}

@keyframes mega-crit-pop {
    0% {
        transform: scale(1);
    }
    20% {
        transform: scale(2.2) rotate(-10deg);
        color: var(--crit-mega);
    }
    40% {
        transform: scale(1.8) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0);
    }
}

/* Ultra Crit - golden jackpot */
.char.ultra-crit {
    animation: ultra-crit-pop 0.7s ease-out forwards;
    color: var(--crit-ultra) !important;
    text-shadow: 0 0 20px var(--crit-ultra), 0 0 40px var(--crit-ultra-glow), 0 0 60px var(--crit-ultra), 0 0 80px var(--crit-ultra-glow);
}

@keyframes ultra-crit-pop {
    0% {
        transform: scale(1);
    }
    15% {
        transform: scale(2.5) rotate(-15deg);
        color: var(--crit-ultra);
    }
    30% {
        transform: scale(2) rotate(15deg);
    }
    50% {
        transform: scale(2.3) rotate(-5deg);
    }
    100% {
        transform: scale(1) rotate(0);
    }
}

/* ==================== Daily Spin Wheel ==================== */
#spin-wheel-section {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 100, 0, 0.1));
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 215, 0, 0.3);
    text-align: center;
}

#spin-wheel-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.spin-icon {
    font-size: 1.5rem;
    animation: spin-icon-wobble 2s ease-in-out infinite;
}

@keyframes spin-icon-wobble {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
}

.spin-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--x-premium-gold);
    text-transform: uppercase;
}

.spin-btn {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    border: none;
    border-radius: var(--radius-full);
    color: var(--x-black);
    font-size: var(--font-size-md);
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    transition: all var(--transition-fast);
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.spin-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.spin-btn:disabled {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

.spin-btn .btn-icon {
    font-size: 1.2rem;
}

.spin-btn.free-spin {
    animation: free-spin-pulse 2s ease-in-out infinite;
}

@keyframes free-spin-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
    50% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 0 60px rgba(255, 215, 0, 0.4); }
}

#spin-cost-info {
    margin-top: var(--spacing-sm);
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

/* Spin Wheel Modal/Overlay */
#spin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#spin-overlay.active {
    opacity: 1;
    visibility: visible;
}

.spin-wheel-container {
    position: relative;
    width: 350px;
    height: 350px;
}

.spin-wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        #ffd93d 0deg 36deg,
        #ffa500 36deg 72deg,
        #ff6b6b 72deg 108deg,
        #4d96ff 108deg 144deg,
        #1d9bf0 144deg 180deg,
        #a855f7 180deg 216deg,
        #ff4757 216deg 252deg,
        #ff6600 252deg 288deg,
        #22c55e 288deg 324deg,
        #ffd700 324deg 360deg
    );
    border: 8px solid var(--x-premium-gold);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5), inset 0 0 50px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: visible;
    transition: transform 5s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.wheel-icons {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
}

.wheel-icon {
    position: absolute;
    font-size: 2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 0 10px rgba(0, 0, 0, 0.5);
    /* Center the icon on its position */
    margin-left: -0.5em;
    margin-top: -0.5em;
}

.spin-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.5rem;
    color: var(--x-premium-gold);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
    z-index: 10;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.spin-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    border: 4px solid var(--x-black);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--x-black);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.spin-result-display {
    margin-top: var(--spacing-xl);
    text-align: center;
}

.spin-result-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
}

.spin-result-label {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--x-premium-gold);
    text-transform: uppercase;
}

.spin-result-value {
    font-size: var(--font-size-2xl);
    font-weight: 900;
    color: var(--success-green);
    margin-top: var(--spacing-sm);
}

.spin-close-btn {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-md) var(--spacing-xl);
    background: var(--x-blue);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-size: var(--font-size-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.spin-close-btn:hover {
    background: var(--x-blue-hover);
    transform: scale(1.05);
}

.spin-wheel-modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-xl);
}

/* ==================== Daily Streak Popup ==================== */
.streak-popup {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-xl);
    min-width: 320px;
    max-width: 400px;
}

.streak-header {
    text-align: center;
    padding-bottom: var(--spacing-lg);
    border-bottom: 2px solid;
    width: 100%;
    margin-bottom: var(--spacing-lg);
}

.streak-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 0 20px currentColor;
}

.streak-title {
    font-size: var(--font-size-2xl);
    font-weight: 900;
    margin: 0;
    text-shadow: 0 0 15px currentColor;
}

.streak-subtitle {
    font-size: var(--font-size-md);
    color: var(--text-secondary);
    margin-top: var(--spacing-xs);
}

.streak-multiplier {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-lg);
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-lg);
    width: 100%;
}

.streak-mult-value {
    font-size: 3rem;
    font-weight: 900;
    text-shadow: 0 0 20px currentColor;
}

.streak-mult-label {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.streak-progress {
    width: 100%;
    margin-bottom: var(--spacing-lg);
}

.streak-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.streak-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.streak-progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.streak-next-bonus {
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
    margin-top: var(--spacing-sm);
}

.streak-max-tier {
    text-align: center;
    font-size: var(--font-size-md);
    color: var(--x-premium-gold);
    font-weight: 600;
}

.streak-bonus {
    width: 100%;
    text-align: center;
    padding: var(--spacing-md);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 140, 0, 0.1));
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 215, 0, 0.3);
    margin-bottom: var(--spacing-lg);
}

.streak-bonus-title {
    font-size: var(--font-size-sm);
    color: var(--x-premium-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--spacing-sm);
}

.streak-bonus-rewards {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
}

.streak-reward {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.streak-reward-icon {
    font-size: var(--font-size-lg);
    color: var(--x-premium-gold);
}

.streak-reward-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--success-green);
}

.streak-claim-btn {
    padding: var(--spacing-md) var(--spacing-2xl);
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    font-size: var(--font-size-lg);
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    min-width: 180px;
    margin-top: var(--spacing-md);
}

.streak-claim-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    filter: brightness(1.1);
}

.streak-claim-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.streak-broken .streak-broken-message {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    font-size: var(--font-size-md);
}

/* ==================== Quest Panel ==================== */
.quest-panel {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 300px;
    max-height: 400px;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 100;
    overflow: hidden;
    transition: all var(--transition-medium);
}

.quest-panel.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
}

.quest-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--border-color);
}

.quest-panel-header h3 {
    margin: 0;
    font-size: var(--font-size-md);
    color: var(--text-primary);
}

.quest-timer {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

.quest-list {
    max-height: 320px;
    overflow-y: auto;
    padding: var(--spacing-sm);
}

.quest-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-xs);
    border-left: 3px solid transparent;
    transition: all var(--transition-fast);
}

.quest-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.quest-easy {
    border-left-color: #4ade80;
}

.quest-medium {
    border-left-color: #fbbf24;
}

.quest-hard {
    border-left-color: #f87171;
}

.quest-complete {
    background: rgba(74, 222, 128, 0.1);
}

.quest-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}

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

.quest-description {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quest-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    margin: var(--spacing-xs) 0;
    overflow: hidden;
}

.quest-progress-fill {
    height: 100%;
    background: var(--x-blue);
    border-radius: var(--radius-full);
    transition: width var(--transition-fast);
}

.quest-complete .quest-progress-fill {
    background: var(--success-green);
}

.quest-progress-text {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

.quest-reward {
    flex-shrink: 0;
    text-align: right;
}

.quest-reward-preview {
    display: flex;
    flex-direction: column;
    font-size: var(--font-size-xs);
    color: var(--x-premium-gold);
}

.quest-claim-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--success-green);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--x-black);
    font-size: var(--font-size-xs);
    font-weight: 700;
    cursor: pointer;
    animation: pulse 1s ease infinite;
}

.quest-claim-btn:hover {
    transform: scale(1.05);
}

.quest-claimed {
    font-size: var(--font-size-xs);
    color: var(--success-green);
    font-weight: 600;
}

.quest-empty {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-tertiary);
}

#quest-btn {
    position: relative;
}

#quest-btn.quest-ready::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: var(--success-green);
    border-radius: 50%;
    animation: pulse 1s ease infinite;
}

/* ==================== Feature Unlock System ==================== */

/* Unlock overlay - modal for feature announcements */
.unlock-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(8px);
    animation: unlock-overlay-in 0.3s ease-out;
}

.unlock-overlay.hidden {
    display: none;
}

@keyframes unlock-overlay-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.unlock-modal {
    background: linear-gradient(180deg, rgba(30, 30, 50, 0.98), rgba(15, 15, 30, 0.98));
    border: 2px solid var(--x-premium-gold);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 
        0 0 60px rgba(255, 215, 0, 0.3),
        0 0 100px rgba(255, 215, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: unlock-modal-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes unlock-modal-in {
    from {
        transform: scale(0.5) translateY(50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.unlock-header {
    margin-bottom: var(--spacing-md);
}

.unlock-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--x-premium-gold), #ff8c00);
    color: var(--x-black);
    font-size: var(--font-size-xs);
    font-weight: 800;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-full);
    letter-spacing: 1px;
    text-transform: uppercase;
    animation: unlock-badge-pulse 1.5s ease-in-out infinite;
}

@keyframes unlock-badge-pulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
    }
}

.unlock-icon {
    font-size: 4rem;
    margin: var(--spacing-md) 0;
    animation: unlock-icon-bounce 0.6s ease-out;
    display: block;
}

@keyframes unlock-icon-bounce {
    0% {
        transform: scale(0) rotate(-180deg);
    }
    60% {
        transform: scale(1.3) rotate(10deg);
    }
    80% {
        transform: scale(0.9) rotate(-5deg);
    }
    100% {
        transform: scale(1) rotate(0);
    }
}

.unlock-title {
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-sm);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.unlock-description {
    font-size: var(--font-size-md);
    color: var(--text-secondary);
    margin: 0 0 var(--spacing-md);
    line-height: 1.5;
}

.unlock-tip {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
    color: var(--x-premium-gold);
    margin-bottom: var(--spacing-lg);
}

.unlock-btn {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-xl);
    background: linear-gradient(135deg, var(--x-premium-gold), #ff8c00);
    border: none;
    border-radius: var(--radius-full);
    color: var(--x-black);
    font-size: var(--font-size-md);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.unlock-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.unlock-btn:active {
    transform: scale(0.98);
}

/* Locked feature states */
.feature-locked {
    display: none !important;
}

.feature-unlocked {
    display: block !important;
    opacity: 1;
    pointer-events: auto;
    animation: feature-unlock 0.5s ease-out;
}

/* Specific unlocked states for flex containers */
#bot-army-display.feature-unlocked {
    display: block !important;
}

@keyframes feature-unlock {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Locked tabs */
.tab-locked {
    opacity: 0.3;
    pointer-events: none;
    position: relative;
}

.tab-locked::after {
    content: '🔒';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1rem;
}

/* Teaser for locked content */
.locked-teaser {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-tertiary);
}

.locked-teaser-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.locked-teaser-text {
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-sm);
}

.locked-teaser-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    color: var(--x-premium-gold);
    font-size: var(--font-size-xs);
}

.locked-teaser-bar {
    width: 100px;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.locked-teaser-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--x-premium-gold), #ff8c00);
    transition: width 0.3s ease;
}

/* ==================== POLISH IMPROVEMENTS ==================== */

/* Market tab - pink/coral candy theme */
.tab[data-tab="market"].active {
    color: var(--candy-pink);
    border-bottom-color: var(--candy-pink);
    background:
        linear-gradient(180deg, rgba(255, 20, 147, 0.2) 0%, rgba(255, 20, 147, 0.05) 100%);
    box-shadow:
        inset 0 0 20px rgba(255, 20, 147, 0.2),
        0 4px 15px rgba(255, 20, 147, 0.3);
}

.tab[data-tab="market"].active .tab-icon {
    filter: drop-shadow(0 0 8px var(--candy-pink));
    animation: jelly-float 3s ease-in-out infinite;
}

/* Enhanced button styles - candy jelly feel */
.btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-full);
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent);
    pointer-events: none;
    border-radius: var(--radius-full) var(--radius-full) 0 0;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--candy-blue), var(--candy-blue-dark));
    color: var(--x-white);
    border-color: var(--candy-blue);
    box-shadow:
        0 4px 15px rgba(0, 212, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--candy-blue-light), var(--candy-blue));
    transform: translateY(-2px) scale(1.02);
    box-shadow:
        0 6px 20px rgba(0, 212, 255, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-hover));
    color: var(--text-primary);
    border-color: var(--border-color);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--bg-hover), var(--bg-tertiary));
    border-color: var(--candy-purple);
    transform: translateY(-2px) scale(1.02);
    box-shadow:
        0 6px 15px rgba(155, 89, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Danger button style */
.btn-danger {
    background: linear-gradient(135deg, var(--candy-red), var(--candy-red-dark));
    color: var(--x-white);
    border-color: var(--candy-red);
    box-shadow:
        0 4px 15px rgba(255, 51, 102, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--candy-red-light), var(--candy-red));
    transform: translateY(-2px) scale(1.02);
    box-shadow:
        0 6px 20px rgba(255, 51, 102, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Improved modal close button */
.close-btn {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-full);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    line-height: 1;
}

.close-btn:hover {
    background: rgba(255, 51, 102, 0.15);
    border-color: var(--candy-red);
    color: var(--candy-red);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 0 15px rgba(255, 51, 102, 0.3);
}

.close-btn:active {
    transform: scale(0.95) rotate(90deg);
}

/* Enhanced locked tab appearance */
.tab-locked {
    opacity: 0.4;
    pointer-events: none;
    position: relative;
    filter: grayscale(0.5);
}

.tab-locked::after {
    content: '🔒';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    opacity: 0.8;
}

.tab-locked .tab-icon,
.tab-locked .tab-label {
    opacity: 0.5;
}

/* Shine effect for interactive elements */
@keyframes shine-sweep {
    0% {
        transform: translateX(-100%) skewX(-15deg);
    }
    100% {
        transform: translateX(200%) skewX(-15deg);
    }
}

.upgrade-item.affordable::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.15),
        transparent
    );
    animation: shine-sweep 2s ease-in-out infinite;
    pointer-events: none;
}

/* Modal polish */
#modal-content {
    background:
        linear-gradient(180deg, rgba(155, 89, 255, 0.08) 0%, transparent 30%),
        var(--bg-secondary);
    border: 2px solid var(--candy-purple);
    box-shadow:
        0 0 60px rgba(155, 89, 255, 0.2),
        0 25px 80px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Stats card polish */
.stat-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    text-align: center;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat-card:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: var(--candy-purple);
    box-shadow: 0 8px 25px rgba(155, 89, 255, 0.2);
}

/* Achievement item polish */
.achievement-item {
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.achievement-item:hover {
    transform: translateX(4px);
    border-color: var(--candy-purple);
    box-shadow: 0 4px 15px rgba(155, 89, 255, 0.2);
}

.achievement-item.unlocked:hover {
    border-color: var(--x-premium-gold);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

/* Jelly float animation (for tab icons) */
@keyframes jelly-float {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    25% {
        transform: translateY(-2px) scale(1.05);
    }
    50% {
        transform: translateY(0) scale(1);
    }
    75% {
        transform: translateY(1px) scale(0.98);
    }
}

/* Subtle pulse for CPS when earning */
#big-cps-value {
    transition: all 0.3s ease;
}

#coin-per-sec.earning #big-cps-value {
    animation: cps-pulse 1.5s ease-in-out infinite;
}

@keyframes cps-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        text-shadow: 0 0 20px var(--candy-green);
    }
}

/* Event ticker polish */
#event-ticker {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
        var(--bg-tertiary);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

#event-ticker:hover {
    border-color: var(--candy-purple);
    box-shadow:
        0 4px 12px rgba(155, 89, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Settings button toggle states */
.setting-item .btn.active {
    background: linear-gradient(135deg, var(--candy-blue), var(--candy-blue-dark));
    color: white;
    border-color: var(--candy-blue);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

/* Graph tab polish */
.graph-tab {
    border: 2px solid var(--border-color);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.graph-tab:hover {
    transform: translateY(-2px);
    border-color: var(--candy-purple);
}

.graph-tab.active {
    background: linear-gradient(135deg, var(--candy-blue), var(--candy-blue-dark));
    border-color: var(--candy-blue);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}
