/* Spot the Difference — game styles (builds on /assets/site.css) */
[hidden] { display: none !important; }

/* ---------- menu ---------- */
.menu-main { padding: 28px 0 60px; }
.menu-head { text-align: center; max-width: 640px; margin: 0 auto 22px; }
.menu-head h1 { font-size: clamp(2.3rem, 7vw, 3.6rem); margin-bottom: .15em; }
.menu-head p { color: var(--ink-soft); font-weight: 700; }

.levels { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 30px; }
.level {
  font: inherit; cursor: pointer; border: 3px solid transparent;
  background: var(--card); color: var(--ink); border-radius: 20px;
  padding: 10px 22px 12px; min-width: 150px; text-align: center;
  box-shadow: 0 4px 0 rgba(59,42,30,.12);
  display: flex; flex-direction: column; align-items: center; line-height: 1.15;
  transition: transform .12s ease;
}
.level:hover { transform: translateY(-2px); }
.level b { font-family: var(--font-display); font-size: 1.25rem; }
.level small { color: var(--ink-soft); font-weight: 700; }
.lv-stars { color: var(--yellow-deep); font-size: 1.2rem; letter-spacing: 2px; }
.level[aria-checked="true"] { border-color: var(--red); background: #fff3d6; box-shadow: 0 4px 0 var(--red-deep); }

.pick-title { text-align: center; font-size: 1.8rem; margin-bottom: 16px; }
.scene-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.scene-card {
  font: inherit; color: inherit; text-align: left; cursor: pointer; padding: 0; border: 0;
  background: var(--card); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow);
  transition: transform .15s ease;
}
.scene-card:hover { transform: translateY(-4px) rotate(-.5deg); }
.scene-card img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.scene-card .sc-body { padding: 10px 14px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.scene-card b { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.1; display: block; }
.scene-card small { color: var(--ink-soft); font-weight: 700; font-size: .8rem; }
.sc-stars { white-space: nowrap; font-size: 1.15rem; letter-spacing: 1px; color: #e3d3b4; }
.sc-stars .on { color: var(--yellow); text-shadow: 0 1px 0 var(--yellow-deep); }
.total-stars { text-align: center; font-weight: 800; color: var(--ink-soft); margin-top: 28px; }
@media (max-width: 520px) {
  .scene-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .scene-card b { font-size: 1rem; }
  .scene-card .sc-body { flex-direction: column; align-items: flex-start; padding: 8px 10px 10px; }
  .level { min-width: 0; flex: 1 1 0; padding: 8px 6px 10px; }
  .level b { font-size: 1.05rem; }
}

/* ---------- play ---------- */
#play { height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--paper); overflow: hidden; }
.toolbar {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 10px max(12px, env(safe-area-inset-left)) 10px max(12px, env(safe-area-inset-right));
}
.tb-btn {
  flex: none; height: 48px; min-width: 48px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--card); color: var(--ink); box-shadow: 0 3px 0 rgba(59,42,30,.15);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px;
  font: 800 1rem var(--font-body);
}
.tb-btn svg { width: 24px; height: 24px; }
.tb-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(59,42,30,.15); }
.tb-btn.hint { background: var(--yellow); box-shadow: 0 3px 0 var(--yellow-deep); }
.tb-btn.hint:disabled { opacity: .5; cursor: default; }
#soundBtn .snd-off { display: none; }
.music-toggle .mt-slash { display: none; }
.music-toggle[aria-pressed="false"] .mt-slash { display: inline; }
.music-toggle[aria-pressed="false"] { opacity: .75; }
.menu-music {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 4px;
  font: 800 .95rem var(--font-body); color: var(--ink); cursor: pointer;
  background: var(--card); border: 0; border-radius: 999px; padding: 8px 16px;
  box-shadow: 0 3px 0 rgba(59,42,30,.12);
}
.menu-music svg { width: 20px; height: 20px; }
#soundBtn[aria-pressed="false"] .snd-on { display: none; }
#soundBtn[aria-pressed="false"] .snd-off { display: block; }
.tb-title { flex: 1; min-width: 0; text-align: center; }
.tb-title span { display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 4px; }
.dot { width: 18px; height: 18px; border-radius: 50%; background: #eadcc0; box-shadow: inset 0 2px 0 rgba(0,0,0,.08); transition: transform .3s cubic-bezier(.3,1.8,.5,1), background .2s; }
.dot.on { background: var(--green); transform: scale(1.2); box-shadow: none; }
@media (max-width: 520px) { .tb-label { display: none; } .tb-btn { padding: 0 10px; } }

.boards {
  flex: 1; min-height: 0; position: relative;
  display: flex; gap: 12px; align-items: center; justify-content: center;
  padding: 0 12px;
}
.boards.stacked { flex-direction: column; gap: 10px; }
/* Board width is set by game.js (whichever layout gives the biggest pictures). */
.board {
  position: relative; flex: none; width: 45%;
  border-radius: 16px; overflow: hidden; background: #e9dcc2;
  box-shadow: 0 0 0 4px #fff, 0 8px 24px rgba(59,42,30,.18);
  touch-action: manipulation; cursor: crosshair; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.board canvas { display: block; width: 100%; height: auto; aspect-ratio: var(--ar, 1.5); }
.board .marks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.play-tip { flex: none; text-align: center; margin: 8px 0 max(10px, env(safe-area-inset-bottom)); font-weight: 800; color: var(--ink-soft); font-size: .95rem; min-height: 1.4em; }
.play-tip.nudge { color: var(--red); }
.loading { position: absolute; inset: 0; display: grid; place-items: center; font: 800 1.4rem var(--font-display); color: var(--ink-soft); background: var(--paper); }

.boards.shake .board { animation: shake .35s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* marks (SVG) */
.found-ring { fill: none; stroke: #2fbf4a; stroke-linecap: round; filter: drop-shadow(0 0 3px #fff); animation: ring-in .45s ease-out both; }
.found-ring-bg { fill: none; stroke: #fff; opacity: .9; animation: ring-in .45s ease-out both; }
@keyframes ring-in { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
.tag { animation: pop .5s cubic-bezier(.3,1.8,.5,1) both; transform-box: fill-box; transform-origin: center; }
.tag rect { fill: #2fbf4a; }
.tag text { fill: #fff; font: 800 30px var(--font-body); }
@keyframes pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.miss { stroke: var(--red); stroke-linecap: round; animation: miss 0.9s ease-out forwards; }
@keyframes miss { 0% { opacity: 0; } 15% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
.hint-ring { fill: rgba(255, 214, 80, .25); stroke: #ffc21a; animation: hint-pulse 0.8s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes hint-pulse { from { transform: scale(.92); } to { transform: scale(1.08); } }
.sparkle { fill: #ffd23f; animation: spark .7s ease-out forwards; transform-box: fill-box; transform-origin: center; }
@keyframes spark { from { opacity: 1; transform: translate(0,0) scale(1); } to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.3); } }

/* ---------- win ---------- */
.win { position: fixed; inset: 0; z-index: 50; background: rgba(40, 24, 10, .45); display: grid; place-items: center; padding: 16px; animation: fade .3s; }
@keyframes fade { from { opacity: 0; } }
.win-card {
  background: var(--card); border-radius: 30px; padding: 26px 26px 22px; text-align: center;
  width: min(440px, 100%); box-shadow: 0 10px 0 rgba(59,42,30,.18), 0 30px 60px rgba(0,0,0,.25);
  animation: pop .5s cubic-bezier(.3,1.6,.5,1);
}
.win-card h2 { font-size: 2.6rem; margin: 4px 0 2px; color: var(--red); }
.win-card p { font-weight: 700; color: var(--ink-soft); }
.win-stars { font-size: 3.4rem; line-height: 1; letter-spacing: 6px; }
.win-stars span { color: #eadcc0; display: inline-block; }
.win-stars span.on { color: var(--yellow); text-shadow: 0 3px 0 var(--yellow-deep); animation: pop .5s cubic-bezier(.3,1.8,.5,1) both; }
.win-stars span.on:nth-child(2) { animation-delay: .25s; }
.win-stars span.on:nth-child(3) { animation-delay: .5s; }
.win-buttons { display: flex; flex-direction: column; gap: 12px; align-items: stretch; margin-top: 8px; }
.win-links { display: flex; justify-content: center; gap: 18px; }
.btn-link { background: none; border: 0; font: 800 1rem var(--font-body); color: var(--ink-soft); cursor: pointer; padding: 6px; text-decoration: underline; }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }
