/* ShootSelect web rater — mobile-first, fast, calm. Dark/light via tokens. No dashboard chrome. */

:root {
  --bg: #f7f7f8; --surface: #ffffff; --text: #17181b; --muted: #6b6f76; --line: #e6e7ea;
  --accent: #c9a961; --accent-ink: #201a0a;
  --superYes: #e0a400; --yes: #2e9e5b; --maybe: #7a7f87; --no: #d9663a; --superNo: #d23b53;
  --radius: 20px; --shadow: 0 10px 30px rgba(0,0,0,.10);
  --safe-t: env(safe-area-inset-top); --safe-b: env(safe-area-inset-bottom);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111214; --surface: #1b1d20; --text: #f2f3f5; --muted: #9aa0a8; --line: #2a2d31;
    --accent: #d4b877; --accent-ink: #1a1508; --shadow: 0 10px 30px rgba(0,0,0,.45);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
}
.app { min-height: 100dvh; display: flex; flex-direction: column; }

/* ---- screens ---- */
.screen {
  flex: 1; display: flex; flex-direction: column;
  padding: calc(16px + var(--safe-t)) 18px calc(16px + var(--safe-b));
  max-width: 560px; width: 100%; margin: 0 auto; gap: 16px;
}
.screen__actions { margin-top: auto; padding-top: 12px; }

.btn {
  width: 100%; min-height: 52px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--text); font-size: 17px; font-weight: 600;
  cursor: pointer; touch-action: manipulation;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* ---- progress ---- */
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress__fill { height: 100%; background: var(--accent); transition: width .3s ease; }

/* ---- emblem ---- */
.emblem { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.emblem__icon { font-size: 40px; line-height: 1; }
.emblem__name { font-size: 18px; font-weight: 700; }
.emblem--xl .emblem__icon { font-size: 72px; }
.emblem--xl .emblem__name { font-size: 26px; }

/* ---- start ---- */
.start__body, .break__body, .catsummary__body, .final__body, .error__body {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 12px;
}
.start__mark, .final__mark { font-size: 60px; }
.start__title { font-size: 24px; margin: 4px 0 0; }
.start__by, .start__meta { color: var(--muted); margin: 0; }
.start__name {
  margin-top: 12px; width: 100%; max-width: 320px; min-height: 50px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font-size: 16px;
}

/* ---- break ---- */
.break__step { color: var(--muted); font-size: 14px; letter-spacing: .04em; text-transform: uppercase; margin: 0; }
.break__count { font-size: 16px; margin: 0; }
.break__done { color: var(--accent); font-weight: 600; margin: 0; }

/* ---- rating ---- */
.rating { gap: 12px; }
.rating__top { display: flex; flex-direction: column; gap: 8px; }
.rating__meta { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.rating__cat { font-weight: 600; color: var(--text); }

.cardstack { position: relative; flex: 1; min-height: 0; display: flex; }
.card {
  position: relative; flex: 1; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow); touch-action: none; user-select: none;
  animation: cardIn .18s ease-out;
}
@keyframes cardIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.card--dragging { transition: none; }
.card__img { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; pointer-events: none; }
.card__overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 96px; opacity: 0; pointer-events: none; text-shadow: 0 4px 24px rgba(0,0,0,.5);
}
.card__missing { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 10px; color: var(--muted); }
.card__missing-icon { font-size: 56px; }
.ratinghint { text-align: center; color: var(--muted); font-size: 13px; margin: 0; }

/* ---- rating bar (built from the manifest scale) ---- */
.ratingbar { display: flex; justify-content: space-between; gap: 8px; }
.ratebtn {
  flex: 1; min-height: 60px; border: none; border-radius: 16px; background: var(--surface);
  box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; cursor: pointer; touch-action: manipulation; color: var(--text); padding: 6px 2px;
}
.ratebtn:active { transform: translateY(1px) scale(.98); }
.ratebtn__icon { font-size: 24px; line-height: 1; }
.ratebtn__label { font-size: 11px; color: var(--muted); }
.ratebtn--super-yes { box-shadow: inset 0 0 0 2px var(--superYes), var(--shadow); }
.ratebtn--yes { box-shadow: inset 0 0 0 2px var(--yes), var(--shadow); }
.ratebtn--maybe { box-shadow: inset 0 0 0 2px var(--maybe), var(--shadow); }
.ratebtn--no { box-shadow: inset 0 0 0 2px var(--no), var(--shadow); }
.ratebtn--super-no { box-shadow: inset 0 0 0 2px var(--superNo), var(--shadow); }

/* ---- counts ---- */
.counts { list-style: none; padding: 0; margin: 8px 0 0; width: 100%; max-width: 320px; }
.counts__row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.counts__row--empty { justify-content: center; color: var(--muted); border: none; }
.counts__label { flex: 1; text-align: left; }
.counts__num { font-weight: 700; font-variant-numeric: tabular-nums; }
.catsummary__check, .final__mark { font-size: 56px; }
.catsummary__title { font-size: 22px; margin: 0; }
.final__title { font-size: 24px; margin: 0; }
.final__sub { color: var(--muted); margin: 0; }
.final__sync { color: var(--muted); font-size: 14px; }
.final__sync--ok { color: var(--yes); }

/* ---- error ---- */
.error__icon { font-size: 56px; }
.error__title { font-size: 22px; margin: 0; }
.error__text { color: var(--muted); margin: 0 0 8px; }

/* ---- sync badge ---- */
.sync {
  position: fixed; top: calc(8px + var(--safe-t)); right: 10px; z-index: 20;
  background: var(--surface); color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; box-shadow: var(--shadow);
}

/* ---- loading ---- */
.loading { align-items: center; justify-content: center; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.sheet {
  position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet__panel {
  width: 100%; max-width: 560px; background: var(--surface); border-radius: 18px 18px 0 0;
  padding: 18px 18px calc(18px + var(--safe-b)); display: flex; flex-direction: column; gap: 12px;
}
.sheet__head { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.sheet__input { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text); padding: 10px; font-size: 16px; resize: none; }
.sheet__actions { display: flex; gap: 10px; }
.sheet__actions .btn { min-height: 48px; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
