/**
 * Space Quizzed - Space Mode Specific Styles
 */

/* ========== SPACE START BUTTONS ========== */

.space-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.space-buttons.hidden {
    display: none;
}

/* Both buttons same size */
.space-buttons .space-btn {
    width: 180px;
    height: 100px;
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 10px;
}

.space-buttons .btn-icon {
    font-size: 2rem;
    line-height: 1;
}

.space-buttons .btn-text {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Quick Play Button - Cyan Neon */
#quick-play-btn {
    background: linear-gradient(180deg, #004444 0%, #002222 100%);
    border: 3px solid #00ffff;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

#quick-play-btn:hover {
    background: linear-gradient(180deg, #006666 0%, #003333 100%);
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.6);
}

/* Galaxy Button - Magenta Neon */
#galaxy-btn {
    background: linear-gradient(180deg, #440044 0%, #220022 100%);
    border: 3px solid #ff00ff;
    color: #ff00ff;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.8);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
}

#galaxy-btn:hover {
    background: linear-gradient(180deg, #660066 0%, #330033 100%);
    box-shadow: 0 0 25px rgba(255, 0, 255, 0.6);
}

/* Mobile responsive */
@media (max-width: 600px) {
    .space-buttons {
        gap: 10px;
        padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left);
    }

    .space-buttons .space-btn {
        width: 140px;
        height: 70px;
        padding: 10px 15px;
        gap: 4px;
    }

    .space-buttons .btn-icon {
        font-size: 1.5rem;
    }

    .space-buttons .btn-text {
        font-size: 0.75rem;
    }
}

@media (max-width: 350px) {
    .space-buttons .space-btn {
        width: 120px;
        height: 65px;
    }

    .space-buttons .btn-icon {
        font-size: 1.3rem;
    }

    .space-buttons .btn-text {
        font-size: 0.7rem;
    }
}

/* ========== GALAXY MAP SCREEN ========== */

#galaxy-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

#galaxy-screen.active {
    display: flex !important;
}

.galaxy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 900px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.galaxy-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: 0.15em;
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff;
}

.credits-display {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    color: #ffff00;
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
}

.credits-display .credits-icon {
    font-size: 1.2rem;
}

.credits-display .credits-amount {
    color: #ffffff;
}

/* Galaxy Map Canvas Container */
.galaxy-map-container {
    width: 100%;
    max-width: 900px;
    aspect-ratio: 16/10;
    background: linear-gradient(180deg, #0a0020 0%, #050510 100%);
    border: 2px solid #3070c0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow:
        0 0 20px rgba(48, 112, 192, 0.3),
        inset 0 0 50px rgba(0, 0, 0, 0.5);
}

#galaxy-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Galaxy Action Buttons */
.galaxy-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.galaxy-btn {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    padding: 12px 25px;
    background: linear-gradient(180deg, #3070c0 0%, #1a3a7a 100%);
    border: 2px solid #5090e0;
    border-radius: 5px;
    color: #ffffff;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px #000;
}

.galaxy-btn:hover {
    background: linear-gradient(180deg, #5090e0 0%, #3070c0 100%);
    box-shadow: 0 0 15px rgba(80, 144, 224, 0.5);
    transform: translateY(-2px);
}

.galaxy-btn:active {
    transform: translateY(0);
}

.galaxy-btn.primary {
    background: linear-gradient(180deg, #00c8c8 0%, #008888 100%);
    border-color: #00ffff;
}

.galaxy-btn.primary:hover {
    background: linear-gradient(180deg, #00ffff 0%, #00c8c8 100%);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

/* ========== PLANET DETAIL POPUP ========== */

#planet-popup {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

#planet-popup.hidden {
    display: none;
}

.planet-popup-content {
    background: linear-gradient(180deg, #1a3a7a 0%, #0a1030 100%);
    border: 3px solid #5090e0;
    border-radius: 15px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow:
        0 0 30px rgba(80, 144, 224, 0.3),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.planet-popup-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    display: block;
}

.planet-popup-name {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #00ffff;
    margin-bottom: 10px;
    text-shadow: 0 0 10px #00ffff;
}

.planet-popup-description {
    color: #aaccff;
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.planet-popup-status {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    padding: 8px 15px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 20px;
}

.planet-popup-status.conquered {
    background: rgba(0, 200, 83, 0.2);
    color: #00c853;
    border: 1px solid #00c853;
}

.planet-popup-status.available {
    background: rgba(0, 255, 255, 0.2);
    color: #00ffff;
    border: 1px solid #00ffff;
}

.planet-popup-status.locked {
    background: rgba(102, 102, 102, 0.2);
    color: #666666;
    border: 1px solid #666666;
}

.planet-popup-highscore {
    font-size: 0.8rem;
    color: #ffff00;
    margin-bottom: 15px;
}

.planet-popup-requirement {
    font-size: 0.8rem;
    color: #ff6666;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 0, 0, 0.1);
    border-radius: 5px;
}

.planet-popup-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ========== WERFT/HANGAR SCREEN ========== */

#hangar-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

#hangar-screen.active {
    display: flex !important;
}

.hangar-content {
    width: 100%;
    max-width: 700px;
}

.hangar-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: 0.1em;
    color: #ff00ff;
    text-shadow: 0 0 10px #ff00ff;
    text-align: center;
    margin-bottom: 30px;
}

/* Ship Display */
.ship-display {
    background: linear-gradient(180deg, #1a1a30 0%, #0a0a15 100%);
    border: 2px solid #5090e0;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.ship-display::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(0, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.ship-icon {
    font-size: 5rem;
    margin-bottom: 15px;
    display: block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.ship-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    color: #ffffff;
    margin-bottom: 10px;
}

.ship-level {
    font-size: 0.8rem;
    color: #aaaaaa;
}

/* Upgrades Grid */
.upgrades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.upgrade-card {
    background: linear-gradient(180deg, #1a3a7a 0%, #0a1030 100%);
    border: 2px solid #3070c0;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

.upgrade-card:hover {
    border-color: #5090e0;
    box-shadow: 0 0 15px rgba(80, 144, 224, 0.3);
}

.upgrade-card.maxed {
    border-color: #00c853;
    background: linear-gradient(180deg, #0a3a2a 0%, #051510 100%);
}

.upgrade-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.upgrade-icon {
    font-size: 2rem;
}

.upgrade-info {
    flex: 1;
}

.upgrade-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    color: #ffffff;
    margin-bottom: 5px;
}

.upgrade-level {
    font-size: 0.75rem;
    color: #00ffff;
}

.upgrade-description {
    font-size: 0.8rem;
    color: #aaccff;
    margin-bottom: 15px;
    line-height: 1.4;
}

.upgrade-buy-btn {
    width: 100%;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    padding: 12px;
    background: linear-gradient(180deg, #ffaa00 0%, #cc7700 100%);
    border: 2px solid #ffcc00;
    border-radius: 5px;
    color: #000;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upgrade-buy-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #ffcc00 0%, #ffaa00 100%);
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.5);
}

.upgrade-buy-btn:disabled {
    background: linear-gradient(180deg, #444 0%, #333 100%);
    border-color: #555;
    color: #666;
    cursor: not-allowed;
}

.upgrade-buy-btn.maxed {
    background: linear-gradient(180deg, #00aa55 0%, #006633 100%);
    border-color: #00c853;
    color: #fff;
}

/* ========== MISSION INTRO OVERLAY ========== */

#mission-intro-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.5s ease;
}

#mission-intro-overlay.hidden {
    display: none;
}

.mission-intro-content {
    text-align: center;
}

.mission-planet-icon {
    font-size: 6rem;
    margin-bottom: 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.mission-text {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.3rem;
    color: #00ffff;
    text-shadow: 0 0 20px #00ffff;
    margin-bottom: 10px;
}

.mission-planet-name {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 2.2rem;
    letter-spacing: 0.1em;
    color: #ffffff;
    text-shadow: 0 0 20px #ffffff;
    margin-bottom: 30px;
}

.mission-loading {
    font-size: 0.8rem;
    color: #888;
}

/* Stars animation for mission intro */
.mission-stars {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.mission-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    animation: starMove 2s linear infinite;
}

@keyframes starMove {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(100vh) scale(0.5); opacity: 0; }
}

/* ========== SPACE JOKER BUTTONS ========== */

.space-joker-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.space-joker-btn {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    padding: 8px 15px;
    background: linear-gradient(180deg, #330066 0%, #1a0033 100%);
    border: 2px solid #9900ff;
    border-radius: 5px;
    color: #ff00ff;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.space-joker-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #660099 0%, #330066 100%);
    box-shadow: 0 0 15px rgba(153, 0, 255, 0.5);
}

.space-joker-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.space-joker-btn .joker-icon {
    font-size: 1rem;
}

.space-joker-btn .joker-count {
    background: #ff00ff;
    color: #000;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.5rem;
}

/* ========== PROBABILITY DISPLAY (Sensors upgrade) ========== */

.probability-indicator {
    position: absolute;
    top: 5px;
    right: 10px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.5rem;
    padding: 3px 8px;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.answer-btn.show-probability .probability-indicator {
    opacity: 1;
}

.probability-indicator.high {
    background: rgba(0, 200, 83, 0.3);
    color: #00c853;
    border: 1px solid #00c853;
}

.probability-indicator.medium {
    background: rgba(255, 200, 0, 0.3);
    color: #ffc800;
    border: 1px solid #ffc800;
}

.probability-indicator.low {
    background: rgba(255, 100, 100, 0.3);
    color: #ff6464;
    border: 1px solid #ff6464;
}

/* ========== SHIELD EFFECT ========== */

.shield-effect {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1500;
    animation: shieldFlash 1s ease-out;
}

@keyframes shieldFlash {
    0% {
        background: radial-gradient(ellipse at center, rgba(0, 255, 255, 0.5) 0%, transparent 70%);
    }
    100% {
        background: transparent;
    }
}

.shield-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.5rem;
    color: #00ffff;
    text-shadow: 0 0 20px #00ffff, 0 0 40px #00ffff;
    animation: shieldTextAnim 1s ease-out forwards;
    z-index: 1501;
}

@keyframes shieldTextAnim {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    30% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

/* ========== CREDITS POPUP (after game) ========== */

.credits-earned-popup {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.2rem;
    color: #ffff00;
    text-shadow: 0 0 20px rgba(255, 255, 0, 0.8);
    animation: creditsPopup 2s ease-out forwards;
    z-index: 1500;
}

@keyframes creditsPopup {
    0% { opacity: 0; transform: translateX(-50%) translateY(20px); }
    20% { opacity: 1; transform: translateX(-50%) translateY(0); }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* ========== REACTOR INCOME BANNER ========== */

.reactor-banner {
    width: 100%;
    max-width: 900px;
    background: linear-gradient(90deg, rgba(255, 200, 0, 0.2) 0%, rgba(255, 150, 0, 0.2) 100%);
    border: 2px solid #ffcc00;
    border-radius: 8px;
    padding: 10px 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    animation: reactorPulse 2s ease-in-out infinite;
}

.reactor-banner.hidden {
    display: none;
}

@keyframes reactorPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 200, 0, 0.3); }
    50% { box-shadow: 0 0 20px rgba(255, 200, 0, 0.6); }
}

.reactor-icon {
    font-size: 1.5rem;
}

.reactor-text {
    font-family: 'Rajdhani', sans-serif;
    color: #ffcc00;
}

.collect-btn {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    padding: 8px 20px;
    background: linear-gradient(180deg, #ffcc00 0%, #ff9900 100%);
    border: none;
    border-radius: 5px;
    color: #000;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.collect-btn:hover {
    background: linear-gradient(180deg, #ffdd33 0%, #ffaa00 100%);
    transform: scale(1.05);
}

/* ========== JOKER INVENTORY BAR ========== */

.joker-inventory-bar {
    width: 100%;
    max-width: 900px;
    background: rgba(30, 20, 50, 0.8);
    border: 1px solid #6600cc;
    border-radius: 8px;
    padding: 8px 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    font-family: 'Rajdhani', sans-serif;
}

.inventory-label {
    color: #9966ff;
    font-weight: bold;
}

.inventory-item {
    color: #cc99ff;
    display: flex;
    align-items: center;
    gap: 4px;
}

.inventory-item span {
    background: rgba(153, 0, 255, 0.3);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.85rem;
}

.inventory-capacity {
    color: #888;
    margin-left: auto;
    font-size: 0.85rem;
}

/* ========== JOKER SHOP SCREEN ========== */

#joker-shop-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

#joker-shop-screen.active {
    display: flex !important;
}

.shop-content {
    width: 100%;
    max-width: 700px;
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.shop-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: 0.1em;
    color: #ff9900;
    text-shadow: 0 0 10px #ff9900;
}

.shop-info {
    background: rgba(30, 30, 60, 0.8);
    border: 1px solid #5090e0;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 25px;
    text-align: center;
}

.shop-info p {
    color: #aaccff;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.inventory-status {
    font-family: 'Rajdhani', sans-serif;
    color: #ff00ff;
    font-size: 1rem;
}

.workshop-discount {
    color: #00ff00;
    margin-left: 10px;
}

.workshop-discount.hidden {
    display: none;
}

/* Joker Shop Grid */
.joker-shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.joker-shop-card {
    background: linear-gradient(180deg, #2a1a4a 0%, #1a0a30 100%);
    border: 2px solid #9900ff;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
    text-align: center;
}

.joker-shop-card:hover {
    border-color: #cc33ff;
    box-shadow: 0 0 20px rgba(153, 0, 255, 0.4);
}

.joker-shop-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.joker-shop-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.2rem;
    color: #ff00ff;
    margin-bottom: 8px;
}

.joker-shop-desc {
    color: #cc99ff;
    font-size: 0.85rem;
    margin-bottom: 15px;
    line-height: 1.4;
}

.joker-shop-price {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    color: #ffcc00;
    margin-bottom: 5px;
}

.joker-shop-price.discounted {
    text-decoration: line-through;
    color: #888;
    font-size: 0.9rem;
}

.joker-shop-price-new {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.2rem;
    color: #00ff00;
    margin-bottom: 10px;
}

.joker-shop-owned {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.joker-buy-btn {
    width: 100%;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    padding: 12px;
    background: linear-gradient(180deg, #9900ff 0%, #6600aa 100%);
    border: 2px solid #cc33ff;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.joker-buy-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #cc33ff 0%, #9900ff 100%);
    box-shadow: 0 0 15px rgba(204, 51, 255, 0.5);
}

.joker-buy-btn:disabled {
    background: linear-gradient(180deg, #444 0%, #333 100%);
    border-color: #555;
    color: #666;
    cursor: not-allowed;
}

/* ========== ENHANCED HANGAR/WERFT ========== */

.hangar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.credits-display.small {
    font-size: 0.9rem;
}

.credits-display.small .credits-icon {
    font-size: 1rem;
}

.ship-display {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
}

.ship-info {
    text-align: left;
}

/* Ship Parts Grid (new style) */
.ship-parts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.ship-part-card {
    background: linear-gradient(180deg, #1a3a7a 0%, #0a1030 100%);
    border: 2px solid #3070c0;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

.ship-part-card:hover {
    border-color: #5090e0;
    box-shadow: 0 0 15px rgba(80, 144, 224, 0.3);
}

.ship-part-card.maxed {
    border-color: #00c853;
    background: linear-gradient(180deg, #0a3a2a 0%, #051510 100%);
}

.ship-part-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.ship-part-icon {
    font-size: 2.5rem;
}

.ship-part-info {
    flex: 1;
}

.ship-part-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    color: #ffffff;
    margin-bottom: 5px;
}

.ship-part-level {
    font-size: 0.8rem;
    color: #00ffff;
}

.ship-part-level-bar {
    display: flex;
    gap: 4px;
    margin-top: 5px;
}

.level-pip {
    width: 20px;
    height: 6px;
    background: #333;
    border-radius: 3px;
}

.level-pip.filled {
    background: linear-gradient(90deg, #00ffff, #00cccc);
    box-shadow: 0 0 5px #00ffff;
}

.ship-part-desc {
    font-size: 0.85rem;
    color: #aaccff;
    margin-bottom: 10px;
    line-height: 1.4;
}

.ship-part-effect {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    color: #00ff00;
    margin-bottom: 15px;
    padding: 8px;
    background: rgba(0, 255, 0, 0.1);
    border-radius: 5px;
}

.ship-part-effect.inactive {
    color: #888;
    background: rgba(128, 128, 128, 0.1);
}

.ship-part-buy-btn {
    width: 100%;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.95rem;
    padding: 12px;
    background: linear-gradient(180deg, #ffaa00 0%, #cc7700 100%);
    border: 2px solid #ffcc00;
    border-radius: 5px;
    color: #000;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.ship-part-buy-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #ffcc00 0%, #ffaa00 100%);
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.5);
}

.ship-part-buy-btn:disabled {
    background: linear-gradient(180deg, #444 0%, #333 100%);
    border-color: #555;
    color: #666;
    cursor: not-allowed;
}

.ship-part-buy-btn.maxed {
    background: linear-gradient(180deg, #00aa55 0%, #006633 100%);
    border-color: #00c853;
    color: #fff;
}

/* ========== ENHANCED PLANET POPUP ========== */

.planet-popup-details {
    margin-bottom: 15px;
}

.planet-popup-details p {
    font-size: 0.85rem;
    color: #aaccff;
    margin-bottom: 5px;
}

.planet-popup-tier {
    color: #00ffff !important;
}

.planet-popup-level {
    color: #ff6666 !important;
}

.planet-popup-travel-cost {
    color: #ffcc00 !important;
}

.planet-popup-status.current {
    background: rgba(255, 255, 0, 0.2);
    color: #ffff00;
    border: 1px solid #ffff00;
}

/* ========== HIDE SETTINGS BAR FOR SPACE QUIZZED ========== */

/* Hide settings bar completely in Space Quizzed mode */
body.pack-space .settings-bar {
    display: none !important;
}

/* Hide starfield switcher on galaxy screen (doesn't need it there) */
body:has(#galaxy-screen.active) #starfield-switcher {
    display: none !important;
}

/* ========== MOBILE RESPONSIVE ========== */

@media (max-width: 600px) {
    #galaxy-screen {
        padding: 10px;
        padding-top: calc(10px + env(safe-area-inset-top));
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
        padding-left: max(10px, env(safe-area-inset-left));
        padding-right: max(10px, env(safe-area-inset-right));
        justify-content: flex-start;
        min-height: 100dvh;
        box-sizing: border-box;
    }

    .galaxy-header {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        margin-bottom: 8px;
        gap: 10px;
    }

    .galaxy-title {
        font-size: 1.1rem;
    }

    .credits-display {
        font-size: 0.75rem;
    }

    .galaxy-map-container {
        aspect-ratio: unset;
        /* Fixed height calculation for immediate sizing */
        height: calc(100dvh - 180px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        min-height: 280px;
        max-height: 600px;
    }

    .galaxy-actions {
        margin-top: 15px;
        gap: 10px;
    }

    .galaxy-btn {
        font-size: 0.75rem;
        padding: 10px 18px;
    }

    .planet-popup-content {
        padding: 20px;
    }

    .planet-popup-icon {
        font-size: 3rem;
    }

    .planet-popup-name {
        font-size: 1.1rem;
    }

    .hangar-title {
        font-size: 1.2rem;
    }

    .ship-icon {
        font-size: 4rem;
    }

    .upgrades-grid {
        grid-template-columns: 1fr;
    }

    .upgrade-name {
        font-size: 0.85rem;
    }

    .mission-planet-icon {
        font-size: 4rem;
    }

    .mission-text {
        font-size: 1rem;
    }

    .mission-planet-name {
        font-size: 1.5rem;
    }

    /* Mobile: Reactor Banner */
    .reactor-banner {
        padding: 8px 15px;
        gap: 10px;
        font-size: 0.85rem;
    }

    .reactor-icon {
        font-size: 1.2rem;
    }

    .collect-btn {
        padding: 6px 15px;
        font-size: 0.8rem;
    }

    /* Mobile: Joker Inventory */
    .joker-inventory-bar {
        padding: 6px 10px;
        gap: 8px;
        font-size: 0.8rem;
    }

    .inventory-item span {
        padding: 1px 6px;
        font-size: 0.75rem;
    }

    /* Mobile: Shop */
    .shop-title {
        font-size: 1.3rem;
    }

    .joker-shop-grid {
        grid-template-columns: 1fr;
    }

    .joker-shop-card {
        padding: 15px;
    }

    .joker-shop-icon {
        font-size: 2.5rem;
    }

    /* Mobile: Hangar */
    .hangar-header {
        flex-direction: column;
        gap: 10px;
    }

    .ship-parts-grid {
        grid-template-columns: 1fr;
    }

    .ship-part-card {
        padding: 15px;
    }

    .ship-part-icon {
        font-size: 2rem;
    }

    .ship-part-name {
        font-size: 1rem;
    }
}

/* Extra tall phones (iPhone Pro Max etc) - flex: 1 handles this now */

/* Landscape mobile */
@media (max-height: 500px) {
    #galaxy-screen {
        padding: 5px 10px;
        padding-left: max(5px, env(safe-area-inset-left));
        padding-right: max(5px, env(safe-area-inset-right));
    }

    .galaxy-header {
        margin-bottom: 5px;
    }

    .galaxy-map-container {
        height: calc(100dvh - 100px);
        aspect-ratio: unset;
        max-height: none;
    }

    .galaxy-actions {
        margin-top: 5px;
    }

    .galaxy-btn {
        padding: 8px 15px;
        font-size: 0.7rem;
    }
}
