/* ==========================================================================
   Waiting, failing and empty states (Stage 12) - shared by every page.
   Rules: nothing appears for a wait under 250ms; jokes only on waiting and winning,
   plain words on money and failure; motion switched off for prefers-reduced-motion.
   Design: crease-loading-states.html.
   ========================================================================== */

/* ---------- Offline: a banner, not a blocking screen. Grey - a condition, not an error. ---------- */
.st-offline {
    position: sticky;
    top: 0;
    z-index: 1080;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    background: #3A3A3A;
    color: #fff;
    padding: 10px 16px;
    font-size: 14px;
    text-align: left;
}

    .st-offline[hidden] { display: none; }
    .st-offline b { font-weight: 700; }

/* ---------- Busy buttons keep their width, so nothing moves under a finger ---------- */
.st-busy { cursor: progress !important; opacity: .85; }

/* ---------- Empty states: dashed, a real heading, a next step. Never shimmering. ---------- */
.st-empty {
    border: 1.5px dashed var(--lav-line);
    border-radius: var(--r-card);
    background: #fff;
    padding: 20px 22px;
    margin-bottom: 16px;
}

    .st-empty h2, .st-empty h3 { font-size: 17px; font-weight: 700; color: var(--ink); margin: 0 0 4px; }
    .st-empty p { margin: 0 0 10px; color: var(--text); }

/* ---------- The booking loader: the crease is drawn, the ball pitches along it ---------- */
.st-loader {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(255, 255, 255, .96);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
}

    .st-loader[hidden] { display: none; }

.st-loader__title { font-size: 20px; font-weight: 700; color: var(--ink); margin: 0 0 22px; }

.st-pitch { position: relative; width: 220px; height: 70px; margin: 0 auto 18px; }

.st-crease {
    position: absolute;
    left: 0;
    bottom: 8px;
    height: 3px;
    width: 0;
    background: var(--lavender);
    border-radius: 2px;
    animation: st-draw 1.7s ease-out forwards;
}

.st-ball {
    position: absolute;
    left: 0;
    bottom: 11px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #B3262E;
    box-shadow: inset -3px -3px 0 rgba(0, 0, 0, .18);
    animation: st-run 1.7s linear infinite, st-bounce .85s cubic-bezier(.3, 0, .7, 1) infinite;
}

    .st-ball::after {
        content: "";
        position: absolute;
        left: 8px;
        top: 1px;
        width: 2px;
        height: 16px;
        background: rgba(255, 255, 255, .8);
        border-radius: 1px;
        animation: st-spin .85s linear infinite;
    }

.st-beat { font-size: 15px; color: var(--muted); min-height: 1.6em; margin: 0; }

@keyframes st-draw { to { width: 100%; } }
@keyframes st-run { from { left: 0; } to { left: calc(100% - 18px); } }
@keyframes st-bounce {
    0%, 100% { transform: translateY(0); }
    40% { transform: translateY(-34px); }
    70% { transform: translateY(-10px); }
}
@keyframes st-spin { to { transform: rotate(360deg); } }

/* ---------- Autosave proof beside a label ---------- */
.st-save { font-size: 12.5px; font-weight: 600; margin-left: 8px; transition: opacity .6s; }
.st-save--ok { color: var(--green); }
.st-save--err { color: var(--dan); }
.st-save--fade { opacity: 0; }

/* ---------- Error and not-found pages ---------- */
.st-page { background: var(--bg); padding: 64px 16px; min-height: 60vh; }
.st-page__card { max-width: 520px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r-card); padding: 30px 28px; text-align: center; }
.st-page__card h1 { font-size: 22px; font-weight: 700; color: var(--ink); margin: 0 0 8px; }
.st-page__card p { color: var(--text); }
.st-page__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.st-page__ref { font-size: 12px; color: var(--muted); margin-top: 16px; }

@media (prefers-reduced-motion: reduce) {
    .st-crease { animation: none; width: 100%; }
    .st-ball, .st-ball::after { animation: none; left: calc(50% - 9px); }
    .st-save { transition: none; }
}
