:root {
    color-scheme: dark;
    --menu-gold: #ffd75a;
    --menu-shadow: #2b1600;
    --menu-stone: #d4d1ad;
    --menu-blue: #0b2741;
    --menu-deep: #02050a;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

.game-menu-body {
    background: var(--menu-deep);
    cursor: url("/game/assets/ui/cursors/arrow.png"), auto;
    font-family: "Courier New", monospace;
}

.game-title-screen {
    align-items: center;
    background:
        linear-gradient(rgba(2, 5, 10, 0.14), rgba(2, 5, 10, 0.34)),
        url("/game/assets/background.png") center / cover no-repeat;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
    padding: calc(var(--hud-topbar-height) + 1rem) clamp(1rem, 3vw, 2rem) clamp(1rem, 3vw, 2rem);
}

.game-title-stage {
    align-items: center;
    aspect-ratio: 320 / 200;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    image-rendering: pixelated;
    max-height: calc(100vh - 2rem);
    max-width: min(100vw - 2rem, 960px);
    position: relative;
    width: 100%;
}

.game-title-brand {
    margin-top: clamp(1.4rem, 6vw, 4.2rem);
    text-align: center;
    text-shadow:
        0 2px 0 var(--menu-shadow),
        2px 0 0 var(--menu-shadow),
        -2px 0 0 var(--menu-shadow),
        0 0 12px #000;
}

.game-title-kicker,
.game-title-subtitle {
    color: var(--menu-gold);
    display: block;
    font-size: clamp(0.72rem, 2.2vw, 1.15rem);
    font-weight: 700;
    line-height: 1.1;
    text-transform: uppercase;
}

.game-title-brand h1 {
    color: #ffb947;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.1rem, 8.6vw, 5.5rem);
    line-height: 0.9;
    margin: 0.12em 0 0.08em;
    text-shadow:
        0 3px 0 #7d3500,
        3px 0 0 #7d3500,
        -3px 0 0 #2a1000,
        0 0 18px #000;
}

.game-title-menu {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: clamp(0.28rem, 1.25vw, 0.74rem);
    margin-top: clamp(0.4rem, 2vw, 1.4rem);
    width: min(44rem, 70%);
}

.game-title-prompt {
    color: white;
    font-size: clamp(0.8rem, 2.2vw, 1.4rem);
    font-weight: 700;
    line-height: 1;
    margin: 0 0 0.08rem;
    text-shadow: 2px 2px 0 #000;
}


.game-title-empty {
    color: #f6e8b2;
    font-size: clamp(0.76rem, 1.8vw, 1rem);
    line-height: 1.25;
    margin: 0.2rem 0 0.4rem;
    max-width: 24rem;
    text-align: center;
    text-shadow: 2px 2px 0 #000;
}

.game-menu-form {
    display: flex;
    justify-content: center;
    margin: 0;
    width: 100%;
}

.game-menu-button {
    background:
        linear-gradient(#273a45, #18252d),
        url("/game/assets/ui/menu_button_1.png") center / 100% 100%;
    border: 2px solid var(--menu-stone);
    box-shadow:
        inset 0 0 0 2px #1a2730,
        0 0 0 2px #253846,
        0 4px 0 #05080c;
    color: #fff8cf;
    cursor: url("/game/assets/ui/cursors/arrow.png"), pointer;
    display: block;
    font-family: "Courier New", monospace;
    font-size: clamp(0.86rem, 2.25vw, 1.38rem);
    font-weight: 700;
    line-height: 1;
    min-height: clamp(2.1rem, 4.4vw, 3rem);
    padding: 0.28rem 1.25rem 0.34rem;
    text-align: center;
    text-shadow: 2px 2px 0 #000;
    width: min(100%, 22rem);
}

.game-menu-button:hover:not(:disabled),
.game-menu-button:focus-visible:not(:disabled) {
    background:
        linear-gradient(#375066, #20313d),
        url("/game/assets/ui/menu_button_2.png") center / 100% 100%;
    color: var(--menu-gold);
    outline: 2px solid var(--menu-gold);
    outline-offset: 3px;
}

.game-menu-button:active:not(:disabled) {
    transform: translateY(2px);
}

.game-menu-button-short {
    margin-top: clamp(0.28rem, 1.2vw, 0.78rem);
    width: min(100%, 13rem);
}

.game-menu-button-wide {
    margin-top: clamp(0.38rem, 1.6vw, 1rem);
}

.game-menu-button.is-disabled {
    cursor: url("/game/assets/ui/cursors/invalid_command.png"), not-allowed;
    filter: grayscale(0.65) brightness(0.72);
    opacity: 0.8;
}

.saved-game-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-height: clamp(9rem, 30vh, 16rem);
    overflow-y: auto;
    padding: 0.2rem;
    width: min(100%, 31rem);
}

.saved-game-row {
    background: rgba(12, 27, 38, 0.88);
    border: 2px solid var(--menu-stone);
    box-shadow:
        inset 0 0 0 2px #1a2730,
        0 3px 0 #05080c;
    color: #fff8cf;
    cursor: url("/game/assets/ui/cursors/arrow.png"), pointer;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    padding: 0.45rem 0.7rem;
    text-decoration: none;
    text-shadow: 2px 2px 0 #000;
}

.saved-game-row:hover,
.saved-game-row:focus-visible {
    border-color: var(--menu-gold);
    color: var(--menu-gold);
    outline: 2px solid var(--menu-gold);
    outline-offset: 2px;
}

.saved-game-title {
    font-size: clamp(0.78rem, 1.75vw, 1rem);
    font-weight: 700;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.saved-game-meta {
    color: #d9e4e7;
    font-size: clamp(0.62rem, 1.45vw, 0.82rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.game-title-footer {
    bottom: clamp(0.5rem, 2vw, 1rem);
    color: var(--menu-gold);
    font-size: clamp(0.58rem, 1.6vw, 0.9rem);
    font-weight: 700;
    left: clamp(0.5rem, 2vw, 1rem);
    line-height: 1;
    margin: 0;
    position: absolute;
    text-shadow: 2px 2px 0 #000;
}

@media (max-width: 560px) {
    .game-title-stage {
        aspect-ratio: 10 / 9;
    }

    .game-title-menu {
        width: min(88%, 22rem);
    }
}
