/* ============================================ */
/* UI-BARS.CSS - Top Bar, Bottom Bar,          */
/* Tooltips, Pause Overlay, Wave Complete,     */
/* Tutorial, Base Mission Buttons              */
/* Design 2: "Sci-Fi Glass HUD" (2026-10)      */
/* Dark glass panels, 1px lit top edge, thin   */
/* accent lines, role colours from ArtKit:     */
/*   energy amber, shield cyan, research       */
/*   violet, economy green / gold, danger red, */
/*   wave magenta                              */
/* ============================================ */

#game-container {
    --hud-panel-top: #161f2c;
    --hud-panel-mid: #0e141e;
    --hud-panel-bot: #0a0f17;
    --hud-ink: #05080d;
    --hud-line: rgba(150, 180, 220, 0.14);
    --hud-text: #dbe6f3;
    --hud-dim: #8394a9;
    --hud-energy: #ffbf3c;
    --hud-shield: #3fd4ff;
    --hud-research: #a978ff;
    --hud-economy: #47dd84;
    --hud-gold: #f2c14e;
    --hud-danger: #ff3348;
    --hud-wave: #ff2e7a;
}

/* ============================================ */
/* TOP BAR                                     */
/* ============================================ */
.topbar {
    width: 1280px;
    height: 75px;
    display: flex;
    align-items: center;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 45%),
        linear-gradient(180deg, var(--hud-panel-top) 0%, var(--hud-panel-mid) 60%, var(--hud-panel-bot) 100%);
    border-bottom: 1px solid var(--hud-ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 3px 12px rgba(0, 0, 0, 0.45);
    padding: 0 20px;
    gap: 20px;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 950;
    font-family: 'Segoe UI', system-ui, Arial, sans-serif;
    pointer-events: auto;
    line-height: 1;
    color: var(--hud-text);
}
/* thin accent line along the lower edge (cyan -> magenta) */
.topbar::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(63, 212, 255, 0) 0%, rgba(63, 212, 255, 0.55) 18%, rgba(63, 212, 255, 0.12) 50%, rgba(255, 46, 122, 0.55) 84%, rgba(255, 46, 122, 0) 100%);
    pointer-events: none;
}

/* --- Building Count Indicator --- */
.topbar-building-count {
    font-size: 17px;
    color: #9fb0c4;
    font-weight: 600;
    white-space: nowrap;
    margin-left: auto;
    line-height: 26px;
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: center;
}
/* crisp "structures" icon instead of the colour emoji */
.topbar-building-count::before {
    content: '';
    width: 0.95em;
    height: 0.95em;
    margin-right: 6px;
    flex-shrink: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M1 15h14' stroke='%239fb0c4' stroke-width='1.6'/%3E%3Crect x='2' y='8' width='5' height='6' rx='.6' fill='%236f8299'/%3E%3Crect x='9' y='4' width='5' height='10' rx='.6' fill='%239fb0c4'/%3E%3Crect x='10.5' y='6' width='2' height='1.5' fill='%23121a26'/%3E%3Crect x='10.5' y='9' width='2' height='1.5' fill='%23121a26'/%3E%3Crect x='3.5' y='10' width='2' height='1.5' fill='%23121a26'/%3E%3Cpath d='M4.5 8V3l-2 1.5' stroke='%23ffbf3c' stroke-width='1.2' fill='none'/%3E%3C/svg%3E") center / contain no-repeat;
}
.topbar-building-count.limit-warning {
    color: #ff6a5a;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(255, 51, 72, 0.45);
}

/* --- Coins Group --- */
.topbar-coins {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.topbar-coin-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.75) 0, rgba(255, 255, 255, 0) 32%),
        radial-gradient(circle at 50% 50%, #f7cf5c 0, #e9b23a 46%, #c98a1a 47%, #e4a92e 62%, #a8700f 100%);
    border: 1px solid #7a5208;
    box-shadow: 0 0 0 1px rgba(255, 224, 140, 0.35) inset, 0 0 8px rgba(242, 193, 78, 0.45);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
/* Double sweep shine (triggered by .coin-shine class via JS) */
.topbar-coin-icon::before, .topbar-coin-icon::after {
    content: '';
    position: absolute; top: -50%; width: 25%; height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
    transform: skewX(-20deg);
    opacity: 0;
    left: -60%;
}
.topbar-coin-icon::after { left: -40%; }
.topbar-coin-icon.coin-shine::before {
    animation: coinSweepA 0.6s ease-in-out forwards;
}
.topbar-coin-icon.coin-shine::after {
    animation: coinSweepB 0.6s ease-in-out 0.08s forwards;
}
@keyframes coinSweepA { 0% { left: -60%; opacity: 1; } 100% { left: 130%; opacity: 1; } }
@keyframes coinSweepB { 0% { left: -40%; opacity: 1; } 100% { left: 150%; opacity: 1; } }
.topbar-coin-val {
    font-size: 26px;
    font-weight: 600;
    color: var(--hud-gold);
    min-width: 50px;
    line-height: 26px;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6), 0 0 10px rgba(242, 193, 78, 0.25);
}
.topbar-coin-rate {
    font-size: 17px;
    color: var(--hud-economy);
    margin-left: -4px;
    line-height: 26px;
    font-variant-numeric: tabular-nums;
}
.topbar-coin-rate.negative {
    color: #ff6a5a;
}
.coin-val {
    color: var(--hud-gold) !important;
}
.coin-rate {
    color: #6ee89c !important;
    margin-left: -4px;
}

/* --- Timecard (cyan time theme) --- */
.topbar-timecards {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    cursor: default;
    position: relative;
}
.base-topbar .topbar-timecards {
    margin-left: -15px;
    margin-right: -15px;
}
.base-topbar .topbar-research-group {
    margin-left: -15px;
}

/* --- Base topbar: shine via JS class toggle (random interval) --- */
.base-topbar .topbar-timecard-icon {
    animation: topbarShine 8s ease-in-out infinite;
    transform-style: flat;
    overflow: hidden;
}
@keyframes topbarShine {
    0%, 85% { filter: brightness(1); }
    90% { filter: brightness(1.5); }
    95% { filter: brightness(1); }
    100% { filter: brightness(1); }
}

/* --- Bar containers 15% shorter + indent in base --- */
.base-topbar .topbar-bar-group .topbar-bar-container,
.base-topbar .topbar-research-group .topbar-bar-container {
    width: 184px;
}
.topbar-timecard-icon {
    width: 18px;
    height: 24px;
    border-radius: 4px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 40%),
        linear-gradient(180deg, #0f3346 0%, #08202f 100%);
    border: 1px solid #3fd4ff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 8px rgba(63, 212, 255, 0.4), inset 0 0 6px rgba(63, 212, 255, 0.25);
    flex-shrink: 0;
    position: relative;
}
.topbar-timecard-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border: 1px solid #9eeaff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 4px rgba(63, 212, 255, 0.6);
}
.topbar-timecard-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1px;
    height: 4px;
    background: #dcf8ff;
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(-30deg);
    border-radius: 1px;
}
.timecard-val {
    color: #7fe6ff !important;
    line-height: 26px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6), 0 0 10px rgba(63, 212, 255, 0.25) !important;
}

/* --- Divider --- */
.topbar-divider {
    width: 1px;
    height: 34px;
    background: linear-gradient(180deg, rgba(150, 180, 220, 0), rgba(150, 180, 220, 0.28), rgba(150, 180, 220, 0));
    box-shadow: 1px 0 0 rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

/* --- Bar Groups (Energy / Research) --- */
.topbar-bar-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}
.topbar-bar-icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 26px;
    display: inline-flex;
    align-items: center;
}
.topbar-bar-icon svg {
    width: 1em;
    height: 1em;
    display: block;
    overflow: visible;
}
.topbar-bar-container {
    width: 216px;
    height: 22px;
    background: linear-gradient(180deg, #05080d 0%, #0d1420 100%);
    border: 1px solid #03050a;
    border-radius: 4px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(255, 255, 255, 0.07);
    position: relative;
    overflow: hidden;
}
/* 10 % ticks over the fill */
.topbar-bar-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg, transparent 0, transparent calc(10% - 1px), rgba(0, 0, 0, 0.28) calc(10% - 1px), rgba(0, 0, 0, 0.28) 10%);
    pointer-events: none;
}
.topbar-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
    position: absolute;
    top: 0;
    left: 0;
}
.topbar-bar-fill.energy {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 45%),
        linear-gradient(90deg, #b8700c 0%, #f0a92a 70%, #ffcf5a 100%);
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.3), 0 0 8px rgba(255, 191, 60, 0.35);
}
.topbar-bar-fill.research {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 45%),
        linear-gradient(90deg, #5a34b8 0%, #8f5cf0 70%, #b48bff 100%);
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.3), 0 0 8px rgba(169, 120, 255, 0.35);
}
/* paused research: amber hazard stripes */
.topbar-bar-fill.research.paused {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 45%),
        repeating-linear-gradient(-45deg, #c98a1a 0, #c98a1a 6px, #94620c 6px, #94620c 12px);
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}
.topbar-bar-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px;
    font-size: 15px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.85), 0 0 3px #000, 0 0 6px rgba(0, 0, 0, 0.6);
    z-index: 1;
    font-variant-numeric: tabular-nums;
}
.topbar-bar-text .val,
.topbar-bar-text .rate {
    flex-shrink: 0;
    white-space: nowrap;
}
.topbar-bar-text .rate {
    font-size: 13px;
    color: #e6edf6;
}
.topbar-bar-text .rate.negative {
    color: #ff7a6a;
}

/* --- Research Group (clickable) --- */
.topbar-research-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    cursor: pointer;
    position: relative;
}
.topbar-research-group .topbar-bar-container {
    transition: border-color 0.15s, box-shadow 0.15s;
}
.topbar-research-group:hover .topbar-bar-container {
    border-color: rgba(169, 120, 255, 0.7);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7), 0 0 10px rgba(169, 120, 255, 0.3);
}
.topbar-research-name {
    font-size: 17px;
    color: #c9a8ff;
    font-weight: bold;
    white-space: nowrap;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 26px;
    text-shadow: 0 0 10px rgba(169, 120, 255, 0.3);
}
.topbar-research-name.paused {
    color: #ffbf3c;
    text-shadow: none;
}
.topbar-research-name.idle {
    color: #6c7a8c;
    font-weight: normal;
    text-shadow: none;
}

/* Research idle glow pulse */
.topbar-research-group.idle-glow {
    animation: researchIdleGlow 0.5s ease-in-out 4;
}
.topbar-research-group.idle-glow .topbar-research-name {
    color: #c9a8ff;
    font-weight: bold;
}
@keyframes researchIdleGlow {
    0%, 100% {
        filter: drop-shadow(0 0 0px transparent);
    }
    50% {
        filter: drop-shadow(0 0 8px #a978ff) drop-shadow(0 0 16px #c9a8ff);
    }
}

/* Energy low warning glow pulse */
.topbar-bar-group.energy-low-glow {
    animation: energyLowGlow 0.5s ease-in-out 4;
}
@keyframes energyLowGlow {
    0%, 100% {
        filter: drop-shadow(0 0 0px transparent);
    }
    50% {
        filter: drop-shadow(0 0 8px #ff3348) drop-shadow(0 0 16px #ff8844);
    }
}

/* --- Wave Group --- */
.topbar-wave-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}
.topbar-wave-block {
    text-align: center;
    min-width: 60px;
}
.topbar-wave-num {
    font-size: 32px;
    font-weight: bold;
    color: var(--hud-wave);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7), 0 0 12px rgba(255, 46, 122, 0.45);
    font-variant-numeric: tabular-nums;
}
.topbar-wave-timer {
    font-size: 14px;
    color: #ff8fb5;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}
.topbar-end-wave-btn {
    padding: 8px 20px;
    border: 2px solid rgba(255, 46, 122, 0.85);
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(255, 46, 122, 0.2) 0%, rgba(255, 46, 122, 0.05) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 10px rgba(255, 46, 122, 0.12);
    color: #ff5c95;
    font-size: 15px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s, color 0.15s, border-color 0.15s;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-shadow: 0 0 8px rgba(255, 46, 122, 0.35);
}
.topbar-end-wave-btn:hover {
    background: linear-gradient(180deg, rgba(255, 46, 122, 0.34) 0%, rgba(255, 46, 122, 0.12) 100%);
    border-color: #ff6aa0;
    color: #ffd0e0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 16px rgba(255, 46, 122, 0.4);
}
.topbar-end-wave-btn:active {
    background: rgba(255, 46, 122, 0.4);
}
.topbar-reward {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--hud-gold);
    font-size: 14px;
    font-weight: 600;
    text-shadow: none;
}
.topbar-end-wave-btn:hover .topbar-reward {
    color: #ffe08a;
}
.topbar-mini-coin {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff3c0 0, #f2c14e 40%, #a8700f 100%);
    display: inline-block;
    flex-shrink: 0;
}

/* Return to Base button (combat TopBar) */
.topbar-base-btn {
    padding: 8px 20px;
    border: 2px solid rgba(63, 212, 255, 0.7);
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(63, 212, 255, 0.18) 0%, rgba(63, 212, 255, 0.04) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.5);
    color: #9fe7ff;
    font-size: 15px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s, color 0.15s, border-color 0.15s;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.topbar-base-btn:hover {
    background: linear-gradient(180deg, rgba(63, 212, 255, 0.32) 0%, rgba(63, 212, 255, 0.1) 100%);
    border-color: #7fe6ff;
    color: #e6faff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 14px rgba(63, 212, 255, 0.35);
}

/* ============================================ */
/* BASE TOPBAR - 10% larger fonts & icons      */
/* ============================================ */
.base-topbar .topbar-coin-icon {
    width: 26px;
    height: 26px;
}
.base-topbar .topbar-timecard-icon {
    width: 20px;
    height: 26px;
}
.base-topbar .topbar-timecard-icon::before {
    width: 12px;
    height: 12px;
}
.base-topbar .topbar-timecard-icon::after {
    height: 5px;
}
.base-topbar .topbar-coin-val {
    font-size: 29px;
}
.base-topbar .topbar-coins {
    margin-right: 48px;
}
.base-topbar .topbar-coin-rate {
    font-size: 19px;
    margin-left: -6px;
}
.base-topbar .topbar-timecards {
    margin-left: -40px;
}
.base-topbar .topbar-bar-icon {
    font-size: 24px;
}
.base-topbar .topbar-bar-container {
    width: 238px;
    height: 26px;
}
.base-topbar .topbar-bar-text {
    font-size: 17px;
}
.base-topbar .topbar-bar-text .rate {
    font-size: 14px;
}
.base-topbar .topbar-research-name {
    font-size: 19px;
}
.base-topbar .topbar-building-count {
    font-size: 19px;
}
/* Base title block (right side): "BASE" + server clock + day/night */
.topbar-base-title {
    font-size: 20px !important;
    letter-spacing: 3px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7), 0 0 12px rgba(255, 46, 122, 0.4);
}
.topbar-base-subline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 3px;
}
.topbar-server-clock {
    font-size: 13px !important;
    color: #7fa2c2 !important;
    letter-spacing: 1px;
}
.topbar-daynight {
    font-size: 12px;
    letter-spacing: 0.5px;
}

/* ============================================ */
/* BOTTOM BAR                                  */
/* ============================================ */
.bottombar {
    width: 1280px;
    height: 75px;
    display: flex;
    align-items: center;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 40%),
        linear-gradient(180deg, var(--hud-panel-top) 0%, var(--hud-panel-mid) 55%, var(--hud-panel-bot) 100%);
    border-top: 1px solid var(--hud-ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 -3px 12px rgba(0, 0, 0, 0.4);
    padding: 0 10px;
    gap: 10px;
    position: absolute;
    top: 645px;
    left: 0;
    z-index: 950;
    font-family: 'Segoe UI', system-ui, Arial, sans-serif;
    pointer-events: auto;
    color: var(--hud-text);
}
.bottombar::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(63, 212, 255, 0) 0%, rgba(63, 212, 255, 0.5) 20%, rgba(63, 212, 255, 0.12) 55%, rgba(255, 46, 122, 0.45) 88%, rgba(255, 46, 122, 0) 100%);
    pointer-events: none;
}

/* --- Bottom Bar Buttons --- */
.bottombar-btn {
    background: transparent;
    border: none;
    color: #7d8ca0;
    padding: 10px 16px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s, text-shadow 0.15s;
    font-family: inherit;
    flex-shrink: 0;
    border-bottom: 2px solid transparent;
}
.bottombar-btn:hover {
    color: #fff;
    border-bottom-color: currentColor;
}
.bottombar-btn.research {
    color: #cdb2ff;
    border: 1px solid rgba(169, 120, 255, 0.5);
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(169, 120, 255, 0.2) 0%, rgba(169, 120, 255, 0.05) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.45);
    letter-spacing: 0.5px;
}
.bottombar-btn.research:hover {
    color: #f0e6ff;
    text-shadow: 0 0 10px rgba(169, 120, 255, 0.7);
    border-color: rgba(190, 150, 255, 0.85);
    background: linear-gradient(180deg, rgba(169, 120, 255, 0.34) 0%, rgba(169, 120, 255, 0.1) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.45), 0 0 14px rgba(169, 120, 255, 0.35);
}
.bottombar-btn.menu {
    color: #ff4f8b;
}
.bottombar-btn.menu:hover {
    text-shadow: 0 0 10px rgba(255, 46, 122, 0.6);
}

/* Split Button (Tutorial + Menu) */
.bottombar-split-btn {
    display: flex;
    border: none;
    border-radius: 6px;
    overflow: hidden;
}
.bottombar-split-btn .bottombar-btn {
    font-size: 22px;
    padding: 8px 18px;
    border-bottom: none;
}
.bottombar-split-btn .bottombar-btn.tutorial {
    color: #5cc9ff;
    border-right: 1px solid rgba(150, 180, 220, 0.18);
}
.bottombar-split-btn .bottombar-btn.tutorial:hover {
    text-shadow: 0 0 10px rgba(63, 212, 255, 0.6);
    background: rgba(63, 212, 255, 0.1);
}
.bottombar-split-btn .bottombar-btn.menu:hover {
    background: rgba(255, 46, 122, 0.1);
}

.bottombar-btn.options-combat {
    color: #a7b4c4;
    font-size: 18px;
    min-width: 36px;
    text-align: center;
    padding: 2px 4px;
}
.bottombar-btn.options-combat:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}
.bottombar-btn.pause {
    color: #ff4f8b;
    font-size: 18px;
    min-width: 50px;
    text-align: center;
}
.bottombar-btn.pause:hover {
    text-shadow: 0 0 10px rgba(255, 46, 122, 0.6);
}
.bottombar-btn.speed15,
.bottombar-btn.speed2 {
    color: #7fcfe8;
    font-size: 13px;
    min-width: 32px;
    text-align: center;
    padding: 2px 4px;
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
}
.bottombar-btn.speed15:hover,
.bottombar-btn.speed2:hover {
    text-shadow: 0 0 10px rgba(110, 200, 228, 0.6);
}
.bottombar-btn.speed15.active,
.bottombar-btn.speed2.active {
    color: #ffcf5a;
    background: rgba(255, 191, 60, 0.14);
    border-bottom-color: #ffbf3c;
    text-shadow: 0 0 8px rgba(255, 191, 60, 0.6);
}

/* --- Buildings Area --- */
.bottombar-buildings {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    flex: 1;
    overflow: hidden;
    padding: 0 5px;
}

/* --- Building Slot --- */
.bottombar-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.01) 100%);
    box-shadow: inset 0 0 0 1px rgba(150, 180, 220, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: background 0.15s, box-shadow 0.15s;
    position: relative;
    flex-shrink: 0;
    /* equal card height for all slots (half-scale walls / fusion are shorter than 38px) */
    min-height: 61px;
    justify-content: flex-end;
}
.bottombar-slot:hover {
    background: linear-gradient(180deg, rgba(63, 212, 255, 0.16) 0%, rgba(63, 212, 255, 0.04) 100%);
    box-shadow: inset 0 0 0 1px rgba(63, 212, 255, 0.6), 0 0 12px rgba(63, 212, 255, 0.2);
}
.bottombar-slot canvas {
    display: block;
    image-rendering: auto;
    transition: filter 0.15s;
}
.bottombar-slot-cost {
    font-size: 14px;
    font-weight: bold;
    color: var(--hud-gold);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.8);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.bottombar-slot-cost.cost-scrap {
    color: #c7d1dd;
}
.bottombar-slot-cost.cost-coin {
    color: var(--hud-gold);
}
.bottombar-slot-cost .slot-scrap-icon {
    font-size: 10px;
    line-height: 1;
}
.bottombar-slot-cost .slot-coin-icon {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    margin-top: 1px;
    background: radial-gradient(circle at 35% 30%, #fff3c0 0, #f2c14e 40%, #a8700f 100%);
    box-shadow: 0 0 0 1px rgba(122, 82, 8, 0.9), 0 0 4px rgba(242, 193, 78, 0.45);
}
/* shine sweep (UIManager toggles .coin-shine on .inline-coin-icon) */
.bottombar-slot-cost .slot-coin-icon {
    position: relative;
    overflow: hidden;
}
.bottombar-slot-cost .slot-coin-icon::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -80%;
    width: 40%;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
    transform: skewX(-20deg);
    opacity: 0;
}
.bottombar-slot-cost .slot-coin-icon.coin-shine::after {
    animation: slotCoinSweep 0.6s ease-in-out forwards;
}
@keyframes slotCoinSweep { 0% { left: -80%; opacity: 1; } 100% { left: 140%; opacity: 1; } }
/* Not affordable: desaturated icon + red cost (state is readable without hiding the slot) */
.bottombar-slot.cannot-afford {
    opacity: 1;
    background: rgba(0, 0, 0, 0.18);
    box-shadow: inset 0 0 0 1px rgba(150, 180, 220, 0.06);
}
.bottombar-slot.cannot-afford canvas {
    filter: grayscale(0.9) brightness(0.5);
}
.bottombar-slot.cannot-afford .bottombar-slot-cost {
    color: #d0505c;
}
.bottombar-slot.cannot-afford .slot-coin-icon,
.bottombar-slot.cannot-afford .slot-scrap-icon {
    filter: grayscale(1);
    opacity: 0.6;
}
.bottombar-slot.cannot-afford:hover {
    background: rgba(255, 51, 72, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 51, 72, 0.45);
}
.bottombar-slot.cannot-afford:hover canvas {
    filter: grayscale(0.6) brightness(0.7);
}

/* --- Right Buttons Group --- */
.bottombar-right-btns {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    flex-shrink: 0;
    border: 1px solid rgba(150, 180, 220, 0.14);
    border-radius: 8px;
    padding: 4px 8px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.15) 100%);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* --- Score Display --- */
.bottombar-score-box {
    font-family: 'Segoe UI', system-ui, Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--hud-gold);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7), 0 0 10px rgba(242, 193, 78, 0.25);
    white-space: nowrap;
    padding: 4px 10px;
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}
.bottombar-score-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.bottombar-score-label {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 12px;
    font-weight: 600;
    color: #8f9fb3;
    text-shadow: none;
}
.bottombar-rank-row {
    font-size: 12px;
    font-weight: 400;
    color: #8394a9;
    text-shadow: none;
}
.bottombar-rank-value {
    color: #b9c6d6;
}

.bottombar-cg-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 4px;
    border: 1px solid rgba(63, 212, 255, 0.4);
}

/* --- Shared HUD tooltip panel --- */
.bottombar-tooltip,
.energy-tooltip,
.timecard-tooltip {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 30%),
        linear-gradient(180deg, rgba(22, 30, 44, 0.97) 0%, rgba(9, 13, 21, 0.97) 100%);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    color: var(--hud-text);
    font-family: 'Segoe UI', system-ui, Arial, sans-serif;
}

/* --- Bottom Bar Tooltip --- */
.bottombar-tooltip {
    position: absolute;
    transform: translateX(-50%);
    border: 1px solid rgba(63, 212, 255, 0.5);
    border-top: 2px solid var(--hud-shield);
    border-radius: 6px;
    padding: 7px 12px 8px;
    font-size: 12px;
    z-index: 1000;
    pointer-events: none;
    white-space: nowrap;
}
.bottombar-tooltip-title {
    color: #9fe7ff;
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 3px;
    letter-spacing: 0.3px;
}
.bottombar-tooltip-stats {
    color: var(--hud-gold);
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* --- Energy Tooltip --- */
.energy-tooltip {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 78px;
    border: 1px solid rgba(255, 191, 60, 0.45);
    border-top: 2px solid var(--hud-energy);
    border-radius: 8px;
    padding: 10px 14px 8px;
    font-size: 12px;
    z-index: 1100;
    pointer-events: none;
    min-width: 340px;
}
.energy-tooltip-columns {
    display: flex;
    gap: 16px;
}
.energy-tooltip-col {
    flex: 1;
    min-width: 100px;
}
.energy-tooltip-col-title {
    font-weight: bold;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
    padding-bottom: 3px;
    border-bottom: 1px solid var(--hud-line);
}
.energy-tooltip-col.producers .energy-tooltip-col-title {
    color: var(--hud-economy);
}
.energy-tooltip-col.consumers .energy-tooltip-col-title {
    color: #ff7a6a;
}
.energy-tooltip-row {
    display: flex;
    justify-content: space-between;
    padding: 1px 0;
    font-size: 11px;
    color: #c3cedb;
}
.energy-tooltip-row .name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}
.energy-tooltip-row .value {
    font-weight: bold;
    white-space: nowrap;
    margin-left: 8px;
    font-variant-numeric: tabular-nums;
}
.energy-tooltip-col.producers .energy-tooltip-row .value {
    color: var(--hud-economy);
}
.energy-tooltip-col.consumers .energy-tooltip-row .value {
    color: #ff7a6a;
}
.energy-tooltip-sum {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid rgba(150, 180, 220, 0.22);
    margin-top: 3px;
    padding-top: 3px;
    font-weight: bold;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.energy-tooltip-col.producers .energy-tooltip-sum .value {
    color: var(--hud-economy);
}
.energy-tooltip-col.consumers .energy-tooltip-sum .value {
    color: #ff7a6a;
}
.energy-tooltip-balance {
    text-align: center;
    font-weight: bold;
    font-size: 13px;
    margin-top: 6px;
    padding-top: 5px;
    border-top: 1px solid var(--hud-line);
    font-variant-numeric: tabular-nums;
}
.energy-tooltip-balance.surplus { color: var(--hud-economy); }
.energy-tooltip-balance.deficit { color: #ff7a6a; }
.energy-tooltip-balance.neutral { color: #aab8c8; }
.energy-tooltip-times {
    margin-top: 6px;
    padding-top: 5px;
    border-top: 1px solid rgba(150, 180, 220, 0.1);
}
.energy-tooltip-time {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #99aabb;
    padding: 2px 0;
}
.energy-tooltip-time .ett-label { display: flex; align-items: center; gap: 5px; }
.energy-tooltip-time .ett-icon { display: flex; align-items: center; flex-shrink: 0; }
.energy-tooltip-time .ett-val { font-weight: bold; white-space: nowrap; margin-left: 10px; font-variant-numeric: tabular-nums; }
.energy-tooltip-time .ett-val.surplus { color: var(--hud-economy); }
.energy-tooltip-time .ett-val.deficit { color: #ff7a6a; }
.energy-tooltip-time .ett-val.neutral { color: #aab8c8; }

/* --- Timecard Tooltip --- */
.timecard-tooltip {
    position: absolute;
    left: 0;
    top: 46px;
    border: 1px solid rgba(63, 212, 255, 0.45);
    border-top: 2px solid var(--hud-shield);
    border-radius: 8px;
    padding: 10px 14px 8px;
    font-size: 12px;
    z-index: 1100;
    pointer-events: auto;
    min-width: 300px;
    white-space: nowrap;
}
.timecard-tooltip-title {
    font-weight: bold;
    font-size: 13px;
    color: #7fe6ff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--hud-line);
}
.timecard-tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 12px;
    color: #c3cedb;
    gap: 8px;
}
.timecard-tooltip-row .name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.timecard-tooltip-row .time {
    font-weight: bold;
    white-space: nowrap;
    color: var(--hud-gold);
    min-width: 60px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.timecard-speedup-btn {
    background: linear-gradient(180deg, rgba(63, 212, 255, 0.28) 0%, rgba(63, 212, 255, 0.1) 100%);
    border: 1px solid rgba(63, 212, 255, 0.7);
    border-radius: 4px;
    color: #bff2ff;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, box-shadow 0.15s;
}
.timecard-speedup-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, rgba(63, 212, 255, 0.5) 0%, rgba(63, 212, 255, 0.2) 100%);
    box-shadow: 0 0 10px rgba(63, 212, 255, 0.35);
}
.timecard-speedup-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.timecard-ad-btn {
    background: linear-gradient(180deg, rgba(71, 221, 132, 0.26) 0%, rgba(71, 221, 132, 0.08) 100%);
    border: 1px solid rgba(71, 221, 132, 0.7);
    border-radius: 4px;
    color: #b6f5cf;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, box-shadow 0.15s;
}
.timecard-ad-btn:hover:not(.ad-disabled) {
    background: linear-gradient(180deg, rgba(71, 221, 132, 0.45) 0%, rgba(71, 221, 132, 0.18) 100%);
    box-shadow: 0 0 10px rgba(71, 221, 132, 0.35);
}
.timecard-ad-btn.ad-disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.timecard-tooltip-empty {
    color: #6c7a8c;
    font-style: italic;
    text-align: center;
    padding: 8px 0;
}

/* PAUSE OVERLAY */
.pause-overlay-container {
    display: flex;
    justify-content: center;
    align-items: center;
}
.pause-overlay-btn {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 35%),
        linear-gradient(180deg, rgba(20, 28, 42, 0.86) 0%, rgba(9, 13, 21, 0.86) 100%);
    border: 1px solid rgba(255, 46, 122, 0.55);
    border-top: 2px solid var(--hud-wave);
    border-radius: 12px;
    padding: 30px 60px;
    color: #ff5c95;
    font-family: 'Segoe UI', system-ui, Arial, sans-serif;
    font-size: 32px;
    font-weight: bold;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 0 0 14px rgba(255, 46, 122, 0.45);
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
    text-align: center;
    pointer-events: auto;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.pause-overlay-btn span {
    display: block;
    font-size: 16px;
    font-weight: normal;
    color: #93a3b7;
    margin-top: 10px;
    letter-spacing: 0.5px;
    text-transform: none;
    text-shadow: none;
}
.pause-overlay-btn:hover {
    border-color: rgba(255, 46, 122, 0.9);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 46, 122, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ============================================ */
/* MOBILE OVERRIDES                             */
/* ============================================ */
/* Top bar left of wave: 30% larger */
.mobile .topbar-coin-val { font-size: 34px; }
.mobile .topbar-coin-rate { font-size: 22px; }
.mobile .topbar-coin-icon { width: 31px; height: 31px; }
.mobile .topbar-scrap { font-size: 34px; }
.mobile .topbar-scrap-icon { font-size: 31px; }
.mobile .topbar-timecard-icon { width: 23px; height: 31px; }
.mobile .topbar-timecard-icon::before { width: 14px; height: 14px; border-width: 1.5px; }
.mobile .topbar-timecard-icon::after { height: 6px; }
.mobile .topbar-bar-icon { font-size: 29px; }
.mobile .topbar-bar-text { font-size: 20px; }
.mobile .topbar-bar-text .rate { font-size: 17px; }
.mobile .topbar-research-name { font-size: 22px; }
.mobile .topbar-building-count { font-size: 24px; }
.mobile .topbar-wave-num { font-size: 40px; }
.mobile .topbar-wave-timer { font-size: 18px; }
.mobile .topbar-wave-block { min-width: 75px; }
.mobile .topbar-bar-group { padding: 10px 8px; margin: -10px -8px; }
.mobile .energy-tooltip { font-size: 16px; min-width: 400px; padding: 14px 18px 12px; top: 95px; }
.mobile .energy-tooltip-col-title { font-size: 15px; margin-bottom: 6px; padding-bottom: 4px; }
.mobile .energy-tooltip-row { font-size: 15px; padding: 2px 0; }
.mobile .energy-tooltip-row .name { max-width: 160px; }
.mobile .energy-tooltip-sum { font-size: 16px; margin-top: 5px; padding-top: 5px; }
.mobile .energy-tooltip-balance { font-size: 17px; margin-top: 8px; padding-top: 7px; }
.mobile .energy-tooltip-time { font-size: 14px; }
.mobile .timecard-tooltip { font-size: 16px; min-width: 360px; padding: 14px 18px 12px; top: 60px; }
.mobile .timecard-tooltip-title { font-size: 17px; }
.mobile .timecard-tooltip-row { font-size: 15px; padding: 6px 0; }
.mobile .timecard-speedup-btn { font-size: 14px; padding: 6px 12px; }
.mobile .timecard-ad-btn { font-size: 14px; padding: 6px 12px; }
/* Wave group: already large enough, keep desktop sizes */
/* Bottom bar: 30% larger */
.mobile .bottombar-btn { font-size: 20px; }
.mobile .bottombar-btn.speed15,
.mobile .bottombar-btn.speed2 { font-size: 17px; }
.mobile .bottombar-btn.pause { font-size: 23px; }
.mobile .bottombar-slot-cost { font-size: 18px; }
.mobile .bottombar-slot-cost .slot-coin-icon { width: 13px; height: 13px; }
.mobile .bottombar-slot-cost .slot-scrap-icon { font-size: 13px; }
.mobile .bottombar-tooltip { font-size: 18px; padding: 8px 16px; top: 575px; }
.mobile .bottombar-tooltip-title { font-size: 18px; margin-bottom: 4px; }
.mobile .bottombar-tooltip-stats { font-size: 16px; }

/* ============ Scrap display in top bar ============ */
.topbar-scrap {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e3e9f0;
    font-size: 26px;
    font-weight: 600;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}
.topbar-scrap-icon {
    font-size: 24px;
    filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.6));
}

/* ============================================ */
/* SHARED IN-GAME DIALOG LOOK                   */
/* (wave complete, tutorial ask)               */
/* ============================================ */

/* ============ Wave Complete Dialog ============ */
.wave-complete-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(ellipse at center, rgba(4, 8, 14, 0.45) 0%, rgba(4, 8, 14, 0.75) 100%);
}
.wave-complete-dialog {
    position: relative;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 30%),
        linear-gradient(180deg, rgba(22, 31, 46, 0.98) 0%, rgba(9, 13, 21, 0.98) 100%);
    border: 1px solid rgba(63, 212, 255, 0.35);
    border-top: 2px solid var(--hud-shield);
    border-radius: 10px;
    padding: 24px 40px;
    text-align: center;
    color: var(--hud-text);
    font-family: 'Segoe UI', system-ui, Arial, sans-serif;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 30px rgba(63, 212, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    min-width: 280px;
    animation: hudDialogIn 0.22s ease-out;
}
@keyframes hudDialogIn {
    from { opacity: 0; transform: translateY(8px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.wave-complete-title {
    margin: 0 0 12px 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #9fe7ff;
    text-shadow: 0 0 12px rgba(63, 212, 255, 0.45);
}
.wave-complete-scrap {
    font-size: 20px;
    font-weight: 600;
    margin: 16px 0;
    color: #e3e9f0;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--hud-line);
    border-radius: 6px;
    font-variant-numeric: tabular-nums;
}
.wave-complete-scrap-icon {
    font-size: 22px;
    margin-left: 8px;
    margin-right: 0;
}
.wave-complete-total {
    font-size: 14px;
    color: var(--hud-dim);
    margin-bottom: 16px;
}
.wave-complete-timecard {
    font-size: 16px;
    font-weight: 600;
    color: #7fe6ff;
    margin: 12px 0 18px 0;
}
.wave-complete-continue {
    padding: 10px 34px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-family: inherit;
    background: linear-gradient(180deg, rgba(63, 212, 255, 0.26) 0%, rgba(63, 212, 255, 0.08) 100%);
    color: #dff7ff;
    border: 1px solid rgba(63, 212, 255, 0.75);
    border-radius: 6px;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.5);
    transition: background 0.15s, box-shadow 0.15s;
}
.wave-complete-continue:hover {
    background: linear-gradient(180deg, rgba(63, 212, 255, 0.42) 0%, rgba(63, 212, 255, 0.16) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 16px rgba(63, 212, 255, 0.35);
}

/* ============================================ */
/* Tutorial System                              */
/* ============================================ */

/* Ask Dialog (first visit) */
.tutorial-ask-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(ellipse at center, rgba(4, 8, 14, 0.6) 0%, rgba(4, 8, 14, 0.85) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    pointer-events: auto;
}
.tutorial-ask-dialog {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 30%),
        linear-gradient(180deg, rgba(22, 31, 46, 0.98) 0%, rgba(9, 13, 21, 0.98) 100%);
    border: 1px solid rgba(63, 212, 255, 0.35);
    border-top: 2px solid #3fd4ff;
    border-radius: 10px;
    padding: 28px 36px;
    text-align: center;
    max-width: 420px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.tutorial-ask-title {
    color: #e3edf8;
    font-size: 20px;
    font-weight: 600;
    font-family: 'Segoe UI', system-ui, Arial, sans-serif;
    margin-bottom: 20px;
}
.tutorial-ask-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 18px;
}
.tutorial-ask-btn {
    background: linear-gradient(180deg, rgba(63, 212, 255, 0.26) 0%, rgba(63, 212, 255, 0.08) 100%);
    border: 1px solid rgba(63, 212, 255, 0.75);
    border-radius: 6px;
    color: #dff7ff;
    font-size: 17px;
    font-weight: 600;
    font-family: 'Segoe UI', system-ui, Arial, sans-serif;
    padding: 10px 32px;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.5);
    transition: background 0.15s, box-shadow 0.15s, color 0.15s;
}
.tutorial-ask-btn:hover {
    background: linear-gradient(180deg, rgba(63, 212, 255, 0.42) 0%, rgba(63, 212, 255, 0.16) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 16px rgba(63, 212, 255, 0.35);
    color: #fff;
}
.tutorial-ask-btn.tutorial-no {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(150, 180, 220, 0.3);
    color: #9aa8b9;
}
.tutorial-ask-btn.tutorial-no:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #d6dee8;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.5);
}
.tutorial-ask-hint {
    color: #7d8ca0;
    font-size: 12px;
    font-family: 'Segoe UI', system-ui, Arial, sans-serif;
    line-height: 1.5;
}

/* Tutorial Step Overlay */
.tutorial-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: transparent;
    z-index: 10002;
    pointer-events: auto;
    cursor: pointer;
    overflow: hidden;
}
.tutorial-highlight {
    position: absolute;
    border-radius: 10px;
    border: 2px solid #3fd4ff;
    box-shadow: 0 0 0 9999px rgba(4, 8, 14, 0.75), 0 0 22px rgba(63, 212, 255, 0.45), inset 0 0 14px rgba(63, 212, 255, 0.25);
    background: transparent;
    pointer-events: none;
    z-index: 2;
}
.tutorial-arrow {
    position: absolute;
    transform: translateX(-50%) rotate(180deg);
    color: #dcf8ff;
    font-size: 28px;
    text-shadow: 0 0 10px rgba(63, 212, 255, 0.9), 0 0 2px #000;
    animation: tutorial-arrow-bounce 1s ease-in-out infinite;
    pointer-events: none;
    z-index: 3;
}
@keyframes tutorial-arrow-bounce {
    0%, 100% { transform: translateX(-50%) rotate(180deg) translateY(0); }
    50% { transform: translateX(-50%) rotate(180deg) translateY(-8px); }
}
.tutorial-arrow-up {
    transform: translateX(-50%) rotate(0deg);
    animation: tutorial-arrow-bounce-up 1s ease-in-out infinite;
}
@keyframes tutorial-arrow-bounce-up {
    0%, 100% { transform: translateX(-50%) rotate(0deg) translateY(0); }
    50% { transform: translateX(-50%) rotate(0deg) translateY(8px); }
}
.tutorial-arrow-right {
    transform: rotate(-90deg);
    animation: tutorial-arrow-bounce-right 1s ease-in-out infinite;
}
@keyframes tutorial-arrow-bounce-right {
    0%, 100% { transform: rotate(-90deg) translateY(0); }
    50% { transform: rotate(-90deg) translateY(-8px); }
}
.tutorial-text {
    position: absolute;
    text-align: center;
    max-width: 380px;
    pointer-events: none;
    z-index: 3;
}
.tutorial-text-content {
    color: #e3edf8;
    font-size: 15px;
    font-family: 'Segoe UI', system-ui, Arial, sans-serif;
    line-height: 1.5;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 35%),
        linear-gradient(180deg, rgba(22, 31, 46, 0.96) 0%, rgba(9, 13, 21, 0.96) 100%);
    border: 1px solid rgba(63, 212, 255, 0.35);
    border-left: 3px solid #3fd4ff;
    border-radius: 8px;
    padding: 14px 20px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.tutorial-tap-hint {
    color: #8394a9;
    font-size: 12px;
    font-family: 'Segoe UI', system-ui, Arial, sans-serif;
    margin-top: 8px;
    letter-spacing: 0.5px;
    animation: tutorial-tap-pulse 2s ease-in-out infinite;
}
@keyframes tutorial-tap-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ============================================ */
/* BASE MISSION BUTTONS (BaseCreateScene)       */
/* 195x78, positioned by Phaser DOM at x 1175   */
/* .base-mission-btn = pointer-events whitelist */
/* (base.css) + JS hook, also used by other   */
/* dialogs -> styling only via .mission-card   */
/* ============================================ */
.base-mission-btn.mission-card {
    --mission: #3fd4ff;
    --mission-rgb: 63, 212, 255;
    --mission-text: #bfeeff;
    position: relative;
    width: 195px;
    height: 78px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    text-align: center;
    font-family: 'Segoe UI', system-ui, Arial, sans-serif;
    font-weight: bold;
    color: var(--mission-text);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7), 0 0 10px rgba(var(--mission-rgb), 0.4);
    border: 1px solid rgba(var(--mission-rgb), 0.55);
    border-left: 3px solid var(--mission);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0) 38%),
        linear-gradient(100deg, rgba(var(--mission-rgb), 0.22) 0%, rgba(var(--mission-rgb), 0.04) 60%),
        linear-gradient(180deg, #172131 0%, #0b1019 100%);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 16px rgba(var(--mission-rgb), 0.12);
    transition: box-shadow 0.15s, border-color 0.15s, background 0.15s;
    overflow: hidden;
}
/* thin scan accent along the top */
.base-mission-btn.mission-card::after {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(var(--mission-rgb), 0) 0%, rgba(var(--mission-rgb), 0.8) 50%, rgba(var(--mission-rgb), 0) 100%);
    pointer-events: none;
}
.base-mission-btn.mission-card:hover {
    border-color: rgba(var(--mission-rgb), 0.9);
    border-left-color: var(--mission);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 24px rgba(var(--mission-rgb), 0.35);
}
.base-mission-btn.mission-card.mission-iceland {
    --mission: #3fd4ff;
    --mission-rgb: 63, 212, 255;
    --mission-text: #bfeeff;
}
.base-mission-btn.mission-card.mission-greenland {
    --mission: #47dd84;
    --mission-rgb: 71, 221, 132;
    --mission-text: #b9f5cf;
}
.base-mission-btn.mission-card.mission-lavaland {
    --mission: #ff6a3a;
    --mission-rgb: 255, 106, 58;
    --mission-text: #ffc2a8;
}
.base-mission-btn.mission-card.mission-locked {
    --mission: #5d6878;
    --mission-rgb: 120, 132, 150;
    --mission-text: #8e99a8;
    gap: 4px;
    text-shadow: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 38%),
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.025) 0, rgba(255, 255, 255, 0.025) 6px, transparent 6px, transparent 12px),
        linear-gradient(180deg, #151a22 0%, #0b0e13 100%);
}
.base-mission-btn.mission-card.mission-locked:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 16px rgba(242, 193, 78, 0.2);
    border-color: rgba(242, 193, 78, 0.55);
}
.base-mission-btn.mission-card.mission-locked.mission-unaffordable {
    opacity: 0.55;
    cursor: not-allowed;
}
.base-mission-btn.mission-card.mission-locked.mission-unaffordable:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    border-color: rgba(var(--mission-rgb), 0.55);
}
/* "Not enough energy" flash (class toggled by the click handler) */
.base-mission-btn.mission-card.mission-denied,
.base-mission-btn.mission-card.mission-denied:hover {
    border-color: rgba(255, 51, 72, 0.9);
    border-left-color: #ff3348;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 26px rgba(255, 51, 72, 0.45);
}
.mission-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 23px;
    width: 100%;
    letter-spacing: 0.5px;
}
.mission-icon {
    font-size: 26px;
    line-height: 1;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.7));
}
.mission-cost {
    font-size: 13px;
    text-shadow: none;
    width: 100%;
    display: flex;
    justify-content: center;
}
.mission-unlock-cost {
    font-size: 13px;
    color: #e3c06a;
    font-weight: 600;
}
