/* Live views (host, player, overlay) */
.sm-question { margin: 1rem 0; }
.sm-qtext { font-size: 1.6rem; font-weight: 600; margin-bottom: 1rem; }
.sm-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .75rem; }
.sm-option { display: flex; align-items: center; gap: .75rem; padding: .9rem 1rem; border: 2px solid #ced4da; border-radius: .75rem; background: #fff; color: #212529; font-size: 1.15rem; text-align: left; position: relative; }
button.sm-option:not(:disabled):hover { border-color: #0d6efd; }
button.sm-option:disabled { opacity: .7; }
.sm-letter { display: inline-flex; width: 2rem; height: 2rem; align-items: center; justify-content: center; border-radius: 50%; background: #0d6efd; color: #fff; font-weight: 700; flex: none; }
.sm-correct { border-color: #198754; background: #d1e7dd; }
.sm-dim { opacity: .45; }
.sm-chosen { box-shadow: 0 0 0 3px #ffc107; }
.sm-count { margin-left: auto; font-weight: 700; }
.sm-timer { font-variant-numeric: tabular-nums; font-weight: 700; }
.sm-timer-low { color: #dc3545; }
.sm-scoreboard { list-style: none; margin: 0; padding: 0; }
.sm-scoreboard li { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem .6rem; border-bottom: 1px solid rgba(0,0,0,.1); }
.sm-scoreboard li.sm-out { opacity: .45; text-decoration: line-through; }
.sm-score { font-weight: 700; }

.sm-host { background: #f8f9fa; min-height: 100vh; }
.sm-host-bar { position: sticky; top: 0; z-index: 20; background: #f8f9fa; padding: .5rem 0; border-bottom: 1px solid #dee2e6; }
.sm-host-questions { max-height: 40vh; overflow-y: auto; }
.sm-host-tabs .nav-link { cursor: pointer; }
.sm-preview .sm-qtext { font-size: 1.25rem; }

.sm-player { max-width: 32rem; margin: 0 auto; padding: 1rem; min-height: 100vh; }
.sm-player-bar { display: flex; justify-content: space-between; align-items: center; font-weight: 600; padding-bottom: .5rem; border-bottom: 1px solid #dee2e6; }
.sm-player .sm-options { grid-template-columns: 1fr; }
.sm-wait { text-align: center; font-size: 1.3rem; margin-top: 4rem; color: #6c757d; }
.sm-buzz { display: block; width: 100%; padding: 2.5rem 1rem; font-size: 2.5rem; font-weight: 800; border-radius: 1.5rem; margin-top: 1rem; }

html:has(.sm-overlay), body:has(.sm-overlay) { background: transparent; }
.sm-overlay { display: grid; grid-template-columns: 1fr 18rem; gap: 1rem; padding: 1.5rem; color: var(--sm-text, #fff); min-height: 100vh; align-content: start; background: var(--sm-bg-image, none) center / cover no-repeat, var(--sm-bg, transparent); font-family: var(--sm-font, inherit); }
.sm-overlay .sm-box { background: var(--sm-panel, rgba(10, 15, 40, .82)); border-radius: 1rem; padding: 1.25rem 1.5rem; }
.sm-overlay .sm-center { grid-column: 1 / -1; text-align: center; font-size: 1.8rem; }
.sm-overlay .sm-title { font-size: 2.6rem; font-weight: 800; }
.sm-overlay .sm-code { font-size: 3rem; letter-spacing: .2rem; color: var(--sm-accent, #ffc107); }
.sm-overlay .sm-ticker { position: fixed; top: 0; left: 0; right: 0; z-index: 50; overflow: hidden; white-space: nowrap; background: var(--sm-accent, #ffc107); color: #111; font-size: 1.6rem; font-weight: 700; padding: .35rem 0; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.sm-overlay .sm-ticker-track { display: inline-block; padding-left: 100%; animation: sm-ticker-scroll linear infinite; }
@keyframes sm-ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) {
    .sm-overlay .sm-ticker { text-align: center; white-space: normal; }
    .sm-overlay .sm-ticker-track { padding-left: 0; animation: none; }
}
.sm-overlay .sm-small { font-size: 1rem; opacity: .8; }
.sm-overlay .sm-option { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.35); color: var(--sm-text, #fff); font-size: 1.5rem; }
.sm-overlay .sm-correct { background: var(--sm-correct, rgba(25,135,84,.7)); border-color: #75d6a6; }
.sm-overlay .sm-qtext { font-size: 2.2rem; }
.sm-overlay .sm-big-timer { font-size: 3rem; }
.sm-overlay .sm-scoreboard li { border-color: rgba(255,255,255,.2); font-size: 1.2rem; }
.sm-buzzed { margin-top: 1rem; font-size: 1.8rem; font-weight: 700; color: var(--sm-accent, #ffc107); }

/* Avatars and join QR */
.sm-avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; flex: none; vertical-align: middle; line-height: 1; }
.sm-avatar-sm { width: 1.8rem; height: 1.8rem; font-size: 1.1rem; }
.sm-avatar-lg { width: 4rem; height: 4rem; font-size: 2.4rem; }
.sm-avatar-btn { border: 0; background: none; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.sm-avatar-choice { display: inline-flex; align-items: center; justify-content: center; padding: 0; line-height: 1; width: 2.4rem; height: 2.4rem; font-size: 1.4rem; border: 2px solid #ced4da; border-radius: .5rem; background: #fff; }
.sm-color-choice { width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #adb5bd; }
.sm-avatar-choice.sel, .sm-color-choice.sel { box-shadow: 0 0 0 3px #0d6efd; }
.sm-qr-code { width: 12rem; background: #fff; padding: .25rem; border-radius: .5rem; margin: 0 auto; }
.sm-qr-code svg { width: 100%; height: auto; display: block; }
.sm-qr-url { font-size: .75rem; word-break: break-all; text-align: center; margin-top: .25rem; }
.sm-host-qr { width: 8rem; }
.sm-host-qr .sm-qr-code { width: 8rem; }
.sm-host-qr .sm-qr-url { display: none; }
.sm-overlay-qr { margin-top: 1rem; }
.sm-overlay-qr .sm-qr-code { width: 16rem; }
.sm-overlay-qr .sm-qr-url { font-size: 1rem; color: #fff; }

/* Typed answers and results */
.sm-text-answer { display: flex; gap: .5rem; margin-top: 1rem; }
.sm-match-answer { margin-top: 1rem; }
.sm-match-row { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .5rem; }
.sm-match-item { font-weight: 600; }
.sm-match-list { list-style: none; padding: 0; margin: .5rem 0; font-size: 1.1em; }
.sm-match-list li { padding: .15rem 0; }
.sm-sort-rows { list-style: none; padding: 0; margin: 0; }
.sm-sort-row { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.sm-sort-item { flex: 1; font-weight: 600; }
.sm-media { display: block; max-width: 100%; max-height: 40vh; margin: .5rem auto; }
audio.sm-media { width: 100%; max-width: 480px; }
.sm-match-targets { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }
.sm-match-target { padding: .15rem .6rem; border-radius: 1rem; background: rgba(255,255,255,.15); }
.sm-solution { margin-top: 1rem; font-size: 1.4em; }
.sm-results { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .35rem; }
.sm-results li { display: flex; align-items: center; gap: .5rem; padding: .35rem .6rem; border-radius: .5rem; background: rgba(128,128,128,.15); }
.sm-results li.sm-correct { background: rgba(25,135,84,.35); opacity: 1; }
.sm-results li.sm-dim { opacity: .6; }
.sm-results .sm-name { flex: 1; font-weight: 600; }
.sm-results .sm-rank { font-weight: 700; min-width: 2rem; text-align: right; }

.sm-q-skipped { text-decoration: line-through; opacity: .6; }
.sm-skipped { margin-top: 1rem; padding: .75rem 1rem; border-radius: .5rem; background: rgba(128,128,128,.25); font-weight: 600; text-align: center; }
.sm-option.sm-removed { opacity: .25; text-decoration: line-through; pointer-events: none; }
.sm-live-answers .sm-guess { opacity: .9; }
.sm-map { position: relative; container-type: inline-size; line-height: 0; border-radius: .5rem; overflow: hidden; margin-bottom: .75rem; }
.sm-map img { width: 100%; display: block; user-select: none; }
.sm-pickable { cursor: crosshair; }
.sm-target { position: absolute; transform: translate(-50%, -50%); border: 3px solid #22c55e; border-radius: 50%; background: rgba(34,197,94,.25); pointer-events: none; }
.sm-mark { position: absolute; transform: translate(-50%, -50%); pointer-events: none; font-size: 1.5rem; line-height: 1; }
.sm-mark.sm-correct { filter: drop-shadow(0 0 6px #22c55e); }
.sm-lines { position: absolute; left: 0; top: 0; width: 100cqw; height: 100cqw; overflow: visible; pointer-events: none; }
.sm-line { stroke: #f8fafc; stroke-width: .45; stroke-dasharray: 1.4 .9; stroke-linecap: round; filter: drop-shadow(0 0 1px #000); }
.sm-line.sm-correct { stroke: #22c55e; }
.sm-km { position: absolute; transform: translate(-50%, -50%); pointer-events: none; font-size: .85rem; font-weight: 700; line-height: 1; padding: .15rem .4rem; border-radius: .6rem; background: rgba(0,0,0,.75); color: #fff; white-space: nowrap; }
.sm-picker { position: relative; display: block; width: 100%; max-width: 600px; cursor: crosshair; }

/* Error bar for layouts without scoped styles (EmptyLayout); Blazor shows it via inline style on errors */
#blazor-error-ui { display: none; background: lightyellow; bottom: 0; left: 0; padding: .6rem 1.25rem; position: fixed; width: 100%; z-index: 1000; color: #000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

.sm-cam-preview { display: block; width: 100%; max-width: 20rem; aspect-ratio: 16 / 9; object-fit: cover; border-radius: .5rem; background: #000; }
