.ski-page {
    display: flex;
    flex-direction: column;
    background: #e0edf4;
    box-sizing: border-box;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.ski-game {
    --ski-ink: #19384a;
    --ski-panel: #f6fbfd;
    width: 100%;
    max-width: 760px;
    min-height: 230px;
    flex: 1 0 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    box-sizing: border-box;
    padding: 8px 10px calc(6px + max(8px, env(safe-area-inset-bottom)));
    margin: 0 auto;
    color: var(--ski-ink);
}

.ski-game [hidden] { display: none; }

.ski-hud {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) 44px;
    align-items: center;
    gap: 8px;
    padding: 4px 7px 4px 12px;
    flex: none;
    background: var(--ski-panel);
    border: 1px solid #aac7d9;
    border-radius: 10px;
}

.ski-hud > div {
    font-size: 12px;
    line-height: 1.08;
    font-variant-numeric: tabular-nums;
}

.ski-hud strong {
    display: block;
    margin-top: 4px;
    font-size: clamp(13px, 4vw, 20px);
}

.ski-game button {
    border: 0;
    border-radius: 7px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.ski-game button:focus-visible, .ski-stage canvas:focus-visible {
    outline: 3px solid #d3922c;
    outline-offset: -3px;
}

.ski-pause {
    min-height: 44px;
    color: var(--ski-ink);
    background: #deedf5;
}

.ski-pause:disabled { opacity: .42; cursor: default; }

.ski-stage {
    position: relative;
    flex: 1 0 auto;
    min-height: 156px;
    overflow: hidden;
    background: #eef8fc;
    border: 1px solid #aac7d9;
    border-radius: 11px;
}

.ski-stage canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: pixelated;
}

.ski-stage.ski-running canvas {
    touch-action: none;
}

.ski-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-items: safe center;
    overflow-y: auto;
    padding: 8px;
    box-sizing: border-box;
    background: rgba(30, 67, 86, .19);
}

.ski-card {
    max-width: 310px;
    padding: 16px 18px;
    background: var(--ski-panel);
    border: 2px solid #729cb5;
    border-radius: 10px;
    box-shadow: 0 4px #a8c8d9;
    text-align: center;
}

.ski-card h1 {
    margin: 0;
    color: #214454;
    font-size: clamp(19px, 5vw, 28px);
    line-height: 1.1;
}

.ski-card p { margin: 7px 0 10px; font-size: 13px; line-height: 1.3; }

.ski-primary {
    min-width: 132px;
    min-height: 44px;
    padding: 5px 16px;
    color: white;
    background: #225f5e;
}

.ski-primary:disabled { opacity: .55; cursor: default; }

.ski-chase, .ski-boost {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 18px);
    width: max-content;
    padding: 5px 10px;
    border-radius: 5px;
    color: white;
    font-size: 12px;
    font-weight: 700;
    pointer-events: none;
}

.ski-chase { top: 9px; background: #623855; }
.ski-boost { bottom: 9px; background: #8c4c1d; }

.ski-storage { margin: 0; font-size: 12px; }

@media (max-height: 430px) {
    .ski-game { padding-top: 4px; gap: 4px; }
    .ski-card { padding: 9px 13px; }
    .ski-card p { margin: 5px 0 7px; }
}
