/* HUD - Score Display */
#hud {
    position: fixed;
    top: calc(20px + var(--safe-area-inset-top));
    left: 50%;
            transform: translateX(-50%);
            display: none;
            gap: 30px;
            z-index: 100;
    pointer-events: none;
}

.pause-btn {
    position: fixed;
    top: calc(16px + var(--safe-area-inset-top));
    right: calc(16px + var(--safe-area-inset-right));
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 2px solid rgba(0, 255, 255, 0.6);
    background: rgba(0, 0, 0, 0.4);
    color: #00ffff;
    font-size: 18px;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 150;
    cursor: pointer;
    text-shadow: 0 0 10px #00ffff;
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.35);
    -webkit-tap-highlight-color: transparent;
}

.pause-btn:hover {
    background: rgba(0, 255, 255, 0.18);
    box-shadow: 0 0 18px rgba(0, 255, 255, 0.6);
}

.pause-btn.is-paused {
    color: #ff00ff;
    border-color: rgba(255, 0, 255, 0.6);
    text-shadow: 0 0 10px #ff00ff;
    box-shadow: 0 0 12px rgba(255, 0, 255, 0.35);
}

@media (max-width: 768px) {
    .pause-btn {
        top: calc(12px + var(--safe-area-inset-top));  /* Slightly lower on mobile */
    }
}

        .hud-item {
            text-align: center;
            color: #fff;
            text-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff;
        }

        .hud-label {
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 1.5px;
            opacity: 0.8;
            font-weight: 600;
        }

        .hud-value {
            font-size: 24px;
            font-weight: bold;
        }

/* Hits counter - Warning/orange style in main HUD */
.hud-item-hits {
    color: #ffaa00;
    text-shadow: 0 0 10px rgba(255, 170, 0, 0.8), 0 0 20px rgba(255, 170, 0, 0.4);
}

.hud-item-hits .hud-value {
    color: #ffaa00;
}

/* Main HUD mobile optimization */
@media (max-width: 768px) {
    #hud {
        gap: 24px;  /* Reduced from 30px to save space */
    }

    .hud-value {
        font-size: 28px;  /* Increased from 24px */
    }

    .hud-label {
        font-size: 12px;  /* Increased from 11px */
    }
}

@media (max-width: 430px) {
    .hud-value {
        font-size: 32px;  /* Even larger on small screens */
    }
}

/* ========================================
   Real-Time Performance HUD
   Priority 1: Enhanced Player Feedback
   ======================================== */

.gameplay-hud {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hud-performance-item {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 14px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.hud-perf-value {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

/* Status color coding */
.hud-performance-item.status-good {
    border-color: rgba(0, 255, 100, 0.6);
    background: rgba(0, 255, 100, 0.1);
    box-shadow: 0 0 12px rgba(0, 255, 100, 0.3);
}

.hud-performance-item.status-good .hud-perf-value {
    color: #00ff64;
    text-shadow: 0 0 10px rgba(0, 255, 100, 0.6);
}

.hud-performance-item.status-warning {
    border-color: rgba(255, 170, 0, 0.6);
    background: rgba(255, 170, 0, 0.1);
    box-shadow: 0 0 12px rgba(255, 170, 0, 0.3);
}

.hud-performance-item.status-warning .hud-perf-value {
    color: #ffaa00;
    text-shadow: 0 0 10px rgba(255, 170, 0, 0.6);
}

.hud-performance-item.status-bad {
    border-color: rgba(255, 0, 100, 0.6);
    background: rgba(255, 0, 100, 0.1);
    box-shadow: 0 0 12px rgba(255, 0, 100, 0.3);
}

.hud-performance-item.status-bad .hud-perf-value {
    color: #ff0064;
    text-shadow: 0 0 10px rgba(255, 0, 100, 0.6);
}

/* Star prediction */
.hud-star-prediction {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 8px;
    padding: 10px 14px;
    text-align: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.hud-star-prediction span {
    color: #ffd700;
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    letter-spacing: 0.5px;
}

.hud-star-prediction.status-excellent {
    border-color: rgba(0, 255, 100, 0.6);
    background: rgba(0, 255, 100, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 100, 0.4);
}

.hud-star-prediction.status-excellent span {
    color: #00ff64;
    text-shadow: 0 0 12px rgba(0, 255, 100, 0.8);
}

.hud-star-prediction.status-decent {
    border-color: rgba(255, 170, 0, 0.6);
    background: rgba(255, 170, 0, 0.1);
}

.hud-star-prediction.status-decent span {
    color: #ffaa00;
}

.hud-star-prediction.status-poor {
    border-color: rgba(255, 0, 100, 0.6);
    background: rgba(255, 0, 100, 0.1);
}

.hud-star-prediction.status-poor span {
    color: #ff0064;
}

/* Mobile responsive */
@media (max-width: 768px) {
    /* Remove top/right overrides - now handled in JS with safe area insets */
    .gameplay-hud {
        display: none; /* Hide performance HUD on mobile */
    }

    .hud-performance-item,
    .hud-star-prediction {
        padding: 10px 14px;  /* Increased from 6px 10px */
    }

    .hud-perf-value {
        font-size: 14px;  /* Increased from 11px to 14px */
    }

    .hud-star-prediction span {
        font-size: 13px;  /* Increased from 10px to 13px */
    }
}

/* Extra small phones need even more attention */
@media (max-width: 430px) {
    .gameplay-hud {
        gap: 10px;
    }

    .hud-performance-item,
    .hud-star-prediction {
        padding: 12px 16px;  /* More padding on small screens */
    }

    .hud-perf-value {
        font-size: 15px;  /* Larger on small screens */
    }

    .hud-star-prediction span {
        font-size: 14px;  /* Larger on small screens */
    }
}

/* Landscape mode optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .gameplay-hud {
        top: calc(60px + var(--safe-area-inset-top));  /* Closer to top in landscape */
        gap: 6px;  /* Tighter spacing */
    }

    .hud-performance-item,
    .hud-star-prediction {
        padding: 6px 12px;  /* Smaller padding */
    }

    .hud-perf-value {
        font-size: 12px;  /* Slightly smaller in landscape */
    }

    .hud-star-prediction span {
        font-size: 11px;
    }

    #hud {
        gap: 20px;  /* Tighter main HUD spacing */
    }

    .hud-value {
        font-size: 22px;  /* Smaller in landscape */
    }
}

/* ========================================
   Combo Counter HUD
   ======================================== */
#combo-display {
    position: fixed;
    top: calc(70px + var(--safe-area-inset-top));
    right: calc(16px + var(--safe-area-inset-right));
    display: none;
    flex-direction: column;
    align-items: flex-end;
    z-index: 120;
    pointer-events: none;
}

#combo-display.active {
    display: flex;
}

#combo-count {
    font-size: 32px;
    font-weight: 900;
    color: #00ffff;
    text-shadow: 0 0 12px rgba(0, 255, 255, 0.8), 0 0 24px rgba(0, 255, 255, 0.4);
    transition: transform 0.15s ease;
    line-height: 1;
}

#combo-count.pop {
    transform: scale(1.3);
}

#combo-multiplier {
    font-size: 14px;
    font-weight: 700;
    color: #ff00ff;
    text-shadow: 0 0 8px rgba(255, 0, 255, 0.6);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ========================================
   Floating Timing Feedback
   ======================================== */
#timing-feedback {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 130;
    pointer-events: none;
    font-size: 28px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0;
    transition: none;
}

#timing-feedback.show {
    animation: timingFeedbackAnim 0.7s ease-out forwards;
}

@keyframes timingFeedbackAnim {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1.2);
    }
    30% {
        opacity: 1;
        transform: translateX(-50%) translateY(-10px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-40px) scale(0.8);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    #combo-count {
        font-size: 28px;
    }

    #timing-feedback {
        font-size: 24px;
    }
}

/* ================================================
   BOOSTER ANNOUNCEMENT — floating center-screen
   ================================================ */
#booster-announcement {
    position: fixed;
    top: 35%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 140;
    pointer-events: none;
    opacity: 0;
    text-align: center;
    font-family: inherit;
    font-weight: bold;
    letter-spacing: 3px;
    text-transform: uppercase;
    white-space: nowrap;
}

#booster-announcement.show {
    animation: boosterAnnouncementAnim 1.2s ease-out forwards;
}

@keyframes boosterAnnouncementAnim {
    0%   { opacity: 0;   transform: translateX(-50%) scale(0.4)  translateY(20px); filter: blur(4px); }
    15%  { opacity: 1;   transform: translateX(-50%) scale(1.3)  translateY(0);    filter: blur(0);   }
    30%  { opacity: 1;   transform: translateX(-50%) scale(1.05) translateY(-8px); filter: blur(0);   }
    70%  { opacity: 1;   transform: translateX(-50%) scale(1.0)  translateY(-18px); }
    100% { opacity: 0;   transform: translateX(-50%) scale(0.9)  translateY(-40px); }
}

/* ================================================
   BOOSTER STATUS BADGES — persistent bottom-left
   ================================================ */
#booster-status {
    position: fixed;
    bottom: calc(90px + var(--safe-area-inset-bottom));
    left: calc(16px + var(--safe-area-inset-left));
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 120;
    pointer-events: none;
}

.booster-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.78);
    border-radius: 24px;
    padding: 7px 14px 7px 10px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid transparent;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1.5px;
    color: #fff;
    text-transform: uppercase;
    animation: badgeEnter 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: opacity 0.4s ease;
    min-width: 130px;
}

@keyframes badgeEnter {
    from { opacity: 0; transform: translateX(-24px) scale(0.75); }
    to   { opacity: 1; transform: translateX(0)     scale(1);    }
}

.booster-badge.shield {
    border-color: rgba(102, 204, 255, 0.85);
    box-shadow: 0 0 12px rgba(102, 204, 255, 0.4), inset 0 0 8px rgba(102, 204, 255, 0.08);
}
.booster-badge.magnet {
    border-color: rgba(255, 153, 0, 0.85);
    box-shadow: 0 0 12px rgba(255, 153, 0, 0.4), inset 0 0 8px rgba(255, 153, 0, 0.08);
}
.booster-badge.speed {
    border-color: rgba(255, 221, 85, 0.85);
    box-shadow: 0 0 12px rgba(255, 221, 85, 0.4), inset 0 0 8px rgba(255, 221, 85, 0.08);
}

.booster-badge .badge-icon {
    font-size: 17px;
    line-height: 1;
    flex-shrink: 0;
}

.booster-badge .badge-label {
    flex: 1;
    font-size: 11px;
}

.booster-badge .badge-timer {
    font-size: 11px;
    opacity: 0.85;
    min-width: 22px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Pulse/blink when < 3 s remaining */
.booster-badge.expiring {
    animation: badgeExpire 0.45s ease-in-out infinite alternate;
}

@keyframes badgeExpire {
    from { opacity: 1;   box-shadow: 0 0 14px currentColor; }
    to   { opacity: 0.3; box-shadow: 0 0 4px  currentColor; }
}

/* Mobile tweaks */
@media (max-width: 768px) {
    #booster-announcement {
        font-size: 22px !important;
        letter-spacing: 2px;
    }

    .booster-badge {
        font-size: 11px;
        padding: 6px 12px 6px 8px;
        min-width: 110px;
    }
}
