/* === Astral Vanguard — Styles === */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #000010;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    font-family: 'Segoe UI', 'Consolas', 'Courier New', monospace;
    user-select: none;
    -webkit-user-select: none;
}

#gameContainer {
    position: relative;
    width: 480px;
    height: 800px;
    /* Scale to fit viewport while maintaining aspect ratio */
    transform-origin: center center;
}

#gameCanvas {
    display: block;
    width: 480px;
    height: 800px;
    image-rendering: auto;
    background: #000010;
    border: 2px solid #1a1a4e;
    border-radius: 4px;
}

/* === Overlay Screens === */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 16, 0.88);
    z-index: 10;
    overflow-y: auto;
    padding: 20px 0;
}

.overlay.hidden {
    display: none;
}

.title-content {
    text-align: center;
    max-width: 440px;
    padding: 10px;
}

/* === Title Text === */
.game-title {
    font-size: 40px;
    font-weight: 900;
    letter-spacing: 8px;
    color: #ffffff;
    text-shadow:
        0 0 10px #4488ff,
        0 0 20px #4488ff,
        0 0 40px #2266cc;
    margin: 3px 0;
    line-height: 1;
}

.game-title.subtitle {
    color: #ff6644;
    text-shadow:
        0 0 10px #ff6644,
        0 0 20px #ff4422,
        0 0 40px #cc2200;
    font-size: 34px;
    letter-spacing: 12px;
}

.game-title.game-over {
    color: #ff2222;
    text-shadow:
        0 0 10px #ff2222,
        0 0 20px #ff0000,
        0 0 40px #cc0000;
}

.game-title.victory {
    color: #ffdd00;
    text-shadow:
        0 0 10px #ffdd00,
        0 0 20px #ffaa00,
        0 0 40px #ff8800;
}

/* === Title Decoration === */
.title-decoration {
    margin: 6px 0;
}

.star {
    font-size: 18px;
    color: #ffdd00;
    text-shadow: 0 0 8px #ffdd00;
    margin: 0 8px;
    display: inline-block;
    animation: starPulse 1.5s ease-in-out infinite;
}

.star:nth-child(2) { animation-delay: 0.3s; }
.star:nth-child(3) { animation-delay: 0.6s; }

@keyframes starPulse {
    0%, 100% { opacity: 0.4; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* === Blink Text === */
.blink-text {
    font-size: 13px;
    color: #aaccff;
    letter-spacing: 3px;
    margin-top: 8px;
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* === Controls Info === */
.controls-info {
    margin-top: 10px;
    display: inline-block;
    text-align: left;
}

.ctrl-row {
    display: flex;
    align-items: center;
    margin: 4px 0;
}

.ctrl-keys {
    min-width: 110px;
    text-align: right;
    margin-right: 12px;
}

.ctrl-action {
    color: #8899bb;
    font-size: 12px;
    font-family: 'Segoe UI', 'Consolas', monospace;
    letter-spacing: 1px;
}

.controls-info .key {
    display: inline-block;
    background: #1a1a3e;
    border: 1px solid #445577;
    border-radius: 3px;
    padding: 2px 7px;
    color: #bbddff;
    font-family: 'Consolas', monospace;
    font-size: 11px;
    margin: 0 1px;
}

/* === Score Text === */
.score-text {
    font-size: 20px;
    color: #ffdd00;
    letter-spacing: 2px;
    margin: 8px 0;
}

.victory-subtitle {
    font-size: 16px;
    color: #ffaa44;
    letter-spacing: 2px;
    margin: 6px 0;
}

/* === HUD (rendered on canvas, but some elements can be CSS overlays) === */
/* The main HUD is drawn on canvas; this is just for any supplementary CSS UI */

/* === Highscore Box === */
.highscore-box {
    margin-top: 6px;
    text-align: center;
}

.hs-title {
    color: #ffdd00;
    font-size: 10px;
    letter-spacing: 2px;
    margin-bottom: 2px;
    text-shadow: 0 0 6px #ff8800;
}

.hs-list {
    color: #8899bb;
    font-size: 9px;
    line-height: 1.4;
    font-family: 'Consolas', monospace;
    max-height: 85px;
    overflow-y: auto;
}

.hs-list .hs-row {
    padding: 1px 0;
}

.hs-list .hs-rank {
    color: #667788;
    margin-right: 6px;
}

.hs-list .hs-name {
    color: #ffdd44;
    font-weight: bold;
}

.hs-list .hs-score {
    color: #aaccff;
    margin-left: 8px;
}

.hs-list .hs-empty {
    color: #334455;
    font-style: italic;
}

/* === Highscore Name Entry === */
.hs-name-input {
    font-size: 42px;
    font-family: 'Consolas', monospace;
    color: #ffdd44;
    letter-spacing: 16px;
    margin: 15px 0;
    text-shadow: 0 0 12px #ff8800;
    background: rgba(0,0,30,0.5);
    padding: 8px 20px;
    border-radius: 6px;
    display: inline-block;
}

.hs-name-input .char-selected {
    color: #ffffff;
    text-shadow: 0 0 20px #ffffff, 0 0 40px #ffdd00;
}

/* === Volume Control === */
.volume-control {
    margin-top: 30px;
    padding: 12px 20px;
    background: rgba(10,10,40,0.6);
    border-radius: 8px;
    display: inline-block;
}

.vol-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 180px;
    height: 6px;
    background: #1a1a3e;
    border-radius: 3px;
    outline: none;
    border: 1px solid #334466;
}

.vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4488ff;
    cursor: pointer;
    border: 2px solid #aaccff;
    box-shadow: 0 0 8px #4488ff;
}

.vol-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4488ff;
    cursor: pointer;
    border: 2px solid #aaccff;
    box-shadow: 0 0 8px #4488ff;
}
