html,
body {
    margin: 0;
    overflow: hidden;
    background: linear-gradient(to top, #ffaa66 0%, #3a3250 30%, #0c0919 100%);
    font-family: 'Inter', sans-serif;
    color: #e2e8f0;
    overscroll-behavior: none;
}

canvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.font-orbitron {
    font-family: 'Orbitron', sans-serif;
}

.glass-panel {
    position: relative;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 242, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
    border-color: rgba(0, 242, 255, 0.35);
    box-shadow: 0 8px 32px 0 rgba(0, 242, 255, 0.05);
}

.resource-card {
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(30, 41, 59, 0.4);
}

.resource-card:hover {
    background: rgba(0, 242, 255, 0.1);
    border-color: rgba(0, 242, 255, 0.5);
    transform: translateY(-2px);
}

.resource-card.selected {
    background: rgba(0, 242, 255, 0.2);
    border-color: #00f2ff;
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.2);
}

/* Ship Model Selector */
.ship-model-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: left;
    width: 100%;
}

.ship-model-card:hover {
    background: rgba(0, 242, 255, 0.05);
    border-color: rgba(0, 242, 255, 0.3);
    transform: translateX(4px);
}

.ship-model-card.active {
    background: rgba(0, 242, 255, 0.15);
    border-color: #00f2ff;
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.2);
}

.ship-model-card.active span:first-child {
    color: #00f2ff;
}

.btn-launch {
    background: linear-gradient(135deg, #ffaa00 0%, #e67e00 100%);
    color: #000;
    font-weight: 900;
    letter-spacing: 1.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(255, 170, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-launch::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.6s ease;
}

.btn-launch:hover:not(.disabled)::before {
    left: 100%;
}

.btn-launch:hover:not(.disabled) {
    transform: scale(1.03);
    box-shadow: 0 6px 25px rgba(255, 170, 0, 0.6);
    background: linear-gradient(135deg, #ffbb33 0%, #ffaa00 100%);
}

.btn-launch.disabled {
    background: rgba(75, 85, 99, 0.3);
    color: rgba(156, 163, 175, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: none;
    cursor: not-allowed;
    pointer-events: none;
}

#inventory-list::-webkit-scrollbar {
    width: 6px;
}

#inventory-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

#inventory-list::-webkit-scrollbar-thumb {
    background: rgba(0, 242, 255, 0.2);
    border-radius: 3px;
}

#inventory-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 242, 255, 0.4);
}

#loading-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #020617 0%, #000000 100%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hud-border {
    position: relative;
}

.hud-border::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    border: 1px solid transparent;
    background: linear-gradient(135deg, rgba(0, 242, 255, 0.3) 0%, transparent 40%, transparent 60%, rgba(255, 170, 0, 0.3) 100%) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.glow-cyan {
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.6);
}

.glow-orange {
    text-shadow: 0 0 10px rgba(255, 170, 0, 0.6);
}

.hidden {
    display: none !important;
}

.panel-content {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 0;
    width: 320px;
    /* matching parent width */
    max-height: 500px;
    opacity: 1;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 242, 255, 0.25);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(0);
    z-index: 50;
    box-sizing: border-box;
    pointer-events: auto;
}

.panel-content.collapsed {
    max-height: 0px !important;
    opacity: 0;
    pointer-events: none;
    transform: translateY(15px);
    padding: 0 !important;
    border-color: transparent;
    box-shadow: none;
}

#panel-left-content {
    left: 0;
}

#panel-right-content {
    right: 0;
    left: auto;
}

.panel-icon {
    font-size: 1.35rem;
    transition: all 0.3s ease;
    display: inline-block;
}

/* When the panel is active (not collapsed) */
.glass-panel:not(.panel-collapsed) .panel-icon {
    filter: drop-shadow(0 0 10px rgba(0, 242, 255, 0.8));
    transform: scale(1.15);
}

.arrow-rotate {
    transform: rotate(-180deg);
}

/* ── Fuel Store Side Panel (Earth) ────────────────────────────── */
#fuel-store-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100vh;
    background: rgba(5, 10, 25, 0.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-left: 1px solid rgba(0, 242, 255, 0.25);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.6);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#fuel-store-panel.collapsed {
    transform: translateX(320px);
}

#fuel-store-toggle {
    position: absolute;
    left: -42px;
    top: 60%;
    transform: translateY(-50%);
    width: 42px;
    height: 64px;
    background: rgba(5, 10, 25, 0.92);
    border: 1px solid rgba(0, 242, 255, 0.3);
    border-right: none;
    border-radius: 10px 0 0 10px;
    cursor: pointer;
    color: #00f2ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.2s;
    z-index: 201;
}

#fuel-store-toggle:hover {
    background: rgba(0, 242, 255, 0.08);
}

.store-nav-tab {
    flex: 1;
    padding: 11px 8px;
    text-align: center;
    font-size: 9px;
    font-weight: 800;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
    border-bottom: 2px solid transparent;
    font-family: 'Orbitron', sans-serif;
}

.store-nav-tab.active {
    color: #ffaa00;
    border-bottom-color: #ffaa00;
    background: rgba(255, 170, 0, 0.05);
}

.store-section {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* Fuel truck cards */
.fuel-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 16px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.fuel-card:hover {
    background: rgba(255, 170, 0, 0.04);
    border-color: rgba(255, 170, 0, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.5);
}

.fuel-card.featured {
    border-color: rgba(255, 170, 0, 0.35);
    background: linear-gradient(135deg, rgba(255, 170, 0, 0.06), rgba(255, 170, 0, 0.02));
}

.fuel-card.featured::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 90px;
    height: 90px;
    background: radial-gradient(circle at top right, rgba(255, 170, 0, 0.18), transparent 70%);
    pointer-events: none;
}

.fuel-buy-btn {
    width: 100%;
    margin-top: 10px;
    background: linear-gradient(90deg, #ffaa00, #e67e00);
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 11px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow: 0 4px 14px rgba(255, 170, 0, 0.25);
    font-family: 'Orbitron', sans-serif;
}

.fuel-buy-btn:hover {
    background: linear-gradient(90deg, #ffcc44, #ffaa00);
    transform: scale(1.02);
    box-shadow: 0 8px 22px rgba(255, 170, 0, 0.4);
}

.fuel-buy-btn:active {
    transform: scale(0.97);
}

.fuel-buy-btn:disabled {
    background: rgba(75, 85, 99, 0.3);
    color: rgba(156, 163, 175, 0.5);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.fuel-card.featured .fuel-buy-btn {
    background: linear-gradient(90deg, #22c55e, #10b981);
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.25);
}

.fuel-card.featured .fuel-buy-btn:hover {
    background: #fff;
    box-shadow: 0 8px 22px rgba(34, 197, 94, 0.4);
}

/* CR balance pill */
#store-cr-balance {
    font-size: 16px;
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    color: #22c55e;
    text-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

/* Purchase notification */
#store-notification {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 10, 20, 0.95);
    border: 1px solid rgba(0, 242, 255, 0.3);
    color: #00f2ff;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    font-family: 'Orbitron', sans-serif;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 210;
}

#store-notification.show {
    opacity: 1;
}

@media (max-width: 767px) {
    #fuel-store-panel {
        width: 88vw;
    }

    #fuel-store-panel.collapsed {
        transform: translateX(100%);
    }

    #fuel-store-toggle {
        left: -38px;
        width: 38px;
        height: 54px;
        font-size: 16px;
    }
}

#toggle-panel {
    top: 40% !important;
}

#screen-hangar,
#fuel-store-panel,
#tank-tooltip {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}