/* ScrimMate local variable font */
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/InterVariable.woff2') format('woff2-variations'),
       url('/fonts/InterVariable.woff2') format('woff2'),
       url('/fonts/InterVariable.ttf') format('truetype-variations');
}

/* ScrimMate rebuild design foundation. Legacy screens inherit the aliases below
   until their individual routes move onto the component layer. */
:root {
  --sm-ink: #0a0d13;
  --sm-glass: color-mix(in srgb, var(--surface-container, #171b23) 82%, transparent);
  --sm-glass-raised: color-mix(in srgb, var(--surface-container-high, #202633) 88%, transparent);
  --sm-line: color-mix(in srgb, var(--outline-variant, #414957) 58%, transparent);
  --sm-accent: var(--primary, #f6c445);
  --sm-text: var(--on-surface, #f1f4f8);
  --sm-muted: var(--on-surface-variant, #aeb8c7);
  --sm-danger: var(--error, #ffb4ab);
  --sm-success: var(--ok, #70e0ad);
  --sm-font-family: 'Inter Variable', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-family: var(--sm-font-family);
    --sm-z-base: 1;
  --sm-z-header: 20;
  --sm-z-nav: 40;
  --sm-z-snackbar: 50;
  --sm-z-fab: 60;
  --sm-z-sheet-backdrop: 90;
  --sm-z-sheet: 100;
  --sm-z-modal: 110;
  --sm-z-toast: 120;
  --sm-space-1: 4px;
  --sm-space-2: 8px;
  --sm-space-3: 12px;
  --sm-space-4: 16px;
  --sm-space-5: 20px;
  --sm-space-6: 24px;
  --sm-radius-control: 14px;
  --sm-radius-card: 22px;
  --sm-radius-sheet: 30px;
  --sm-elevation-card: 0 12px 36px rgb(0 0 0 / .24);
  --sm-blur: 22px;
  --sm-motion-fast: 140ms;
  --sm-motion-standard: 240ms;
  --sm-ease-spring: cubic-bezier(.2, .8, .2, 1.15);
}

:root[data-theme="light"] {
  color-scheme: light;
  --sm-ink: #f5f3ee;
  --sm-glass: color-mix(in srgb, #fff 82%, transparent);
  --sm-glass-raised: color-mix(in srgb, #fff 94%, transparent);
  --sm-line: rgb(31 38 48 / .14);
}

.sm-surface {
  color: var(--sm-text);
  background: var(--sm-glass);
  border: 1px solid var(--sm-line);
  border-radius: var(--sm-radius-card);
  box-shadow: var(--sm-elevation-card);
  -webkit-backdrop-filter: blur(var(--sm-blur));
  backdrop-filter: blur(var(--sm-blur));
}

.sm-focusable:focus-visible,
:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--sm-accent) 82%, white);
  outline-offset: 3px;
}

.sm-state {
  display: grid;
  justify-items: center;
  gap: var(--sm-space-3);
  padding: clamp(28px, 8vw, 52px) var(--sm-space-6);
  text-align: center;
}

.sm-state__title { margin: 0; color: var(--sm-text); font-size: 1.15rem; }
.sm-state__message { max-width: 34ch; margin: 0; color: var(--sm-muted); line-height: 1.55; }
.sm-chip { display: inline-flex; align-items: center; min-height: 28px; padding: 3px 10px; border: 1px solid var(--sm-line); border-radius: 999px; color: var(--sm-text); font-size: .78rem; font-weight: 700; }
.sm-chip--success { color: var(--sm-success); }
.sm-chip--danger { color: var(--sm-danger); }
.sm-segmented { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--sm-line); border-radius: 999px; background: var(--sm-glass); }
.sm-segmented__option { min-height: 40px; padding: 6px 14px; border: 0; border-radius: 999px; color: var(--sm-muted); background: transparent; font: inherit; }
.sm-segmented__option.is-selected { color: var(--sm-ink); background: var(--sm-accent); font-weight: 750; }
.sm-skeleton-list { display: grid; gap: var(--sm-space-3); }
.sm-skeleton { min-height: 72px; border: 1px solid var(--sm-line); border-radius: var(--sm-radius-card); background: linear-gradient(100deg, var(--sm-glass) 28%, var(--sm-glass-raised) 44%, var(--sm-glass) 62%); background-size: 220% 100%; animation: sm-shimmer 1.4s linear infinite; }
@keyframes sm-shimmer { to { background-position-x: -220%; } }
.sm-snackbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sm-space-4); padding: 12px 16px; border: 1px solid var(--sm-line); border-radius: 16px; color: var(--sm-text); background: var(--sm-glass-raised); box-shadow: var(--sm-elevation-card); }
.sm-snackbar button { min-height: 40px; border: 0; color: var(--sm-accent); background: transparent; font: inherit; font-weight: 750; }
.sm-field { display: grid; gap: var(--sm-space-2); color: var(--sm-muted); }
.sm-field :is(input, select, textarea) { min-width: 0; min-height: 48px; border-radius: var(--sm-radius-control); }

.sm-route-enter { animation: sm-route-in var(--sm-motion-standard) var(--sm-ease-spring) both; }
@keyframes sm-route-in { from { opacity: .82; transform: translateY(5px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  :root { --sm-motion-fast: 0ms; --sm-motion-standard: 0ms; }
}

.wizard-progress { display: flex; gap: 8px; margin: 16px 0; padding: 0; list-style: none; }
.wizard-progress li { flex: 1; padding: 8px 10px; border: 1px solid var(--sm-line); border-radius: 999px; color: var(--sm-muted); text-align: center; font-size: .82rem; }
.wizard-progress li[aria-current="step"] { border-color: var(--sm-accent); color: var(--sm-text); background: var(--sm-glass-raised); font-weight: 700; }
.wizard-step { min-width: 0; margin: 0; padding: 0; border: 0; }
.wizard-step legend { margin-bottom: 12px; color: var(--sm-text); font-weight: 750; }
.wizard-controls { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }

/* Utility classes replacing inline styles */
.sm-form-grid, .sm-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sm-scoring-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sm-mt-8 { margin-top: 8px; }
.sm-mt-12 { margin-top: 12px; }
.sm-mt-14 { margin-top: 14px; }
.sm-mt-16 { margin-top: 16px; }
.sm-mb-8 { margin-bottom: 8px; }
.sm-mb-12 { margin-bottom: 12px; }
.sm-my-12 { margin: 12px 0; }
.sm-evidence-img { max-width: 90vw; max-height: 80dvh; }
.sm-shot-img { max-width: 100%; border-radius: 8px; margin: 8px 0; }
.sm-flex-between { display: flex; justify-content: space-between; align-items: center; }
.sm-bullet-list { padding-left: 18px; line-height: 1.6; }
.sm-summary-lead { font-size: 15px; line-height: 1.5; margin: 8px 0; }
.sm-text-muted { color: var(--sm-muted, #aeb8c7); }
.sm-text-accent { color: var(--sm-accent, #f6c445); }
.confirm-actions { justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* Scan Progress Bar (Task 3) - accessible, theme-aware, 130% font scale tolerant */
.sm-scan-progress { display: flex; flex-direction: column; gap: 8px; padding: 12px; margin: 12px 0; border: 1px solid var(--sm-line); border-radius: 12px; background: var(--sm-glass-raised); }
.sm-progress-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sm-progress-caption { font-size: 0.95rem; font-weight: 700; color: var(--sm-text); }
.sm-btn-compact { min-height: 44px; min-width: 44px; padding: 6px 14px; font-size: 0.85rem; box-sizing: border-box; }
.sm-progress-track { width: 100%; height: 8px; background: var(--sm-line); border-radius: 4px; overflow: hidden; }
.sm-progress-fill { height: 100%; background: var(--sm-accent); border-radius: 4px; transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); width: 0%; }
.sm-progress-fill[data-progress="0"] { width: 0%; }
.sm-progress-fill[data-progress="20"] { width: 20%; }
.sm-progress-fill[data-progress="40"] { width: 40%; }
.sm-progress-fill[data-progress="60"] { width: 60%; }
.sm-progress-fill[data-progress="80"] { width: 80%; }
.sm-progress-fill[data-progress="100"] { width: 100%; }
.sm-progress-fill.sm-working { animation: sm-progress-shimmer 1.5s infinite linear; }
@keyframes sm-progress-shimmer { 0% { opacity: 0.65; } 50% { opacity: 1; } 100% { opacity: 0.65; } }
.sm-progress-subline { font-size: 0.85rem; color: var(--sm-muted); line-height: 1.4; }
.sm-progress-slow { font-size: 0.85rem; color: var(--sm-accent); font-weight: 600; }
.sm-hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .sm-progress-fill { transition: none !important; }
  .sm-progress-fill.sm-working { animation: none !important; }
}

/* Universal 44x44px touch targets and safe gaps */
button, .btn, [role="button"], input[type="button"], input[type="submit"] { min-height: 44px; min-width: 44px; box-sizing: border-box; }

/* Responsive code block and pre formatting for zero overflow */
pre, code, .code-block {
  white-space: pre-wrap !important;
  word-break: break-all !important;
  overflow-wrap: break-word !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.setup-required-screen,
.setup-required-card,
.setup-steps-box,
.setup-step,
.step-content {
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

/* OCR review: shared flags and warnings (player dialog and manager review) */
.sm-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sm-flag, input.sm-flag, select.sm-flag { border-color: var(--sm-danger) !important; box-shadow: 0 0 0 1px var(--sm-danger); }
.sm-card-flagged { border-left: 3px solid var(--sm-danger); }
.sm-flag-note { font-size: .82rem; font-weight: 700; color: var(--sm-danger); margin-bottom: 6px; }
.notice.warning { border: 1px solid var(--sm-danger); background: color-mix(in srgb, var(--sm-danger) 10%, transparent); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.notice.warning ul { margin: 6px 0 0; padding-left: 18px; }
.notice.warning li { margin: 2px 0; }
@media (max-width: 360px) { .sm-grid-3 { grid-template-columns: 1fr 1fr; } }

/* ------------------------------------------------------------------
   Shared people + sheet primitives (v0.16)
   ------------------------------------------------------------------ */
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.sm-av { --av-size: 40px; position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: var(--av-size); height: var(--av-size); border-radius: 50%;
  background: linear-gradient(140deg, hsl(var(--av-h, 42) 72% 58%), hsl(calc(var(--av-h, 42) + 28) 68% 40%));
  color: #fff; font-weight: 800; font-size: calc(var(--av-size) * .38); letter-spacing: .02em; text-shadow: 0 1px 2px rgb(0 0 0 / .25); user-select: none; }
.sm-av img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.sm-av--xs { --av-size: 28px; } .sm-av--sm { --av-size: 34px; } .sm-av--md { --av-size: 42px; } .sm-av--lg { --av-size: 50px; } .sm-av--xl { --av-size: 88px; }
.sm-av--square { border-radius: 30%; }
.sm-av--ring { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); }
.sm-av__dot { position: absolute; right: 2%; bottom: 2%; width: 28%; height: 28%; min-width: 10px; min-height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2.5px var(--surface); z-index: 1; }
.sm-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-size: 12px; font-weight: 800; }
.sm-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; animation: sm-spin .7s linear infinite; display: inline-block; flex-shrink: 0; }
@keyframes sm-spin { to { transform: rotate(360deg); } }
.danger-text { color: var(--error) !important; }

.sm-sheet-layer { position: fixed; inset: 0; z-index: var(--sm-z-sheet, 100); display: flex; align-items: flex-end; justify-content: center; }
.sm-sheet-backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / .45); animation: sm-fade-in .18s ease; }
.sm-sheet { position: relative; width: min(100%, 30rem); max-height: 86dvh; overflow-y: auto; padding: 8px 12px calc(14px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; background: var(--surface-container); color: var(--on-surface); box-shadow: 0 -12px 40px rgb(0 0 0 / .3); animation: sm-sheet-up .26s var(--sm-ease-spring, ease); }
.sm-sheet-layer.is-closing .sm-sheet { animation: sm-sheet-down .18s ease forwards; }
.sm-sheet-layer.is-closing .sm-sheet-backdrop { animation: sm-fade-out .18s ease forwards; }
@keyframes sm-sheet-up { from { transform: translateY(100%); } }
@keyframes sm-sheet-down { to { transform: translateY(100%); } }
@keyframes sm-fade-in { from { opacity: 0; } }
@keyframes sm-fade-out { to { opacity: 0; } }
.sm-sheet__grab { display: block; width: 40px; height: 5px; margin: 2px auto 10px; border-radius: 3px; background: var(--outline-variant); }
.sm-sheet__preview { display: grid; gap: 2px; padding: 4px 8px 12px; border-bottom: 1px solid var(--outline-variant); margin-bottom: 10px; }
.sm-sheet__preview span { color: var(--on-surface-variant); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.sm-sheet__preview small { color: var(--on-surface-variant); font-size: 12px; }
.sm-sheet__reactions { display: flex; justify-content: space-between; gap: 4px; padding: 6px; margin: 0 0 10px; border-radius: 999px; background: var(--surface-container-high); }
.sm-sheet__react { width: 46px; height: 46px; border-radius: 50%; font-size: 24px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; transition: transform .12s var(--sm-ease-spring, ease), background .12s ease; }
.sm-sheet__react:active { transform: scale(1.25); }
.sm-sheet__react.is-on { background: color-mix(in srgb, var(--primary) 30%, transparent); }
.sm-sheet__list { display: grid; }
.sm-sheet__item { display: flex; align-items: center; gap: 14px; min-height: 50px; padding: 0 12px; border-radius: 14px; color: var(--on-surface); font-size: 15px; font-weight: 600; text-align: left; }
.sm-sheet__item:active { background: var(--surface-container-high); }
@media (hover: hover) { .sm-sheet__item:hover { background: var(--surface-container-high); } }
.sm-sheet__item svg { width: 22px; height: 22px; fill: var(--on-surface-variant); flex-shrink: 0; }
.sm-sheet__item.is-danger, .sm-sheet__item.is-danger svg { color: var(--error); fill: var(--error); }
.sm-sheet__item:disabled { opacity: .5; }
@media (min-width: 768px) { .sm-sheet-layer { align-items: center; } .sm-sheet { border-radius: 26px; } }

/* ===================== v0.17 motion & feel ===================== */
:root { --sm-ease-out: cubic-bezier(.2, .8, .2, 1); --sm-ease-spring: cubic-bezier(.34, 1.36, .64, 1); }
html { scroll-behavior: auto; }
body { overscroll-behavior-y: none; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }

/* Page enter: content slides in, header + bottom nav stay still */
.sm-page-in { animation: sm-page-in .32s var(--sm-ease-out) both; }
.sm-page-in--back { animation: sm-page-back .3s var(--sm-ease-out) both; }
.sm-page-in--fade { animation: sm-fade-in .22s ease both; }
@keyframes sm-page-in { from { opacity: 0; transform: translate3d(18px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes sm-page-back { from { opacity: 0; transform: translate3d(-18px, 0, 0); } to { opacity: 1; transform: none; } }
.sm-page-in .sm-screen > *, .sm-page-in--back .sm-screen > * { animation: sm-rise .42s var(--sm-ease-out) both; }
.sm-page-in .sm-screen > :nth-child(2) { animation-delay: 30ms; }
.sm-page-in .sm-screen > :nth-child(3) { animation-delay: 60ms; }
.sm-page-in .sm-screen > :nth-child(4) { animation-delay: 90ms; }
.sm-page-in .sm-screen > :nth-child(n+5) { animation-delay: 120ms; }
@keyframes sm-rise { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }

/* Press feedback: everything tappable gives a quick, soft squeeze */
:where(.sm-team-card, .sm-convo, .sm-adm-user, .sm-adm-queue__item, .sm-home-card, .sm-scrim-card, .sm-match-card, .sm-result-card, .sm-list-row, .sm-chip-btn, .sm-adm-chip, .sm-adm-tabs__btn, .sm-sheet__item, .sm-app-shell__icon, .seg button, .text-btn) {
  transition: transform .16s var(--sm-ease-out), background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .2s ease;
}
:where(.sm-team-card, .sm-convo, .sm-adm-user, .sm-adm-queue__item, .sm-home-card, .sm-scrim-card, .sm-match-card, .sm-result-card, .sm-list-row):active { transform: scale(.985); }
:where(.sm-chip-btn, .sm-adm-chip, .sm-adm-tabs__btn, .sm-app-shell__icon, .seg button):active { transform: scale(.94); }
.sm-app-shell__tab svg { transition: transform .28s var(--sm-ease-spring); }
.sm-app-shell__tab:active svg { transform: scale(.86); }
.sm-app-shell__tab.is-active svg { animation: sm-tab-pop .38s var(--sm-ease-spring); }
@keyframes sm-tab-pop { 0% { transform: scale(.8); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Snackbar: slides up, auto hides */
.notice.snackbar { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; border-radius: 16px; box-shadow: 0 14px 34px -10px rgb(0 0 0 / .45); animation: sm-snack-in .34s var(--sm-ease-spring) both; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.notice.snackbar .sm-snack__icon { flex: 0 0 auto; width: 22px; height: 22px; display: grid; place-items: center; }
.notice.snackbar .sm-snack__icon svg { width: 20px; height: 20px; }
.notice.snackbar .sm-snack__text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; color: inherit; }
.notice.snackbar .text-btn { flex: 0 0 auto; margin-left: auto; }
.notice.snackbar.is-top { top: calc(10px + env(safe-area-inset-top)); bottom: auto; animation-name: sm-snack-in-top; }
.notice.snackbar.is-leaving { animation: sm-snack-out .22s ease forwards; }
.notice.snackbar.is-top.is-leaving { animation-name: sm-snack-out-top; }
@keyframes sm-snack-in { from { opacity: 0; transform: translate3d(0, 24px, 0) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes sm-snack-out { to { opacity: 0; transform: translate3d(0, 18px, 0) scale(.97); } }
@keyframes sm-snack-in-top { from { opacity: 0; transform: translate3d(0, -24px, 0) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes sm-snack-out-top { to { opacity: 0; transform: translate3d(0, -18px, 0); } }
.notice.snackbar .sm-snack__bar { position: absolute; left: 14px; right: 14px; bottom: 5px; height: 2px; border-radius: 2px; background: currentColor; opacity: .25; transform-origin: left; animation: sm-snack-timer var(--sm-snack-ms, 3800ms) linear forwards; }
@keyframes sm-snack-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* Announcement banner (admin > Broadcast) */
.sm-announce { display: flex; align-items: flex-start; gap: 10px; padding: 12px 8px 12px 12px; margin: 0 0 14px; border-radius: 16px; border: 1px solid var(--sm-ann-line); background: var(--sm-ann-bg); color: var(--on-surface); animation: sm-rise .36s var(--sm-ease-out) both; --sm-ann-accent: var(--primary); --sm-ann-bg: color-mix(in srgb, var(--primary) 12%, var(--surface-container)); --sm-ann-line: color-mix(in srgb, var(--primary) 40%, transparent); }
.sm-announce.is-success { --sm-ann-accent: var(--ok); --sm-ann-bg: color-mix(in srgb, var(--ok) 12%, var(--surface-container)); --sm-ann-line: color-mix(in srgb, var(--ok) 40%, transparent); }
.sm-announce.is-warning { --sm-ann-accent: var(--error); --sm-ann-bg: color-mix(in srgb, var(--error) 12%, var(--surface-container)); --sm-ann-line: color-mix(in srgb, var(--error) 40%, transparent); }
.sm-announce.is-leaving { animation: sm-fade-out .2s ease forwards; }
.sm-announce__icon { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: color-mix(in srgb, var(--sm-ann-accent) 20%, transparent); color: var(--sm-ann-accent); }
.sm-announce__icon svg { width: 19px; height: 19px; }
.sm-announce__text { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; padding: 2px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: default; }
button.sm-announce__text { cursor: pointer; }
.sm-announce__text b { font-size: 14.5px; overflow-wrap: anywhere; }
.sm-announce__text span { font-size: 13px; color: var(--on-surface-variant); overflow-wrap: anywhere; }
.sm-announce__close { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--on-surface-variant); cursor: pointer; }
.sm-announce__close svg { width: 18px; height: 18px; }

/* Skeleton shimmer is lighter on GPU: only transform animates */
@media (prefers-reduced-motion: reduce) {
  .sm-page-in, .sm-page-in--back, .sm-page-in .sm-screen > *, .sm-page-in--back .sm-screen > *, .notice.snackbar, .sm-announce, .sm-app-shell__tab.is-active svg { animation: none !important; }
}
html.sm-reduce-motion *, html.sm-reduce-motion *::before, html.sm-reduce-motion *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
