/* ═══════════════════════════════════════════════
   Very Long Boards — Styles
   ═══════════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --mc-back-color: rgba(255, 46, 156, 0.5);
    --mc-back-glow: 0 0 8px rgba(255, 46, 156, 0.95);
}

body {
    background: #0a0612;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Press Start 2P', monospace;
    overflow: hidden;
}


/* ── GAME CONTAINER ── */
#game-container {
    position: relative;
    width: 960px;
    height: 540px;
}

#renderCanvas {
    width: 100%;
    height: 100%;
    display: block;
    border: 2px solid #ff2e9c;
    box-shadow: 0 0 20px rgba(255, 46, 156, 0.3);
    outline: none;
    touch-action: none;
}

/* ── OVERLAYS ── */
.overlay {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10, 6, 18, 0.85);
    z-index: 10;
}

.overlay.active {
    display: flex;
}

/* ── TITLE SCREEN ── */
.title-text {
    text-align: center;
    margin-bottom: 40px;
}

.title-main {
    font-size: 28px;
    color: #ff2e9c;
    text-shadow: 0 0 20px rgba(255, 46, 156, 0.6);
    line-height: 1.4;
    margin-bottom: 16px;
}

.title-sub {
    font-size: 10px;
    color: #b537f2;
    letter-spacing: 0.15em;
}

.title-carl {
    font-size: 8px;
    color: #888;
    margin-top: 12px;
    letter-spacing: 0.1em;
}

.insert-coin {
    font-size: 10px;
    color: #ffe03a;
    letter-spacing: 0.15em;
    text-shadow: 0 0 12px rgba(255, 224, 58, 0.8);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* ── CHARACTER SELECT ── */
.cs-title {
    font-size: 14px;
    color: #ff2e9c;
    margin-bottom: 30px;
    text-shadow: 0 0 12px rgba(255, 46, 156, 0.5);
}

.cs-cards {
    display: flex;
    gap: 16px;
    margin-bottom: 30px;
}

.cs-card {
    width: 140px;
    padding: 16px;
    border: 2px solid #333;
    background: #111;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cs-card.selected {
    border-color: #ff2e9c;
    box-shadow: 0 0 16px rgba(255, 46, 156, 0.4);
}

.cs-preview {
    width: 64px;
    height: 80px;
    image-rendering: pixelated;
    margin-bottom: 12px;
}

.cs-name {
    font-size: 8px;
    color: #ffe03a;
    margin-bottom: 4px;
    letter-spacing: 0.05em;
}

.cs-desc {
    font-size: 6px;
    color: #888;
    margin-bottom: 8px;
}

/* ── Stat bars, shared by both select screens ──
   Built by js/statbars.js from the multipliers in js/config.js. Stacked rows
   rather than one 5px line: four stats on a 140px card is unreadable inline,
   and the bar has to be comparable at a glance to be worth drawing. */
.stat-bars {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 8px;
}

.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 6px;
    line-height: 1;
}

.stat-label {
    color: #666;
    letter-spacing: 0.08em;
}

.stat-bar {
    color: #39ff6e;
    letter-spacing: 0.12em;
    white-space: nowrap;
}

.cs-card.selected .stat-bar,
.bs-card.selected .stat-bar {
    color: #ff2e9c;
}

.cs-hint {
    font-size: 8px;
    color: #666;
    animation: blink 1s step-end infinite;
}

/* ── BOARD SELECT ── */
.bs-title {
    font-size: 14px;
    color: #ff2e9c;
    margin-bottom: 30px;
    text-shadow: 0 0 12px rgba(255, 46, 156, 0.5);
}

.bs-cards {
    display: flex;
    gap: 16px;
    margin-bottom: 30px;
}

.bs-card {
    width: 150px;
    padding: 16px;
    border: 2px solid #333;
    background: #111;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.bs-card.selected {
    border-color: #ff2e9c;
    box-shadow: 0 0 16px rgba(255, 46, 156, 0.4);
}

.bs-preview {
    width: 100px;
    height: 40px;
    image-rendering: pixelated;
    margin-bottom: 12px;
}

.bs-name {
    font-size: 8px;
    color: #ffe03a;
    margin-bottom: 4px;
    letter-spacing: 0.05em;
}

.bs-desc {
    font-size: 6px;
    color: #888;
    margin-bottom: 8px;
}


/* ── Leaderboard ── */
.go-leaderboard {
    margin-top: 18px;
    width: 220px;
}

.lb-title {
    font-size: 8px;
    color: #39ff6e;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
    text-shadow: 0 0 8px rgba(57, 255, 110, 0.4);
}

.lb-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* Ten rows at 7px, so a full board never pushes the actions off screen. */
    max-height: 132px;
    overflow-y: auto;
}

.lb-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 7px;
    color: #999;
}

.lb-rank {
    width: 16px;
    text-align: right;
    color: #666;
}

.lb-initials {
    width: 32px;
    letter-spacing: 0.1em;
}

.lb-score {
    flex: 1;
    text-align: right;
    color: #ffe03a;
}

.lb-row.lb-new {
    color: #ff2e9c;
}

.lb-row.lb-new .lb-score,
.lb-row.lb-new .lb-rank {
    color: #ff2e9c;
}

.lb-empty {
    font-size: 7px;
    color: #555;
}

/* Says where an ordinary ranked run landed, in place of asking. */
.go-ranked {
    margin-top: 10px;
    font-size: 7px;
    color: #39ff6e;
    letter-spacing: 0.08em;
    min-height: 7px;
}

/* ── Initials entry ── */
/* Shown by adding .active rather than by setting an inline display, so the
   stylesheet keeps ownership of the layout: an inline display:block here beat
   the flex column and put the label beside the field. */
.go-initials {
    display: none;
}

.go-initials.active {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.go-initials label {
    font-size: 7px;
    color: #39ff6e;
    letter-spacing: 0.08em;
}

.go-initials input {
    font-family: inherit;
    font-size: 14px;
    width: 90px;
    padding: 6px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: #ffe03a;
    background: #0a0612;
    border: 2px solid #ff2e9c;
    outline: none;
}

/* ── HUD ── */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px;
    pointer-events: none;
    z-index: 5;
}

.hud-score, .hud-speed, .hud-dist {
    font-size: 8px;
    color: #ffe03a;
    text-shadow: 0 0 8px rgba(255, 224, 58, 0.5);
    margin-bottom: 4px;
}

.hud-trick {
    font-size: 14px;
    color: #ff2e9c;
    text-shadow: 0 0 16px rgba(255, 46, 156, 0.8);
    text-align: center;
    animation: pulse 0.3s ease infinite;
}

@keyframes pulse {
    50% { transform: scale(1.2); }
}

/* ── GAME OVER ── */
.go-title {
    font-size: 24px;
    color: #ff2e9c;
    text-shadow: 0 0 20px rgba(255, 46, 156, 0.6);
    margin-bottom: 8px;
}

.go-cause {
    font-size: 12px;
    color: #ff6b35;
    margin-bottom: 16px;
    letter-spacing: 0.1em;
}

.go-score, .go-dist, .go-best {
    font-size: 10px;
    color: #ffe03a;
    margin-bottom: 8px;
    text-shadow: 0 0 8px rgba(255, 224, 58, 0.4);
}

.go-best {
    color: #ff2e9c;
    margin-top: 12px;
}

.go-actions {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.go-action {
    font-size: 9px;
    color: #888;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: color 0.2s;
}

.go-action:hover {
    color: #ffe03a;
}

.go-key {
    display: inline-block;
    width: 60px;
    padding: 4px 8px;
    border: 1px solid #555;
    background: #222;
    color: #ffe03a;
    font-size: 7px;
    text-align: center;
    margin-right: 8px;
    vertical-align: middle;
}

/* ── PAUSE ── */
.pause-text {
    font-size: 20px;
    color: #b537f2;
    margin-bottom: 20px;
    text-shadow: 0 0 16px rgba(181, 55, 242, 0.6);
}

/* ── MOBILE ── */
@media (max-width: 1000px) {
    #game-container {
        width: 100vw;
        height: calc(100vw * 0.5625);
    }
    
    #renderCanvas {
        border: none;
    }
    
    .cs-cards {
        flex-direction: column;
    }
    
    .cs-card {
        width: 200px;
    }

    .bs-cards {
        flex-direction: column;
    }

    .bs-card {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .title-main { font-size: 20px; }
    .cs-title { font-size: 12px; }
}
