/* Slope Rush - game-specific styles (loads after games.css) */

.sr-h1 { font-size: clamp(1.6rem, 6.5vw, 2.4rem); margin-bottom: 8px; }

.sr-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 10px;
    color: #666;
}

/* Playfield: fixed 2:3 shape, sized so the whole game fits the window */
.sr-wrap {
    max-width: clamp(300px, calc((100vh - 270px) * 0.667 + 28px), 460px);
    max-width: clamp(300px, calc((100svh - 270px) * 0.667 + 28px), 460px);
    margin-top: 16px;
}

.sr-wrap .stage-frame canvas {
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 3;
}

.sr-wrap .game-hud {
    flex-wrap: nowrap;
    gap: 10px;
    min-height: 52px;
}

.sr-wrap .hud-stat { min-width: 0; flex: 0 1 auto; }
.sr-wrap .hud-actions { gap: 6px; flex-shrink: 0; }
.sr-wrap .hud-btn { padding: 7px 11px; font-size: 0.78rem; white-space: nowrap; }
.sr-wrap .hud-btn[hidden] { display: none; }
.sr-wrap .hud-btn[aria-pressed="true"] { color: var(--ink-mut, #65786e); }

/* Overlays */
.sr-overlay {
    justify-content: safe center;
    gap: 10px;
    padding: 14px 12px;
    overflow-y: auto;
}

.sr-overlay h2 { font-size: clamp(1.4rem, 6vw, 1.9rem); }
.sr-overlay p { max-width: 34ch; }
.sr-overlay .sr-lede { font-size: 0.9rem; }

.sr-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: min(100%, 300px);
}

.sr-mode {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 8px;
    border-radius: 12px;
    border: 1.5px solid rgba(242, 237, 226, 0.22);
    background: rgba(242, 237, 226, 0.06);
    color: #f2ede2;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.sr-mode:hover { border-color: rgba(242, 237, 226, 0.5); }
.sr-mode[aria-pressed="true"] {
    border-color: #dfa947;
    background: rgba(223, 169, 71, 0.16);
}
.sr-mode:focus-visible,
.sr-skin:focus-visible,
.sr-link-btn:focus-visible { outline: 3px solid #f7f3e8; outline-offset: 2px; }

.sr-mode-name { font-size: 0.88rem; font-weight: 700; }
.sr-mode-sub { font-size: 0.72rem; color: rgba(242, 237, 226, 0.65); }

.sr-overlay .sr-goal {
    font-size: 0.8rem;
    font-weight: 600;
    color: #e8c15c;
    min-height: 1.2em;
}

.sr-skins {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.sr-skin {
    position: relative;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid rgba(242, 237, 226, 0.25);
    background: rgba(242, 237, 226, 0.06);
    cursor: pointer;
    display: grid;
    place-items: center;
}

.sr-skin.is-on { border-color: #e8c15c; box-shadow: 0 0 0 2px rgba(232, 193, 92, 0.3); }
.sr-skin.is-locked { cursor: default; opacity: 0.55; }
.sr-skin-dot { width: 20px; height: 20px; border-radius: 50%; display: block; }
.sr-skin-lock {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    color: #f2ede2;
}

.sr-overlay .sr-meta {
    font-size: 0.72rem;
    color: rgba(242, 237, 226, 0.6);
    min-height: 1.2em;
}

/* Result card */
.sr-result { gap: 8px; animation: sr-in 0.35s ease-out both; }
@keyframes sr-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

.sr-score {
    font-family: 'Inter', sans-serif;
    font-size: clamp(2.4rem, 11vw, 3.2rem);
    font-weight: 800;
    line-height: 1;
    color: #faf7f1;
    font-variant-numeric: tabular-nums;
}

.sr-best {
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(242, 237, 226, 0.75);
    min-height: 1.2em;
}
.sr-best.is-new { color: #e8c15c; font-size: 1rem; }

.sr-stats {
    display: flex;
    gap: 16px;
    justify-content: center;
}
.sr-stats div { display: flex; flex-direction: column; gap: 1px; }
.sr-stats .k {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(242, 237, 226, 0.55);
}
.sr-stats .v { font-size: 0.95rem; font-weight: 700; color: #faf7f1; }

.sr-earned {
    list-style: none;
    margin: 0;
    padding: 0;
    width: min(100%, 300px);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sr-earn {
    font-size: 0.76rem;
    line-height: 1.35;
    padding: 5px 9px;
    border-radius: 8px;
    background: rgba(242, 237, 226, 0.07);
    color: rgba(242, 237, 226, 0.85);
    text-align: left;
}
.sr-earn--goal { background: rgba(232, 193, 92, 0.18); color: #f6dfa0; }
.sr-earn--skin { background: rgba(91, 227, 176, 0.18); color: #bff5dd; }

.sr-link-btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    background: none;
    border: none;
    color: rgba(242, 237, 226, 0.7);
    text-decoration: underline;
    cursor: pointer;
    padding: 4px 8px;
}

.sr-overlay .play-btn { padding: 12px 34px; }

@media (max-height: 560px), (max-width: 380px) {
    .sr-overlay { gap: 7px; }
    .sr-score { font-size: 2.2rem; }
}

@media (prefers-reduced-motion: reduce) {
    .sr-result { animation: none; }
    .sr-mode, .sr-skin { transition: none; }
}

@media (max-height: 820px) {
    .sr-intro { display: none; }
    .sr-h1 { font-size: 1.5rem; margin-bottom: 0; }
}

@media (max-width: 520px) {
    .sr-wrap { margin-left: -16px; margin-right: -16px; max-width: none; }
}
