body {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #000;
    font-family: 'Courier New', monospace;
    margin: 0;
    height: 100vh;
    color: #fff;
    overflow: hidden;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    box-sizing: border-box;
}

#splash-screen {
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: none;
}

#splash-screen button {
    background: #000;
    color: #0f0;
    border: 2px solid #0f0;
    padding: 14px 20px;
    font-size: 1.3em;
    white-space: nowrap;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    box-shadow: 0 0 10px #0f0;
    transition: all 0.3s ease;
    width: 100%;
}

#splash-screen button:hover {
    background: #0f0;
    color: #000;
    box-shadow: 0 0 20px #0f0;
}

.splash-hs-btn {
    font-size: 0.9em !important;
    padding: 10px 20px !important;
    color: #0ff !important;
    border-color: #0ff !important;
    box-shadow: 0 0 8px #0ff !important;
}

.splash-hs-btn:hover {
    background: #0ff !important;
    color: #000 !important;
}

.splash-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    margin-top: 40px;
    width: 60%;
    margin-left: auto;
    margin-right: auto;
}

.game-options {
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    justify-content: center;
}

.board-select {
    position: relative;
    z-index: 1;
    background: #000;
    color: #0ff;
    border: 2px solid #0ff;
    padding: 8px 20px;
    font-size: 1.1em;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    box-shadow: 0 0 10px #0ff;
    transition: all 0.3s ease;
    outline: none;
    width: 180px;
    text-align: center;
}

.board-select option {
    background: #000;
    color: #0ff;
    padding: 8px;
}

#game-container-1p {
    display: none;
    width: 100%;
    max-width: 800px;
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    margin: 0 auto;
    position: relative;
    box-sizing: border-box;
}

#stage-header {
    text-align: center;
    color: #0ff;
    text-shadow: 0 0 10px #0ff;
    font-size: 1.6em;
    letter-spacing: 4px;
    padding: 15px 0;
    flex-shrink: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.peek-flash {
    color: gold !important;
    text-shadow: 0 0 20px gold, 0 0 40px gold !important;
    animation: peekFlash 0.3s ease-in-out infinite;
    letter-spacing: 8px !important;
}

.bomb-flash {
    color: #f44 !important;
    text-shadow: 0 0 20px #f44, 0 0 40px #f00 !important;
    animation: peekFlash 0.3s ease-in-out infinite;
    letter-spacing: 8px !important;
}

@keyframes peekFlash {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.15); }
}

#stage-back-btn {
    position: absolute;
    left: 15px;
    background: none;
    border: 2px solid #0ff;
    color: #0ff;
    font-family: 'Courier New', monospace;
    font-size: 0.5em;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

#stage-back-btn:hover {
    background: #0ff;
    color: #000;
}

#game-board {
    flex: 1;
    position: relative;
    width: 100%;
    margin: 0;
    border-top: 2px solid #0ff;
    background: rgba(0, 255, 255, 0.05);
    overflow: hidden;
    box-sizing: border-box;
}

#control-area {
    height: 100px;
    width: 100%;
    display: flex;
    align-items: center;
    background: #000;
    padding: 10px;
    box-sizing: border-box;
    border-top: none;
    position: relative;
}

.player-area {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 10px;
    position: relative;
    background: rgba(0, 255, 255, 0.05);
    margin: 0 5px;
    border-radius: 5px;
    border: 2px solid #0ff;
    gap: 15px;
}

.player-label {
    font-weight: bold;
    color: #0ff;
    text-shadow: 0 0 10px #0ff;
    margin: 0;
    font-size: 1.1em;
}

.target-tile {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    opacity: 1;
    margin: 0;
    transition: transform 0.15s ease;
}

.target-tile.pulse {
    transform: scale(0);
}

.match-label {
    color: #0ff;
    text-shadow: 0 0 8px #0ff;
    font-size: 1.1em;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.match-label.throb {
    animation: matchThrob 0.5s ease-in-out 3;
}

@keyframes matchThrob {
    0%, 100% { transform: scale(1); text-shadow: 0 0 8px #0ff; }
    50% { transform: scale(1.3); text-shadow: 0 0 20px #0ff, 0 0 40px #0ff; }
}

.game-message {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    align-items: center;
    justify-content: center;
    font-size: 1.4em;
    letter-spacing: 4px;
    text-transform: uppercase;
    z-index: 10;
    background: rgba(0, 255, 255, 0.05);
    border-radius: 5px;
}

.game-message.active {
    display: flex;
}

.game-message.look {
    color: #0ff;
    text-shadow: 0 0 20px #0ff;
    animation: messageThrob 1s ease-in-out infinite;
}

.game-message.match {
    color: #0f0;
    text-shadow: 0 0 20px #0f0;
    animation: messageThrob 0.4s ease-in-out infinite;
}

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

.player-accuracy {
    color: #0ff;
    text-shadow: 0 0 10px #0ff;
    font-size: 1.6em;
    font-weight: bold;
    min-width: 60px;
}

#middle-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #0ff;
    margin: 0 5px;
    border-radius: 5px;
    background: rgba(0, 255, 255, 0.05);
}

.tile {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
    border: 4px solid rgba(255, 255, 255, 0.6);
}

.tile::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
}

.tile.face-up {
    transform: rotateY(0deg);
}

.tile.face-down {
    transform: rotateY(180deg);
    background: white !important;
    box-shadow: none !important;
}

.mute-btn {
    position: fixed;
    top: 5px;
    right: 10px;
    background: none;
    border: 1px solid #0ff;
    color: #0ff;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 3px;
    cursor: pointer;
    z-index: 2000;
    text-transform: uppercase;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.mute-btn:hover {
    opacity: 1;
}

.mute-btn.muted {
    color: #666;
    border-color: #666;
    text-decoration: line-through;
}

.version {
    position: fixed;
    top: 5px;
    left: 5px;
    font-size: 12px;
    color: #0ff;
    text-shadow: 0 0 5px #0ff;
}

#gift-notification {
    color: gold;
    text-shadow: 0 0 10px gold;
    text-align: center;
    animation: giftPulse 2s ease-in-out;
    transform-origin: center center;
    padding: 5px;
}

#gift-notification .title {
    font-size: 1.2em;
    margin-bottom: 2px;
    letter-spacing: 2px;
}

#gift-notification .countdown {
    font-size: 1.8em;
    font-weight: bold;
    line-height: 1;
}

#victory-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.victory-text {
    font-size: 5em;
    color: gold;
    text-shadow: 0 0 20px gold;
    animation: victoryPulse 1s ease-in-out infinite;
    text-align: center;
    font-family: 'Courier New', monospace;
    letter-spacing: 4px;
}

.victory-player {
    font-size: 8em;
    margin: 20px 0;
    background: linear-gradient(45deg, #ff0, #fa0, #f70, #f00);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 30px rgba(255, 200, 0, 0.5);
    animation: victoryGlow 2s ease-in-out infinite;
}

@keyframes victoryPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes victoryGlow {
    0% { filter: brightness(1) blur(0); }
    50% { filter: brightness(1.5) blur(4px); }
    100% { filter: brightness(1) blur(0); }
}

#control-area.single-player {
    justify-content: center;
}

#control-area.single-player .player-area {
    flex: none;
    width: 100%;
    justify-content: center;
}

#board-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    pointer-events: none;
}

.overlay-text {
    font-size: 4em;
    color: #0ff;
    text-shadow: 0 0 20px #0ff;
    animation: overlayPulse 0.5s ease-in-out;
    font-family: 'Courier New', monospace;
    letter-spacing: 4px;
}

@keyframes overlayPulse {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.tile.dev-mode {
    transform-style: preserve-3d;
}

.tile.dev-mode .dev-indicator {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotateY(180deg);
    opacity: 0.7;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.tile.dev-mode.face-down .dev-indicator {
    transform: translate(-50%, -50%) rotateY(0deg);
}

.tile.dev-mode::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: white;
    backface-visibility: hidden;
    transform: rotateY(180deg);
}

.tile.dev-mode.face-down::after {
    transform: rotateY(0deg);
}

.player-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

.player-score {
    color: #0ff;
    text-shadow: 0 0 10px #0ff;
    font-size: 1.4em;
    font-weight: bold;
    padding-left: 5px;
    padding-right: 15px;
    border-right: 2px solid rgba(0, 255, 255, 0.3);
    order: -1;
}

#countdown {
    font-size: 3.5em;
    color: #0ff;
    text-shadow: 0 0 15px #0ff;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.title-art {
    font-family: 'Courier New', monospace;
    font-size: 3.4vw;
    line-height: 1;
    white-space: pre;
    color: #0ff;
    text-shadow: 0 0 10px #0ff, 0 0 30px #0ff;
    margin-bottom: 40px;
    display: inline-block;
    text-align: left;
}

/* ── 2P Game Container (Landscape Columns) ── */

#game-container-2p {
    display: none;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    grid-template-areas:
        "header header header"
        "p1     board  p2";
    grid-template-columns: 110px 1fr 110px;
    grid-template-rows: auto 1fr;
    box-sizing: border-box;
}

.stage-header-2p {
    grid-area: header;
    text-align: center;
    color: #0ff;
    text-shadow: 0 0 10px #0ff;
    font-size: 1.2em;
    letter-spacing: 3px;
    padding: 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-bottom: 2px solid #0ff;
}

.stage-back-btn-2p {
    position: absolute;
    left: 10px;
    background: none;
    border: 2px solid #0ff;
    color: #0ff;
    font-family: 'Courier New', monospace;
    font-size: 0.6em;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
}

.stage-back-btn-2p:hover {
    background: #0ff;
    color: #000;
}

#game-board-2p {
    grid-area: board;
    position: relative;
    border-left: 2px solid #0ff;
    border-right: 2px solid #0ff;
    background: rgba(0, 255, 255, 0.05);
    overflow: hidden;
}

.player-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 5px;
    background: rgba(0, 255, 255, 0.03);
    position: relative;
    transition: opacity 0.3s ease;
}

#player1-area-2p {
    grid-area: p1;
}

#player2-area-2p {
    grid-area: p2;
}

.player-col.active-turn {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: inset 0 0 20px rgba(0, 255, 255, 0.15);
}

.player-col.inactive-turn {
    opacity: 0.3;
}

.player-col-label {
    color: #0ff;
    text-shadow: 0 0 8px #0ff;
    font-size: 1.2em;
    letter-spacing: 3px;
}

.player-col-score {
    color: #0ff;
    text-shadow: 0 0 10px #0ff;
    font-size: 2em;
    font-weight: bold;
}

.player-col .match-label {
    font-size: 0.9em;
}

.player-col .target-tile {
    width: 40px;
    height: 40px;
}

.player-timer {
    color: #0ff;
    text-shadow: 0 0 15px #0ff;
    font-size: 2.5em;
    font-weight: bold;
    min-height: 1.2em;
}

.stage-header-msg {
    letter-spacing: 6px;
    text-transform: uppercase;
}

.stage-header-msg.look {
    color: #0ff;
    text-shadow: 0 0 20px #0ff;
    animation: messageThrob 1s ease-in-out infinite;
}

.stage-header-msg.match {
    color: #0f0;
    text-shadow: 0 0 20px #0f0;
    animation: messageThrob 0.4s ease-in-out infinite;
}

/* ── Settings ── */

.settings-section {
    margin-bottom: 20px;
    text-align: left;
}

.settings-label {
    color: #0ff;
    text-shadow: 0 0 5px #0ff;
    font-size: 1em;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.settings-toggle {
    background: #000;
    color: #0f0;
    border: 2px solid #0f0;
    padding: 6px 20px;
    font-family: 'Courier New', monospace;
    font-size: 1em;
    cursor: pointer;
    border-radius: 4px;
    box-shadow: 0 0 8px #0f0;
    transition: all 0.2s;
}

.settings-toggle.off {
    color: #666;
    border-color: #444;
    box-shadow: none;
}

.settings-toggle:hover {
    opacity: 0.8;
}

.music-tracks {
    max-height: 300px;
    overflow-y: auto;
}

.music-track {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin: 4px 0;
    border: 1px solid #333;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.music-track:hover {
    border-color: #0ff;
    background: rgba(0, 255, 255, 0.05);
}

.music-track.selected {
    border-color: #0f0;
    background: rgba(0, 255, 0, 0.08);
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.2);
}

.music-track .track-name {
    color: #fff;
    flex: 1;
}

.music-track .track-bpm {
    color: #666;
    font-size: 0.85em;
}

/* ── Initials Entry ── */

#initials-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.initials-title {
    font-size: 2.5em;
    color: gold;
    text-shadow: 0 0 20px gold;
    letter-spacing: 6px;
    animation: victoryPulse 1s ease-in-out infinite;
}

.initials-score {
    font-size: 2em;
    color: #0ff;
    text-shadow: 0 0 15px #0ff;
}

.initials-prompt {
    font-size: 1em;
    color: #888;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.initials-slots {
    display: flex;
    gap: 15px;
}

.initial-slot-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.initial-slot {
    font-size: 3em;
    color: #0ff;
    text-shadow: 0 0 15px #0ff;
    border: 2px solid #0ff;
    width: 60px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    background: rgba(0, 255, 255, 0.05);
}

.initial-arrow {
    background: none;
    border: 1px solid #0ff;
    color: #0ff;
    font-size: 1.2em;
    width: 40px;
    height: 30px;
    cursor: pointer;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.initial-arrow:hover {
    background: #0ff;
    color: #000;
}

#initials-screen button:last-child {
    background: #000;
    color: #0f0;
    border: 2px solid #0f0;
    padding: 12px 40px;
    font-size: 1.2em;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    box-shadow: 0 0 10px #0f0;
    margin-top: 15px;
}

#initials-screen button:last-child:hover {
    background: #0f0;
    color: #000;
}

/* ── High Scores Table ── */

.hs-selector {
    margin-bottom: 20px;
}

.hs-table {
    text-align: left;
    width: 100%;
    max-width: 350px;
    margin: 0 auto 20px;
}

.hs-row {
    display: flex;
    padding: 6px 0;
    border-bottom: 1px solid #222;
    font-size: 1em;
}

.hs-rank {
    color: #666;
    width: 30px;
}

.hs-initials {
    color: #0ff;
    text-shadow: 0 0 5px #0ff;
    width: 60px;
    letter-spacing: 3px;
}

.hs-score {
    color: gold;
    flex: 1;
    text-align: right;
}

.hs-date {
    color: #444;
    width: 90px;
    text-align: right;
    font-size: 0.85em;
}

.hs-empty {
    color: #666;
    text-align: center;
    padding: 30px 0;
    font-style: italic;
}

/* ── Menu Screens ── */

.menu-screen {
    text-align: center;
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    background: #000;
    padding: 8em 1.5em;
    border-top: 2px solid #0ff;
    border-bottom: 2px solid #0ff;
    box-shadow: 0 -5px 20px #0ff, 0 5px 20px #0ff;
    max-height: 85vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.menu-title {
    font-size: 1.8em;
    color: #0ff;
    text-shadow: 0 0 15px #0ff;
    margin-bottom: 40px;
    letter-spacing: 4px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 30px;
}

.menu-screen button,
.menu-buttons button {
    background: #000;
    color: #0f0;
    border: 2px solid #0f0;
    padding: 12px 30px;
    font-size: 1.1em;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    box-shadow: 0 0 10px #0f0;
    transition: all 0.3s ease;
}

.menu-screen button:hover,
.menu-buttons button:hover {
    background: #0f0;
    color: #000;
    box-shadow: 0 0 20px #0f0;
}

.menu-options {
    margin-bottom: 20px;
}

.back-btn {
    margin-top: 30px;
    font-size: 0.9em !important;
    color: #0ff !important;
    border-color: #0ff !important;
    box-shadow: 0 0 5px #0ff !important;
}

.back-btn:hover {
    color: #000 !important;
    background: #0ff !important;
    box-shadow: 0 0 15px #0ff !important;
}

/* ── Ascent Stage List ── */

.stage-list {
    text-align: left;
    margin-bottom: 20px;
}

.stage-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 5px;
    border: 1px solid #333;
    gap: 10px;
    font-size: 0.9em;
}

.stage-number {
    color: #666;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.stage-name {
    flex: 1;
    color: #fff;
}

.stage-difficulty {
    color: #666;
    font-size: 0.8em;
    width: 70px;
    text-align: right;
}

.stage-stars {
    color: gold;
    text-shadow: 0 0 5px gold;
    width: 50px;
    text-align: center;
    letter-spacing: 2px;
}

.stage-status {
    width: 50px;
    text-align: center;
}

.stage-item.stage-completed {
    border-color: #0f04;
    background: rgba(0, 255, 0, 0.03);
}

.stage-item.stage-completed .stage-number {
    color: #0f0;
}

.stage-item.stage-current {
    border-color: #0ff;
    background: rgba(0, 255, 255, 0.08);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

.stage-item.stage-current .stage-number,
.stage-item.stage-current .stage-name {
    color: #0ff;
    text-shadow: 0 0 5px #0ff;
}

.stage-item.stage-current .stage-status {
    color: #0ff;
}

.stage-item.stage-locked {
    opacity: 0.35;
}

.ascent-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 10px;
}

/* ── Stage Complete Screen ── */

#stage-complete-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.stage-complete-title {
    font-size: 2.5em;
    color: #0ff;
    text-shadow: 0 0 20px #0ff;
    letter-spacing: 4px;
}

.stage-complete-name {
    font-size: 1.5em;
    color: #fff;
}

.stage-complete-stars {
    font-size: 3em;
    color: gold;
    text-shadow: 0 0 15px gold;
    letter-spacing: 8px;
}

.stage-complete-stats {
    font-size: 1.1em;
    color: #aaa;
    line-height: 1.8;
}

#stage-complete-screen button {
    background: #000;
    color: #0f0;
    border: 2px solid #0f0;
    padding: 12px 30px;
    font-size: 1.1em;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    box-shadow: 0 0 10px #0f0;
    transition: all 0.3s ease;
    margin-top: 10px;
}

#stage-complete-screen button:hover {
    background: #0f0;
    color: #000;
}

/* ── Ascent Complete Screen ── */

#ascent-complete-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.ascent-complete-title {
    font-size: 2.5em;
    color: gold;
    text-shadow: 0 0 20px gold;
    letter-spacing: 4px;
    animation: victoryPulse 1s ease-in-out infinite;
}

.ascent-total-score {
    font-size: 1.5em;
    color: #0ff;
    text-shadow: 0 0 10px #0ff;
}

.ascent-total-stars {
    font-size: 1.2em;
    color: gold;
    text-shadow: 0 0 5px gold;
}

.ascent-results {
    width: 100%;
    max-width: 350px;
    margin: 10px 0;
}

.ascent-result-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #222;
    font-size: 0.9em;
}

.result-name {
    color: #fff;
    flex: 1;
}

.result-stars {
    color: gold;
    width: 60px;
    text-align: center;
    letter-spacing: 2px;
}

.result-score {
    color: #0ff;
    width: 60px;
    text-align: right;
}

.ascent-complete-actions {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

#ascent-complete-screen button {
    background: #000;
    color: #0f0;
    border: 2px solid #0f0;
    padding: 12px 30px;
    font-size: 1em;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    box-shadow: 0 0 10px #0f0;
    transition: all 0.3s ease;
}

#ascent-complete-screen button:hover {
    background: #0f0;
    color: #000;
}

/* ── Mobile Responsive ── */

@media (max-width: 480px) {
    #splash-screen {
        width: 90vw;
        padding: 1em;
        box-sizing: border-box;
    }

    .title-art {
        margin-bottom: 15px;
    }

    .game-options {
        flex-wrap: wrap;
        gap: 8px;
    }

    .board-select {
        width: 100%;
        font-size: 0.95em;
        padding: 8px 10px;
    }

    .stage-complete-title,
    .ascent-complete-title {
        font-size: 1.8em;
    }

    .stage-complete-stars {
        font-size: 2em;
    }

    #control-area {
        height: auto;
        min-height: 60px;
        padding: 6px;
    }

    .player-area {
        padding: 6px;
        gap: 8px;
    }

    .player-label {
        font-size: 0.85em;
    }

    .player-score {
        font-size: 1.1em;
        padding-right: 8px;
    }

    .target-tile {
        width: 24px;
        height: 24px;
    }

    #countdown {
        font-size: 2.5em;
    }

    .victory-text {
        font-size: 3em;
    }

    .victory-player {
        font-size: 5em;
    }
}


@media (min-width: 481px) and (max-width: 820px) {
    #splash-screen {
        width: 85vw;
        max-width: 700px;
        padding: 1.5em;
        box-sizing: border-box;
    }

    .game-options {
        flex-wrap: wrap;
        gap: 10px;
    }

    .board-select {
        width: calc(50% - 10px);
    }

}

/* ── 2P Stage Select (Landscape) ── */

#mode-2p-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
}

.screen-2p-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
    gap: 30px;
}

.screen-2p-left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screen-2p-left .menu-title {
    font-size: 1.5em;
    margin: 0;
}

.screen-2p-center {
    flex: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stage-list-select {
    width: 100%;
    max-width: 300px;
    height: auto !important;
    max-height: 70vh;
    overflow-y: auto;
    padding: 0;
}

.stage-list-select option {
    padding: 8px 12px;
    cursor: pointer;
}

.stage-list-select option:checked {
    background: rgba(0, 255, 0, 0.2);
    color: #0f0;
}

.screen-2p-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.screen-2p-right button {
    background: #000;
    color: #0f0;
    border: 2px solid #0f0;
    padding: 12px 30px;
    font-size: 1.1em;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    box-shadow: 0 0 10px #0f0;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 180px;
}

.screen-2p-right button:hover {
    background: #0f0;
    color: #000;
}

/* ── Orientation Lock ── */

.rotate-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.rotate-icon {
    font-size: 4em;
    color: #0ff;
    text-shadow: 0 0 20px #0ff;
    animation: rotateHint 2s ease-in-out infinite;
}

.rotate-text {
    color: #0ff;
    text-shadow: 0 0 10px #0ff;
    font-size: 1.2em;
    letter-spacing: 3px;
    text-transform: uppercase;
}

@keyframes rotateHint {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}

/* Show overlay when landscape but portrait required */
@media (orientation: landscape) {
    body.require-portrait .rotate-overlay {
        display: flex;
    }
}

/* Show overlay when portrait but landscape required */
@media (orientation: portrait) {
    body.require-landscape .rotate-overlay {
        display: flex;
    }
}

/* ── Landscape Overrides ── */

@media (orientation: landscape) {
    .menu-screen {
        padding: 2em 1.5em;
        max-height: 95vh;
    }

    #splash-screen {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 40px;
    }

    .title-art {
        font-size: 1.4vw;
        margin-bottom: 0;
    }

    .splash-buttons {
        margin-top: 0;
        width: auto;
        min-width: 150px;
    }
}