/* CSS controls page layout and buttons; game sprites and boards are drawn in JavaScript.
   Later phone-specific rules override desktop defaults, so rule order matters. */
/* Change this source to try another font; the Arcade alias is shared by all game text. */
@font-face
{
    font-family: "Arcade";
    src: url("assets/Fonts/bytebounce/ByteBounce.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap
}

:root
{
    font-synthesis: none
}

:root
{
    color-scheme: dark;
    --navy: #0d122b;
    --bg: #070713;
    --cyan: #39d9ea;
    --pink: #ed285e;
    --text: #f4efff;
    --muted: #aaa4bb;
    font-family: "Arcade", monospace;
    background: var(--bg);
    color: var(--text)
}

*
{
    box-sizing: border-box
}

body
{
    margin: 0
}

a
{
    color: inherit;
    text-decoration: none
}

button
{
    font: inherit;
    cursor: pointer
}

a:focus-visible,
button:focus-visible,
canvas:focus-visible
{
    outline: 3px solid #fff;
    outline-offset: 5px
}

button,
a
{
    touch-action: manipulation
}

.announcement
{
    background: #f9f8f6;
    color: #13162b;
    padding: 9px 15px;
    text-align: center;
    font: 400 10px "Arcade", monospace;
}

header
{
    background: var(--navy);
    padding: 0 36px
}

.masthead
{
    height: 90px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #767886
}

.brand
{
    text-align: center;
    font: 19px "Arcade", monospace;
}

.brand span
{
    display: block;
    color: #c9b78d;
    font: 9px "Arcade", monospace;
    margin-top: 9px
}



nav
{
    min-height: 49px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 25px;
    overflow: auto;
    white-space: nowrap
}

nav a
{
    font: 400 11px "Arcade", monospace;
    text-transform: uppercase;
    padding: 16px 0
}

nav a:hover
{
    color: var(--cyan)
}

main
{
    min-height: 650px;
    background: radial-gradient(ellipse at 50% 0, #170c32 0, transparent 65%);
    position: relative
}

main:after
{
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(0deg, transparent 0, transparent 3px, #00000024 3px, #00000024 4px);
    z-index: 2
}

.arcade-title
{
    text-align: center;
    padding: 75px 20px 49px
}

.arcade-title p
{
    font-size: 16.5px;
    color: var(--cyan);
    margin: 10px 0 27px
}

.arcade-title h1
{
    font: 46px "Arcade", monospace;
    text-shadow: 0 0 8px white, 0 0 22px #e25ab8;
    margin: 0 0 16px
}

.neon-rule
{
    height: 2px;
    max-width: 340px;
    margin: auto;
    background: linear-gradient(90deg, transparent, var(--pink), #fff, var(--cyan), transparent);
    box-shadow: 0 0 13px #e55ead
}

.arcade-title h2
{
    font-size: 21px;
    font-weight: 400;
    color: var(--muted);
    margin: 24px 0 0
}

/* The lobby uses a grid of game cards; smaller-screen rules reduce the column count. */
.game-grid
{
    max-width: 1020px;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    padding: 10px 25px 80px
}

.game-card
{
    background: linear-gradient(120deg, #201024, #091b26);
    border: 2px solid transparent;
    border-radius: 6px;
    background-clip: padding-box;
    box-shadow: -2px -2px 0 var(--pink), 2px 2px 0 var(--cyan), 0 0 16px #e92c581b;
    overflow: hidden;
    transition: transform .18s, box-shadow .18s;
    display: flex;
    flex-direction: column;
    text-align: center
}

.game-card:hover
{
    transform: translateY(-5px);
    box-shadow: -2px -2px 0 var(--pink), 2px 2px 0 var(--cyan), 0 0 25px #39d9ea44
}

.game-card h3
{
    font-size: 14px;
    font-weight: 400;
    margin: 0;
    padding: 20px 8px;
    text-transform: uppercase;
    min-height: 57px
}

.game-card canvas
{
    display: block;
    width: 100%;
    aspect-ratio: 10/7;
    height: auto;
    image-rendering: auto;
    border-block: 1px solid #66324f
}

.game-card p
{
    font-size: 17px;
    line-height: 1.4;
    color: #c0b8ce;
    margin: 19px 20px;
    min-height: 70px
}

.play-label
{
    color: var(--cyan);
    font-size: 14px;
    margin: 0 0 23px;
    display: block
}

.coming
{
    border: 1px dashed #564d65;
    box-shadow: none;
    background: #12101d;
    justify-content: center;
    min-height: 335px
}

.coming:hover
{
    transform: none;
    box-shadow: none
}

.coming .question
{
    font-size: 90px;
    color: #655875;
    text-shadow: 0 0 12px #a270ad
}

.coming p
{
    min-height: 0
}

.coming .play-label
{
    color: #857591
}

footer
{
    background: var(--navy);
    padding: 45px max(30px, calc((100% - 1120px)/2));
    display: flex;
    gap: 50px;
    justify-content: space-between;
    align-items: start;
    border-top: 1px solid #3e3654
}

footer h2
{
    font: 400 11px "Arcade", monospace;
}

footer p
{
    font: 14px/1.7 "Arcade", monospace;
    color: #b5b5c4
}

footer>a
{
    font-size: 11px;
    white-space: nowrap;
    padding-top: 10px
}

.skip
{
    position: absolute;
    top: -100px;
    z-index: 10;
    background: white;
    color: black;
    padding: 12px
}

.skip:focus
{
    top: 5px
}

/* Shared container for the title, canvas, toolbar and controls of the selected game. */
#player
{
    max-width: 900px;
    margin: auto;
    padding: 25px 25px 65px;
    position: relative;
    z-index: 3
}

.player-heading
{
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--muted)
}

.player-heading a
{
    font-size: 22px;
    color: var(--cyan)
}

#game-title
{
    text-align: center;
    font-size: 28px;
    text-transform: uppercase;
    margin: 24px 0 12px
}

#instructions
{
    text-align: center;
    color: #c3bcd0;
    font-size: 15px;
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto 22px
}

/* This wrapper anchors overlays above the canvas, including the iPhone Snake arrow buttons. */
.cabinet
{
    position: relative;
    border: 2px solid #777088;
    box-shadow: -2px -2px 0 var(--pink), 2px 2px 0 var(--cyan);
    background: #0b1022;
    overflow: hidden
}

#game
{
    display: block;
    width: 100%;
    height: auto;
    touch-action: none;
    image-rendering: auto
}

.game-overlay
{
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: #090c21ce;
    text-align: center;
    padding: 25px
}

.game-overlay h2
{
    font-size: clamp(20px, 4vw, 36px);
    text-transform: uppercase;
    text-shadow: 0 0 16px #d465cc
}

.game-overlay p
{
    line-height: 1.6;
    max-width: 430px;
    font-size: 16px;
    color: #d1c7dc
}

.game-overlay button,
.controls button
{
    background: #1c1530;
    color: #fff;
    border: 1px solid var(--cyan);
    padding: 14px 20px;
    box-shadow: 3px 3px 0 #af2657
}

.game-overlay button:hover,
.controls button:hover
{
    background: #352348
}

.toolbar
{
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    font-size: 12px
}

.toolbar button
{
    border: 1px solid #514762;
    background: #191429;
    color: white;
    padding: 12px
}

.controls
{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 19px
}

.controls button
{
    font-size: 13px;
    min-width: 70px
}

.controls button:disabled
{
    opacity: .4;
    cursor: default
}

.keyboard-note,
.prototype-note
{
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.6
}

.prototype-note
{
    font-size: 11px;
    margin-top: 20px
}

[hidden]
{
    display: none !important
}

@media(max-width:700px)
{
    header
    {
        padding: 0 18px
    }

    .masthead
    {
        height: 82px
    }

    .brand
    {
        font-size: 15px
    }

    .brand span
    {
        font-size: 8px
    }



    nav
    {
        justify-content: start;
        gap: 25px
    }

    .announcement
    {
        font-size: 8px;
        line-height: 1.5;
    }

    .arcade-title
    {
        padding: 48px 15px 35px
    }

    .game-grid
    {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 19px;
        padding-inline: 20px
    }

    .game-card p
    {
        font-size: 14px;
        margin: 15px 12px;
        min-height: 65px
    }

    .game-card h3
    {
        font-size: 12px
    }

    footer
    {
        flex-direction: column;
        gap: 20px
    }

    #player
    {
        padding-inline: 12px
    }

    .toolbar
    {
        font-size: 10px;
        gap: 5px
    }

    .toolbar button
    {
        font-size: 10px;
        padding: 11px 8px
    }

    .player-heading span
    {
        display: none
    }
}

@media(max-width:440px)
{
    .game-grid
    {
        grid-template-columns: 1fr;
        max-width: 340px
    }

    .game-card p
    {
        min-height: 0;
        font-size: 17px
    }

    .game-card h3
    {
        font-size: 14px
    }

    .coming
    {
        min-height: 300px
    }

    .game-overlay p
    {
        font-size: 13px
    }

    .game-overlay h2
    {
        margin: 8px
    }

    .game-overlay button
    {
        padding: 10px 15px
    }
}

@media(prefers-reduced-motion:reduce)
{
    .game-card
    {
        transition: none
    }
}

.game-card canvas
{
    aspect-ratio: 10/7
}

.toolbar
{
    flex-wrap: wrap
}

.toolbar button:disabled
{
    opacity: .55;
    cursor: default
}

.food-note
{
    font: 14px/1.6 "Arcade", monospace;
    color: #c9bfd5;
    max-width: 760px;
    margin: 22px auto
}

.food-note a
{
    color: #82e3ee;
    text-decoration: underline
}

.controls button
{
    min-height: 46px
}

.game-overlay p
{
    max-width: 580px
}

.controls
{
    position: relative;
    z-index: 4
}

.load-notice
{
    position: relative;
    z-index: 3;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    color: #ffdfa0;
    font: 16px/1.5 "Arcade", monospace;
}

/* Render text at its natural proportions; sprite sampling is handled inside the games. */
canvas
{
    font-stretch: normal
}

.game-card canvas
{
    flex: none;
    height: auto;
    aspect-ratio: 10/7
}

#game
{
    aspect-ratio: 10/7
}

/* Holding a gameplay control should charge a jump, not select its label. */
#game,
.controls,
.controls *,
.toolbar button,
.game-overlay button
{
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.controls,
.controls button
{
    touch-action: none
}

@media(max-width:700px)
{
    body[data-game] main
    {
        min-height: 0
    }

    #player
    {
        display: flex;
        flex-direction: column;
        padding: 12px 10px 28px;
        min-width: 0
    }

    #game-title
    {
        font-size: 26px;
        margin: 12px 0 8px
    }

    #instructions
    {
        font-size: 18px;
        line-height: 1.35;
        margin-bottom: 12px
    }

    .cabinet
    {
        width: 100%;
        flex: none
    }

    .controls
    {
        order: 1;
        margin-top: 12px;
        gap: 8px
    }

    .controls button
    {
        flex: 1 1 100px;
        min-height: 58px;
        font-size: 20px;
        padding: 14px 10px
    }

    .toolbar
    {
        order: 2;
        gap: 8px;
        margin-top: 12px
    }

    .toolbar button
    {
        flex: 1 1 auto;
        min-height: 48px;
        font-size: 18px;
        padding: 10px
    }

    #status
    {
        flex-basis: 100%;
        order: 1;
        text-align: center;
        font-size: 18px
    }

    .keyboard-note
    {
        order: 3;
        font-size: 18px;
        line-height: 1.4
    }

    .food-note
    {
        order: 4;
        font-size: 18px
    }

    .game-overlay
    {
        padding: 12px;
        overflow-y: auto
    }

    .game-overlay h2
    {
        font-size: 24px;
        margin: 0 0 8px
    }

    .game-overlay p
    {
        font-size: 17px;
        line-height: 1.2;
        margin: 0 0 10px
    }

    .game-overlay button
    {
        min-height: 44px;
        font-size: 20px;
        flex-shrink: 0
    }
}

/* Landscape phones keep the playfield and touch controls side by side. */
/* Portrait adjustments change the space around the canvas; script.js sets its logical dimensions. */
@media(max-width:700px) and (orientation:portrait)
{
    body[data-game="blocks"] #instructions
    {
        display: none
    }

    body[data-game="blocks"] .cabinet
    {
        width: min(100%, max(216px, calc((100svh - 300px)*.642857)));
        align-self: center;
    }

    body[data-game="blocks"] .controls
    {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr))
    }

    body[data-game="blocks"] .controls button
    {
        min-height: 52px;
        min-width: 0
    }

    body[data-game="blocks"] [data-action="down"]
    {
        grid-column: 1
    }

    body[data-game="blocks"] [data-action="act"]
    {
        grid-column: 2 / span 2
    }
}

@media(pointer:coarse) and (orientation:landscape) and (max-height:550px)
{

    body[data-game] footer
    {
        display: none
    }

    body[data-game] main
    {
        min-height: 0
    }

    #player
    {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 170px;
        grid-template-areas: "back back" "game title" "game controls" "game toolbar" "game hint" "note note";
        gap: 8px;
        max-width: calc(142.857svh + 130px);
        padding: 8px 10px;
    }

    .player-heading
    {
        grid-area: back
    }

    #game-title
    {
        grid-area: title;
        font-size: 22px;
        margin: 0
    }

    #instructions
    {
        display: none
    }

    .cabinet
    {
        grid-area: game;
        align-self: start;
        width: 100%
    }

    .controls
    {
        grid-area: controls;
        margin: 0;
        gap: 6px
    }

    .controls button
    {
        min-width: 0;
        min-height: 48px;
        padding: 8px;
        font-size: 18px;
        flex: 1 1 60px
    }

    .toolbar
    {
        grid-area: toolbar;
        margin: 0;
        gap: 4px
    }

    .toolbar button
    {
        min-height: 44px;
        font-size: 16px;
        padding: 8px;
        flex: 1 1 auto
    }

    #status
    {
        flex-basis: 100%;
        font-size: 16px;
        text-align: center
    }

    .keyboard-note
    {
        grid-area: hint;
        margin: 0;
        font-size: 16px
    }

    .food-note
    {
        grid-area: note
    }
}

/* Phone controls are scoped to detected small touch devices, leaving desktop layouts intact. */
body[data-phone="true"] footer
{
    display: none
}

body[data-phone="true"] main
{
    min-height: 0
}

body[data-phone="true"] #player
{
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    padding-top: max(8px, env(safe-area-inset-top))
}

body[data-phone="true"] #instructions
{
    display: none
}

body[data-phone="true"] #game-title
{
    font-size: 23px;
    margin: 8px 0 10px
}

body[data-phone="true"] .controls button
{
    min-width: 0;
    min-height: 52px
}

body[data-phone="true"] .controls button:active
{
    background: #493453;
    box-shadow: 1px 1px 0 #af2657;
    transform: translate(1px, 1px)
}

body[data-phone="true"] .toolbar button:disabled
{
    display: none
}

body[data-phone="true"] .keyboard-note
{
    font-size: 16px;
    margin: 10px 0
}

body[data-phone="true"][data-game="trail"] .controls
{
    display: grid;
    grid-template-columns: repeat(3, 64px);
    grid-template-rows: repeat(3, 52px);
    gap: 4px;
    align-self: center;
    justify-content: center
}

body[data-phone="true"][data-game="trail"] .controls button
{
    font-size: 30px;
    padding: 0
}

body[data-phone="true"][data-game="trail"] [data-action="up"]
{
    grid-column: 2;
    grid-row: 1
}

body[data-phone="true"][data-game="trail"] [data-action="left"]
{
    grid-column: 1;
    grid-row: 2
}

body[data-phone="true"][data-game="trail"] [data-action="right"]
{
    grid-column: 3;
    grid-row: 2
}

body[data-phone="true"][data-game="trail"] [data-action="down"]
{
    grid-column: 2;
    grid-row: 3
}

body[data-phone="true"][data-game="sort"] .controls
{
    display: grid;
    grid-template-columns: 1fr 1fr
}

body[data-phone="true"][data-game="sort"] [data-action="label"]
{
    grid-column: 1 / -1;
    min-height: 44px
}

body[data-phone="true"][data-game="tycoon"] .controls
{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr))
}

body[data-phone="true"][data-game="tycoon"] .controls button
{
    font-size: 16px;
    padding: 8px 4px
}

body[data-phone="true"][data-game="tycoon"] [data-action="lemonade"],
body[data-phone="true"][data-game="tycoon"] [data-action="cookie"],
body[data-phone="true"][data-game="tycoon"] [data-action="act"]
{
    display: none
}

body[data-phone="true"][data-game="flappy"] .controls button
{
    min-height: 68px;
    font-size: 19px
}

@media(orientation:landscape) and (max-height:550px)
{
    body[data-phone="true"][data-game="trail"] .controls
    {
        grid-template-columns: repeat(3, 48px);
        grid-template-rows: repeat(3, 44px)
    }

    body[data-phone="true"][data-game="trail"] .controls button
    {
        min-height: 44px
    }

    body[data-phone="true"][data-game="tycoon"] .controls
    {
        grid-template-columns: 1fr
    }

    body[data-phone="true"] .keyboard-note
    {
        display: none
    }

    body[data-phone="true"][data-game="blocks"] .controls
    {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr))
    }

    body[data-phone="true"][data-game="blocks"] [data-action="down"]
    {
        grid-column: 1
    }

    body[data-phone="true"][data-game="blocks"] [data-action="act"]
    {
        grid-column: 2 / span 2
    }
}

/* Portrait playfields use their own aspect ratio, without stretching the game art. */
@media(max-width:700px) and (orientation:portrait)
{
    body[data-phone="true"] .cabinet
    {
        width: min(100%, calc((100svh - 210px)*.75));
        align-self: center
    }

    body[data-phone="true"][data-game="trail"] .cabinet
    {
        width: min(100%, calc((100svh - 285px)*.75))
    }

    body[data-phone="true"][data-game="blocks"] .cabinet
    {
        width: min(100%, calc((100svh - 235px)*.642857))
    }

    body[data-phone="true"] #game-title
    {
        font-size: 20px;
        margin: 4px 0 6px
    }

    body[data-phone="true"] .controls
    {
        margin-top: 8px
    }

    body[data-phone="true"] .toolbar
    {
        gap: 6px;
        margin-top: 8px
    }

    body[data-phone="true"] .toolbar button
    {
        font-size: 16px;
        min-height: 44px;
        padding: 8px
    }

    body[data-phone="true"] #status
    {
        font-size: 14px
    }

    body[data-phone="true"] .keyboard-note
    {
        font-size: 14px;
        margin: 8px 0
    }
}

/* iPhone-only Snake: a near-edge-to-edge board and translucent thumb controls. */
.snake-edge-controls
{
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
    padding: 0 12px 18px
}

.snake-edge-group
{
    display: flex;
    flex-direction: column;
    gap: 8px
}

.snake-edge-controls button
{
    pointer-events: auto;
    width: 48px;
    height: 50px;
    padding: 0;
    border: 1px solid #b9f7ed85;
    border-radius: 8px;
    background: #102b3c66;
    color: #ffffffd9;
    font: 30px "Arcade", monospace;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none
}

.snake-edge-controls button:active
{
    background: #68cbb07a;
    border-color: #fff
}

body[data-iphone="true"][data-game="trail"] #controls
{
    display: none
}

body[data-iphone="true"][data-game="trail"] .game-overlay
{
    z-index: 5
}

@media(orientation:portrait) and (max-width:700px)
{
    body[data-iphone="true"][data-game="trail"] #player
    {
        padding-left: 0;
        padding-right: 0
    }

    body[data-iphone="true"][data-game="trail"] .cabinet
    {
        width: 100%;
        border-left: 0;
        border-right: 0;
        box-shadow: none
    }

    body[data-iphone="true"][data-game="trail"] .player-heading,
    body[data-iphone="true"][data-game="trail"] .toolbar
    {
        padding-inline: 12px
    }

    body[data-iphone="true"][data-game="trail"] .snake-edge-group
    {
        position: absolute;
        bottom: max(18px, calc(100% - 100svh + 120px))
    }

    body[data-iphone="true"][data-game="trail"] .snake-edge-group[data-side="left"]
    {
        left: max(12px, env(safe-area-inset-left))
    }

    body[data-iphone="true"][data-game="trail"] .snake-edge-group[data-side="right"]
    {
        right: max(12px, env(safe-area-inset-right))
    }

    body[data-iphone="true"][data-game="trail"] .keyboard-note
    {
        display: none
    }

    body[data-iphone="true"][data-game="trail"] #status
    {
        display: none
    }
}

/* Dedicated claw controls: analog joystick on the left, a large Drop button on the right. */
body[data-game="sort"] .controls,
body[data-phone="true"][data-game="sort"] .controls
{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 8px 18px;
}
.lunch-joystick
{
    position: relative;
    width: 138px;
    height: 138px;
    flex: 0 0 138px;
    border: 3px solid #7d99a6;
    border-radius: 50%;
    background: radial-gradient(circle, #355568 0 35%, #162c40 36% 100%);
    touch-action: none;
    user-select: none;
    cursor: grab;
}
.lunch-stick-arrows
{
    position: absolute;
    inset: 6px;
    text-align: center;
    white-space: pre;
    font: 25px/39px monospace;
    color: #b6d3dc;
    pointer-events: none;
}
.lunch-stick-knob
{
    position: absolute;
    left: calc(50% - 22px);
    top: calc(50% - 22px);
    width: 44px;
    height: 44px;
    border: 3px solid #ffe1a1;
    border-radius: 50%;
    background: #d2a65f;
    box-shadow: 0 5px 0 #172b3c;
    pointer-events: none;
}
body[data-game="sort"] .controls [data-action="act"]
{
    min-height: 82px;
    max-width: 210px;
    flex: 1;
    font-size: 22px;
    touch-action: none;
}
.lunch-joystick:focus-visible
{
    outline: 3px solid #ffe1a1;
    outline-offset: 4px;
}
@media (max-height: 500px) and (orientation: landscape)
{
    body[data-phone="true"][data-game="sort"] .controls
    {
        flex-direction: column;
        gap: 12px;
        padding: 0;
    }
}

/* Center the brand after removing the header links. */
.masthead
{
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}
.masthead .brand
{
    grid-column: 1;
}
.game-card h3
{
    font-size: clamp(20px, 2vw, 24px);
    line-height: 1.35;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Shared header typography and navigation across the homepage and every game. */
.announcement
{
    font-size: 17px;
    line-height: 1.5;
    padding: 12px 16px;
}
.masthead
{
    height: auto;
    min-height: 112px;
    padding: 20px 0;
}
.brand
{
    font-size: clamp(26px, 3.3vw, 36px);
    line-height: 1.2;
    color: #fff;
}
.brand span
{
    font-size: clamp(16px, 2vw, 20px);
    line-height: 1.4;
    color: #f3d9a4;
    margin-top: 8px;
}
/* Pixel-edged game buttons match the arcade palette and leave room to grow. */
header nav
{
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 20px;
    white-space: normal;
    overflow: visible;
    padding: 20px 8px 24px;
}
header nav a
{
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    max-width: 100%;
    font-size: clamp(17px, 1.8vw, 21px);
    line-height: 1.35;
    text-align: center;
    padding: 10px 16px;
    color: #f9f8f6;
    background: #17273c;
    border: 2px solid #688592;
    border-radius: 0;
    box-shadow: inset 0 2px 0 #ffffff12, 4px 4px 0 #050816;
    transform-origin: center;
    transition: transform 150ms ease-out, background-color 150ms ease-out,
        border-color 150ms ease-out, box-shadow 150ms ease-out;
}
@media (hover: hover) and (pointer: fine)
{
    header nav a:hover
    {
        z-index: 1;
        transform: translateY(-2px) scale(1.06);
        color: #fff3ce;
        background: #244052;
        border-color: var(--cyan);
        box-shadow: inset 0 2px 0 #ffffff20, 5px 6px 0 #050816;
    }
}
header nav a:focus-visible
{
    z-index: 1;
    transform: translateY(-2px) scale(1.06);
    color: #fff3ce;
    background: #244052;
    border-color: var(--cyan);
}
header nav a:active
{
    transform: translateY(2px);
    border-color: var(--cyan);
    box-shadow: inset 0 2px 0 #ffffff12, 2px 2px 0 #050816;
}
@media (prefers-reduced-motion: reduce)
{
    header nav a
    {
        transition: none;
    }
}

/* The winning prize uses the same pixel sprite as its savings milestone. */
#reward-preview
{
    display: block;
    width: 160px;
    height: 144px;
    max-width: 40vw;
    object-fit: contain;
    image-rendering: pixelated;
    margin: 4px auto;
}
#reward-preview[hidden]
{
    display: none;
}
/* Homepage information and reusable placeholder control art. */
.about-button, .feedback-link, .feedback-page button
{
    padding: 10px 18px;
    border: 2px solid #688592;
    background: #17273c;
    color: #fff3ce;
    font: inherit;
    font-size: 24px;
    box-shadow: 4px 4px 0 #050816;
}
.about-button[hidden] { display: none; }
.masthead { gap: 20px; }
.masthead:has(.about-button:not([hidden])) { grid-template-columns: 110px minmax(0, 1fr) 110px; }
.masthead:has(.about-button:not([hidden])) .brand { grid-column: 2; }
.about-button { grid-column: 3; grid-row: 1; justify-self: end; align-self: center; font-size: 20px; padding: 8px 12px; }
.arcade-title { padding: 32px 20px 28px; text-align: center; }
.arcade-title h1 { font-size: clamp(42px, 7vw, 64px); margin: 0 0 16px; line-height: 1; }
.arcade-title h2 { font-size: clamp(20px, 3vw, 28px); margin: 16px 0 0; }
.arcade-title .neon-rule { margin-left: auto; margin-right: auto; }
.social-links { display: flex; flex-direction: column; gap: 12px; font-size: 24px; }
footer .feedback-link { align-self: center; white-space: nowrap; }
.developer-credit
{
    flex: 1;
    min-width: 0;
    text-align: center;
    align-self: center;
}
.developer-credit h2
{
    font-size: 24px;
    line-height: 1.3;
    margin: 0 0 12px;
    color: #fff3ce;
}
.developer-credit p
{
    font-size: 20px;
    line-height: 1.6;
    margin: 0;
}
.developer-credit p span
{
    display: block;
    text-wrap: balance;
}
#about-dialog
{
    width: min(700px, calc(100% - 32px));
    max-height: 78dvh;
    overflow-y: auto;
    padding: clamp(18px, 3vw, 28px);
    border: 3px solid #688592;
    background: #101c30;
    color: #f4efff;
    box-shadow: 8px 8px 0 #050816;
    font-size: 24px;
    line-height: 1.45;
}
#about-dialog::backdrop { background: #030513d9; }
body:has(#about-dialog[open]) { overflow: hidden; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.dialog-heading h2 { margin: 0; color: #ffe398; }
#about-close { font-size: 32px; background: #233b50; color: white; border: 2px solid #688592; min-width: 44px; min-height: 44px; }
kbd, .hint-button
{
    display: inline-block;
    font: inherit;
    font-weight: bold;
    line-height: 1.1;
    padding: 2px 6px;
    margin: 2px 1px;
    border: 2px solid #8da7b1;
    background: #223d50;
    color: #fff1c9;
    box-shadow: 0 3px 0 #080e20;
    vertical-align: baseline;
}
.hint-button { border-radius: 7px; background: #42536d; }
.hint-joystick { display: inline-block; position: relative; width: 25px; height: 25px; border: 2px solid #7d99a6; border-radius: 50%; background: #162c40; vertical-align: middle; }
.hint-joystick span { position: absolute; width: 12px; height: 12px; left: 5px; top: 4px; border-radius: 50%; background: #d2a65f; border: 1px solid #ffe1a1; }
.feedback-page { width: min(740px, calc(100% - 32px)); margin: auto; padding: 40px 0 64px; font-size: 24px; line-height: 1.4; }
.feedback-page::after { display: none; }
.feedback-page h1 { color: #ffe398; }
.feedback-page form { display: grid; gap: 12px; }
.feedback-page input, .feedback-page textarea { width: 100%; padding: 12px; border: 2px solid #688592; background: #101c30; color: white; font: 20px/1.4 system-ui, sans-serif; }
.feedback-page textarea { resize: vertical; }
.feedback-page form button { justify-self: start; margin-top: 12px; }
@media (max-width: 600px)
{
    .about-button { font-size: 18px; padding: 6px 10px; }
    .masthead:has(.about-button:not([hidden])) { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
    .masthead:has(.about-button:not([hidden])) .brand { grid-column: 1; }
    .about-button { grid-column: 2; }
    footer .feedback-link { white-space: normal; }
}

/* Larger reading text, with scrolling available for long instructions on short screens. */
#instructions
{
    font-size: 22px;
    line-height: 1.5;
    max-width: 800px;
}
.game-overlay p
{
    font-size: 22px;
    line-height: 1.4;
}
.game-overlay
{
    overflow-y: auto;
    justify-content: safe center;
}
.game-overlay > *
{
    flex-shrink: 0;
}
.feedback-page + footer
{
    justify-content: center;
    align-items: center;
    text-align: center;
}
.feedback-page + footer > a
{
    font-size: 26px;
    line-height: 1.4;
    white-space: normal;
    padding: 12px;
}
@media (max-width: 600px)
{
    .game-overlay p
    {
        font-size: 20px;
        line-height: 1.3;
    }
}
