/* ==========================================================================
   STACK MASTER - Gameplay HUD & In-Game Stylesheet (game.css)
   ========================================================================== */

#gameHUD {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px 24px 20px;
}

/* Top Stats & Controls Bar (Adapts cleanly to both Landscape and Portrait) */
.game-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    pointer-events: auto;
}

/* Left Stats: Level & Best Score */
.hud-left-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.hud-stat-level {
    font-size: 26px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.hud-stat-best {
    font-size: 15px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    gap: 4px;
}

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

/* Center: Prominent Dynamic Score (matching reference screenshot) */
.hud-center-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    pointer-events: none;
}

.hud-banner-title {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 2.5px;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    text-transform: uppercase;
    margin: 0 0 2px 0;
    line-height: 1;
}

.game-center-score {
    text-align: center;
    margin-top: 2px;
    pointer-events: none;
}

/* Big elegant, crisp score counter matching reference screenshot */
.current-score-text {
    font-size: 68px;
    font-weight: 300;
    line-height: 1;
    color: #ffffff;
    letter-spacing: 1px;
    text-shadow: 0 4px 16px rgba(180, 83, 9, 0.35), 0 1px 3px rgba(0, 0, 0, 0.2);
    font-variant-numeric: tabular-nums;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Diamonds Badge matching reference screenshot (e.g. 152 ◆) */
.hud-diamonds-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 28px;
    font-weight: 400;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 8px rgba(180, 83, 9, 0.4);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    user-select: none;
}

.hud-diamonds-badge .diamond-icon {
    font-size: 22px;
    color: #ffffff;
    line-height: 1;
    transform: rotate(0deg);
}

/* Combo Streak Multiplier Badge */
.combo-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    padding: 3px 12px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1px;
    color: #78350f;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.combo-badge.visible {
    opacity: 1;
    transform: scale(1);
    animation: comboPulse 0.8s infinite alternate ease-in-out;
}

@keyframes comboPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); }
}

/* Rewarding 10-Level Theme Milestone Toast */
.hud-milestone-toast {
    position: absolute;
    top: 110px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px) scale(0.92);
    padding: 6px 20px;
    background: rgba(18, 12, 6, 0.78);
    border: 1px solid rgba(254, 240, 138, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 999px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 16px rgba(251, 191, 36, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 60;
    white-space: nowrap;
}

.hud-milestone-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}

/* Right Controls: Hint & Buttons */
.hud-right-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    pointer-events: auto;
}

.hud-hints-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.hud-hint-drop {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.2px;
}

.hud-sound-status {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
}

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

.sound-toggle-btn {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 12px;
    color: #ffffff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: all 0.15s ease;
}

.sound-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

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

.sound-toggle-btn.muted {
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.5);
}

.top-bar-btn {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 12px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: all 0.15s ease;
}

.top-bar-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

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

/* Bottom Hint */
.hud-bottom-wrap {
    width: 100%;
    text-align: center;
    pointer-events: none;
    margin-bottom: 8px;
}

.hud-bottom-hint {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.3px;
}
