/* Cranberries vs Blueberries in Space - Styles */

/* Color Palette */
:root {
    --cranberry-red: #dc143c;
    --blueberry-blue: #4169e1;
    --space-black: #0a0a0f;
    --star-white: #ffffff;
    --ui-gray: #333;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(to bottom, #000011, #000033);
    color: var(--star-white);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

/* Game Container */
#game-container {
    width: 1350px;  /* Canvas (1000px) + Side panels (150px each) + gaps */
    max-width: 100vw;
    text-align: center;
    position: relative;
}

/* Screen System */
.screen {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Title Screen */
#title-screen {
    padding: 2rem 2rem 10rem 2rem; /* Extra bottom padding for credits box */
    position: relative;
    min-height: 100vh;
}

#title-screen.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#title-screen h1 {
    font-size: 3rem;
    color: var(--cranberry-red);
    text-shadow: 0 0 10px var(--cranberry-red);
    margin-bottom: 0.5rem;
}

#title-screen h2 {
    font-size: 2rem;
    color: var(--blueberry-blue);
    text-shadow: 0 0 10px var(--blueberry-blue);
    margin-bottom: 2rem;
}

.tagline {
    font-size: 1.2rem;
    margin-bottom: 3rem;
    font-style: italic;
}

/* Audio Controls - Fixed position in corner */
.audio-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 1000; /* Always on top */
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.audio-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: bold;
    margin-right: 0.25rem;
}

.audio-toggle-button {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 0.4rem 0.9rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 50px;
    text-align: center;
}

.audio-toggle-button.off {
    background: rgba(150, 150, 150, 0.3);
    border-color: rgba(150, 150, 150, 0.5);
    color: rgba(255, 255, 255, 0.6);
}

.audio-toggle-button.on {
    background: var(--cranberry-red);
    border-color: var(--cranberry-red);
    color: white;
    box-shadow: 0 0 10px rgba(220, 20, 60, 0.5);
}

.audio-toggle-button:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.6);
}

.audio-toggle-button:active {
    transform: scale(0.95);
}

.volume-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    min-width: 35px;
    text-align: right;
}

/* Volume Slider */
.volume-slider {
    width: 100px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--cranberry-red);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(220, 20, 60, 0.5);
    transition: all 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    background: #ff1744;
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(220, 20, 60, 0.8);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--cranberry-red);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(220, 20, 60, 0.5);
    transition: all 0.2s ease;
}

.volume-slider::-moz-range-thumb:hover {
    background: #ff1744;
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(220, 20, 60, 0.8);
}

/* Credits Box */
.credits-box {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--cranberry-red);
    border-radius: 10px;
    padding: 1.5rem 2rem;
    text-align: center;
    box-shadow: 0 0 20px rgba(220, 20, 60, 0.3);
    z-index: 1; /* Below other content */
    transition: all 0.3s ease;
}

.credits-box.clickable {
    cursor: pointer;
}

.credits-box.clickable:hover {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 0 30px rgba(220, 20, 60, 0.6);
    border-color: gold;
}

.credits-hint {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: gold;
    opacity: 0.7;
    font-style: italic;
}

.credits-box.clickable:hover .credits-hint {
    opacity: 1;
    color: #ffd700;
}

.studio-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--cranberry-red);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.developers {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.developer {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dev-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--star-white);
    margin-bottom: 0.3rem;
}

.dev-role {
    font-size: 0.9rem;
    color: #aaa;
    font-style: italic;
}

/* Buttons */
.game-button {
    background: linear-gradient(to bottom, var(--cranberry-red), #8b0000);
    border: 2px solid var(--star-white);
    color: var(--star-white);
    font-size: 1.5rem;
    padding: 1rem 2rem;
    margin: 0.5rem;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s;
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
    z-index: 10; /* Ensure buttons are above credits box */
}

.game-button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--cranberry-red);
}

.game-button:active {
    transform: scale(0.95);
}

.game-button.secondary {
    background: linear-gradient(to bottom, #555, #333);
    font-size: 1.2rem;
}

/* Game Screen Layout */
#game-screen {
    position: relative;
}

#game-layout {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 1rem;
}

/* Side Panels */
.side-panel {
    width: 150px;
    height: 600px; /* Match canvas height */
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid var(--star-white);
    border-radius: 10px;
    padding: 1.5rem 1rem;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
}

.side-panel h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--star-white);
}

#score-display,
#level-display {
    text-align: center;
}

#score-display span,
#level-display span {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

#score {
    color: var(--cranberry-red);
    text-shadow: 0 0 10px var(--cranberry-red);
}

#level {
    color: var(--blueberry-blue);
    text-shadow: 0 0 10px var(--blueberry-blue);
}

.label {
    font-size: 0.85rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Player Shields Panel */
#player-shields-panel {
    margin-top: 2rem;
    padding-top: 1rem;
}

.shields-divider {
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--star-white), transparent);
    margin-bottom: 1rem;
}

#player-shields-panel h4 {
    font-size: 1rem;
    color: var(--cranberry-red);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.player-shield-bar {
    font-size: 1.5rem;
    color: var(--cranberry-red);
    font-family: monospace;
    letter-spacing: 3px;
    margin-bottom: 0.3rem;
    text-shadow: 0 0 5px var(--cranberry-red);
}

.player-shield-text {
    font-size: 0.85rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Player Ammo Panel (Secondary Weapon) */
#player-ammo-panel {
    margin-top: 2rem;
    padding-top: 1rem;
}

.ammo-divider {
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--star-white), transparent);
    margin-bottom: 1rem;
}

#player-ammo-panel h4 {
    font-size: 1rem;
    color: gold;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.player-weapon-name {
    font-size: 0.75rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.player-ammo-bar {
    font-size: 1.2rem;
    color: gold;
    font-family: monospace;
    letter-spacing: 2px;
    margin-bottom: 0.3rem;
    text-shadow: 0 0 5px gold;
}

.player-ammo-text {
    font-size: 0.85rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Boss Health Panel */
#boss-health-panel {
    margin-top: 2rem;
    padding-top: 1rem;
}

.boss-divider {
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--star-white), transparent);
    margin-bottom: 1rem;
}

#boss-health-panel h4 {
    font-size: 1rem;
    color: var(--cranberry-red);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.boss-name {
    font-size: 0.9rem;
    color: var(--blueberry-blue);
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.boss-health-bar {
    font-size: 1.5rem;
    color: var(--cranberry-red);
    font-family: monospace;
    letter-spacing: 3px;
    margin-bottom: 0.3rem;
    text-shadow: 0 0 5px var(--cranberry-red);
}

.boss-health-text {
    font-size: 0.85rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Canvas */
#game-canvas {
    border: 3px solid var(--star-white);
    background: #000000;
    display: block;
    margin: 0 auto;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

/* Game Over Screen */
#gameover-screen {
    padding: 2rem;
}

#gameover-screen h1 {
    font-size: 3rem;
    color: var(--blueberry-blue);
    text-shadow: 0 0 10px var(--blueberry-blue);
    margin-bottom: 1rem;
}

#gameover-screen p {
    font-size: 1.5rem;
    margin: 1rem 0;
}

.final-score {
    font-size: 2rem !important;
    color: var(--cranberry-red);
    font-weight: bold;
}

/* Level Select Screen */
#level-select-screen {
    padding: 2rem;
}

#level-select-layout {
    display: flex;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

#level-select-sidebar {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#level-select-main {
    flex: 1;
    position: relative;
}

#level-select-screen h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--cranberry-red);
    text-shadow: 0 0 10px var(--cranberry-red);
}

#level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto 2rem auto;
}

.level-card {
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid var(--star-white);
    border-radius: 15px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.level-card.unlocked {
    border-color: var(--cranberry-red);
    box-shadow: 0 0 20px rgba(220, 20, 60, 0.3);
}

.level-card.unlocked:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 30px var(--cranberry-red);
    border-color: var(--star-white);
}

.level-card.locked {
    border-color: #666;
    opacity: 0.6;
    cursor: not-allowed;
}

.level-card.locked:hover {
    opacity: 0.7;
}

.level-number {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--blueberry-blue);
    margin-bottom: 0.5rem;
}

.level-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--star-white);
    margin-bottom: 1rem;
}

.level-info {
    font-size: 1.1rem;
    color: #aaa;
    margin-bottom: 1rem;
}

.level-status {
    font-size: 1rem;
    color: var(--cranberry-red);
    font-weight: bold;
}

.level-card.locked .level-status {
    color: #999;
}

.level-card.explore {
    border-color: gold;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(0, 0, 0, 0.8));
}

.level-card.explore:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 30px gold;
    border-color: var(--star-white);
}

.level-card.explore .level-number {
    font-size: 2.5rem;
}

.level-card.explore .level-status {
    color: gold;
}

.level-card.story {
    border-color: #9370db;
    box-shadow: 0 0 20px rgba(147, 112, 219, 0.3);
    background: linear-gradient(135deg, rgba(147, 112, 219, 0.1), rgba(0, 0, 0, 0.8));
}

.level-card.story:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 30px #9370db;
    border-color: var(--star-white);
}

.level-card.story .level-number {
    font-size: 2.5rem;
}

.level-card.story .level-status {
    color: #9370db;
}

/* Ship Selection Screen */
#ship-select-screen {
    padding: 2rem;
}

#ship-select-screen h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--cranberry-red);
    text-shadow: 0 0 10px var(--cranberry-red);
}

#ship-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 2rem auto;
}

.ship-card {
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid var(--cranberry-red);
    border-radius: 15px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    box-shadow: 0 0 20px rgba(220, 20, 60, 0.3);
}

.ship-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 0 30px var(--cranberry-red);
    border-color: var(--star-white);
}

.ship-card.selected {
    border-color: gold;
    box-shadow: 0 0 30px gold;
}

/* Confirm Ship Button */
.confirm-ship-button {
    display: block;
    margin: 2rem auto;
    font-size: 2rem;
    padding: 1.5rem 3rem;
    background: linear-gradient(to bottom, var(--cranberry-red), #8b0000);
    border: 3px solid var(--star-white);
    border-radius: 15px;
    transition: all 0.3s;
}

.confirm-ship-button:disabled {
    background: linear-gradient(to bottom, #444, #222);
    border-color: #666;
    color: #666;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.confirm-ship-button:not(:disabled) {
    animation: buttonPulse 2s infinite;
}

.confirm-ship-button:not(:disabled):hover {
    transform: scale(1.15);
    box-shadow: 0 0 40px gold, 0 0 60px var(--cranberry-red);
    border-color: gold;
}

.confirm-ship-button:not(:disabled):active {
    transform: scale(1.05);
}

@keyframes buttonPulse {
    0%, 100% {
        box-shadow: 0 0 20px var(--cranberry-red);
    }
    50% {
        box-shadow: 0 0 40px var(--cranberry-red), 0 0 20px gold;
    }
}

.ship-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    width: 128px;
    height: 128px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
}

.ship-icon img {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.ship-name {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--star-white);
    margin-bottom: 0.5rem;
}

.ship-info {
    font-size: 1.1rem;
    color: #aaa;
    margin-bottom: 1rem;
}

.ship-stats {
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(220, 20, 60, 0.1);
    border-radius: 10px;
}

.stat {
    font-size: 1.1rem;
    color: var(--star-white);
    margin: 0.5rem 0;
}

.ship-status {
    font-size: 1rem;
    color: var(--cranberry-red);
    font-weight: bold;
    margin-top: 1rem;
}

/* Change Ship Button */
.change-ship-btn {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--cranberry-red);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 15px rgba(220, 20, 60, 0.3);
    z-index: 10;
}

.change-ship-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 0 25px var(--cranberry-red);
    border-color: var(--star-white);
}

.change-ship-btn:active {
    transform: scale(0.95);
}

/* Controls Button */
.controls-btn {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--blueberry-blue);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 15px rgba(65, 105, 225, 0.3);
    z-index: 10;
}

.controls-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px var(--blueberry-blue);
    border-color: var(--star-white);
}

.controls-btn:active {
    transform: scale(0.95);
}

/* Controls Dialog */
.controls-dialog-box {
    max-width: 900px;
    border-color: var(--blueberry-blue);
    box-shadow: 0 0 40px var(--blueberry-blue);
    padding: 2rem;
}

.controls-dialog-box h2 {
    color: var(--blueberry-blue);
    text-shadow: 0 0 10px var(--blueberry-blue);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.controls-dialog-box > div:not(.dialog-buttons) {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.controls-section {
    flex: 1;
}

.controls-section h3 {
    font-size: 1.1rem;
    color: var(--cranberry-red);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.control-key {
    background: rgba(65, 105, 225, 0.2);
    border: 2px solid var(--blueberry-blue);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    font-size: 1rem;
    font-weight: bold;
    color: var(--star-white);
    min-width: 70px;
    text-align: center;
    box-shadow: 0 0 10px rgba(65, 105, 225, 0.3);
}

.control-desc {
    font-size: 0.95rem;
    color: var(--star-white);
}

.control-tip {
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 0.3rem;
    padding-left: 0.5rem;
}

/* Status Panel */
.status-panel {
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid var(--blueberry-blue);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 0 20px rgba(65, 105, 225, 0.3);
}

/* Sidebar Buttons */
.sidebar-button {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--cranberry-red);
    border-radius: 10px;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--star-white);
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 15px rgba(220, 20, 60, 0.3);
}

.sidebar-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 25px var(--cranberry-red);
    border-color: var(--star-white);
    background: rgba(220, 20, 60, 0.2);
}

.sidebar-button:active {
    transform: translateY(0);
}

.status-panel h2 {
    font-size: 1.5rem;
    color: var(--blueberry-blue);
    text-shadow: 0 0 10px var(--blueberry-blue);
    margin-bottom: 1.5rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.status-label {
    font-size: 1rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--star-white);
}

.status-value.currency {
    color: gold;
    text-shadow: 0 0 5px gold;
    font-size: 1.3rem;
}

.status-divider {
    height: 2px;
    background: linear-gradient(to right, transparent, var(--blueberry-blue), transparent);
    margin: 1rem 0;
}

/* Level Select Buttons */
.level-select-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
    gap: 1rem;
}

.game-button.reset {
    background: linear-gradient(to bottom, #555, #333);
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    border-color: #666;
}

.game-button.reset:hover {
    background: linear-gradient(to bottom, #dc143c, #8b0000);
    border-color: var(--star-white);
    box-shadow: 0 0 20px rgba(220, 20, 60, 0.5);
}

/* Trading Hub Screen */
#trading-hub-screen {
    padding: 2rem;
}

#trading-hub-screen h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: gold;
    text-shadow: 0 0 10px gold;
}

#moon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 2rem auto;
}

.moon-card {
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid var(--star-white);
    border-radius: 15px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.moon-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 30px gold;
    border-color: gold;
}

.moon-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.moon-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--star-white);
    margin-bottom: 0.5rem;
}

.moon-info {
    font-size: 1.1rem;
    color: #aaa;
    margin-bottom: 1rem;
}

.moon-status {
    font-size: 1rem;
    color: gold;
    font-weight: bold;
}

/* Dialog System */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-in;
}

.dialog-box {
    background: linear-gradient(to bottom, #1a1a2e, #0f0f1e);
    border: 3px solid gold;
    border-radius: 20px;
    padding: 3rem;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 0 40px gold;
    animation: slideIn 0.3s ease-out;
}

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

.dialog-box h2 {
    font-size: 2rem;
    color: gold;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px gold;
}

.dialog-box p {
    font-size: 1.3rem;
    color: var(--star-white);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.dialog-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Story Chapters Screen */
#story-chapters-screen {
    padding: 2rem;
}

#story-chapters-screen h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #9370db;
    text-shadow: 0 0 10px #9370db;
}

#chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 2rem auto;
}

.chapter-card {
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid var(--star-white);
    border-radius: 15px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.chapter-card.unlocked {
    border-color: #9370db;
    box-shadow: 0 0 20px rgba(147, 112, 219, 0.3);
}

.chapter-card.unlocked:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 30px #9370db;
    border-color: var(--star-white);
}

.chapter-card.locked {
    border-color: #666;
    opacity: 0.6;
    cursor: not-allowed;
}

.chapter-card.locked:hover {
    opacity: 0.7;
}

.chapter-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.chapter-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--star-white);
    margin-bottom: 0.5rem;
}

.chapter-info {
    font-size: 1.1rem;
    color: #aaa;
    margin-bottom: 1rem;
}

.chapter-status {
    font-size: 1rem;
    color: #9370db;
    font-weight: bold;
}

.chapter-card.locked .chapter-status {
    color: #999;
}

/* Story Dialog */
.story-dialog-box {
    max-width: 700px;
    border-color: #9370db;
    box-shadow: 0 0 40px #9370db;
}

.story-graphic {
    width: 100%;
    height: 200px;
    background: rgba(147, 112, 219, 0.1);
    border: 2px solid #9370db;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.graphic-placeholder {
    font-size: 4rem;
    opacity: 0.5;
}

.story-text {
    font-size: 1.2rem;
    color: var(--star-white);
    margin-bottom: 2rem;
    line-height: 1.8;
    text-align: left;
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

/* Credits Screen */
#credits-screen {
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

#credits-screen h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: gold;
    text-shadow: 0 0 10px gold;
}

.credits-content {
    max-height: 70vh;
    overflow-y: auto;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    border: 2px solid gold;
    margin-bottom: 2rem;
}

.credits-section {
    margin-bottom: 2.5rem;
}

.credits-section h2 {
    font-size: 1.8rem;
    color: var(--cranberry-red);
    margin-bottom: 1.5rem;
    text-align: center;
    text-shadow: 0 0 8px var(--cranberry-red);
}

.credit-person {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(220, 20, 60, 0.1);
    border-left: 4px solid var(--cranberry-red);
    border-radius: 8px;
}

.credit-name {
    font-size: 1.4rem;
    font-weight: bold;
    color: gold;
    margin-bottom: 1rem;
}

.credit-roles {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.credit-role {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    padding-left: 1rem;
    line-height: 1.6;
}

/* Tools & Technology Section */
.credits-tech {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}

.tech-item {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
}

.tech-item strong {
    color: gold;
}

.tech-item a {
    color: var(--blueberry-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

.tech-item a:hover {
    color: #6495ed;
    text-decoration: underline;
}

/* Special Thanks */
.credits-thanks {
    text-align: center;
    font-size: 1.2rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
}

.credits-thanks p {
    margin-bottom: 1rem;
}

/* Credits Footer */
.credits-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.credits-footer p {
    margin-bottom: 0.5rem;
}

/* Shop Dialog */
.shop-dialog-box {
    max-width: 900px;
    border-color: #00d4ff;
    box-shadow: 0 0 40px #00d4ff;
    padding: 2rem;
}

.shop-dialog-box h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.shop-greeting {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 1rem;
}

.shop-status {
    display: flex;
    gap: 3rem;
    justify-content: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(0, 212, 255, 0.1);
    border: 2px solid #00d4ff;
    border-radius: 10px;
}

.shop-stat {
    text-align: center;
}

.shop-stat-label {
    font-size: 0.75rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.3rem;
}

.shop-stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #00d4ff;
    text-shadow: 0 0 10px #00d4ff;
}

.shop-item {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #00d4ff;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.shop-item-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.shop-item-info {
    flex-grow: 1;
    text-align: left;
}

.shop-item-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--star-white);
    margin-bottom: 0.3rem;
}

.shop-item-description {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 0.5rem;
}

.shop-item-price {
    font-size: 1.1rem;
    color: gold;
    font-weight: bold;
}

.shop-item-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.shop-buy-button {
    font-size: 1.1rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(to bottom, #00d4ff, #0088cc);
    border-color: #00d4ff;
    margin: 0;
}

.shop-buy-button:hover {
    box-shadow: 0 0 20px #00d4ff;
}

.shop-buy-button:disabled {
    background: linear-gradient(to bottom, #555, #333);
    border-color: #666;
    cursor: not-allowed;
    opacity: 0.5;
}

.shop-buy-button:disabled:hover {
    transform: none;
    box-shadow: none;
}

.shop-message {
    font-size: 0.9rem;
    font-weight: bold;
    min-height: 1.2rem;
    white-space: nowrap;
}

.shop-message.success {
    color: #0f0;
    text-shadow: 0 0 10px #0f0;
}

.shop-message.error {
    color: #f00;
    text-shadow: 0 0 10px #f00;
}

/* Weapon Shop Specific Styles */
.weapon-shop-box {
    max-width: 1000px;
    border-color: #dc143c;
    box-shadow: 0 0 40px #dc143c;
    padding: 1.5rem;
}

.weapon-shop-box h2 {
    color: #dc143c;
    text-shadow: 0 0 10px #dc143c;
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
}

.weapon-shop-box .shop-greeting {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.weapon-shop-box .shop-status {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

#weapon-shop-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#weapon-shop-items .shop-item {
    padding: 1rem;
}

#weapon-shop-items .shop-item-icon {
    font-size: 2.5rem;
}

#weapon-shop-items .shop-item-name {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

#weapon-shop-items .shop-item-description {
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

#weapon-shop-items .shop-item-price {
    font-size: 0.95rem;
}

.weapon-ammo-count {
    font-size: 0.9rem;
    color: #00d4ff;
    font-weight: bold;
    margin-top: 0.3rem;
}

.shop-item-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.shop-item-actions button {
    min-width: 110px;
    font-size: 0.95rem;
    padding: 0.6rem 1.2rem;
    margin: 0;
}

.buy-weapon-btn {
    background: linear-gradient(to bottom, #dc143c, #8b0000);
    border-color: #dc143c;
}

.buy-weapon-btn:hover:not(:disabled) {
    box-shadow: 0 0 20px #dc143c;
}

.buy-ammo-btn {
    background: linear-gradient(to bottom, #ff8c00, #cc7000);
    border-color: #ff8c00;
}

.buy-ammo-btn:hover:not(:disabled) {
    box-shadow: 0 0 20px #ff8c00;
}

.equip-weapon-btn {
    background: linear-gradient(to bottom, #228b22, #006400);
    border-color: #228b22;
}

.equip-weapon-btn:hover:not(:disabled) {
    box-shadow: 0 0 20px #228b22;
}

.equip-weapon-btn.equipped {
    background: linear-gradient(to bottom, #555, #333);
    border-color: gold;
    box-shadow: 0 0 15px gold;
}

#weapon-shop-message {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* ============================================
   CUTSCENE DIALOG SYSTEM
   ============================================ */

.cutscene-overlay {
    background: rgba(0, 0, 0, 0.95); /* Darker overlay for drama */
    animation: fadeIn 0.5s ease-in;
}

.cutscene-box {
    background: linear-gradient(135deg, #1a0000, #0a0a1a);
    border: 4px solid #ff4444;
    border-radius: 15px;
    padding: 2rem;
    max-width: 600px;
    text-align: center;
    box-shadow: 0 0 60px rgba(255, 68, 68, 0.6), inset 0 0 20px rgba(255, 68, 68, 0.1);
    animation: cutsceneEnter 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes cutsceneEnter {
    0% {
        transform: scale(0.7) rotateX(20deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.05) rotateX(-5deg);
    }
    100% {
        transform: scale(1) rotateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.cutscene-header {
    margin-bottom: 1.5rem;
}

.cutscene-label {
    font-size: 0.9rem;
    font-weight: bold;
    color: #ff4444;
    text-transform: uppercase;
    letter-spacing: 3px;
    animation: blink 1.5s infinite;
    text-shadow: 0 0 10px #ff4444;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.cutscene-content {
    margin: 2rem 0;
}

.cutscene-speaker-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(68, 68, 255, 0.1);
    border: 2px solid #4444ff;
    border-radius: 10px;
}

.cutscene-enemy-icon {
    font-size: 3rem;
    filter: drop-shadow(0 0 10px #4444ff);
}

.cutscene-speaker-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4444ff;
    text-shadow: 0 0 15px #4444ff;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.cutscene-dialog-text {
    font-size: 1.3rem;
    line-height: 1.8;
    color: var(--star-white);
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.4);
    border-left: 4px solid #ff4444;
    border-radius: 8px;
    font-style: italic;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.cutscene-button {
    font-size: 1.3rem;
    padding: 1rem 2.5rem;
    background: linear-gradient(to bottom, #ff4444, #cc0000);
    border: 3px solid #ff6666;
    color: white;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

.cutscene-button:hover {
    background: linear-gradient(to bottom, #ff6666, #ff0000);
    box-shadow: 0 0 30px #ff4444;
    transform: scale(1.05);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 20px #ff4444;
    }
    50% {
        box-shadow: 0 0 40px #ff4444;
    }
}

/* Responsive Design */
@media (max-width: 1400px) {
    #game-container {
        width: 95vw;
    }

    #game-layout {
        flex-direction: column;
        align-items: center;
    }

    .side-panel {
        width: 100%;
        max-width: 500px;
    }

    #game-layout {
        gap: 0.5rem;
    }

    #title-screen h1 {
        font-size: 2rem;
    }

    #title-screen h2 {
        font-size: 1.5rem;
    }

    .game-button {
        font-size: 1.2rem;
        padding: 0.8rem 1.5rem;
    }
}
