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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    padding: 10px;
}

.game-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 380px;
    width: 100%;
}

header h1 {
    font-size: 2rem;
    background: linear-gradient(45deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
}

/* ========== PROGRESS SECTION - TOP ========== */
.progress-section {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.2), rgba(254, 202, 87, 0.2));
    border: 2px solid rgba(255, 107, 107, 0.5);
    border-radius: 15px;
    padding: 12px 15px;
    margin-bottom: 12px;
}

.level-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.level-label {
    font-size: 0.8rem;
    color: #feca57;
    font-weight: bold;
    letter-spacing: 2px;
}

.level-number {
    font-size: 2rem;
    font-weight: bold;
    color: #ff6b6b;
    text-shadow: 0 0 20px rgba(255, 107, 107, 0.8);
}

.level-separator {
    font-size: 1.2rem;
    color: #666;
}

.level-total {
    font-size: 1.2rem;
    color: #888;
}

.progress-container {
    width: 100%;
}

.progress-bar {
    height: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff6b6b, #feca57, #2ecc71);
    border-radius: 10px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.progress-text {
    font-size: 0.9rem;
    color: #fff;
    font-weight: bold;
}

/* ========== BOOST SECTION ========== */
.boost-section {
    margin-bottom: 12px;
}

.boost-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.boost-button {
    flex: 1;
    padding: 12px 8px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    max-width: 140px;
}

.boost-5x {
    background: linear-gradient(135deg, #f39c12, #e74c3c);
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.5);
}

.boost-3x {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    box-shadow: 0 4px 15px rgba(142, 68, 173, 0.4);
}

.boost-button:hover {
    transform: translateY(-3px) scale(1.02);
}

.boost-button:disabled {
    background: #444;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

.boost-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.boost-label {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.boost-status {
    background: linear-gradient(45deg, #f39c12, #e74c3c);
    padding: 10px 20px;
    border-radius: 25px;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 1.1rem;
    animation: pulse 0.8s infinite;
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.6);
}

.boost-status.hidden {
    display: none;
}

.boost-icon {
    font-size: 1.3rem;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(243, 156, 18, 0.6); }
    50% { transform: scale(1.05); box-shadow: 0 0 30px rgba(243, 156, 18, 0.9); }
}

/* ========== CHARACTER DISPLAY ========== */
.character-display {
    margin-bottom: 12px;
}

.character-name {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: #48dbfb;
    text-shadow: 0 0 10px rgba(72, 219, 251, 0.5);
}

.canvas-wrapper {
    position: relative;
    display: inline-block;
}

#game-canvas {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.3s;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

#game-canvas:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

#game-canvas.clicked {
    transform: scale(0.95);
}

#game-canvas.boosted {
    box-shadow: 0 0 40px rgba(243, 156, 18, 0.7);
    border-color: #f39c12;
}

.click-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: bold;
    color: #feca57;
    text-shadow: 0 0 20px rgba(254, 202, 87, 0.8);
    pointer-events: none;
    opacity: 0;
    transition: none;
}

.click-feedback.show {
    animation: feedbackPop 0.4s ease-out;
}

.click-feedback.boosted {
    color: #f39c12;
    font-size: 3rem;
    text-shadow: 0 0 30px rgba(243, 156, 18, 1);
}

@keyframes feedbackPop {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
    100% { opacity: 0; transform: translate(-50%, -70%) scale(1); }
}

/* ========== CLICK BUTTON ========== */
.click-button {
    padding: 18px 70px;
    font-size: 1.4rem;
    font-weight: bold;
    background: linear-gradient(45deg, #2ecc71, #27ae60);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.5);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 12px;
}

.click-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.7);
}

.click-button:active {
    transform: translateY(0) scale(0.98);
}

/* ========== LEVEL UP ANIMATION ========== */
@keyframes levelUp {
    0% { transform: scale(1); filter: brightness(1); }
    25% { transform: scale(1.1); filter: brightness(1.5); }
    50% { transform: scale(1.2); filter: brightness(2) hue-rotate(20deg); }
    75% { transform: scale(1.1); filter: brightness(1.5); }
    100% { transform: scale(1); filter: brightness(1); }
}

.level-up {
    animation: levelUp 0.6s ease;
}

/* ========== FLOATING PARTICLES ========== */
.click-particle {
    position: fixed;
    pointer-events: none;
    font-size: 1.5rem;
    font-weight: bold;
    color: #feca57;
    text-shadow: 0 0 10px rgba(254, 202, 87, 0.8);
    animation: floatUp 0.8s ease forwards;
    z-index: 1000;
}

.click-particle.boosted {
    color: #f39c12;
    font-size: 2rem;
    text-shadow: 0 0 15px #f39c12;
}

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

/* ========== NEED BOOST MESSAGE ========== */
.need-boost-hint {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.3), rgba(231, 76, 60, 0.3));
    border: 2px solid #f39c12;
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: #feca57;
    animation: hintPulse 2s infinite;
}

@keyframes hintPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ========== FOOTER ATTRIBUTION ========== */
.game-footer {
    position: fixed;
    bottom: 8px;
    right: 10px;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.25);
}

.game-footer a {
    color: rgba(255, 255, 255, 0.35);
    text-decoration: none;
}

.game-footer a:hover {
    color: rgba(255, 255, 255, 0.6);
}
