/* Wobble-specific styles. Loaded after games.css. */

/* The canvas is sized in JS and must sit centred in the board frame. */
.stage-frame canvas { margin: 0 auto; }

/* The start card has to fit a 300px-high stage on a phone. */
#start-overlay { gap: 10px; padding: 14px 16px; }
#start-overlay h2 { font-size: 1.45rem; }
#start-overlay p { font-size: 0.88rem; line-height: 1.45; }
#start-overlay .overlay-note { font-size: 0.72rem; line-height: 1.4; }

.wobble-hud-medals .v { font-variant-numeric: tabular-nums; }

.hud-btn[aria-pressed="true"] {
    border-color: var(--emerald, #0e7a55);
    color: #0b5c40;
}

.hud-btn[hidden] { display: none; }

/* End-of-run card, laid over the stage once the marble has rolled off */
.wobble-result {
    position: absolute;
    inset: 10px;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    font-family: 'Inter', sans-serif;
    color: #f2ede2;
    background: rgba(11, 36, 29, 0.94);
    overflow: hidden;
    animation: wobble-card-in 260ms ease-out both;
}

.wobble-result[hidden] { display: none; }

@keyframes wobble-card-in {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.wobble-result-title {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(247, 243, 232, 0.7);
}

.wobble-result-time {
    margin: 0;
    font-size: clamp(2.2rem, 10vw, 3rem);
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: #f7f3e8;
}

.wobble-result-time span { font-size: 0.5em; font-weight: 600; opacity: 0.7; }

.wobble-result-best {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(242, 237, 226, 0.78);
    min-height: 1.4em;
}

.wobble-result-best.is-new { color: #e8c15c; font-weight: 700; }

.wobble-medals {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    width: 100%;
    max-width: 320px;
}

.wobble-medal {
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 5px 6px;
    border-radius: 8px;
    border: 1px solid rgba(242, 237, 226, 0.25);
    color: rgba(242, 237, 226, 0.5);
}

.wobble-medal.is-earned {
    color: #201703;
    background: #e8c15c;
    border-color: #e8c15c;
}

.wobble-medal.is-new {
    box-shadow: 0 0 0 3px rgba(232, 193, 92, 0.35);
}

.wobble-result-note {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(242, 237, 226, 0.6);
}

.wobble-again {
    margin-top: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 10px 26px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: #b97f1f;
    color: #201703;
    box-shadow: 0 6px 20px rgba(185, 127, 31, 0.45);
}

.wobble-again:focus-visible { outline: 3px solid #f7f3e8; outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
    .wobble-result { animation: none; }
    .wobble-again { transition: none; }
}
