/*
 * v4-games.css — the two lab games in the v4 frame. The game art inside the
 * canvas stays hand-drawn; the card around it becomes an app window.
 */

.v4-game-main { max-width: 1240px; margin: 0 auto; padding-bottom: 110px; }
.v4-game-main > :not(.v4-page-head) { margin-left: 24px; margin-right: 24px; }

/* ---------- the game window ---------- */

.runner-card,
.stack-card {
    border: 0;
    border-radius: 20px;
    background: #fbfaf7;
    color: #18262b;
    box-shadow: 0 1px 0 #fff inset, 0 0 0 1px rgba(24, 38, 43, .12), 0 40px 70px -36px rgba(10, 30, 40, .55);
    overflow: hidden;
    transform: none;
    animation: v4-rise .7s var(--v4-ease) both;
}
.runner-card::before,
.runner-tape,
.stack-tape { display: none; }

.runner-toolbar,
.stack-toolbar {
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(24, 38, 43, .1);
    background: linear-gradient(180deg, #f4f2ec, #ebe7de);
}
.runner-toolbar h2,
.stack-toolbar h2 { margin: 2px 0 0; font: 600 1.2rem var(--v4-font); }
.runner-file,
.stack-file { position: relative; padding-left: 64px; color: #5f6d70; font: 500 .78rem var(--v4-mono); }
.runner-file::before,
.stack-file::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 11px;
    height: 11px;
    margin-top: -5.5px;
    border-radius: 50%;
    background: #ff5f57;
    box-shadow: 18px 0 0 #febc2e, 36px 0 0 #28c840;
}

.runner-scoreboard,
.stack-scoreboard { gap: 8px; color: #5f6d70; font: 500 .74rem var(--v4-mono); }
.runner-scoreboard span,
.stack-scoreboard span { padding: 5px 10px; border-radius: 999px; background: #fff; box-shadow: 0 0 0 1px rgba(24, 38, 43, .12); }
.runner-scoreboard strong,
.stack-scoreboard strong { color: #18262b; font-size: .86rem; }

.runner-overlay,
.stack-overlay { background: rgba(251, 250, 247, .9); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.runner-overlay p,
.stack-overlay p { font-family: var(--v4-font); }
.runner-overlay img,
.stack-overlay > img { border-radius: 50%; }
.runner-kicker,
.stack-kicker { color: #5f6d70; font: 600 .74rem var(--v4-mono) !important; }
#runner-overlay-title,
#stack-overlay-title { font-size: 1.3rem; font-weight: 600; }

.runner-identity input,
.stack-identity input {
    padding: 10px 14px;
    border: 0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 0 0 1.5px rgba(24, 38, 43, .2);
    color: #18262b;
    font: 500 .9rem var(--v4-mono);
}
.runner-identity input:focus,
.stack-identity input:focus { box-shadow: 0 0 0 2.5px var(--v4-yellow); }
.runner-identity label,
.stack-identity label { color: #5f6d70; font: 600 .72rem var(--v4-mono); }

/* every game button becomes a pill */
.runner-primary,
.runner-secondary,
.runner-controls button,
.runner-leaderboard button,
.stack-primary,
.stack-secondary,
.stack-controls button,
.stack-panel-heading button,
.stack-touch-controls button {
    border: 0;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(24, 38, 43, .16), 0 4px 10px -6px rgba(24, 38, 43, .3);
    color: #18262b;
    font: 600 .9rem var(--v4-font);
    transform: none;
}
.runner-primary,
.stack-primary {
    background: linear-gradient(180deg, #ffe39b, var(--v4-yellow) 55%, var(--v4-yellow-lo));
    box-shadow: 0 2px 0 rgba(255, 255, 255, .85) inset, 0 0 0 1.5px rgba(150, 85, 0, .45), 0 10px 20px -10px rgba(220, 140, 0, .7);
}
.runner-primary:hover,
.runner-secondary:hover,
.runner-controls button:hover,
.runner-leaderboard button:hover,
.stack-primary:hover,
.stack-secondary:hover,
.stack-controls button:hover,
.stack-panel-heading button:hover,
.stack-touch-controls button:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(24, 38, 43, .2), 0 8px 16px -8px rgba(24, 38, 43, .4); }
.runner-primary:disabled,
.stack-primary:disabled { opacity: .45; transform: none; box-shadow: 0 0 0 1px rgba(150, 85, 0, .3); }

.runner-controls,
.stack-controls { border-top: 1px solid rgba(24, 38, 43, .1); }
.runner-controls p,
.stack-controls p,
.runner-status,
.stack-status { color: #5f6d70; font: 500 .8rem/1.6 var(--v4-mono); }
.v4-page kbd { padding: 1px 6px; border-radius: 6px; background: #fff; box-shadow: 0 0 0 1px rgba(24, 38, 43, .18), 0 2px 0 rgba(24, 38, 43, .15); font: 500 .74rem var(--v4-mono); }

/* stack overflow's side panels */
.stack-side { border-radius: 14px; }

/* ---------- leaderboards + notes ---------- */

.runner-leaderboard,
.stack-leaderboard,
.stack-log-panel {
    border: 0;
    border-radius: 20px;
    background: #fbfaf7;
    color: #18262b;
    box-shadow: 0 0 0 1px rgba(24, 38, 43, .1), 0 24px 44px -28px rgba(10, 30, 40, .45);
    overflow: hidden;
}
.runner-leaderboard-heading,
.stack-panel-heading { border-bottom: 1px solid rgba(24, 38, 43, .1); }
.runner-leaderboard-heading span,
.stack-panel-heading span { color: #5f6d70; font: 600 .72rem var(--v4-mono); }
.runner-leaderboard-heading h2,
.stack-panel-heading h2 { font: 600 1.25rem var(--v4-font); }
#runner-leaderboard-list li,
#stack-leaderboard-list li { border-top: 1px solid rgba(24, 38, 43, .08); font-family: var(--v4-mono); font-size: .82rem; }
#runner-leaderboard-list .runner-rank { color: var(--v4-yellow-lo); }
#runner-personal-result:not(:empty) { border-top: 1px solid rgba(24, 38, 43, .1); background: #fff5d6; }

.runner-note {
    border-radius: 18px;
    background: #fff4b8;
    color: #18262b;
    box-shadow: 0 0 0 1px rgba(150, 85, 0, .2), 0 18px 34px -22px rgba(10, 30, 40, .45);
    transform: rotate(1deg);
}
.runner-note strong { color: #7a5a00; font-family: var(--v4-mono); }

@media (max-width: 760px) {
    .v4-game-main > :not(.v4-page-head) { margin-left: 12px; margin-right: 12px; }
    .runner-toolbar,
    .stack-toolbar { padding: 10px 12px; }
    .runner-file,
    .stack-file { padding-left: 0; }
    .runner-file::before,
    .stack-file::before { display: none; }
}

/* ---------- stack overflow: the console inside the window ---------- */

.stack-card { padding: 0 0 6px; background: #fbfaf7; }
.stack-toolbar { margin-bottom: 22px; padding-bottom: 12px; }
.stack-console { padding: 0 18px; }
.stack-controls,
.stack-touch-controls,
.stack-status { margin-left: 18px; margin-right: 18px; }

.stack-scoreboard { padding: 0; border: 0; background: none; box-shadow: none; color: #5f6d70; font: 500 .74rem var(--v4-mono); }
.stack-scoreboard strong { display: inline; margin: 0 0 0 4px; color: #18262b; font-size: .86rem; letter-spacing: 0; }

.stack-board-wrap { border: 0; border-radius: 14px; box-shadow: 0 0 0 1px rgba(24, 38, 43, .16), 0 18px 34px -22px rgba(10, 30, 40, .5); }

.stack-side {
    padding: 14px 12px;
    border: 0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(24, 38, 43, .12), 0 10px 20px -16px rgba(10, 30, 40, .4);
    transform: none;
}
.stack-side--hold,
.stack-side--next { transform: none; }
.stack-side > span,
.stack-incident-readout span { color: #5f6d70; font: 600 .72rem var(--v4-mono); }
.stack-incident-readout { border-top: 1px solid rgba(24, 38, 43, .1); }

.stack-kicker { padding: 3px 10px; border-radius: 999px; background: var(--v4-yellow-hi); color: #7a5a00 !important; }

/* leaderboard + incident log */
.stack-leaderboard,
.stack-log-panel { padding: 0; transform: none; }
.stack-panel-heading { padding: 14px 18px; }
#stack-leaderboard-status,
#stack-personal-result { margin: 0; padding: 12px 18px; color: #5f6d70; font: 500 .8rem/1.5 var(--v4-mono); }
#stack-leaderboard-list,
#stack-event-log { margin: 0; padding: 0 18px 12px; }
#stack-leaderboard-list li,
#stack-event-log li { border-bottom: 1px solid rgba(24, 38, 43, .08); font-family: var(--v4-mono); font-size: .8rem; }
/* a single "nobody yet" line spans the whole row */
#stack-leaderboard-list li:only-child:not(:has(strong)) { display: block; padding: 10px 3px; color: #5f6d70; }
.stack-legend { margin: 0 18px 16px; border-top: 1px solid rgba(24, 38, 43, .1); }
.stack-legend b { border-radius: 6px; }

#stack-event-log li span { color: #5f6d70; }
