/* Where's Rocko? — Spot the Difference.
   Loaded by /spot/ on TOP of the shared /styles.css design tokens — same
   pattern as /play/play.css. Uses the warm "Creative Library" system
   (paper / surface / ink / brand #F04E37), NOT the old navy game chrome. */
:root {
  /* seek-category hue, mirrored from home.css so /spot/ can use it standalone */
  --c-seek: #2E74E8;
  --spot-ok: #2FA24B;   /* "found it" green */
}
@media (prefers-color-scheme: dark) {
  :root { --c-seek: #5C9BFF; --spot-ok: #56C878; }
}

body.spot main { max-width: 1080px; margin: 0 auto; padding: 0 20px 64px; }

/* ============ level select ============ */
.spot-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 30px; flex-wrap: wrap;
  margin: 26px 0 30px; padding: 34px 36px; border-radius: 26px;
  background: radial-gradient(120% 150% at 100% 0%,
    color-mix(in srgb, var(--brand) 16%, var(--surface)) 0%, var(--surface) 60%);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.spot-hero-art {
  flex: 0 0 auto; width: 116px; height: 116px;
  filter: drop-shadow(0 10px 20px rgba(30,22,14,.18));
}
.spot-hero-copy { flex: 1 1 300px; min-width: 0; }
.spot-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: #fff; background: var(--c-seek); padding: 4px 11px; border-radius: 999px; margin: 0 0 12px;
}
.spot-hero h1 { font-size: clamp(1.9rem, 4.8vw, 3rem); margin: 0 0 .26em; }
.spot-hero h1 .accent { color: var(--brand); }
.spot-hero .lede { font-size: 1.06rem; font-weight: 700; color: var(--ink-soft); margin: 0; max-width: 52ch; }
.spot-hero .lede strong { color: var(--ink); }

.level-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.level-card {
  display: flex; flex-direction: column; text-align: left; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); color: inherit;
  transition: transform .12s ease, box-shadow .12s ease;
}
.level-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.level-thumb {
  position: relative; display: flex; gap: 3px; height: 132px; padding: 8px; background: var(--surface-2);
}
.level-thumb .thumb-half { flex: 1 1 0; min-width: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #cdeaf6; }
.level-thumb .spot-svg { width: 100%; height: 100%; display: block; }
.level-thumb .thumb-count {
  position: absolute; right: 12px; bottom: 10px;
  font-family: var(--font-body); font-size: .66rem; font-weight: 800; letter-spacing: .04em;
  color: #fff; background: rgba(33,30,26,.72); padding: 3px 9px; border-radius: 999px;
}
.level-meta { padding: 13px 16px 4px; display: flex; flex-direction: column; gap: 2px; }
.level-name { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; }
.level-tag { color: var(--ink-soft); font-size: .88rem; font-weight: 700; }

/* difficulty chips */
.diff-row { display: flex; gap: 8px; padding: 8px 16px 16px; margin-top: auto; }
.diff-btn {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 1px;
  font: inherit; cursor: pointer; padding: 8px 4px; border-radius: 12px;
  background: var(--surface-2); border: 1.5px solid var(--line); color: var(--ink);
  transition: border-color .12s ease, color .12s ease, transform .08s ease;
}
.diff-btn:hover { border-color: var(--c-seek); color: var(--c-seek); transform: translateY(-1px); }
.diff-btn .dn { font-family: var(--font-display); font-weight: 600; font-size: .92rem; }
.diff-btn .db { font-size: .66rem; font-weight: 800; color: var(--ink-soft); }
.diff-btn .db.has { color: var(--brand-ink); }

/* locked-scene glue (shared lock/done/badge/nudge rules live in styles.css).
   The shared grayscale targets <img> thumbs, but spot's thumbs are inline SVG
   halves, so gray those here; and make a locked card's difficulty chips look
   inert while keeping pointer-events ON so a tap still bubbles up and nudges. */
.level-card.locked .level-thumb .thumb-half { filter: grayscale(1) brightness(.7); }
.level-card.locked .diff-row { opacity: .5; }
.level-card.locked .diff-btn { cursor: default; }
.level-card.locked .diff-btn:hover { border-color: var(--line); color: var(--ink); transform: none; }

.spot-fine { margin-top: 24px; }

/* ============ HUD ============ */
.hud { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 20px 0 14px; }
.hud-back {
  font: inherit; font-weight: 800; cursor: pointer; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 15px;
}
.hud-back:hover { border-color: var(--brand); color: var(--brand-ink); }
.hud-scene { font-family: var(--font-display); font-weight: 700; font-size: 1.16rem; }
.hud-count {
  display: inline-flex; align-items: baseline; gap: 4px; padding: 5px 13px; border-radius: 999px;
  background: color-mix(in srgb, var(--c-seek) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c-seek) 40%, var(--line));
  font-weight: 800; color: var(--c-seek);
}
.hud-count b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.hud-spacer { flex: 1 1 auto; }
.hud-stat { display: flex; flex-direction: column; align-items: center; line-height: 1.1; min-width: 56px; }
.hud-label { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); font-weight: 800; }
.hud-value { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 1.02rem; }
.hud-hint {
  font: inherit; font-family: var(--font-display); font-weight: 600; cursor: pointer; color: #fff;
  background: var(--brand); border: 0; border-radius: 999px; padding: 9px 16px;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 38%, transparent);
}
.hud-hint:hover:not(:disabled) { transform: translateY(-1px); }
.hud-hint:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* ============ stage: two panels ============ */
.spot-caption { text-align: center; color: var(--ink-soft); font-weight: 800; margin: 0 0 10px; font-size: .96rem; }
.spot-caption b { color: var(--brand-ink); }
.spot-stage { display: flex; gap: 16px; align-items: flex-start; }
.spot-panel {
  position: relative; flex: 1 1 0; min-width: 0; aspect-ratio: 4 / 3;
  background: #cdeaf6; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); cursor: crosshair; touch-action: manipulation;
}
.spot-panel .spot-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; }
.spot-panel .panel-tag {
  position: absolute; left: 10px; top: 10px; z-index: 4; pointer-events: none;
  font-family: var(--font-display); font-weight: 600; font-size: .74rem; letter-spacing: .03em;
  color: #fff; background: rgba(33,30,26,.62); padding: 3px 10px; border-radius: 999px;
}
/* stacked on narrow screens: let aspect-ratio drive each panel's height
   (flex:1 1 0 would collapse it to 0 in a column flex container) */
@media (max-width: 760px) {
  .spot-stage { flex-direction: column; }
  .spot-panel { flex: none; width: 100%; }
}

/* ---- found marker (both panels) ---- */
.spot-found {
  position: absolute; z-index: 5; width: 42px; height: 42px; margin: -21px 0 0 -21px;
  border: 4px solid var(--spot-ok); border-radius: 50%; pointer-events: none;
  background: color-mix(in srgb, var(--spot-ok) 16%, transparent);
  display: grid; place-items: center; animation: spotFound .45s cubic-bezier(.3,1.4,.5,1) both;
}
.spot-found::after { content: "✓"; color: var(--spot-ok); font-weight: 900; font-size: 20px; line-height: 1; }
@keyframes spotFound { 0% { transform: scale(0); } 100% { transform: scale(1); } }

/* ---- miss ping (reused pattern) ---- */
.miss-ping {
  position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; z-index: 6;
  border: 3px solid var(--brand); border-radius: 50%; pointer-events: none;
  animation: missPing .6s ease-out forwards;
}
@keyframes missPing { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(3.4); opacity: 0; } }

/* ---- hint ring (reused pattern) ---- */
.hint-ring {
  position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; z-index: 6;
  border: 4px solid #ffd166; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(10,12,20,.14);
  animation: hintRing 1.4s ease-out forwards;
}
@keyframes hintRing { 0% { transform: scale(8); opacity: 0; } 25% { opacity: 1; } 100% { transform: scale(1); opacity: .9; } }

/* ============ win modal (reused pattern) ============ */
.win { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center;
  background: rgba(10,12,20,.5); backdrop-filter: blur(3px); padding: 20px; }
.win[hidden] { display: none; }   /* class display must not beat the hidden attr */
.win-card {
  background: var(--surface); color: var(--ink); border-radius: 22px; padding: 30px 30px 26px;
  text-align: center; max-width: 400px; width: 100%; box-shadow: 0 24px 70px rgba(0,0,0,.4);
  animation: winPop .35s ease both;
}
@keyframes winPop { 0% { transform: scale(.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.win-rocko { width: 116px; height: 116px; animation: rockoWag 1s ease-in-out infinite alternate; }
@keyframes rockoWag { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
.win-card h2 { font-size: 1.9rem; margin: 6px 0 4px; }
.win-time { font-size: 1.05rem; color: var(--ink-soft); font-weight: 700; margin: 0 0 2px; }
.win-time strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.win-best { font-weight: 800; color: var(--brand-ink); margin: 4px 0 18px; min-height: 1.2em; }
.win-actions { display: flex; flex-direction: column; gap: 10px; }
.win-actions .btn { justify-content: center; border-radius: 14px; }

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

/* ── Lock-and-fit the play screen so it never internal-scrolls (Ron 2026-09-30:
   game screens locked, no scroll). Scoped to the play state via body.spot.rk-playing,
   so the scene gallery is untouched. The play view fills the locked height as a flex
   column; the two pictures share the space and letterbox to contain (SVG
   preserveAspectRatio), so nothing spills off. ── */
body.spot.rk-playing #view-game.game {
  display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden;
}
body.spot.rk-playing .hud { flex: 0 0 auto; margin: 12px 0 8px; }
body.spot.rk-playing .spot-caption { flex: 0 0 auto; margin: 0 0 8px; }
body.spot.rk-playing .spot-stage { flex: 1 1 auto; min-height: 0; align-items: stretch; flex-direction: row; }
body.spot.rk-playing .spot-panel { flex: 1 1 0; min-width: 0; width: auto; height: 100%; min-height: 0; aspect-ratio: auto; }
/* portrait phones only: stack the two pictures, sharing the height (landscape keeps
   them side by side so each stays as big as possible) */
@media (max-width: 760px) and (orientation: portrait) {
  body.spot.rk-playing .spot-stage { flex-direction: column; }
  body.spot.rk-playing .spot-panel { width: 100%; height: auto; }
}
