* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background: radial-gradient(circle at top, #1b2735 0, #090a0f 60%);
    color: #f5f5f5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.game-header, .game-footer {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-title {
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.game-user {
    font-size: 0.9rem;
    opacity: 0.9;
}

.game-main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.game-wrapper {
    position: relative;
    max-width: 960px;
    width: 100%;
}

#gameCanvas {
    width: 100%;
    height: auto;
    border-radius: 8px;
    background: linear-gradient(to top, #1b1b1b 0, #222 40%, #334 100%);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

/* HUD */

/* ============================
   HUD — GLOBAL LAYOUT
   ============================ */
.hud {
    position: absolute;
    top: 10px;
    left: 0;
    width: 100%;
    z-index: 50;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    color: #fff;
}

/* ============================
   PLAYER NAME — BIG NEON TITLE
   ============================ */
#playerName {
    font-size: 2.6rem;
    font-weight: 900;
    text-align: center;
    letter-spacing: 2px;
    color: #ffffff;

    /* Neon glow */
    text-shadow:
        0 0 8px rgba(0, 200, 255, 1),
        0 0 16px rgba(0, 200, 255, 0.9),
        0 0 28px rgba(0, 200, 255, 0.7),
        0 0 40px rgba(0, 200, 255, 0.5);

    /* Optional pulse animation */
    animation: playerNamePulse 2.8s ease-in-out infinite;
}

@keyframes playerNamePulse {
    0%   { text-shadow: 0 0 8px rgba(0,200,255,0.8); }
    50%  { text-shadow: 0 0 22px rgba(0,200,255,1); }
    100% { text-shadow: 0 0 8px rgba(0,200,255,0.8); }
}

/* ============================
   HUD ROWS (Lives, Score, etc.)
   ============================ */
.hud-row {
    display: flex;
    gap: 20px;
    font-size: 1.3rem;
    font-weight: 700;
    text-shadow: 0 0 6px rgba(0,0,0,0.7);
}

/* HUD item label + value */
.hud-item .label {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-right: 4px;
}

/* ============================
   BARS (Fuel / Energy)
   ============================ */
.bar-container {
    width: 260px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bar-container .label {
    font-size: 1rem;
    font-weight: 700;
    opacity: 0.95;
    text-shadow: 0 0 6px rgba(0,0,0,0.7);
}

.bar {
    width: 100%;
    height: 16px;
    background: rgba(0,0,0,0.4);
    border-radius: 6px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #00ff9d, #00c86d);
    transition: width 0.15s linear;
}

/* Energy bar colour override */
#energyBar {
    background: linear-gradient(90deg, #ff4d4d, #c80000);
}

/* ============================
   OVERLAY — FULLSCREEN BACKDROP
   ============================ */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200; /* above HUD */
}

#overlay.hidden {
    display: none;
}

/* ============================
   OVERLAY CONTENT BOX
   ============================ */
#overlayContent {
    background: rgba(20, 20, 20, 0.85);
    padding: 40px 60px;
    border-radius: 14px;
    text-align: center;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 0 25px rgba(0, 200, 255, 0.4);
    border: 2px solid rgba(0, 200, 255, 0.6);
}

/* ============================
   TITLE — BIG NEON
   ============================ */
#overlayTitle {
    font-size: 2.4rem;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 20px;
    letter-spacing: 1px;

    text-shadow:
        0 0 10px rgba(0, 200, 255, 1),
        0 0 20px rgba(0, 200, 255, 0.8),
        0 0 35px rgba(0, 200, 255, 0.6);
}

/* ============================
   MESSAGE TEXT
   ============================ */
#overlayMessage {
    font-size: 1.3rem;
    color: #e0e0e0;
    margin-bottom: 30px;
    line-height: 1.4;
}

/* ============================
   BUTTON
   ============================ */
#overlayButton {
    padding: 14px 28px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #000;
    background: #00eaff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s ease;
    box-shadow: 0 0 12px rgba(0, 200, 255, 0.8);
}

#overlayButton:hover {
    background: #00bcd4;
    box-shadow: 0 0 18px rgba(0, 200, 255, 1);
}

/* ============================
   EVENT POPUP (Rescued!, Fuel Boost, etc.)
   ============================ */
#eventOverlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20,20,20,0.85);
    padding: 20px 40px;
    border-radius: 12px;
    text-align: center;
    z-index: 250;
    border: 2px solid rgba(0,200,255,0.6);
    box-shadow: 0 0 20px rgba(0,200,255,0.5);
}

#eventOverlay.hidden {
    display: none;
}

#eventTitle {
    font-size: 2rem;
    font-weight: 900;
    color: #00eaff;
    text-shadow:
        0 0 10px rgba(0,200,255,1),
        0 0 20px rgba(0,200,255,0.8);
}

.hidden {
    display: none;
}

/* Speech bubbles for villagers */

.speech-bubble {
    position: absolute;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #111;
    font-size: 0.65rem;
    pointer-events: none;
    white-space: nowrap;
    transform: translate(-50%, -100%);
}

/* Screen shake helper */

.shake {
    animation: shake 0.25s linear;
}

@keyframes shake {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-4px, 2px); }
    50% { transform: translate(3px, -3px); }
    75% { transform: translate(-2px, 3px); }
    100% { transform: translate(0, 0); }
}

.guest-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: #ff4757;
    color: #fff;
    font-size: 0.7rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Website link under Volcano Rescue title */
#siteLink {
    font-family: Verdana, sans-serif;
    font-size: 1rem;
    margin-top: -6px; /* tighten spacing under title */
    text-align: left;
    width: 100%;
    padding-left: 20px; /* aligns with your title */
}

#siteLink a {
    color: #ffffff;
    text-decoration: none;
    opacity: 0.85;
    transition: 0.2s ease;
}

#siteLink a:hover {
    opacity: 1;
    text-shadow: 0 0 6px rgba(0, 200, 255, 0.7);
}

