/* spotdiff — 找不同 */

.app { max-width: 980px; padding-bottom: 32px; }

/* ── HUD ───────────────────────────────────────────── */
.hud { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px auto; max-width: 600px; }
.hud-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 8px 6px; text-align: center; box-shadow: var(--shadow-sm); min-width: 0;
}
.hud-label { font-size: 11px; color: var(--text-muted); letter-spacing: 0.5px; white-space: nowrap; }
.hud-value {
  font-size: 20px; font-weight: 800; color: var(--accent); margin-top: 2px;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
:where(body:not(.dark)) .hud-value { color: color-mix(in srgb, var(--accent) 55%, #000); }
.hud-value.low { color: #e53935 !important; }
body.dark .hud-value.low { color: #ff6e6e !important; }

/* ── Toolbar ───────────────────────────────────────── */
.toolbar { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 10px; }
.seg { display: flex; gap: 4px; }
.diff-btn[aria-pressed="true"], #daily-btn[aria-pressed="true"] {
  background: #6a1b9a; color: #fff; box-shadow: 0 0 0 2px #ce93d8 inset;
}

/* ── Scenes ────────────────────────────────────────── */
.scenes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.scenes.site-paused { visibility: hidden; }
.scene-box {
  position: relative; border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-lg); border: 3px solid var(--surface); background: var(--surface);
}
.scene-tag {
  font-size: 11px; font-weight: 800; padding: 3px 8px; line-height: 1.2;
  color: var(--text-strong); background: var(--surface);
}
.scene-holder { line-height: 0; }
.scene-holder svg {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 3;
  cursor: crosshair; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.scene-box.shake { animation: sd-shake 0.38s ease; }
@keyframes sd-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}
.scenes.locked .scene-holder svg { cursor: default; }

/* Keyboard play: focus a picture, arrows move the crosshair, Enter / Space taps */
.scene-holder svg:focus { outline: none; }
.scene-holder svg:focus-visible { outline: 3px solid #ffd54f; outline-offset: -3px; }
.kb-cursor { display: none; pointer-events: none; fill: none; stroke: #fff; stroke-width: 2.5; }
.kb-cursor circle { stroke: #d500f9; stroke-width: 2.5; }
.kb-cursor path { stroke: #d500f9; stroke-width: 2.5; stroke-linecap: round; }
.kb-cursor .kb-dot { fill: #d500f9; stroke: #fff; stroke-width: 0.8; }
.scene-holder svg:focus-visible .kb-cursor { display: inline; filter: drop-shadow(0 0 1.5px #fff); }
.kb-legend { margin-top: 0; }

/* Marks inside the SVG */
.mark-ring { fill: none; stroke: #00c853; stroke-width: 3.5; }
.mark-halo { fill: none; stroke: #fff; stroke-width: 7; opacity: 0.9; }
.mark-ring.hinted { stroke: #ffab00; }
.mark-ring.missed { stroke: #e53935; stroke-dasharray: 6 4; }
.mark-ring.pop { animation: sd-pop 0.35s ease-out; transform-box: fill-box; transform-origin: center; }
@keyframes sd-pop { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.miss-x { stroke: #e53935; stroke-width: 3.5; stroke-linecap: round; }
.penalty {
  position: absolute; z-index: 3; pointer-events: none; font-weight: 900; font-size: 18px;
  color: #ff1744; text-shadow: 0 1px 0 #fff, 0 0 4px #fff; transform: translate(-50%, -100%);
  animation: sd-rise 0.9s ease-out forwards;
}
@keyframes sd-rise { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -28px; } }

/* ── Actions ───────────────────────────────────────── */
.action-row { display: flex; justify-content: center; gap: 8px; margin: 12px 0 6px; flex-wrap: wrap; }
.hint-btn { background: #f9a825; color: #3e2723; }
.hint-btn:hover:not(:disabled) { background: #f57f17; }
.legend { font-size: 12px; color: var(--text-muted); text-align: center; margin: 6px 4px; line-height: 1.5; }

/* ── Overlay ───────────────────────────────────────── */
.sd-overlay {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(20, 10, 30, 0.5); padding: 16px;
}
.sd-overlay[hidden] { display: none; }
.sd-card {
  background: var(--surface); color: var(--text-strong); border-radius: var(--radius-lg);
  padding: 22px 26px; text-align: center; box-shadow: var(--shadow-lg); max-width: 340px; width: 100%;
}
.sd-icon { font-size: 40px; }
.sd-title { font-size: 22px; font-weight: 800; margin: 6px 0; }
.sd-sub { font-size: 14px; color: var(--text); margin-bottom: 14px; line-height: 1.6; }
.sd-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.btn.primary { background: #6a1b9a; color: #fff; }
.btn.primary:hover:not(:disabled) { background: #4a148c; }

@media (max-width: 700px) {
  .scenes { grid-template-columns: 1fr; gap: 8px; }
  .hud { gap: 5px; }
  .hud-value { font-size: 17px; }
}
