
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    background: #071426;
    color: #fff;
    font-family: 'Trebuchet MS', sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-shell {
    width: min(1100px, 100%);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.game-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

    .game-logo > span {
        font-size: 42px;
    }

    .game-logo h1 {
        font-size: 22px;
        margin: 0;
        letter-spacing: 2px;
    }

    .game-logo small {
        color: #e4b94f;
        font-size: 10px;
        letter-spacing: 3px;
    }

.game-best {
    text-align: right;
    color: #a8b8ce;
    font-size: 11px;
    letter-spacing: 2px;
}

    .game-best strong {
        display: block;
        color: #f6ca58;
        font-size: 23px;
        margin-top: 4px;
    }

.game-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 3px solid #344e69;
    border-radius: 10px;
    background: #10294a;
    box-shadow: 0 15px 60px #0009;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

.hud {
    position: absolute;
    top: 18px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.hud-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-shadow: 2px 2px #000;
}

    .hud-item small {
        color: #c5d6ec;
        font-size: 10px;
        letter-spacing: 2px;
    }

    .hud-item strong {
        font-size: 25px;
        color: #ffd45e;
    }

.game-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #071426b8;
    z-index: 5;
}

.hidden {
    display: none;
}

.overlay-panel {
    text-align: center;
    width: min(420px, 90%);
    padding: 20px;
}

.big-santa {
    font-size: 35px;
    margin-bottom: 5px;
}

.eyebrow {
    color: #f4c451;
    font-size: 10px;
    letter-spacing: 4px;
}

.overlay-panel h2 {
    font-size: clamp(32px, 6vw, 52px);
    line-height: 1;
    margin: 15px 0;
    text-shadow: 3px 3px #7c2525;
}

.overlay-panel > p:not(.eyebrow) {
    color: #d0d9e7;
    font-size: 14px;
}

.instructions {
    margin: 25px 0;
    color: #dce6f4;
    font-size: 12px;
}

    .instructions span {
        display: inline-block;
        background: #273f5b;
        border: 1px solid #63809f;
        border-radius: 5px;
        padding: 8px;
        margin: 0 6px 0 12px;
        color: #ffd45e;
        font-weight: bold;
    }

button {
    border: 0;
    background: #c52e35;
    color: white;
    padding: 16px 35px;
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 2px;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 5px #791d25;
    transition: transform .1s;
}

    button:hover {
        background: #e13c43;
        transform: translateY(-2px);
    }

    button:active {
        transform: translateY(3px);
        box-shadow: 0 2px #791d25;
    }

.result-score {
    margin: 25px 0;
}

    .result-score span {
        display: block;
        color: #a8b8ce;
        font-size: 11px;
        letter-spacing: 3px;
    }

    .result-score strong {
        display: block;
        font-size: 45px;
        color: #ffd45e;
        margin-top: 5px;
    }

.game-footer {
    display: flex;
    justify-content: space-between;
    color: #91a5bd;
    font-size: 10px;
    letter-spacing: 2px;
    margin-top: 15px;
}

@media(max-width: 600px) {
    body {
        padding: 8px;
    }

    .game-logo h1 {
        font-size: 15px;
    }

    .game-logo > span {
        font-size: 30px;
    }

    .game-logo small {
        font-size: 8px;
        letter-spacing: 1px;
    }

    .game-best {
        font-size: 9px;
    }

        .game-best strong {
            font-size: 18px;
        }

    .game-footer {
        font-size: 8px;
        letter-spacing: 0;
    }
}
.start-panel {
    width: min(900px, 96%);
    max-height: 95%;
    overflow-y: auto;
}

.start-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 30px;
    align-items: center;
    text-align: center;
}

.start-content {
    min-width: 0;
}

.leaderboard-panel {
    background: rgba(7, 20, 38, 0.85);
    border: 1px solid #526c88;
    border-radius: 8px;
    padding: 20px;
}

    .leaderboard-panel h3 {
        color: #ffd45e;
        margin: 8px 0 20px;
        letter-spacing: 2px;
    }

.leaderboard-row {
    display: grid;
    grid-template-columns: 25px 1fr 65px 48px;
    gap: 8px;
    align-items: center;
    padding: 9px 4px;
    border-bottom: 1px solid #344e69;
    font-size: 12px;
    text-align: left;
}

.leaderboard-rank {
    color: #e4b94f;
}

.leaderboard-score {
    text-align: right;
    color: #ffd45e;
    font-weight: bold;
}

.leaderboard-time {
    text-align: right;
    color: #a8b8ce;
    font-size: 10px;
}

.empty-leaderboard {
    color: #a8b8ce;
    font-size: 13px;
}

.score-entry {
    margin: 18px 0;
}

    .score-entry h3 {
        color: #ffd45e;
    }

    .score-entry input {
        display: block;
        width: 120px;
        margin: 15px auto;
        padding: 12px;
        background: #142c47;
        border: 2px solid #63809f;
        border-radius: 5px;
        color: white;
        text-align: center;
        font-size: 25px;
        font-weight: bold;
        letter-spacing: 6px;
        text-transform: uppercase;
    }

    .score-entry button {
        padding: 12px 22px;
        font-size: 12px;
    }

#scoreSubmitMessage {
    color: #ffd45e;
    font-size: 12px;
}

@media(max-width: 750px) {
    .start-layout {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .start-content .big-santa {
        font-size: 40px;
    }

    .start-content h2 {
        font-size: 32px;
    }

    .leaderboard-panel {
        padding: 12px;
    }
}
/* Game Over Layout */
.game-over-panel {
    width: min(760px, 94%);
    max-height: 95%;
    overflow-y: auto;
    padding: 30px;
}

.game-over-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 30px;
    align-items: center;
}

.game-over-left {
    text-align: center;
}

.game-over-right {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 25px;
    background: rgba(7, 20, 38, 0.65);
    border: 1px solid #526c88;
    border-radius: 8px;
    min-height: 230px;
}

.game-over-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 20px 0;
}

    .game-over-stats .result-score {
        margin: 0;
    }

.game-over-right .score-entry {
    margin: 0;
    width: 100%;
}

    .game-over-right .score-entry input {
        max-width: 100%;
    }

    .game-over-right .score-entry button {
        margin-top: 8px;
    }

@media (max-width: 650px) {
    .game-over-panel {
        padding: 18px;
    }

    .game-over-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .game-over-right {
        min-height: 180px;
        padding: 18px;
    }

    .game-over-stats {
        margin: 12px 0;
    }
}

/* Loud Crowd Media Branding */

.presented-by-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    margin-right: 35px;
}

    .presented-by-header span,
    .presented-by span,
    .christmas-signoff span {
        color: #a8b8ce;
        font-size: 8px;
        letter-spacing: 2px;
    }

    .presented-by-header img {
        width: 38px;
        height: 50px;
        object-fit: contain;
    }

.presented-by {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.15);
}

    .presented-by img {
        width: 38px;
        height: 50px;
        object-fit: contain;
    }

.christmas-signoff {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.15);
    text-align: center;
}

    .christmas-signoff p {
        color: #ffd45e;
        font-weight: bold;
        letter-spacing: 3px;
        margin-bottom: 5px;
    }

    .christmas-signoff img {
        display: block;
        width: 55px;
        height: 72px;
        object-fit: contain;
        margin: 8px auto 0;
    }

.instructions div {
    margin: 5px 0px;
}

/* Loading Screen */

.loading-panel {
    width: min(420px, 90%);
    text-align: center;
    padding: 25px;
}

.loading-logo {
    width: 55px;
    height: 70px;
    object-fit: contain;
    margin-bottom: 10px;
}

.loading-panel h2 {
    font-size: 25px;
    letter-spacing: 3px;
    margin: 5px 0;
}

.loading-panel h3 {
    font-size: 13px;
    letter-spacing: 2px;
    color: #ffd45e;
    margin: 15px 0;
}

.loading-santa {
    font-size: 55px;
    margin: 15px 0;
}

.loading-bar {
    width: 100%;
    height: 12px;
    background: #263b59;
    border-radius: 20px;
    overflow: hidden;
    margin-top: 20px;
}

#loadingProgress {
    width: 0%;
    height: 100%;
    background: #f4c451;
    border-radius: 20px;
    transition: width 0.2s ease;
}

#loadingPercentage {
    color: #a8b8ce;
    font-size: 12px;
    margin-top: 8px;
}
#loadingScreen {
    z-index: 20;
}