/* ==========================================================================
   IN-GAME 3D CANVAS, HEADS-UP DISPLAY (HUD) & ON-SCREEN CONTROLS
   ========================================================================== */
/* Three.js Canvas Container */
#game-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

#game-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

/* Invisible Fullscreen Tap Area */
#tap-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    cursor: pointer;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Floating Scores & Combo Effects */
#floating-text-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
}

.floating-score {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    animation: floatUpFade 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    filter: drop-shadow(0 0 10px currentColor);
}

@keyframes floatUpFade {
    0% { opacity: 0; transform: translate(-50%, -20%) scale(0.7); }
    20% { opacity: 1; transform: translate(-50%, -60%) scale(1.1); }
    100% { opacity: 0; transform: translate(-50%, -140%) scale(1); }
}

/* In-Game Notifications Toast */
#game-toast {
    position: absolute;
    top: max(75px, env(safe-area-inset-top, 0px) + 60px);
    left: 50%;
    transform: translateX(-50%) translateY(-15px);
    background: var(--bg-surface-elevated);
    border: 1.2px solid var(--primary-gold);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 20px var(--primary-gold-glow);
    backdrop-filter: var(--card-blur);
    padding: 7px 20px;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    z-index: 25;
    opacity: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* ==========================================================================
   Heads Up Display (HUD) - Soft Golden Style
   ========================================================================== */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding-top: max(14px, env(safe-area-inset-top, 0px) + 6px);
    padding-right: max(20px, env(safe-area-inset-right, 0px) + 4px);
    padding-bottom: max(14px, env(safe-area-inset-bottom, 0px));
    padding-left: max(20px, env(safe-area-inset-left, 0px) + 4px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    pointer-events: none;
}

.hud-left, .hud-center, .hud-right {
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
}

.hud-panel {
    background: var(--bg-surface);
    border: 1.2px solid var(--card-border);
    backdrop-filter: var(--card-blur);
    border-radius: var(--radius-full);
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

.hud-score-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hud-score-value {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1;
    color: #ffffff;
    text-shadow: 0 0 18px var(--primary-gold-glow);
}

.combo-badge {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 0 14px var(--accent-amber-glow);
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
    animation: pulseCombo 0.7s infinite alternate;
}

@keyframes pulseCombo {
    0% { transform: scale(0.98); }
    100% { transform: scale(1.08); }
}

.hud-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--primary-gold);
    text-shadow: 0 0 8px var(--primary-gold-glow);
}

.hud-stat-item.gold { color: var(--primary-gold); }
.hud-stat-item.amber { color: var(--accent-amber); }

.hud-icon-svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
    flex-shrink: 0;
}

.shield-active-badge {
    display: none;
    align-items: center;
    gap: 5px;
    background: rgba(255, 209, 102, 0.15);
    border: 1.2px solid var(--primary-gold);
    color: var(--primary-gold);
    font-size: 0.72rem;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    box-shadow: 0 0 14px var(--primary-gold-glow);
}


/* In-Game HUD Booster Active Badges */
.hud-booster-badge {
    background: rgba(245, 158, 11, 0.25);
    border: 1.2px solid rgba(255, 209, 102, 0.6);
    border-radius: var(--radius-full);
    padding: 4px 10px;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 900;
    color: var(--primary-gold);
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 0 10px rgba(255, 209, 102, 0.4);
    animation: boosterGlow 1.5s ease-in-out infinite alternate;
}

.hud-booster-badge.magnet {
    background: rgba(217, 70, 239, 0.25);
    border-color: rgba(217, 70, 239, 0.6);
    color: #f0abfc;
    box-shadow: 0 0 10px rgba(217, 70, 239, 0.4);
}

@keyframes boosterGlow {
    from { filter: brightness(1); }
    to { filter: brightness(1.3); }
}


/* ==========================================================================
   FULLSCREEN & ANDROID IMMERSIVE STYLES
   ========================================================================== */
:fullscreen,
:-webkit-full-screen,
:-moz-full-screen,
:-ms-fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    overflow: hidden !important;
    background: #080705 !important;
}

:fullscreen #game-container,
:-webkit-full-screen #game-container {
    width: 100% !important;
    height: 100% !important;
}

