:root {
    color-scheme: dark;
}

html {
    min-width: 320px;
    min-height: 100%;
    background: #100b21;
    scroll-behavior: smooth;
}

body.arcade-site {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: #fff4df;
    background:
        radial-gradient(ellipse at 50% -12%, rgba(112, 46, 181, .42), transparent 48rem),
        linear-gradient(180deg, #130d2b 0%, #100b21 45%, #190b23 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

body.arcade-site::before {
    position: fixed;
    z-index: 10;
    inset: 0;
    pointer-events: none;
    opacity: .13;
    background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(205, 226, 255, .11) 4px, transparent 5px);
    content: "";
}

.new-arcade-game-page {
    width: min(100% - 24px, 760px);
    margin: 0 auto;
    padding: 22px 0 40px;
    color: #f4f0ff;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.new-arcade-game-page .arcade-game-heading {
    margin-bottom: 16px;
}

.new-arcade-game-page .arcade-game-heading h1 {
    color: #ffe17b;
    font-family: "ADJMN Arcade Display", "Courier New", monospace;
    font-size: clamp(1.5rem, 6vw, 2.2rem);
    line-height: 1.2;
    text-shadow: 0 3px 0 #743c8f, 0 0 15px rgba(239, 48, 73, .35);
}

.new-arcade-game-page .arcade-game-heading {
    text-align: center;
}

.new-arcade-game-page .arcade-game-tagline {
    max-width: 42ch;
    margin: 12px auto 0;
    color: #4ce8ff;
    font-size: .95rem;
    font-weight: 900;
    letter-spacing: .055em;
    line-height: 1.5;
    text-transform: uppercase;
}

.new-arcade-game-window {
    min-height: clamp(36rem, 72vh, 48rem) !important;
    justify-content: flex-start !important;
}

.new-arcade-game-window > .new-game-screen {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    min-height: 0;
}

.new-arcade-game-window > .golf-game-screen {
    justify-content: space-between;
    gap: 8px;
}

.new-game-hud {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: min(100%, 620px);
    margin: 0 auto;
    padding: 10px;
    border: 1px solid #65517f;
    border-radius: 8px;
    background: rgba(5, 7, 18, .9);
}

.new-game-hud > div {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 3px 7px;
}

.new-game-hud > div + div {
    border-left: 1px solid rgba(163, 147, 190, .28);
}

.new-game-hud span {
    color: #c9c1d9;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .07em;
}

.new-game-hud strong {
    color: #ffe17b;
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
}

.new-game-stage {
    position: relative;
    display: grid;
    place-items: center;
    width: min(100%, 600px);
    margin: 0 auto;
    overflow: hidden;
    border: 2px solid #755f99;
    border-radius: 8px;
    background: #0b0b1d;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, .48);
}

.new-game-stage canvas {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(50vh, 560px);
    object-fit: contain;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.groove-stage {
    width: min(100%, 460px);
}

.groove-stage canvas {
    aspect-ratio: 1;
}

.golf-stage {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    width: min(100%, 620px);
    padding: 8px;
    box-sizing: border-box;
    overflow: hidden;
}

.golf-stage .golf-hud,
.golf-stage .venue-sponsor,
.golf-stage .golf-meter {
    flex: 0 0 auto;
    margin: 0 auto;
}

.golf-stage .golf-hud,
.golf-stage .golf-meter {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.golf-course-stage {
    position: relative;
    width: 100%;
    overflow: hidden;
    border: 2px solid #755f99;
    border-radius: 8px;
    background: #005500;
}

.golf-course-stage canvas {
    width: 100%;
    aspect-ratio: 360 / 340;
    max-height: min(62vh, 620px);
}

.notes-stage {
    width: min(100%, 560px);
}

.notes-stage canvas {
    aspect-ratio: 1.5;
}

.new-game-start-overlay,
.new-game-hole-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: clamp(14px, 5vw, 28px);
    overflow-y: auto;
    border: 1px solid rgba(76, 232, 255, .75);
    background: rgba(12, 9, 29, .72);
    text-align: center;
    backdrop-filter: blur(2px);
}

.new-game-hole-overlay {
    z-index: 3;
    border-color: rgba(255, 225, 123, .8);
    background: rgba(12, 9, 29, .82);
}

.new-game-start-overlay[hidden],
.new-game-hole-overlay[hidden],
.new-game-start-overlay.hidden,
.new-game-hole-overlay.hidden {
    display: none !important;
}

.new-overlay-kicker {
    margin: 0;
    color: #4ce8ff;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .1em;
}

.new-game-start-overlay h2,
.new-game-hole-overlay h2 {
    margin: 0;
    color: #ffe17b;
    font-family: "ADJMN Arcade Display", "Courier New", monospace;
    font-size: clamp(1rem, 4vw, 1.35rem);
    line-height: 1.5;
    text-shadow: 0 2px 4px #080610;
}

.new-game-start-overlay p:not(.new-overlay-kicker),
.new-game-hole-overlay p:not(.new-overlay-kicker) {
    max-width: 45ch;
    margin: 0;
    color: #f2edf9;
    font-size: .95rem;
    line-height: 1.5;
    text-shadow: 0 2px 4px #080610;
}

.arcade-primary-button,
.new-game-touch-controls button {
    min-height: 46px;
    padding: 10px 18px;
    border: 2px solid #ff8097;
    border-radius: 6px;
    color: white;
    background: linear-gradient(180deg, #f44e6d, #bd1640);
    box-shadow: 0 4px 0 #72102c, 0 0 16px rgba(239, 48, 73, .24);
    font: 800 1rem/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
    cursor: pointer;
    touch-action: manipulation;
}

.arcade-primary-button:hover,
.new-game-touch-controls button:hover {
    filter: brightness(1.08);
}

.arcade-primary-button:active,
.new-game-touch-controls button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #72102c;
}

.new-game-touch-controls {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    width: min(100%, 460px);
    margin: 0 auto;
}

.new-game-touch-controls button {
    min-width: 0;
    min-height: 44px;
    padding: 8px;
}

.new-game-touch-controls button:focus-visible,
.arcade-primary-button:focus-visible {
    outline: 3px solid #ffe17b;
    outline-offset: 3px;
}

.venue-sponsor {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    padding: 6px 10px;
    border: 1px solid rgba(255, 225, 123, .6);
    border-radius: 4px;
    color: #ffe17b;
    background: rgba(9, 7, 20, .82);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-align: center;
}

.new-game-meter {
    width: min(100%, 620px);
    margin: 0 auto;
    padding: 8px 10px;
    border: 1px solid #51416b;
    border-radius: 6px;
    background: rgba(5, 7, 18, .75);
}

.new-meter-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    color: #ddd6eb;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .06em;
}

.new-meter-track {
    height: 10px;
    overflow: hidden;
    border: 1px solid #72628a;
    border-radius: 10px;
    background: #171323;
}

.new-meter-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff4371, #ffe17b);
    transition: width .08s linear;
}

.new-game-hole-overlay .hole-result-copy {
    font-size: 1.1rem;
    font-weight: 800;
}

.new-game-scoreboards {
    width: min(100% - 24px, 900px);
    margin: 26px auto 0;
}

.new-game-scoreboards .scoreboards-note {
    color: #d5cee3;
    text-align: center;
}

.new-arcade-game-page .arcade-game-notes {
    width: min(100% - 24px, 760px);
    margin: 18px auto 0;
    color: #e5dff0;
    font-size: 1rem;
    line-height: 1.6;
    text-align: center;
}

.new-arcade-game-page .arcade-game-description {
    margin: 0 auto 8px;
    color: #fff4df;
    font-size: 1.04rem;
    font-weight: 700;
}

.new-arcade-game-page .game-hall-link {
    display: flex;
    justify-content: center;
    margin: 18px auto 0;
}

.new-arcade-game-page .game-hall-link a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid #4ce8ff;
    border-radius: 6px;
    color: #4ce8ff;
    background: rgba(15, 12, 32, .8);
    font-weight: 800;
    text-decoration: none;
}

.new-game-scoreboards .scoreboards-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.new-game-scoreboards .scoreboard-period {
    min-width: 0;
}

.new-game-scoreboards .board-list {
    padding-left: 0;
}

.game-result-brand {
    margin: 0;
    color: #4ce8ff;
    font-size: .75rem;
    font-weight: 900;
    letter-spacing: .1em;
}

@media (max-width: 520px) {
    .new-arcade-game-page {
        padding-top: 18px;
    }

    .new-arcade-game-window {
        min-height: 36rem !important;
    }

    .new-game-hud {
        padding: 7px;
    }

    .new-game-hud > div {
        padding: 3px 5px;
    }

    .new-game-hud span {
        font-size: .61rem;
    }

    .new-game-hud strong {
        font-size: .94rem;
    }

    .new-game-scoreboards .scoreboards-columns {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .arcade-primary-button,
    .new-game-touch-controls button,
    .new-meter-fill {
        transition: none;
    }
}
