/* Rocko's Scavenger Hunt — a hidden-object / I-Spy.
   Loaded by /scavenger/ on TOP of the shared /styles.css design tokens, the
   same pattern as /spot/spot.css and /play/play.css. Warm "Creative Library"
   system (paper / surface / ink / brand #F04E37), seek-category accent. The
   festive dark stage comes from /landing.css (body.rk-land), loaded after this. */
:root {
  /* seek-category hue, mirrored from home.css so /scavenger/ works standalone */
  --c-seek: #2E74E8;
  --scav-ok: #2FA24B;   /* "found it" green */
}
@media (prefers-color-scheme: dark) {
  :root { --c-seek: #5C9BFF; --scav-ok: #56C878; }
}

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

/* ============ scene select ============ */
.scav-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);
}
.scav-hero-art {
  flex: 0 0 auto; width: 116px; height: 116px;
  filter: drop-shadow(0 10px 20px rgba(30,22,14,.18));
}
.scav-hero-copy { flex: 1 1 300px; min-width: 0; }
.scav-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;
}
.scav-hero h1 { font-size: clamp(1.9rem, 4.8vw, 3rem); margin: 0 0 .26em; }
.scav-hero h1 .accent { color: var(--brand); }
.scav-hero .lede { font-size: 1.06rem; font-weight: 700; color: var(--ink-soft); margin: 0; max-width: 54ch; }
.scav-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: var(--ink);   /* not inherit — cards are light panels on the dark stage */
  transition: transform .12s ease, box-shadow .12s ease;
}
.level-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.level-thumb {
  position: relative; height: 138px; overflow: hidden; background: #cdeaf6;
  border-bottom: 1px solid var(--line);
}
.level-thumb .scav-svg { position: absolute; inset: 0; 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 (mirrors /spot/) */
.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: .9rem; }
.diff-btn .db { font-size: .64rem; font-weight: 800; color: var(--ink-soft); }
.diff-btn .db.has { color: var(--brand-ink); }

/* locked scenes (shared .level-card.locked lives in styles.css; the thumb here is
   an inline SVG, not an <img>, so mirror the grey-out and calm the diff chips) */
.level-card.locked .level-thumb .scav-svg { filter: grayscale(1) brightness(.66); }
.level-card.locked .diff-btn { opacity: .5; cursor: default; }
.level-card.locked .diff-btn:hover { border-color: var(--line); color: var(--ink); transform: none; }

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

/* ============ HUD ============ */
.hud { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 20px 0 12px; }
.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; }

/* ============ checklist ============ */
.scav-caption { text-align: center; color: var(--ink-soft); font-weight: 800; margin: 0 0 10px; font-size: .96rem; }
.scav-caption b { color: var(--brand-ink); }
.checklist {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 0 14px;
}
.ck-item {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 9px; border-radius: 999px;
  background: var(--surface); border: 1.5px solid var(--line); box-shadow: var(--shadow);
  font-weight: 800; font-size: .92rem; color: var(--ink);
  transition: opacity .2s ease, background .2s ease, border-color .2s ease;
}
.ck-item .ck-ic { font-size: 1.15rem; line-height: 1; }
.ck-item .ck-ic img { width: 22px; height: 22px; display: block; }
.ck-item .ck-n {
  font-variant-numeric: tabular-nums; font-weight: 900; color: var(--c-seek);
  background: color-mix(in srgb, var(--c-seek) 14%, var(--surface));
  border-radius: 999px; padding: 1px 8px; font-size: .82rem;
}
.ck-item.rocko { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.ck-item.rocko .ck-n { color: var(--brand-ink); background: color-mix(in srgb, var(--brand) 14%, var(--surface)); }
.ck-item.done {
  opacity: .55; background: color-mix(in srgb, var(--scav-ok) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--scav-ok) 45%, var(--line));
}
.ck-item.done .ck-label { text-decoration: line-through; }
.ck-item.done .ck-n { color: #fff; background: var(--scav-ok); }
.ck-item.ping { animation: ckPing .4s cubic-bezier(.3,1.5,.5,1); }
@keyframes ckPing { 0% { transform: scale(1); } 45% { transform: scale(1.14); } 100% { transform: scale(1); } }

/* ============ viewport / stage (pan + zoom, from /play/) ============ */
.viewport {
  position: relative; width: 100%; aspect-ratio: 3 / 2; max-height: 76vh;
  overflow: hidden; border-radius: 18px; border: 1px solid var(--line);
  background: #bfe0ef; box-shadow: var(--shadow);
  cursor: grab; touch-action: none; user-select: none;
}
.viewport:active { cursor: grabbing; }
.viewport img { -webkit-user-drag: none; user-drag: none; }
.stage { position: absolute; inset: 0; transform-origin: 0 0; will-change: transform; }
.scene-layer { position: absolute; inset: 0; }
.scene-layer .scav-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* findable tap targets live inside the svg; feedback is drawn in svg space too */
.scav-svg .find { cursor: pointer; }
.scav-svg .sv-found { animation: svFound .4s cubic-bezier(.3,1.4,.5,1) both; transform-box: fill-box; transform-origin: center; }
@keyframes svFound { 0% { transform: scale(0); } 100% { transform: scale(1); } }
.scav-svg .sv-hint { transform-box: fill-box; transform-origin: center; animation: svHint 1.4s ease-out forwards; }
@keyframes svHint { 0% { transform: scale(8); opacity: 0; } 22% { opacity: 1; } 100% { transform: scale(1); opacity: .95; } }
.scav-svg .sv-miss { transform-box: fill-box; transform-origin: center; animation: svMiss .6s ease-out forwards; }
@keyframes svMiss { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(3.4); opacity: 0; } }

.zoom-controls { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.zoom-controls button {
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
  background: rgba(20,24,36,.82); color: #fff; border: 1px solid rgba(255,255,255,.18);
  font-size: 1.2rem; font-weight: 700; line-height: 1;
}
.zoom-controls button:hover { background: rgba(20,24,36,.98); }
.viewport-hint {
  position: absolute; left: 12px; bottom: 12px; margin: 0; pointer-events: none;
  color: #fff; background: rgba(20,24,36,.6); padding: 4px 10px; border-radius: 999px; font-size: .76rem;
}
@media (max-width: 520px) { .viewport-hint { display: none; } }

/* found toast */
.found-toast {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  background: var(--scav-ok); color: #fff; font-weight: 800; font-size: .95rem;
  padding: 8px 18px; border-radius: 999px; z-index: 7; pointer-events: none;
  box-shadow: 0 6px 20px rgba(0,0,0,.3); white-space: nowrap;
  animation: foundPop .9s ease forwards;
}
@keyframes foundPop {
  0% { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(.9); }
  15% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  80% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-6px); }
}

/* ============ 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; } }
