:root {
    --blue: #1d4ed8;
    --blue-dark: #1e3a8a;
    --red: #dc2626;
    --ink: #0f172a;
    --muted: #64748b;
    --paper: #f8fafc;
    --line: #e2e8f0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; }
[hidden] { display: none !important; }

.top {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: max(.75rem, env(safe-area-inset-top)) 1rem .75rem;
    background: var(--blue); color: #fff;
}
.brand { color: #fff; font-weight: 800; font-size: 1.15rem; text-decoration: none; }
.top nav { display: flex; gap: .25rem; }
.top nav a {
    color: #dbeafe; text-decoration: none; font-weight: 600;
    padding: .4rem .7rem; border-radius: 999px;
}
.top nav a.active { background: #fff; color: var(--blue); }

main { max-width: 720px; margin: 0 auto; padding: 1rem 1rem calc(2rem + env(safe-area-inset-bottom)); }

.progress { display: flex; justify-content: center; gap: .4rem; margin: .25rem 0 1rem; }
.progress span { width: .8rem; height: .8rem; border-radius: 50%; background: var(--line); }
.progress span.seen { background: var(--blue); }
.progress span.now { background: var(--red); transform: scale(1.25); }

/* 4:3 centre crop of the 16:9 clips: every throw stays inside it, and it is bigger on a phone. */
.stage { position: relative; border-radius: 1.25rem; overflow: hidden; background: #cbd5e1; aspect-ratio: 4 / 3; }
@media (max-width: 600px) {
    .stage { margin: 0 -1rem; border-radius: 0; }
}
.stage video { display: block; width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.finished .stage { display: none; }
.play-overlay {
    position: absolute; inset: 0; margin: auto; width: 5.5rem; height: 5.5rem;
    border: 0; border-radius: 50%; background: rgba(15, 23, 42, .7); color: #fff;
    font-size: 2.4rem; padding-left: .4rem; cursor: pointer;
}

.controls { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: 1.25rem; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: 3.5rem; padding: .8rem 1.5rem; border-radius: 1rem; border: 0;
    font: inherit; font-size: 1.2rem; font-weight: 800; cursor: pointer;
    touch-action: manipulation;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 4px 0 #991b1b; }
.btn-ghost { background: #fff; color: var(--blue-dark); box-shadow: inset 0 0 0 2px var(--line); }
.controls .btn-primary { flex: 1 1 14rem; }
.answer .controls { margin-top: 1rem; }
.answer .btn-ghost { flex: 1 1 40%; min-height: 3rem; padding: .6rem .8rem; font-size: 1.05rem; }
.answer .btn-primary { flex-basis: 100%; }
.icon { width: 1.4em; height: 1.4em; }

.answer, .done { text-align: center; margin-top: 1.25rem; }
.answer-name {
    margin: 0; font-size: clamp(2.2rem, 11vw, 3.6rem); font-weight: 900; line-height: 1.05;
    color: var(--blue-dark); animation: pop .35s ease-out;
}
.answer-hint { margin: .6rem auto 0; max-width: 30rem; color: var(--muted); font-size: 1.05rem; }
.done-title { font-size: 3rem; font-weight: 900; margin: 1rem 0 0; color: var(--red); }
.done .btn { margin-top: 1rem; }
.empty { text-align: center; color: var(--muted); margin-top: 3rem; }

@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.list-item {
    width: 100%; display: flex; align-items: center; gap: .9rem; padding: .6rem;
    border: 0; border-radius: 1rem; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
    font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.list-item img { width: 6.5rem; aspect-ratio: 16 / 9; object-fit: cover; border-radius: .6rem; flex: none; }
.list-item span { display: grid; gap: .2rem; flex: 1; }
.list-item strong { font-size: 1.2rem; color: var(--blue-dark); }
.list-item small { color: var(--muted); }
.list-item { text-decoration: none; }
.list-item .chevron { flex: none; color: var(--muted); font-size: 2rem; line-height: 1; padding-right: .3rem; }

.back {
    display: inline-block; margin: -.25rem 0 .75rem; padding: .4rem 0;
    color: var(--blue); font-weight: 700; font-size: 1.05rem; text-decoration: none;
}
.detail .answer-name { animation: none; }
.detail .answer .btn-ghost { flex: 1 1 40%; }
