/* Top HUD Bar - Streamlined, Divine, Luxury Vedic Glassmorphism */
.top-hud {
    width: 100%;
    min-height: 54px;
    height: 54px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    background: linear-gradient(180deg, rgba(8, 14, 28, 0.96) 0%, rgba(13, 20, 38, 0.92) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(250, 204, 21, 0.32);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.55), 0 0 15px rgba(250, 204, 21, 0.12);
    z-index: 40;
    gap: 12px;
    flex-wrap: nowrap;
}

/* Left Brand & Sacred Dham Section */
.brand-section {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.game-title {
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fffbeb 0%, #facc15 50%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    white-space: nowrap;
    text-shadow: 0 0 15px rgba(250, 204, 21, 0.3);
}

.peacock-icon {
    font-size: 1.25rem;
    -webkit-text-fill-color: initial;
    filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.5));
}

.title-sub {
    font-family: 'Outfit', sans-serif;
    font-size: 0.76rem;
    color: #fde047;
    opacity: 0.85;
    -webkit-text-fill-color: initial;
    font-weight: 500;
    letter-spacing: normal;
}

.location-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.45);
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #38bdf8;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.location-badge:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    transform: translateY(-1px);
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.4);
    color: #e0f2fe;
}

.badge-arrow {
    font-size: 0.65rem;
    opacity: 0.8;
    margin-left: 2px;
}

.tag-badge {
    padding: 3px 10px;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.74rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tag-resting {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.4);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.15);
}

.tag-playing {
    background: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.45);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.tag-volleyball {
    background: rgba(234, 179, 8, 0.22);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.6);
    box-shadow: 0 0 12px rgba(250, 204, 21, 0.35);
    animation: divinePulse 2s infinite;
}

/* Center HUD: Quick Pastimes & Compact Visual Inventory */
.center-hud {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quick-pastimes-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(15, 23, 42, 0.75);
    padding: 3px 5px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.play-action-btn {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #f1f5f9;
    padding: 5px 11px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.play-action-btn:hover {
    background: rgba(51, 65, 85, 0.95);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.btn-volleyball-cta {
    background: linear-gradient(135deg, #ea580c 0%, #d97706 50%, #b45309 100%);
    border-color: rgba(253, 224, 71, 0.75);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(234, 88, 12, 0.4);
}

.btn-volleyball-cta:hover {
    background: linear-gradient(135deg, #f97316 0%, #f59e0b 50%, #d97706 100%);
    box-shadow: 0 0 18px rgba(250, 204, 21, 0.6);
    transform: translateY(-1px) scale(1.02);
}

.btn-hub-return {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-color: rgba(74, 222, 128, 0.6);
    color: #ffffff;
}

.btn-hub-return:hover {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.5);
}

/* Compact Visual Inventory Bar */
.inventory-bar {
    display: flex;
    gap: 9px;
    align-items: center;
    background: rgba(15, 23, 42, 0.85);
    padding: 4px 13px;
    border-radius: 9999px;
    border: 1px solid rgba(250, 204, 21, 0.35);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.inv-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #e2e8f0;
    cursor: default;
}

.inv-num {
    font-family: 'Outfit', monospace;
    font-size: 0.88rem;
    font-weight: 800;
}

.inv-divider {
    width: 1px;
    height: 13px;
    background: rgba(255, 255, 255, 0.16);
}

/* Right HUD: Bhajan Music Player, Stamina, Utility Buttons */
.right-hud {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Bhajan Music Player Widget */
.bhajan-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(250, 204, 21, 0.45);
    padding: 3px 10px;
    border-radius: 9999px;
    box-shadow: 0 0 12px rgba(250, 204, 21, 0.15);
    transition: all 0.25s ease;
}

.bhajan-bar.playing {
    border-color: #facc15;
    box-shadow: 0 0 18px rgba(250, 204, 21, 0.4);
    background: rgba(20, 28, 48, 0.95);
}

.music-ctrl-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 4px;
    border-radius: 4px;
    color: #e2e8f0;
    transition: transform 0.15s ease, color 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.music-ctrl-btn:hover {
    transform: scale(1.22);
    color: #facc15;
}

.music-info {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 3px;
    font-size: 0.76rem;
    font-weight: 700;
    color: #facc15;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
}

.music-icon {
    animation: divinePulse 2s infinite;
    font-size: 0.85rem;
}

/* Sleek Stamina Bar */
.stamina-group {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.7);
    padding: 4px 9px;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.stamina-meter {
    width: 50px;
    height: 6px;
    background: #334155;
    border-radius: 999px;
    overflow: hidden;
}

.stamina-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #4ade80);
    transition: width 0.1s ease-out;
}

.stamina-key-text {
    font-size: 0.65rem;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.05em;
}

/* Quick Action Utility Buttons */
.hud-btn-group {
    display: flex;
    gap: 5px;
    align-items: center;
}

.icon-btn {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #e2e8f0;
    padding: 5px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.icon-btn:hover {
    background: rgba(51, 65, 85, 0.95);
    border-color: rgba(250, 204, 21, 0.5);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-flute:hover {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.2);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

/* Responsive Media Queries for Top HUD */
@media (max-width: 1350px) {
    .top-hud {
        padding: 0 12px;
        gap: 8px;
    }
    .game-title {
        font-size: 1.05rem;
    }
    .music-info {
        max-width: 85px;
    }
    .stamina-meter {
        width: 40px;
    }
}

@media (max-width: 1150px) {
    .title-sub {
        display: none;
    }
    .stamina-key-text {
        display: none;
    }
    .btn-text {
        display: none;
    }
    .icon-btn {
        padding: 5px 8px;
        font-size: 0.85rem;
    }
}

@media (max-width: 950px) {
    .pastime-btn-text {
        display: none;
    }
    .location-badge {
        font-size: 0.74rem;
        padding: 3px 8px;
    }
    .tag-badge {
        display: none;
    }
}

@media (max-width: 768px) {
    .top-hud {
        overflow-x: auto;
        scrollbar-width: none;
        flex-wrap: nowrap;
    }
    .top-hud::-webkit-scrollbar {
        display: none;
    }
}

/* Top-Left Corner Minimap - 100% Corner Accuracy */
#minimapContainer {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 175px;
    height: 175px;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid rgba(250, 204, 21, 0.75);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 15px rgba(250, 204, 21, 0.25);
    background-color: #0f172a;
    pointer-events: auto;
    z-index: 35;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#minimapContainer.collapsed {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

#minimapCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.minimap-close-btn {
    position: absolute;
    top: 5px;
    right: 6px;
    width: 18px;
    height: 18px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(250, 204, 21, 0.4);
    color: #facc15;
    font-size: 0.65rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 5;
    opacity: 0.35;
    transition: all 0.2s ease;
}

#minimapContainer:hover .minimap-close-btn {
    opacity: 1;
}

.minimap-close-btn:hover {
    background: rgba(239, 68, 68, 0.9);
    border-color: #ef4444;
    color: #ffffff;
}

/* Floating Sacred Dham Indicator (Top-Center) */
.floating-dham-badge {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 35;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #38bdf8;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 10px rgba(56, 189, 248, 0.15);
    pointer-events: auto;
}

.floating-state-pill {
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.72rem;
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.4);
    font-weight: 700;
}

/* Floating HUD Tray (Top-Right Minimalist Pills) */
.floating-hud-tray {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 35;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
}

.floating-hud-pill {
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(250, 204, 21, 0.4);
    color: #f8fafc;
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

.floating-hud-pill:hover {
    background: rgba(30, 41, 59, 0.96);
    border-color: #facc15;
    box-shadow: 0 0 14px rgba(250, 204, 21, 0.45);
    transform: translateY(-1px);
    color: #fef08a;
}

/* Dynamic Floating Sprint Stamina Bar (Only shows when sprinting or recovering) */
.floating-stamina-widget {
    position: fixed;
    bottom: 85px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 45;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(14px);
    border: 1.5px solid rgba(250, 204, 21, 0.5);
    border-radius: 9999px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 14px rgba(250, 204, 21, 0.3);
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.floating-stamina-widget.hidden-stamina {
    opacity: 0 !important;
    transform: translateX(-50%) translateY(14px) !important;
    pointer-events: none !important;
}

.stamina-icon-pulse {
    font-size: 0.9rem;
    color: #facc15;
    animation: divinePulse 1.2s infinite;
}

.stamina-track {
    width: 140px;
    height: 8px;
    background: rgba(30, 41, 59, 0.9);
    border-radius: 9999px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.stamina-bar-fill {
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(90deg, #10b981, #34d399);
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
    transition: width 0.08s ease, background 0.2s ease;
}

.stamina-key-tag {
    font-size: 0.65rem;
    font-weight: 800;
    color: #facc15;
    background: #0f172a;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(250, 204, 21, 0.4);
    letter-spacing: 0.04em;
}

/* Dynamic Interaction Prompt */
#interactionPrompt {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(12px);
    color: white;
    border: 2px solid #22c55e;
    font-weight: 700;
    padding: 11px 26px;
    border-radius: 9999px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), 0 0 20px rgba(34, 197, 94, 0.45);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 35;
}

#interactionPrompt.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

#interactionPrompt:hover {
    transform: translateX(-50%) translateY(-2px) scale(1.05);
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.7);
}

/* Dialogue Box */
#dialogueBox {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    width: calc(100% - 40px);
    max-width: 680px;
    pointer-events: none;
    z-index: 45;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#dialogueBox.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.dialogue-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 24px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    border: 2px solid rgba(56, 189, 248, 0.4);
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 20px rgba(56, 189, 248, 0.2);
}

.dialogue-avatar {
    font-size: 3rem;
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.3) 0%, rgba(15, 23, 42, 0.6) 80%);
    border-radius: 50%;
    border: 2px solid rgba(250, 204, 21, 0.5);
    box-shadow: 0 0 15px rgba(250, 204, 21, 0.3);
}

.dialogue-content {
    flex-grow: 1;
}

.dialogue-speaker {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dialogue-text {
    font-size: 1rem;
    line-height: 1.5;
    color: #e2e8f0;
}

/* Floating Toast Notifications */
#toastContainer {
    position: absolute;
    top: 75px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    z-index: 50;
}

.toast {
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid var(--gold);
    color: #f8fafc;
    padding: 8px 20px;
    border-radius: 9999px;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4), 0 0 12px var(--gold-glow);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1), toastOut 0.4s ease 2.6s forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-12px); }
}

/* Minimal Vedic HUD Action Pills */
.hud-action-pill {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(250, 204, 21, 0.4);
    color: #f8fafc;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
}

.hud-action-pill:hover {
    background: rgba(30, 41, 59, 0.95);
    border-color: #facc15;
    box-shadow: 0 0 12px rgba(250, 204, 21, 0.35);
    transform: translateY(-1px);
    color: #fef08a;
}

.btn-bag-highlight {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(15, 23, 42, 0.9) 100%);
    border-color: rgba(52, 211, 153, 0.6);
}

.btn-bag-highlight:hover {
    border-color: #34d399;
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.4);
}

.hud-count-badge {
    background: #f59e0b;
    color: #0f172a;
    font-weight: 900;
    font-size: 0.72rem;
    padding: 1px 7px;
    border-radius: 9999px;
    margin-left: 2px;
}
