:root {
  color-scheme: light;
  --page: #eaf4ff;
  --surface: #f9fcff;
  --card: #ffffff;
  --ink: #17223b;
  --muted: #63708a;
  --line: #dce7f4;
  --shadow: 0 18px 55px rgba(35, 69, 116, 0.14);
  --soft-shadow: 0 8px 24px rgba(35, 69, 116, 0.11);
  --primary: #5867e8;
  --primary-dark: #3f4fce;
  --success: #14866d;
  --danger: #d65068;
  --gold: #f1a928;
}

/* SeasonSpark seasonal puzzle experience */
.game-guide {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  color: var(--muted);
  font-weight: 750;
  text-align: center;
}

.game-guide img { width: 2.75rem; height: 2.75rem; object-fit: contain; }
.game-guide img.brand-emblem {
  border-radius: .85rem;
  box-shadow: 0 5px 15px rgba(16, 48, 102, .22);
}
.game-guide p { margin: 0; }

.hint-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .55rem .8rem;
  margin-top: .35rem;
}

.hint-row small { color: var(--muted); font-weight: 650; }
.hint-button {
  border: 1px solid color-mix(in srgb, var(--accent, var(--primary)) 42%, var(--line));
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  padding: .68rem 1rem;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 7px 18px rgba(34, 51, 71, .08);
}

.odd-tile.is-hinted,
.choice-button.is-hinted {
  outline: 4px solid #f3bd4c;
  outline-offset: 2px;
  animation: hint-pulse 1.15s ease-in-out infinite;
}

.scene-hotspot.hinted {
  opacity: 1;
  z-index: 5;
  border: 0;
  background: transparent;
  animation: none;
}

.scene-hotspot.hinted::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(calc(100% + 14px), 42px);
  height: max(calc(100% + 14px), 42px);
  transform: translate(-50%, -50%);
  border: 4px solid #ffd400;
  border-radius: 12px;
  background: rgba(255, 234, 0, .32);
  box-shadow: 0 0 0 3px #ffffff, 0 0 0 7px rgba(255, 73, 137, .95), 0 0 22px 9px rgba(255, 222, 0, .75);
  pointer-events: none;
  animation: spot-hint-pulse .8s ease-in-out infinite alternate;
}

.scene-hotspot.hinted::after {
  content: "HINT";
  position: absolute;
  left: 50%;
  top: max(calc(100% + 9px), 34px);
  transform: translateX(-50%);
  padding: 3px 7px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #d91f67;
  color: #fff;
  box-shadow: 0 3px 9px rgba(27, 20, 44, .38);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: .08em;
  pointer-events: none;
}

.result-mascots { position:relative; width:min(78vw,330px); height:250px; margin:8px auto 16px; display:grid; place-items:center; }
.result-mascots .result-mascot { width:210px; height:210px; object-fit:contain; }
.result-mascots.lumi-unavailable { display:none; flex-basis:0; min-height:0; height:0; margin:0; }

.focus-garden {
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  padding: 1rem;
  background: linear-gradient(145deg, color-mix(in srgb, #dff5ee 75%, var(--card)), color-mix(in srgb, #e7e5ff 72%, var(--card)));
  box-shadow: var(--soft-shadow);
}

.focus-garden > div:first-child { display: flex; align-items: center; gap: .75rem; }
.focus-garden strong, .focus-garden small { display: block; }
.focus-garden small { color: var(--muted); margin-top: .2rem; }
.garden-scene {
  min-height: 7.5rem;
  margin: .8rem 0;
  border-radius: 1.1rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  overflow: hidden;
  padding: .55rem 1rem;
  background: radial-gradient(circle at 50% 15%, rgba(255,255,255,.92), transparent 35%), linear-gradient(#bfe9ec, #d8efd8);
  color: #f2aa32;
  font-size: 1.5rem;
}

.garden-scene img { width: 5.75rem; height: 5.75rem; object-fit: contain; animation: lumi-float 3.4s ease-in-out infinite; }
.lumi-pulse { animation: lumi-float 3.4s ease-in-out infinite; }
.lumi-bright { filter: drop-shadow(0 0 16px rgba(246, 187, 70, .66)); }

@keyframes hint-pulse { 50% { transform: scale(1.035); filter: brightness(1.05); } }
@keyframes spot-hint-pulse {
  from { transform: translate(-50%, -50%) scale(.92); filter: brightness(1); }
  to { transform: translate(-50%, -50%) scale(1.08); filter: brightness(1.2); }
}
@keyframes lumi-float { 50% { transform: translateY(-6px) scale(1.025); } }

.chapter-trail { flex:0 0 auto; display:flex; gap:6px; overflow-x:auto; min-height:50px; padding:1px 2px 5px; scrollbar-width:none; scroll-snap-type:x proximity; }
.chapter-trail::-webkit-scrollbar { display:none; }
.test-mode-banner { flex:0 0 auto; display:flex; align-items:center; justify-content:center; min-height:24px; margin:0 0 4px; padding:3px 8px; border:1px solid color-mix(in srgb, var(--chapter-accent) 45%, var(--line)); border-radius:999px; background:color-mix(in srgb, var(--chapter-accent) 12%, var(--card)); color:var(--ink); text-align:center; }
.test-mode-banner strong { font-size:.69rem; line-height:1.15; }
.chapter-dot { flex:0 0 84px; min-height:46px; display:grid; grid-template-columns:22px 1fr; align-items:center; gap:4px; border:1px solid var(--line); border-radius:13px; padding:4px 5px; background:var(--card); color:var(--ink); font:inherit; cursor:pointer; scroll-snap-align:center; }
.chapter-dot span { display:grid; place-items:center; width:22px; height:22px; border-radius:50%; background:var(--line); font-size:.72rem; font-weight:900; }
.chapter-dot small { display:-webkit-box; width:100%; overflow:hidden; -webkit-box-orient:vertical; -webkit-line-clamp:2; color:var(--muted); font-size:.75rem; font-weight:800; line-height:1.05; text-align:left; }
.chapter-dot.active { border-color:var(--chapter-accent); box-shadow:inset 0 0 0 1px var(--chapter-accent); }
.chapter-dot.active span { background:var(--chapter-accent); color:#fff; }
.chapter-dot.locked { opacity:.54; }

.brand-name {
  display: block;
  margin-bottom: 3px;
  color: #357e83;
  font-size: .82rem;
  font-weight: 950;
  letter-spacing: .02em;
  line-height: 1;
  text-transform: none;
}

.season-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, #5c9b8f 40%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, #e2f4ec 72%, var(--card));
  color: #2f756f;
  font-size: .7rem;
  font-weight: 900;
  white-space: nowrap;
}

.town-marker.p1 { top:9%; right:7%; }
.town-marker.p2 { top:39%; right:5%; }
.town-marker.p3 { top:60%; left:5%; }
.town-marker.p4 { bottom:7%; right:12%; }
.chapter-gate { display:block; width:max-content; max-width:calc(100% - 30px); margin:12px auto 0; border:2px solid #ffe59a; border-radius:999px; padding:.75rem 1.15rem; background:rgba(20,49,62,.96); color:#fff; font:inherit; font-weight:900; box-shadow:0 8px 24px rgba(10,30,42,.22); }

.chapter-puzzle { display:grid; gap:18px; width:min(100%,620px); margin-inline:auto; }
.light-line,.crate-scene,.star-scene { min-height:118px; display:flex; align-items:center; justify-content:center; gap:10px; padding:18px; border:1px solid var(--line); border-radius:24px; background:radial-gradient(circle at 50% 15%,color-mix(in srgb,var(--accent) 18%,transparent),transparent 55%),var(--card); box-shadow:var(--soft-shadow); text-align:center; }
.light-line span { padding:10px; border-radius:12px; background:color-mix(in srgb,var(--accent) 12%,var(--card)); font-weight:850; }
.light-line i { color:var(--accent); font-size:1.5rem; font-style:normal; }
.crate-scene span { display:grid; place-items:center; width:72px; height:72px; border-radius:15px; background:#c98a4c; color:#fff0c8; font-size:2rem; box-shadow:inset 0 -8px rgba(91,51,24,.15); }
.star-scene { color:#f2bc44; font-size:1.35rem; letter-spacing:.08em; background:linear-gradient(150deg,#172044,#32306f); }
.ripple-grid { display:grid; grid-template-columns:repeat(4,1fr); width:min(78vw,330px); aspect-ratio:1; gap:7px; margin-inline:auto; padding:12px; border-radius:24px; background:#a9dce4; box-shadow:var(--soft-shadow); }
.ripple-grid span { display:grid; place-items:center; border-radius:13px; background:#dff6f4; color:#5ba8ba; font-size:1.35rem; }
.ripple-grid span.rock { background:#63747c; color:#93a1a5; }
.ripple-grid span.endpoint { background:var(--accent); color:#fff; font-weight:950; }

.hidden-game { display:grid; gap:11px; width:min(100%,520px); margin-inline:auto; }
.hidden-scene { position:relative; overflow:hidden; width:100%; max-height:54dvh; aspect-ratio:var(--scene-ratio,4/5); border:1px solid color-mix(in srgb,var(--accent) 35%,var(--line)); border-radius:24px 24px 10px 10px; background:#243b4b; box-shadow:var(--shadow); isolation:isolate; }
.hidden-scene > img { width:100%; height:100%; object-fit:cover; display:block; filter:saturate(.93) contrast(1.02); }
.hidden-scene::after { content:""; position:absolute; inset:0; z-index:1; pointer-events:none; border-radius:inherit; box-shadow:inset 0 0 0 1px rgba(255,255,255,.12), inset 0 -22px 46px rgba(18,28,37,.2); }
.hidden-object { position:absolute; z-index:2; left:var(--x); top:var(--y); transform:translate(-50%,-50%); display:grid; place-items:center; width:var(--spot-w); height:var(--spot-h); min-width:22px; min-height:18px; padding:0; border:2px solid transparent; border-radius:24%; background:transparent; cursor:crosshair; transition:background .18s,border-color .18s,opacity .18s,transform .18s; }
.hidden-object > span { width:100%; height:100%; display:block; border-radius:inherit; }
.hidden-object:hover,.hidden-object:focus-visible { transform:translate(-50%,-50%) scale(1.08); border-color:rgba(255,229,140,.9); background:rgba(255,234,157,.12); outline:3px solid rgba(255,255,255,.55); outline-offset:2px; }
.hidden-object.found { opacity:0; pointer-events:none; }
.hidden-object.hinted { border-color:#ffe05f; background:rgba(255,232,112,.18); box-shadow:0 0 0 3px rgba(255,237,139,.35),0 0 16px rgba(255,222,87,.62); animation:hidden-pulse 1.1s ease-in-out infinite; }
.hidden-tray { display:grid; grid-template-columns:repeat(auto-fit,minmax(82px,1fr)); gap:8px; padding:10px; border:1px solid var(--line); border-radius:10px 10px 20px 20px; background:color-mix(in srgb,#402d24 88%,var(--card)); box-shadow:var(--soft-shadow); }
.hidden-target { display:grid; justify-items:center; gap:3px; min-width:0; color:white; }
.hidden-target-thumb { display:grid; place-items:center; overflow:hidden; width:46px; height:46px; padding:0; border:1px solid rgba(255,244,207,.42); border-radius:12px; background-color:rgba(255,255,255,.13); background-image:var(--thumb-image); background-repeat:no-repeat; background-size:var(--thumb-size,270%) auto; background-position:var(--thumb-pos-x,50%) var(--thumb-pos-y,50%); color:#fff4cf; font-size:1.25rem; box-shadow:inset 0 0 0 2px rgba(32,28,24,.12); }
.hidden-target small { width:100%; overflow:hidden; text-overflow:ellipsis; color:#f9eadc; font-size:.65rem; font-weight:850; line-height:1.15; text-align:center; }
.hidden-target.found { opacity:.45; text-decoration:line-through; }
.hidden-target.found .hidden-target-thumb { background-color:rgba(255,229,140,.2); background-image:none; border-color:#ffe58c; }
.hidden-tip { margin:0; color:var(--muted); font-size:.72rem; font-weight:750; line-height:1.35; text-align:center; }
@keyframes hidden-pulse { 50% { transform:translate(-50%,-50%) scale(1.1); } }

@media (max-width:430px) {
  .chapter-dot { flex-basis:82px; }
  .town-marker { max-width:130px; }
  .light-line { gap:5px; padding:12px 8px; }
  .light-line span { padding:8px 6px; font-size:.8rem; }
  .season-pill { display: none; }
  .cove-actions { gap: 6px; }
  .spark-pill { min-height: 34px; padding-inline: 10px; }
  .brand-lockup > img { flex-basis: 38px; width: 38px; height: 38px; border-radius: 11px; }
}

/* SeasonSpark world layer */
.cove-home {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding: calc(6px + env(safe-area-inset-top)) 10px calc(6px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% -10%, rgba(110, 211, 220, .28), transparent 36%),
    var(--surface);
}

.cove-topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  margin-bottom: 5px;
}

.cove-topbar p,
.cove-topbar h1 { margin: 0; }
.cove-topbar p { color: var(--muted); font-size: .78rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.cove-topbar h1 { display:-webkit-box; overflow:hidden; -webkit-box-orient:vertical; -webkit-line-clamp:2; font-size:clamp(1.02rem,4.6vw,1.4rem); line-height:1.02; letter-spacing:-.035em; }
.cove-actions { display: flex; align-items: center; gap: 8px; }
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand-lockup > img {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 7px 18px rgba(27, 68, 127, .22);
}
.brand-lockup > div { min-width: 0; }
.spark-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid color-mix(in srgb, #f0aa29 42%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, #fff3c8 70%, var(--card));
  color: color-mix(in srgb, #9a5a08 78%, var(--ink));
  font-weight: 950;
  box-shadow: var(--soft-shadow);
}

.chapter-intro-popover {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 5;
  display: grid;
  grid-template-columns: 54px 1fr 32px;
  align-items: center;
  gap: 9px;
  padding: 8px 8px 8px 5px;
  border: 1px solid color-mix(in srgb, #57aeb4 30%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(14px);
  animation: chapter-intro-in .25s ease-out both;
}

.chapter-intro-popover img { width:54px; height:54px; object-fit:contain; animation:lumi-float 3.4s ease-in-out infinite; }
.chapter-intro-popover.lumi-unavailable { grid-template-columns:1fr 30px; }
.chapter-intro-popover div { min-width:0; }
.chapter-intro-popover small,.chapter-intro-popover strong { display:block; }
.chapter-intro-popover small { overflow:hidden; color:#347d83; font-size:.66rem; font-weight:900; text-overflow:ellipsis; text-transform:uppercase; white-space:nowrap; }
.chapter-intro-popover strong { margin-top:2px; font-size:.86rem; line-height:1.22; }
.chapter-intro-popover button { display:grid; place-items:center; width:30px; height:30px; padding:0; border:1px solid var(--line); border-radius:50%; background:var(--card); color:var(--muted); cursor:pointer; }

@keyframes chapter-intro-in { from { opacity:0; transform:translateY(-9px) scale(.97); } }

.town-heading {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
  margin: 0 2px 4px;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 750;
}

.town-heading strong { color: var(--ink); font-size: .82rem; }

.town-map {
  flex: 1 1 0;
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 0;
  border: 1px solid color-mix(in srgb, #317f91 30%, var(--line));
  border-radius: 22px;
  background: #6ebdc9;
  box-shadow: 0 18px 42px rgba(34, 79, 97, .2);
  isolation: isolate;
}

.town-map::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(13, 41, 63, .05), transparent 42%, rgba(13, 41, 63, .2));
}

.town-map-art { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; transition: filter .8s ease; }

.season-fall .chapter-intro-popover {
  border-color: color-mix(in srgb, #c97932 38%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, #ffe3bc 76%, var(--card)), color-mix(in srgb, #f1e0cf 74%, var(--card)));
}

.season-fall .chapter-intro-popover small { color: #a75a2f; }

.season-fall .season-pill {
  border-color: color-mix(in srgb, #c97932 46%, var(--line));
  background: color-mix(in srgb, #ffe0b7 76%, var(--card));
  color: #a75a2f;
}

.season-fall .town-map {
  border-color: color-mix(in srgb, #b86333 44%, var(--line));
  background: #aa6a46;
}

.season-fall .town-map-art {
  filter: saturate(var(--map-saturation, .9)) brightness(var(--map-brightness, .84)) contrast(1.04);
}

.season-fall .town-map.lit-0 { --map-brightness: .84; --map-saturation: .88; }
.season-fall .town-map.lit-1 { --map-brightness: .88; --map-saturation: .93; }
.season-fall .town-map.lit-2 { --map-brightness: .92; --map-saturation: .97; }
.season-fall .town-map.lit-3 { --map-brightness: .96; --map-saturation: 1; }
.season-fall .town-map.lit-4 { --map-brightness: 1; --map-saturation: 1.04; }

.town-light {
  position: absolute;
  z-index: 2;
  width: 42%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 220, 112, .76) 0, rgba(255, 172, 58, .34) 34%, transparent 70%);
  filter: blur(7px);
  opacity: 0;
  pointer-events: none;
  transform: scale(.35);
  transition: opacity .65s ease, transform .75s cubic-bezier(.2,.9,.25,1.18);
}

.town-light.is-lit { opacity: .9; transform: scale(1); animation: town-lantern-breathe 3.2s ease-in-out infinite; }
.town-light.p1 { top: -8%; right: -7%; }
.town-light.p2 { top: 28%; right: -9%; }
.town-light.p3 { top: 49%; left: -9%; }
.town-light.p4 { right: -4%; bottom: -9%; }

@keyframes town-lantern-breathe {
  50% { opacity: .7; transform: scale(.92); }
}

.season-fall .town-marker.restored { border-color: #ffd18b; }
.season-fall .cove-toast { border-color: color-mix(in srgb, #c97932 40%, var(--line)); }
.town-marker {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 144px;
  min-height: 45px;
  padding: 5px 8px 5px 6px;
  border: 2px solid rgba(255,255,255,.86);
  border-radius: 15px;
  background: rgba(21, 47, 58, .88);
  color: white;
  text-align: left;
  box-shadow: 0 8px 22px rgba(10, 30, 42, .33);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.town-marker.locked { background: rgba(49, 50, 64, .82); border-style: dashed; }
.town-marker.restored { border-color: #ffe79a; }
.town-marker.lit { border-color: #ffd15c; background: rgba(79, 45, 29, .91); box-shadow: 0 0 0 3px rgba(255, 210, 86, .22), 0 10px 28px rgba(76, 39, 19, .48); }
.town-marker.future { background: rgba(27, 44, 67, .76); border-color: rgba(197, 225, 255, .82); cursor: default; }
.marker-icon { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 10px; background: rgba(255,255,255,.16); color: #ffe17c; font-size: 1.15rem; }
.marker-copy { display: flex; flex-direction: column; min-width: 0; }
.marker-copy strong { font-size: .72rem; line-height: 1.05; }
.marker-copy small { margin-top: 2px; color: rgba(255,255,255,.8); font-size: .62rem; line-height: 1.1; }
.marker-spark { position: absolute; top: -10px; right: -8px; display: grid; place-items: center; width: 25px; height: 25px; border: 2px solid #fff1ad; border-radius: 50%; background: #df8f1f; color: white; font-size: .8rem; box-shadow: 0 0 15px rgba(255, 201, 76, .88); animation: marker-spark-pop .55s cubic-bezier(.2,.9,.25,1.3) both; }

@keyframes marker-spark-pop {
  from { opacity: 0; transform: scale(.3) rotate(-25deg); }
}
.marker-lighthouse { left: 4%; top: 4%; }
.marker-garden { right: 4%; top: 23%; }
.marker-pier { left: 3%; top: 48%; }
.marker-square { right: 4%; top: 59%; }
.marker-starfall { right: 9%; bottom: 5%; }

.cove-toast {
  margin: 10px 0 0;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, #e7a92d 36%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, #fff1bf 68%, var(--card));
  font-weight: 800;
  line-height: 1.35;
}

.cove-game .game-guide img { animation: none; }
.cove-result { background: radial-gradient(circle at 50% 20%, rgba(255, 222, 115, .2), transparent 30%); }

@media (max-width: 360px) {
  .cove-home { padding-inline: 7px; }
  .chapter-dot { flex-basis:78px; }
  .chapter-intro-popover { left:7px; right:7px; grid-template-columns:48px 1fr 28px; }
  .chapter-intro-popover img { width:48px; height:48px; }
  .town-marker { max-width: 124px; padding-right: 6px; }
  .marker-copy strong { font-size: .66rem; }
}

@media (max-height: 700px) {
  .cove-home { padding-top:calc(4px + env(safe-area-inset-top)); padding-bottom:calc(4px + env(safe-area-inset-bottom)); }
  .brand-name { display:none; }
  .cove-topbar { min-height:38px; margin-bottom:3px; }
  .cove-topbar p { font-size:.65rem; }
  .cove-topbar h1 { font-size:1rem; }
  .chapter-trail { min-height:44px; padding-bottom:3px; }
  .chapter-dot { min-height:40px; }
  .town-heading { min-height:20px; margin-bottom:3px; }
  .town-marker { min-height:40px; max-width:124px; }
  .marker-copy small { display:none; }
  .chapter-intro-popover { top:7px; }
}

@media (prefers-reduced-motion: reduce) {
  .odd-tile.is-hinted, .choice-button.is-hinted, .scene-hotspot.hinted, .lumi-pulse, .garden-scene img { animation: none; }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --page: #070b13;
  --surface: #101725;
  --card: #182235;
  --ink: #f4f7ff;
  --muted: #aab6cc;
  --line: #2a3850;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.38);
  --soft-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  --primary: #8d9aff;
  --primary-dark: #7281f0;
  --success: #57cbae;
  --danger: #ff8497;
  --gold: #ffc65c;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    color-scheme: dark;
    --page: #070b13;
    --surface: #101725;
    --card: #182235;
    --ink: #f4f7ff;
    --muted: #aab6cc;
    --line: #2a3850;
    --shadow: 0 18px 55px rgba(0, 0, 0, 0.38);
    --soft-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    --primary: #8d9aff;
    --primary-dark: #7281f0;
    --success: #57cbae;
    --danger: #ff8497;
    --gold: #ffc65c;
  }
}

@media (max-width:430px) {
  .game-page { height:100dvh; min-height:0; overflow:hidden; padding-inline:10px; }
  .game-topbar { min-height:42px; }
  .progress-track { margin-top:7px; }
  .game-stage { overflow:hidden; padding:7px 0 5px; }
  .game-guide { display:none; }
  .prompt-block { margin-bottom:6px; }
  .prompt-block h2 { font-size:clamp(1.08rem,5.3vw,1.35rem); }
  .prompt-block p { margin-top:3px; font-size:.78rem; line-height:1.22; }
  .odd-board { width:min(100%,54dvh); max-height:54dvh; }
  .picture-compare { width:min(100%,50dvh); gap:4px; }
  .picture-panel { padding:4px; border-radius:13px; }
  .picture-scene { border-radius:10px; }
  .scene-label { margin-bottom:2px; font-size:.62rem; }
  .hidden-game { gap:5px; }
  .hidden-scene { max-height:42dvh; border-radius:17px 17px 8px 8px; }
  .hidden-tray { grid-template-columns:repeat(4,minmax(0,1fr)); gap:4px; padding:6px; }
  .hidden-target-thumb { width:38px; height:38px; border-radius:9px; }
  .hidden-target small { font-size:.56rem; }
  .hidden-tip { font-size:.64rem; }
  .choice-grid { margin-top:10px; gap:7px; }
  .choice-button { min-height:54px; padding:8px 10px; }
  .hint-row { margin-top:.2rem; gap:.35rem .6rem; }
  .hint-button { padding:.5rem .8rem; }
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  overscroll-behavior: none;
}

body {
  min-width: 320px;
  background:
    radial-gradient(circle at 12% 12%, rgba(113, 211, 255, 0.26), transparent 30%),
    radial-gradient(circle at 88% 88%, rgba(255, 150, 204, 0.2), transparent 30%),
    var(--page);
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button {
  color: inherit;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 56%, white);
  outline-offset: 3px;
}

.app-shell {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--surface);
  overflow-x: hidden;
  position: relative;
}

@media (min-width: 560px) and (min-height: 760px) {
  body {
    padding: 12px;
  }

  .app-shell {
    min-height: calc(100dvh - 24px);
    border: 1px solid var(--line);
    border-radius: 34px;
    box-shadow: var(--shadow);
  }

  .cove-home { height: calc(100dvh - 24px); }
}

.home-page,
.game-page,
.result-page {
  min-height: inherit;
}

.home-page {
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(22px + env(safe-area-inset-bottom));
}

.home-topbar,
.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  margin: 0;
  font-size: clamp(1.55rem, 7vw, 2rem);
  line-height: 1;
  letter-spacing: -0.045em;
  font-weight: 900;
}

.brand .brainy-word {
  background: linear-gradient(100deg, #4f66eb 4%, #b44fe1 36%, #f15f8b 65%, #ed9a26 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.icon-button {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 4px 14px rgba(42, 64, 104, 0.09);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
}

.welcome-card {
  min-height: 236px;
  margin-top: 16px;
  padding: 22px 20px 84px;
  border-radius: 28px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 84% 22%, rgba(255, 255, 255, 0.65), transparent 26%),
    linear-gradient(135deg, #ccecff 0%, #dbd7ff 50%, #ffd8e9 100%);
  color: #20294d;
  box-shadow: var(--soft-shadow);
}

.welcome-card::before,
.welcome-card::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  transform: rotate(-16deg);
}

.welcome-card::before {
  width: 44px;
  height: 9px;
  right: 22px;
  top: 25px;
}

.welcome-card::after {
  width: 12px;
  height: 12px;
  right: 74px;
  top: 46px;
}

.eyebrow {
  margin: 0 0 4px;
  color: #566083;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.welcome-card h2 {
  max-width: 100%;
  margin: 0;
  font-size: clamp(1.55rem, 7vw, 2rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.welcome-card p:last-of-type {
  max-width: 100%;
  margin: 9px 0 0;
  font-size: 0.93rem;
  line-height: 1.35;
  color: #53607d;
}

.hero-mascot {
  width: 168px;
  height: auto;
  position: absolute;
  left: 50%;
  right: auto;
  bottom: 0;
  display: block;
  border-radius: 22px 22px 0 0;
  transform: translateX(-50%);
  filter: drop-shadow(0 7px 8px rgba(35, 42, 72, 0.14));
}

.section-title {
  margin: 19px 2px 11px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.section-title h2 {
  margin: 0;
  font-size: 1.06rem;
  letter-spacing: -0.02em;
}

.section-title span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.game-card {
  --accent: #6273ea;
  --wash: #e7ebff;
  min-height: 118px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 22px;
  padding: 14px;
  background: linear-gradient(145deg, var(--card), color-mix(in srgb, var(--wash) 58%, var(--card)));
  box-shadow: 0 6px 18px rgba(41, 65, 108, 0.08);
  cursor: pointer;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.game-card:active {
  transform: scale(0.975);
}

.game-card:last-child {
  grid-column: 1 / -1;
  min-height: 104px;
}

.game-card::after {
  content: "";
  position: absolute;
  width: 60px;
  height: 60px;
  right: -20px;
  bottom: -22px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
}

.game-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  margin-bottom: 9px;
  background: var(--wash);
  color: var(--accent);
  font-size: 1.28rem;
  font-weight: 900;
}

.game-card h3 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.game-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.game-card-time {
  position: absolute;
  top: 14px;
  right: 13px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 850;
}

.game-page {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
}

.game-topbar {
  min-height: 48px;
}

.game-heading {
  min-width: 0;
  text-align: center;
}

.game-heading p,
.game-heading h1 {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-heading p {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.game-heading h1 {
  margin-top: 2px;
  font-size: 1.05rem;
}

.progress-track {
  height: 7px;
  margin: 11px 4px 0;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.progress-fill {
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent, var(--primary)), color-mix(in srgb, var(--accent, var(--primary)) 55%, #ff87b5));
  transition: width 260ms ease;
}

.game-stage {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 0 8px;
  overflow-y: auto;
}

.prompt-block {
  width: 100%;
  max-width: 420px;
  margin-bottom: 10px;
  text-align: center;
}

.prompt-block h2 {
  margin: 0;
  font-size: clamp(1.3rem, 6vw, 1.7rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.prompt-block p {
  margin: 6px auto 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.odd-board {
  width: min(calc(100vw - 24px), 456px);
  max-width: 100%;
  max-height: 60dvh;
  aspect-ratio: var(--board-ratio, 1);
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows), minmax(0, 1fr));
  gap: clamp(3px, 1.15vw, 8px);
  padding: clamp(6px, 1.5vw, 10px);
  border: 1px solid var(--line);
  border-radius: 25px;
  background: color-mix(in srgb, var(--card) 88%, var(--board-wash, #dff3ff));
  box-shadow: var(--soft-shadow);
}

.odd-board.dense {
  gap: clamp(3px, .8vw, 5px);
  padding: clamp(5px, 1vw, 7px);
}

.odd-tile {
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: clamp(7px, 2vw, 16px);
  background: var(--tile, #cfeaff);
  color: var(--tile-ink, #244ca0);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: var(--glyph-size, clamp(1.45rem, 9vw, 3rem));
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 -3px 0 rgba(38, 68, 120, 0.08);
  transition: transform 110ms ease, box-shadow 150ms ease;
}

.odd-tile:active {
  transform: scale(0.91);
}

.odd-tile.is-correct {
  box-shadow: 0 0 0 4px var(--success), inset 0 -3px 0 rgba(38, 68, 120, 0.08);
}

.spot-wrap {
  width: 100%;
  max-width: 420px;
  display: grid;
  gap: 9px;
}

.scene-card {
  padding: 8px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--card);
  box-shadow: 0 5px 16px rgba(35, 62, 104, 0.07);
}

.scene-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.scene-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.scene-cell {
  min-height: clamp(40px, 7dvh, 55px);
  border: 0;
  border-radius: 12px;
  background: var(--scene-tile);
  color: var(--scene-ink);
  display: grid;
  place-items: center;
  font-size: clamp(1.25rem, 6vw, 1.75rem);
  font-weight: 900;
  line-height: 1;
}

button.scene-cell {
  cursor: pointer;
}

.scene-cell.found {
  box-shadow: inset 0 0 0 3px var(--success);
  animation: found-pop 240ms ease;
}

.scene-cell.found::after {
  content: "✓";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--success);
  color: white;
  display: grid;
  place-items: center;
  font-size: 0.68rem;
}

.scene-cell {
  position: relative;
}

@keyframes found-pop {
  50% { transform: scale(1.08); }
}

.sequence {
  width: 100%;
  max-width: 420px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  align-items: center;
}

.sequence-token,
.sequence-question {
  aspect-ratio: 1;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(33, 61, 105, 0.08);
}

.sequence-question {
  border-style: dashed;
  color: var(--primary);
  font-size: clamp(1.4rem, 6vw, 2rem);
  font-weight: 900;
}

.pattern-token {
  position: relative;
  width: min(2.45rem, 76%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: .72rem;
  background: color-mix(in srgb, var(--token-color, var(--primary)) 16%, var(--card));
  color: var(--token-color, var(--primary));
  box-shadow: inset 0 0 0 2px var(--token-color, var(--primary));
  font-size: clamp(1.3rem, 7vw, 2.2rem);
  line-height: 1;
}

.pattern-glyph {
  display: grid;
  place-items: center;
  transform: rotate(var(--token-rotate, 0deg)) scale(var(--token-scale, 1));
}

.pattern-color-mark {
  position: absolute;
  right: 2px;
  bottom: 1px;
  min-width: .8rem;
  padding: 1px 2px;
  border-radius: 999px;
  background: var(--card);
  color: var(--token-color, var(--primary));
  font-size: .48rem;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  text-align: center;
}

.choice-grid {
  width: 100%;
  max-width: 420px;
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice-button {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 4px 15px rgba(36, 62, 104, 0.07);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 11px 12px;
  font-size: 1rem;
  font-weight: 760;
  line-height: 1.2;
  text-align: center;
  transition: transform 110ms ease, border-color 160ms ease, background 160ms ease;
}

.choice-button:active {
  transform: scale(0.97);
}

.choice-button.is-correct {
  border-color: var(--success);
  background: color-mix(in srgb, var(--success) 13%, var(--card));
}

.choice-button.is-wrong {
  border-color: var(--danger);
  animation: nudge 230ms ease;
}

.choice-button.pattern-choice {
  min-height: 74px;
}

@keyframes nudge {
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.mystery-card {
  width: 100%;
  max-width: 420px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 24px;
  background:
    radial-gradient(circle at 88% 12%, color-mix(in srgb, var(--accent) 17%, transparent), transparent 32%),
    var(--card);
  box-shadow: var(--soft-shadow);
}

.mystery-clue {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: start;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
  line-height: 1.35;
}

.mystery-clue:last-child {
  border-bottom: 0;
}

.clue-number {
  width: 31px;
  height: 31px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent) 16%, var(--card));
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 900;
}

.feedback {
  width: 100%;
  max-width: 420px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 17px;
  background: color-mix(in srgb, var(--success) 12%, var(--card));
  border: 1px solid color-mix(in srgb, var(--success) 35%, var(--line));
  display: flex;
  gap: 10px;
  align-items: center;
}

.feedback.try {
  background: color-mix(in srgb, var(--danger) 8%, var(--card));
  border-color: color-mix(in srgb, var(--danger) 28%, var(--line));
}

.feedback-icon {
  flex: 0 0 auto;
  font-size: 1.3rem;
}

.feedback-copy {
  min-width: 0;
  flex: 1;
}

.feedback-copy strong,
.feedback-copy span {
  display: block;
}

.feedback-copy strong {
  font-size: 0.9rem;
}

.feedback-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.next-button,
.primary-button,
.secondary-button {
  min-height: 48px;
  border-radius: 15px;
  cursor: pointer;
  font-weight: 850;
}

.next-button {
  flex: 0 0 auto;
  padding: 0 16px;
  border: 0;
  background: var(--success);
  color: white;
}

.status-line {
  min-height: 21px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  text-align: center;
}

.result-page {
  min-height: 100dvh;
  padding: calc(30px + env(safe-area-inset-top)) 24px calc(26px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.result-burst {
  width: 98px;
  height: 98px;
  border-radius: 31px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #102b5d;
  box-shadow: var(--soft-shadow);
  transform: none;
}
.result-burst img { width: 100%; height: 100%; object-fit: cover; }

.result-page h1 {
  margin: 22px 0 7px;
  font-size: clamp(2rem, 9vw, 2.7rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.result-page > p {
  max-width: 340px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.result-mascot {
  width: min(245px, 70vw);
  height: auto;
  margin: 17px 0 2px;
  display: block;
}

.result-stats {
  width: 100%;
  max-width: 330px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 15px 0 18px;
}

.player-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 14px;
}

.player-stats span {
  min-width: 0;
  padding: 9px 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 750;
  line-height: 1.15;
  text-align: center;
}

.player-stats b {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 0.88rem;
}

.daily-card {
  --accent: #5c70e8;
  --wash: #e5eaff;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 23px;
  background:
    radial-gradient(circle at 92% 12%, color-mix(in srgb, var(--accent) 17%, transparent), transparent 34%),
    linear-gradient(145deg, var(--card), color-mix(in srgb, var(--wash) 54%, var(--card)));
  box-shadow: var(--soft-shadow);
}

.daily-card-top,
.daily-main,
.reward-copy,
.reward-win {
  display: flex;
  align-items: center;
}

.daily-card-top {
  justify-content: space-between;
  gap: 12px;
}

.daily-kicker,
.daily-status {
  font-size: 0.73rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.daily-kicker {
  color: var(--accent);
}

.daily-status {
  padding: 5px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
  color: var(--accent);
}

.daily-status.complete {
  background: color-mix(in srgb, var(--success) 14%, var(--card));
  color: var(--success);
}

.daily-main {
  gap: 11px;
  margin: 13px 0;
}

.daily-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 16px;
  background: var(--wash);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  font-weight: 900;
}

.daily-main h2,
.daily-main p {
  margin: 0;
}

.daily-main h2 {
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}

.daily-main p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.81rem;
  line-height: 1.3;
}

.daily-button {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 900;
}

.reward-strip {
  margin-top: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--card);
}

.reward-copy {
  gap: 10px;
}

.reward-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 12px;
  background: #fff0c8;
  display: grid;
  place-items: center;
}

.reward-copy strong,
.reward-copy small,
.reward-win strong,
.reward-win small {
  display: block;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-button {
  width: 46px;
  height: 46px;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
  border-radius: 15px;
  background: color-mix(in srgb, var(--primary) 10%, var(--card));
  color: var(--primary);
  cursor: pointer;
  font-size: .82rem;
  font-weight: 900;
}

.setup-page {
  position: relative;
  min-height: 100dvh;
  padding: calc(28px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.setup-back {
  position: absolute;
  top: calc(18px + env(safe-area-inset-top));
  left: 18px;
}

.setup-mascot {
  width: min(210px, 58vw);
  height: auto;
  display: block;
  margin-bottom: 10px;
}

.setup-page h1 {
  margin: 2px 0 8px;
  font-size: clamp(2rem, 9vw, 2.7rem);
  line-height: 1;
  letter-spacing: -.05em;
}

.setup-copy {
  max-width: 390px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.45;
}

.age-grid,
.profile-list {
  width: 100%;
  max-width: 420px;
  display: grid;
  gap: 10px;
}

.age-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.age-card {
  min-height: 112px;
  padding: 15px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(145deg, var(--card), color-mix(in srgb, var(--primary) 8%, var(--card)));
  box-shadow: 0 5px 16px rgba(35, 69, 116, .08);
  cursor: pointer;
  text-align: left;
}

.age-card strong,
.age-card span {
  display: block;
}

.age-card strong {
  color: var(--ink);
  font-size: 1rem;
}

.age-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.3;
}

.privacy-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: .75rem;
}

.profile-page {
  justify-content: flex-start;
}

.profile-header {
  width: 100%;
  max-width: 420px;
  display: grid;
  grid-template-columns: 46px 1fr 46px;
  align-items: center;
  margin-bottom: 14px;
}

.profile-header h1 {
  margin: 0;
  font-size: 1.45rem;
}

.profile-card {
  width: 100%;
  min-height: 70px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  display: grid;
  grid-template-columns: 44px 1fr 24px;
  gap: 11px;
  align-items: center;
  cursor: pointer;
  text-align: left;
}

.profile-card.active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--card));
}

.profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--primary) 14%, var(--card));
  color: var(--primary);
  font-weight: 900;
}

.profile-card strong,
.profile-card small {
  display: block;
}

.profile-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: .75rem;
}

.add-player {
  width: 100%;
  max-width: 420px;
  margin-top: 14px;
  border: 0;
  background: var(--primary);
  color: white;
}

.paw-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 24, 40, .25);
  backdrop-filter: blur(3px);
}

.paw-popup {
  min-width: 220px;
  padding: 22px 24px;
  border: 1px solid color-mix(in srgb, var(--gold) 38%, var(--line));
  border-radius: 26px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
  animation: paw-pop 220ms ease-out;
}

.paw-popup-icon,
.paw-popup strong,
.paw-popup small {
  display: block;
}

.paw-popup-icon {
  font-size: 2.35rem;
}

.paw-popup strong {
  margin-top: 7px;
  font-size: 1.25rem;
}

.paw-popup small {
  margin-top: 4px;
  color: var(--muted);
  font-size: .78rem;
}

@keyframes paw-pop {
  from { opacity: 0; transform: scale(.84) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-height: 690px) {
  .game-stage { justify-content: flex-start; }
  .odd-board { max-height: 56dvh; }
  .setup-page { justify-content: flex-start; }
  .setup-mascot { width: 145px; }
}

@media (prefers-reduced-motion: reduce) {
  .paw-popup { animation: none; }
}

.reward-copy strong {
  font-size: 0.85rem;
}

.reward-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.25;
}

.streak-dots {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.streak-dot {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
}

.streak-dot.active {
  background: linear-gradient(90deg, #ff8d55, #f1b526);
}

.picture-compare {
  width: 100%;
  max-width: 420px;
  display: grid;
  gap: 8px;
}

.picture-panel {
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 5px 16px rgba(35, 62, 104, 0.08);
}

.picture-scene {
  position: relative;
  aspect-ratio: 1.6;
  overflow: hidden;
  border-radius: 13px;
  isolation: isolate;
}

.scene-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.picture-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(20, 56, 33, 0.04));
  pointer-events: none;
}

.scene-hotspot {
  position: absolute;
  left: var(--hotspot-x);
  top: var(--hotspot-y);
  width: var(--hotspot-w);
  height: var(--hotspot-h);
  z-index: 1;
  padding: 0;
  border: 0;
  border-radius: 35%;
  background: transparent;
  cursor: pointer;
}

.scene-hotspot:focus-visible {
  outline: 3px solid white;
  box-shadow: 0 0 0 5px var(--primary);
}

.scene-hotspot.found {
  border: 3px solid rgba(255, 255, 255, 0.96);
  background: rgba(38, 175, 121, 0.16);
  box-shadow: 0 0 0 3px var(--success), 0 3px 9px rgba(22, 45, 31, 0.18);
  animation: found-pop 240ms ease;
}

.spot-visual-change {
  position: absolute;
  left: var(--mark-x);
  top: var(--mark-y);
  z-index: 1;
  transform: translate(-50%, -50%);
  color: #fff6bd;
  font-size: clamp(1rem, 4.6vw, 1.75rem);
  line-height: 1;
  text-shadow: 0 1px 2px rgba(8, 24, 48, 0.95), 0 0 8px rgba(255, 209, 92, 0.92);
  pointer-events: none;
}

.picture-scene.realistic-crop .scene-image {
  object-fit: cover;
  object-position: var(--spot-position, center);
}

.picture-scene.realistic-crop .scene-hotspot {
  z-index: 2;
}

.result-stats.three {
  max-width: 390px;
  grid-template-columns: repeat(3, 1fr);
}

.reward-win {
  width: 100%;
  max-width: 330px;
  gap: 10px;
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--gold) 46%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--gold) 13%, var(--card));
  text-align: left;
}

.reward-win > span:first-child {
  font-size: 1.6rem;
}

.reward-win strong {
  font-size: 0.85rem;
}

.reward-win small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.75rem;
}

.stat-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--card);
}

.stat-card strong,
.stat-card span {
  display: block;
}

.stat-card strong {
  font-size: 1.25rem;
}

.stat-card span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
}

.result-actions {
  width: 100%;
  max-width: 330px;
  display: grid;
  gap: 9px;
}

.primary-button {
  border: 0;
  background: var(--primary);
  color: white;
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--card);
}

@media (max-height: 700px) {
  .game-page {
    padding-top: calc(8px + env(safe-area-inset-top));
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }

  .game-stage {
    justify-content: flex-start;
    padding-top: 8px;
  }

  .prompt-block {
    margin-bottom: 7px;
  }

  .prompt-block p {
    margin-top: 3px;
  }

  .odd-board {
    width: min(calc(100vw - 20px), 56dvh, 420px);
  }

  .scene-card {
    padding-top: 5px;
    padding-bottom: 7px;
  }

  .picture-scene {
    aspect-ratio: 1.6;
  }

  .feedback {
    margin-top: 8px;
    padding-top: 9px;
    padding-bottom: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Viewport-first layouts. Keep these after legacy rules so sizing is consistent. */
html, body { height:100%; min-height:0; }
body { padding:0; min-width:0; }
.app-shell { width:100%; max-width:1180px; height:var(--app-height,100dvh); min-height:0; overflow:hidden; border:0; border-radius:0; }
.cove-home,.game-page,.result-page { height:100%; min-height:0; padding: max(8px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left)); }
.cove-home { width:min(100%,860px); margin:auto; }
.chapter-trail { display:grid; grid-template-columns:repeat(10,minmax(0,1fr)); gap:4px; overflow:visible; min-height:44px; padding:2px 0 5px; }
.chapter-dot { display:grid; grid-template-columns:1fr; min-width:0; min-height:38px; padding:2px; }
.chapter-dot span { width:100%; height:30px; font-size:.875rem; border-radius:9px; }
.chapter-dot small { display:none; }
.cove-topbar h1 { font-size:clamp(1rem,3vw,1.45rem); }
.test-mode-banner strong { font-size:.75rem; }
.town-marker { max-width:175px; min-height:48px; }
.marker-copy strong { font-size:.875rem; line-height:1.12; }
.marker-copy small { font-size:.75rem; }
.game-page { display:flex; overflow:hidden; }
.game-topbar { flex:0 0 auto; width:100%; min-height:46px; gap:8px; }
.game-heading { flex:1; }
.game-heading p { font-size:.75rem; letter-spacing:0; }
.game-heading h1 { font-size:clamp(1rem,2.5vw,1.35rem); white-space:normal; line-height:1.15; }
.progress-track { flex:0 0 6px; margin:6px 0 0; }
.game-stage { flex:1; min-height:0; width:100%; display:flex; gap:6px; padding:8px 0 0; overflow:visible; justify-content:flex-start; }
.game-guide { display:none; }
.prompt-block { flex:0 0 auto; max-width:760px; margin:0; }
.prompt-block h2 { font-size:clamp(1.2rem,3.5vw,1.8rem); }
.prompt-block p { margin:3px auto 0; font-size:1rem; line-height:1.2; }
.puzzle-surface { flex:1 1 0; min-height:0; min-width:0; width:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; }
.game-footer { flex:0 0 auto; width:100%; display:flex; flex-direction:column; align-items:center; gap:4px; }
.hint-row { margin:0; }
.hint-button { min-height:44px; padding:8px 16px; }
.hint-row small { font-size:.875rem; }
.status-line { min-height:0; margin:0; font-size:.875rem; }
.feedback { margin:0; padding:7px 10px; max-width:760px; }
.feedback-copy span { font-size:.875rem; }
.odd-board,.odd-board.dense { flex:0 0 auto; max-height:none; max-width:100%; margin:0; aspect-ratio:auto; }
.odd-tile { overflow:hidden; }
.picture-compare { max-width:none; gap:8px; grid-template-columns:1fr; }
.picture-compare.side-by-side { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.picture-panel { padding:0; border:0; box-shadow:none; min-width:0; background:transparent; }
.scene-label { height:16px; margin:0 0 4px; font-size:.75rem; line-height:16px; }
.picture-scene { aspect-ratio:1000/625; border-radius:8px; }
.scene-image { object-fit:contain; }
.picture-scene.realistic-crop .scene-image { object-fit:cover; object-position:var(--spot-position,center); }
.scene-hotspot { border-radius:15%; }
.scene-hotspot.hinted { animation:none; }
.hidden-game { max-width:none; gap:8px; justify-items:center; min-height:0; }
.hidden-game.side-by-side { grid-template-columns:minmax(0,1fr) 158px; align-items:center; }
.hidden-scene { max-height:none; max-width:100%; flex:none; aspect-ratio:var(--scene-ratio,1122/1402); border:0; border-radius:10px; }
.hidden-scene > img { object-fit:contain; filter:none; }
.hidden-scene::after { display:none; }
.hidden-tray { width:100%; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; padding:6px; border-radius:12px; }
.hidden-game.side-by-side .hidden-tray { grid-template-columns:repeat(2,minmax(0,1fr)); }
.hidden-target { border:2px solid transparent; border-radius:8px; padding:2px; background:transparent; cursor:pointer; }
.hidden-target.selected { border-color:#ffe08a; background:rgba(255,224,138,.2); }
.hidden-target-thumb { width:44px; height:44px; border:0; border-radius:5px; box-shadow:none; }
.hidden-target small { font-size:.75rem; line-height:14px; white-space:nowrap; }
.hidden-target.found { opacity:.55; }
.hidden-target.found .hidden-target-thumb { background-image:none !important; }
.hidden-object { border:0; border-radius:2px; min-width:0; min-height:0; cursor:pointer; }
.hidden-object:disabled { pointer-events:none; }
.hidden-object:not(.hinted):not(.found):hover { background:transparent; border:0; outline:none; transform:translate(-50%,-50%); }
.hidden-object.hinted { animation:none; outline:2px dashed #ffe05f; box-shadow:none; }
.hidden-object.found { opacity:1; pointer-events:none; border:2px solid #ffe08a; background:#ffe08a22; color:white; font-size:1.3rem; }
.hidden-miss-zone { position:absolute; inset:0; z-index:1; width:100%; height:100%; padding:0; border:0; background:transparent; cursor:crosshair; }
.hidden-picture { display:flex; flex-direction:column; align-items:center; gap:4px; width:100%; min-width:0; }
.hidden-search-badge { display:block; width:100%; margin:0; color:var(--muted); font-size:.75rem; font-weight:800; line-height:18px; text-align:center; white-space:nowrap; }
.hidden-scene { touch-action:none; user-select:none; -webkit-user-select:none; }
.hidden-world > img { display:block; width:100%; height:100%; object-fit:contain; }
/* Keep Find playable when landscape browser chrome leaves little height. */
.game-hidden.find-scroll { overflow-x:hidden; overflow-y:auto; -webkit-overflow-scrolling:touch; }
.game-hidden.find-scroll .game-stage,.game-hidden.find-scroll .puzzle-surface { flex:0 0 auto; }

.sequence,.choice-grid { max-width:660px; }
.choice-grid { margin:0; }
.choice-button.pattern-choice { min-height:clamp(50px,10dvh,105px); }
.sequence-token,.sequence-question { max-height:90px; }
.result-page { gap:8px; justify-content:center; }
.result-burst { width:clamp(46px,9dvh,86px); height:clamp(46px,9dvh,86px); border-radius:22%; flex-shrink:0; }
.result-page h1 { margin:0; font-size:clamp(1.7rem,5vw,2.5rem); }
.result-page > p { font-size:1rem; line-height:1.2; max-width:560px; }
.result-mascots { flex:0 1 210px; min-height:0; width:100%; height:auto; margin:0; }
.result-mascots .result-mascot { width:auto; height:100%; max-height:210px; max-width:100%; margin:0; }
.result-stats.three { flex:0 0 auto; margin:0; max-width:500px; }
.stat-card { padding:9px; }
.stat-card span { font-size:.875rem; }
.result-actions { max-width:500px; gap:7px; }
.primary-button,.secondary-button { min-height:44px; padding:8px; }
@media(min-width:700px) {
  .game-page { padding:18px 24px; }
  .cove-home { padding:14px; }
  .chapter-dot { min-height:50px; }
  .town-marker { max-width:215px; padding:10px; }
  .marker-copy strong { font-size:1rem; }
  .result-actions { grid-template-columns:1fr 1fr; }
}
@media(max-height:600px) {
  .game-page,.result-page { padding-top:max(5px,env(safe-area-inset-top)); padding-bottom:max(5px,env(safe-area-inset-bottom)); }
  .game-stage { gap:4px; padding-top:4px; }
  .game-topbar { min-height:38px; }
  .icon-button { width:38px; height:38px; flex-basis:38px; }
  .prompt-block h2 { font-size:1.15rem; }
  .prompt-block p { font-size:.875rem; }
  .result-mascots { flex-basis:90px; }
  .result-mascots .result-mascot { max-height:90px; }
  .result-page { gap:6px; }
  .sequence { max-width:420px; }
  .choice-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .choice-button.pattern-choice { min-height:48px; padding:4px; }
}
@media(max-width:360px) {
  .town-marker { max-width:140px; padding:5px; }
  .marker-icon { display:none; }
  .spark-pill { padding-inline:7px; font-size:.875rem; }
}

/* Seasons landing, daily puzzle, and streak shop */
.season-landing,.daily-page,.shop-page { width:min(100%,920px); height:100%; min-height:0; margin:auto; padding:max(12px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left)); overflow:hidden; }
.season-landing { display:flex; flex-direction:column; gap:10px; }
.landing-topbar { display:flex; align-items:center; justify-content:space-between; gap:10px; flex:0 0 auto; min-height:42px; }
.landing-topbar .brand-lockup { display:flex; align-items:center; min-width:0; gap:8px; }
.landing-topbar .brand-lockup img { width:34px; height:34px; object-fit:contain; border-radius:10px; }
.landing-topbar .brand-name { display:block; font-size:1.05rem; font-weight:950; letter-spacing:-.035em; }
.landing-topbar .brand-lockup p { margin:1px 0 0; color:var(--muted); font-size:.7rem; font-weight:750; }
.back-link,.text-button { border:0; background:transparent; color:var(--primary-dark); cursor:pointer; font:inherit; font-weight:900; white-space:nowrap; }
.back-link { padding:8px 0; }
.text-button { font-size:.78rem; }
.eyebrow { color:var(--muted); font-size:.66rem; font-weight:950; letter-spacing:.1em; text-transform:uppercase; }
.season-landing .test-mode-banner { flex:0 0 auto; margin:0; padding:5px 8px; }
.daily-hero-card { position:relative; display:flex; align-items:center; gap:10px; width:100%; min-height:75px; padding:11px 12px; border:1px solid color-mix(in srgb,#ef9c45 44%,var(--line)); border-radius:21px; background:linear-gradient(135deg,#fff5d7,#ffe6ba); color:#35220f; box-shadow:0 8px 24px rgba(196,122,24,.16); cursor:pointer; text-align:left; }
.daily-hero-card:active { transform:translateY(1px); }
.daily-hero-icon { display:grid; place-items:center; width:43px; height:43px; flex:0 0 43px; border-radius:14px; background:#f3a94b; color:white; font-size:1.35rem; box-shadow:0 5px 13px rgba(150,86,18,.18); }
.daily-hero-card b,.daily-hero-card small { display:block; }
.daily-hero-card b { font-size:1.02rem; letter-spacing:-.02em; }
.daily-hero-card small { margin-top:2px; color:#765331; font-size:.72rem; font-weight:750; }
.daily-hero-streak { margin-left:auto; color:#9c5423; font-size:.85rem; white-space:nowrap; }
.daily-hero-arrow { color:#9c5423; font-size:1.4rem; font-weight:900; }
.landing-streak-card { display:flex; align-items:center; justify-content:space-between; min-height:58px; padding:9px 13px; border:1px solid color-mix(in srgb,#e6a12d 28%,var(--line)); border-radius:18px; background:color-mix(in srgb,#fff6da 72%,var(--card)); }
.landing-streak-card strong,.landing-streak-card span { display:block; }
.landing-streak-card strong { margin-top:1px; font-size:1.2rem; line-height:1; }
.landing-streak-card div>span { margin-top:4px; color:var(--muted); font-size:.69rem; font-weight:750; }
.streak-flame { color:#e58c28; font-size:1.8rem; }
.season-heading { display:flex; align-items:end; justify-content:space-between; gap:8px; margin-top:1px; }
.season-heading h1 { margin:2px 0 0; font-size:clamp(1.15rem,4.8vw,1.55rem); letter-spacing:-.04em; }
.season-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; min-height:0; flex:1 1 auto; }
.season-card { position:relative; display:flex; align-items:flex-end; min-height:105px; overflow:hidden; padding:10px; border:1px solid rgba(255,255,255,.46); border-radius:18px; background-image:var(--season-art); background-size:cover; background-position:center; color:white; box-shadow:0 8px 22px rgba(18,44,65,.16); cursor:pointer; text-align:left; }
.season-card-wash { position:absolute; inset:0; background:linear-gradient(180deg,rgba(15,35,55,.02),rgba(15,35,55,.82)); }
.season-card-copy,.season-card-arrow { position:relative; z-index:1; }
.season-card-copy { min-width:0; padding-right:20px; }
.season-card-copy small,.season-card-copy b,.season-card-copy span,.season-card-copy em { display:block; }
.season-card-copy small { font-size:.6rem; font-weight:900; letter-spacing:.04em; text-transform:uppercase; opacity:.9; }
.season-card-copy b { margin-top:2px; font-size:1rem; line-height:1; }
.season-card-copy span { margin-top:4px; overflow:hidden; color:rgba(255,255,255,.88); font-size:.66rem; line-height:1.15; text-overflow:ellipsis; white-space:nowrap; }
.season-card-copy em { margin-top:6px; color:#fff2c9; font-size:.62rem; font-style:normal; font-weight:850; }
.season-card-arrow { position:absolute; top:9px; right:10px; font-size:1.15rem; font-weight:950; }
.season-card-summer { border-color:#4aa0a0; }
.season-card-fall { border-color:#c97832; }
.season-card-winter { border-color:#80a9d0; }
.season-card-spring { border-color:#62ae7d; }
.daily-page,.shop-page { display:flex; flex-direction:column; gap:12px; }
.daily-title { flex:0 0 auto; text-align:center; }
.daily-title h1 { margin:3px 0 0; font-size:clamp(1.65rem,7vw,2.3rem); letter-spacing:-.06em; }
.daily-title p { max-width:380px; margin:5px auto 0; color:var(--muted); font-size:.82rem; line-height:1.25; }
.daily-focus-card { display:flex; align-items:center; gap:11px; min-height:78px; padding:12px; border:1px solid color-mix(in srgb,var(--primary) 30%,var(--line)); border-radius:20px; background:linear-gradient(140deg,var(--card),color-mix(in srgb,var(--primary) 11%,var(--card))); }
.daily-focus-orb { display:grid; place-items:center; width:48px; height:48px; flex:0 0 48px; border-radius:16px; background:color-mix(in srgb,var(--primary) 15%,var(--card)); color:var(--primary); font-size:1.45rem; font-weight:900; }
.daily-focus-card small,.daily-focus-card h2,.daily-focus-card p { display:block; margin:0; }
.daily-focus-card small { color:var(--muted); font-size:.67rem; font-weight:850; text-transform:uppercase; }
.daily-focus-card h2 { margin-top:2px; font-size:1rem; }
.daily-focus-card p { margin-top:2px; color:var(--muted); font-size:.72rem; }
.daily-focus-card .daily-status { margin-left:auto; align-self:flex-start; }
.daily-streak-panel { padding:14px; border:1px solid color-mix(in srgb,#e6a12d 35%,var(--line)); border-radius:21px; background:linear-gradient(145deg,color-mix(in srgb,#fff6da 60%,var(--card)),var(--card)); }
.streak-panel-top { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.streak-panel-top strong,.streak-panel-top span { display:block; }
.streak-panel-top strong { margin-top:3px; font-size:1.55rem; letter-spacing:-.04em; }
.streak-panel-top span { margin-top:3px; color:var(--muted); font-size:.72rem; font-weight:750; }
.streak-badge { display:grid; place-items:center; width:48px; height:48px; border-radius:16px; background:#fff0bf; color:#c87922; font-size:1.35rem; }
.streak-note { margin:9px 0 0; color:var(--muted); font-size:.72rem; line-height:1.2; }
.streak-note.warning { color:#ad5d2a; font-weight:850; }
.daily-start-button { width:100%; margin-top:auto; border:0; }
.daily-start-button:disabled { opacity:.55; cursor:default; }
.daily-shop-button { width:100%; }
.daily-practice { align-self:center; font-size:.75rem; }
.shop-page { max-width:560px; }
.shop-balance { display:flex; align-items:baseline; justify-content:center; gap:8px; padding:11px; border:1px solid color-mix(in srgb,var(--gold) 45%,var(--line)); border-radius:16px; background:color-mix(in srgb,var(--gold) 12%,var(--card)); }
.shop-balance span { color:#b9771e; font-size:1.25rem; font-weight:950; }
.shop-balance small { color:var(--muted); font-size:.75rem; font-weight:750; }
.shop-item { display:flex; align-items:center; gap:10px; min-height:80px; padding:11px; border:1px solid var(--line); border-radius:19px; background:var(--card); }
.shop-item-icon { display:grid; place-items:center; width:42px; height:42px; flex:0 0 42px; border-radius:14px; background:#e4f0fc; color:#4a83bc; font-size:1.25rem; }
.shop-item h2,.shop-item p { margin:0; }
.shop-item h2 { font-size:.95rem; }
.shop-item p { margin-top:3px; color:var(--muted); font-size:.7rem; line-height:1.2; }
.shop-buy { margin-left:auto; min-width:66px; min-height:38px; padding:6px 8px; border:0; border-radius:12px; background:var(--primary); color:white; cursor:pointer; font-size:.75rem; font-weight:900; }
.shop-buy:disabled { opacity:.4; cursor:default; }
.club-card { display:flex; align-items:center; gap:10px; padding:13px; border:1px solid color-mix(in srgb,#b982ed 38%,var(--line)); border-radius:19px; background:linear-gradient(140deg,#f5ecff,var(--card)); }
.club-icon { display:grid; place-items:center; width:42px; height:42px; border-radius:14px; background:#d9c1f8; color:#7650ad; font-size:1.35rem; }
.club-card small { color:#7650ad; font-size:.64rem; font-weight:950; letter-spacing:.09em; }
.club-card h2 { margin:2px 0 0; font-size:1rem; }
.club-card p { margin:3px 0 0; color:var(--muted); font-size:.72rem; }
.milestone-list { padding:10px 12px; border:1px dashed var(--line); border-radius:16px; text-align:center; }
.milestone-list h2 { margin:0; font-size:.86rem; }
.milestone-list p { margin:4px 0 0; color:var(--muted); font-size:.73rem; }
.season-winter .season-pill { background:#dcecff; color:#4775a8; }
.season-spring .season-pill { background:#daf2df; color:#43825b; }
.season-winter .town-map-art { filter:saturate(.9) brightness(.98); }
.season-spring .town-map-art { filter:saturate(1.03) brightness(1.02); }
@media(min-width:700px) {
  .season-landing { padding-inline:28px; }
  .season-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .season-card { min-height:170px; }
  .daily-page { max-width:620px; padding-inline:34px; }
}
@media(max-height:620px) {
  .season-landing,.daily-page,.shop-page { gap:7px; padding-top:7px; padding-bottom:7px; }
  .landing-topbar { min-height:36px; }
  .daily-hero-card { min-height:64px; padding:8px 10px; }
  .landing-streak-card { min-height:48px; padding:7px 10px; }
  .season-card { min-height:84px; padding:8px; }
  .season-card-copy span { display:none; }
  .season-card-copy em { margin-top:4px; }
  .daily-title h1 { font-size:1.55rem; }
  .daily-title p { margin-top:2px; }
  .daily-focus-card,.daily-streak-panel { padding:9px; }
  .daily-focus-card { min-height:65px; }
  .daily-streak-panel { min-height:112px; }
  .shop-item { min-height:69px; }
}

/* Keep the Daily Puzzle and Streak Shop actions in view on phones. */
@media(max-width:699px){
  .daily-page,.shop-page{gap:clamp(5px,1dvh,10px);padding:8px 12px max(8px,env(safe-area-inset-bottom))}
  .daily-title p{font-size:.76rem}.daily-focus-card{min-height:67px;padding:8px}.daily-streak-panel{padding:9px}.streak-note{margin-top:5px}
  .shop-page .daily-title p{display:none}.shop-balance{padding:6px}.shop-item{min-height:65px;padding:8px}.club-card{padding:8px}.milestone-list{padding:7px}
}
@media(max-height:600px) and (max-width:699px){
  .daily-page,.shop-page{gap:5px}.daily-title h1{font-size:1.4rem}.daily-title p{display:none}.daily-focus-card{min-height:55px}.daily-streak-panel{padding:7px}.streak-panel-top strong{font-size:1.25rem}.streak-badge{width:36px;height:36px}.streak-note{font-size:.68rem}
  .shop-item{min-height:55px;padding:6px}.shop-item-icon,.club-icon{width:34px;height:34px;flex-basis:34px}.shop-item p,.club-card p{font-size:.67rem}.club-card{padding:6px}.milestone-list{padding:5px}.shop-balance{padding:4px}
}

/* Chapter completion and replay loop */
.endless-gate { display:flex; align-items:center; justify-content:center; gap:9px; width:min(100%,360px); min-height:44px; margin-top:6px; padding:7px 14px; border-color:color-mix(in srgb,var(--primary) 45%,#ffe59a); background:linear-gradient(135deg,#192f62,#5544a5); }
.endless-gate span,.endless-gate small { display:block; }
.endless-gate span { font-size:.9rem; }
.endless-gate small { color:#e7e3ff; font-size:.68rem; }
.endless-game .progress-fill { background:linear-gradient(90deg,#5f76ee,#b45ee2,#ee709d,#f2a541); }
.chapter-complete-backdrop { position:fixed; inset:0; z-index:50; display:grid; place-items:center; padding:max(12px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left)); background:rgba(8,15,31,.7); backdrop-filter:blur(10px); }
.chapter-complete-dialog { width:min(100%,430px); max-height:100%; overflow:hidden; padding:20px; border:1px solid color-mix(in srgb,#f0b74f 55%,var(--line)); border-radius:27px; background:linear-gradient(155deg,color-mix(in srgb,#fff5cf 52%,var(--card)),var(--card)); box-shadow:0 24px 70px rgba(5,13,30,.38); color:var(--ink); text-align:center; }
.chapter-complete-spark { display:grid; place-items:center; width:54px; height:54px; margin:0 auto 8px; border-radius:18px; background:linear-gradient(145deg,#ffd76b,#ee9c39); color:white; font-size:1.7rem; box-shadow:0 8px 22px rgba(202,128,30,.28); }
.chapter-complete-dialog>small { color:#a86a1d; font-size:.68rem; font-weight:950; letter-spacing:.11em; }
.chapter-complete-dialog h2 { margin:4px 0 6px; font-size:clamp(1.65rem,7vw,2.15rem); line-height:1; letter-spacing:-.05em; }
.chapter-complete-dialog>p { max-width:360px; margin:0 auto 13px; color:var(--muted); font-size:.88rem; line-height:1.3; }
.chapter-complete-choice { display:flex; align-items:center; gap:10px; margin:0 0 13px; padding:11px; border:1px solid color-mix(in srgb,var(--primary) 28%,var(--line)); border-radius:18px; background:color-mix(in srgb,var(--primary) 8%,var(--card)); text-align:left; }
.chapter-complete-choice>span { display:grid; place-items:center; width:42px; height:42px; flex:0 0 42px; border-radius:14px; background:linear-gradient(145deg,#6479eb,#a75bd4); color:white; font-size:1.55rem; }
.chapter-complete-choice strong,.chapter-complete-choice small { display:block; }
.chapter-complete-choice strong { font-size:.9rem; }
.chapter-complete-choice small { margin-top:2px; color:var(--muted); font-size:.72rem; line-height:1.2; }
.chapter-complete-dialog>.primary-button,.chapter-complete-dialog>.secondary-button { width:100%; min-height:44px; }
.chapter-complete-dialog>.secondary-button { margin-top:7px; }
@media(max-height:560px) {
  .chapter-complete-dialog { padding:14px 16px; border-radius:22px; }
  .chapter-complete-spark { width:42px; height:42px; margin-bottom:5px; border-radius:14px; font-size:1.35rem; }
  .chapter-complete-dialog h2 { font-size:1.55rem; }
  .chapter-complete-dialog>p { margin-bottom:8px; font-size:.78rem; }
  .chapter-complete-choice { margin-bottom:8px; padding:8px; }
  .chapter-complete-choice>span { width:36px; height:36px; flex-basis:36px; }
}

@media (prefers-reduced-motion: reduce) {
  .scene-hotspot.hinted::before { animation:none; }
}

/* Full seasonal calendar and bright, readable scenic art. */
.chapter-calendar { display:flex; align-items:center; gap:12px; margin:12px 0 4px; }
.chapter-calendar label { font-size:16px; font-weight:700; white-space:nowrap; }
.chapter-calendar select { flex:1; min-width:0; padding:12px 34px 12px 12px; border:1px solid var(--line); border-radius:12px; background:var(--card); color:var(--ink); font:inherit; font-size:16px; }
.season-trail { max-height:112px; }
.chapter-dot small { max-width:115px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cove-home .town-map-art { filter:none; }
.season-card-spring .season-card-wash { background:linear-gradient(180deg,transparent 30%,rgba(35,42,25,.80)); }
.season-card-summer .season-card-wash { background:linear-gradient(180deg,transparent 30%,rgba(0,47,69,.80)); }
.spot-color-change { position:absolute; inset:0; pointer-events:none; z-index:2; }
.spot-color-change img { width:100%; height:100%; display:block; object-fit:fill; }
.picture-scene.seasonal-picture .scene-image { object-fit:fill; }
.picture-scene.seasonal-picture .scene-hotspot { z-index:5; }
.game-spot[data-season="spring"] .picture-scene:not(.seasonal-picture),
.game-spot[data-season="summer"] .picture-scene:not(.seasonal-picture) { filter:brightness(1.06) saturate(1.13); }
@media(max-width:480px) { .chapter-calendar { flex-direction:column; align-items:stretch; gap:6px; } .chapter-calendar select { width:100%; } .brand-lockup h1 { overflow-wrap:anywhere; } }

/* Show the entire landscape scene, with large puzzle stops beneath it. */
.cove-home { overflow-y:auto; }
.cove-home .town-map { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; flex:0 0 auto; padding:0 10px 12px; background:var(--card); }
.cove-home .town-map-art { position:static; grid-column:1/-1; width:calc(100% + 20px); height:auto; margin:0 -10px; aspect-ratio:3/2; object-fit:contain; }
.cove-home .town-map::after,.cove-home .town-light { display:none; }
.cove-home .town-marker { position:static; inset:auto; transform:none; width:100%; max-width:none; min-height:64px; padding:10px; }
.cove-home .marker-copy strong { white-space:normal; font-size:1rem; }
.cove-home .marker-copy small { font-size:.875rem; }
.cove-home .town-marker .marker-icon { display:block; }
.season-card-copy small,.season-card-copy em { font-size:.875rem; }
.season-card-copy b { font-size:1.25rem; }
.season-card-copy span { font-size:.875rem; }
.season-landing { overflow-y:auto; }
.season-grid { min-height:340px; }

.current-season-grid { grid-template-columns:1fr; min-height:250px; }

/* Fall trial: game stops follow an on-image route; testing navigation stays compact. */
.cove-home.season-fall .town-map { display:block; flex:0 0 auto; padding:0; height:clamp(440px,calc(var(--app-height,100dvh) - 155px),780px); min-height:440px; }
.cove-home.season-fall .town-map-art { position:absolute; inset:0; width:100%; height:100%; margin:0; aspect-ratio:auto; object-fit:cover; object-position:center; filter:var(--scene-filter,none); }
.chapter-route { position:absolute; inset:0; width:100%; height:100%; z-index:1; pointer-events:none; }
.chapter-route path { fill:none; vector-effect:non-scaling-stroke; stroke-linecap:round; }
.route-shadow { stroke:rgba(30,32,22,.45); stroke-width:8; }
.route-line { stroke:#ffe59a; stroke-width:4; stroke-dasharray:7 9; }
.cove-home.season-fall .town-marker { position:absolute; right:auto; bottom:auto; transform:translate(-50%,-50%); width:42%; max-width:190px; min-height:62px; padding:8px; }
.cove-home.season-fall .town-marker.p1 { left:27%; top:18%; }
.cove-home.season-fall .town-marker.p2 { left:73%; top:39%; }
.cove-home.season-fall .town-marker.p3 { left:27%; top:60%; }
.cove-home.season-fall .town-marker.p4 { left:73%; top:83%; }
.cove-home.season-fall .marker-copy strong { white-space:normal; font-size:1rem; line-height:1.12; }
.cove-home.season-fall .marker-copy small { display:block; font-size:.875rem; }
.cove-home.season-fall .town-marker .marker-icon { display:grid; flex:0 0 28px; width:28px; height:28px; }
.testing-chapter-tools { flex:0 0 auto; border:1px solid var(--line); border-radius:12px; padding:8px 10px; margin:6px 0; }
.testing-chapter-tools summary { cursor:pointer; font-size:.875rem; font-weight:700; }
.season-trail { display:flex; flex-wrap:nowrap; overflow-x:auto; overflow-y:hidden; min-height:48px; max-height:none; gap:6px; margin:8px 0 0; padding:2px 0 6px; }
.season-trail .chapter-dot { flex:0 0 60px; min-height:42px; }
.season-trail .chapter-dot span { white-space:nowrap; }
.picture-compare .picture-scene { filter:var(--scene-filter,none); }

/* Both views share the same transform, including interactive difference targets. */
.spot-workspace { width:100%; height:100%; min-height:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; }
.spot-zoom-toolbar { display:flex; align-items:center; justify-content:center; gap:6px; flex:0 0 auto; }
.spot-zoom-toolbar button { min-width:44px; min-height:44px; padding:6px 10px; border:1px solid var(--line); border-radius:10px; background:var(--card); color:var(--ink); font:inherit; font-weight:700; }
.spot-zoom-toolbar button:disabled { opacity:.4; }
.spot-zoom-toolbar output { min-width:44px; text-align:center; font-size:.875rem; }
.spot-workspace .picture-compare { flex:0 0 auto; }
.spot-workspace .picture-scene { touch-action:none; cursor:grab; }
.spot-workspace .picture-scene:active { cursor:grabbing; }
.spot-world { position:absolute; inset:0; transform-origin:0 0; will-change:transform; }
.spot-world img { -webkit-user-drag:none; }
.game-spot .prompt-block p { display:none; }
.game-spot .game-heading p { display:none; }
.game-spot .prompt-block h2 { font-size:1.05rem; }
.game-spot.spot-expanded { position:fixed; inset:0; z-index:10000; width:100%; height:var(--app-height,100dvh); max-width:none; margin:0; padding:env(safe-area-inset-top,0px) 8px env(safe-area-inset-bottom,0px); background:var(--page); }
.game-spot.spot-expanded .game-topbar,.game-spot.spot-expanded .progress-track,.game-spot.spot-expanded .prompt-block { display:none; }
.game-spot.spot-expanded .game-stage { padding-top:4px; }

.spot-hint-area { position:absolute; width:35%; height:35%; z-index:3; border:3px dashed #ffe08a; background:#ffe08a20; border-radius:18%; pointer-events:none; }
.spot-world .scene-hotspot { left:calc(var(--hotspot-x) + var(--hotspot-w) / 2); top:calc(var(--hotspot-y) + var(--hotspot-h) / 2); translate:-50% -50%; min-width:calc(32px / var(--spot-scale,1)); min-height:calc(32px / var(--spot-scale,1)); }

/* Puzzle identity artwork throughout the game. */
.puzzle-icon { display:block; width:100%; height:100%; object-fit:cover; border-radius:20%; }
.daily-focus-orb .puzzle-icon { width:48px; height:48px; }
.game-heading { display:flex; justify-content:center; align-items:center; gap:9px; text-align:left; }
.game-heading-icon { flex:0 0 36px; width:36px; height:36px; }
.game-heading > div { min-width:0; }
.marker-icon { position:relative; overflow:visible; }
.marker-icon .puzzle-icon { width:100%; height:100%; }
.marker-lock { position:absolute; right:-6px; bottom:-5px; display:grid; place-items:center; width:16px; height:16px; border-radius:50%; background:#263340; font-size:10px; }
.cove-home .town-marker .marker-icon { display:grid; }
@media(max-width:360px) { .cove-home .town-marker .marker-icon { display:grid; flex-basis:25px; width:25px; height:25px; } }
.display-settings #account-sign-in{display:flex;flex-wrap:wrap;align-items:end;gap:.7rem;margin:.8rem 0 1rem}
.display-settings #account-sign-in label{width:100%;font-weight:700}
.display-settings #account-email{min-width:12rem;flex:1;padding:.75rem;border:1px solid #a7b6b2;border-radius:.75rem;background:var(--surface,#fff);color:var(--ink,#172b36);font:inherit}


/* Account deletion is intentionally isolated to signed-in account settings. */
.display-settings .account-actions{display:flex;flex-wrap:wrap;align-items:center;gap:.65rem;margin:.65rem 0}
.display-settings .account-delete-confirmation{margin:.8rem 0 1rem;padding:1rem;border:1px solid color-mix(in srgb,var(--danger) 48%,var(--line));border-radius:1rem;background:color-mix(in srgb,var(--danger) 7%,var(--card))}
.display-settings .account-delete-confirmation p{margin:.1rem 0 .75rem}
.display-settings .delete-account-link,.display-settings .delete-account-danger{color:var(--danger)}
.display-settings .delete-account-danger{border-color:color-mix(in srgb,var(--danger) 65%,var(--line))}

/* Expanded Spot scrolls within the space above its fixed save-status strip. */
.game-spot.spot-expanded{
  height:calc(var(--app-height,100dvh) - var(--save-status-space,0px) - max(4px,env(safe-area-inset-bottom)));
  max-height:calc(var(--app-height,100dvh) - var(--save-status-space,0px) - max(4px,env(safe-area-inset-bottom)));
  overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch;
  padding-bottom:max(12px,env(safe-area-inset-bottom));
}
.game-spot.spot-expanded .game-stage{flex:1 0 auto;min-height:min-content;overflow:visible;padding-bottom:8px}
.game-spot.spot-expanded .puzzle-surface{min-height:min(150px,35dvh)}
.game-spot.spot-expanded .game-footer{flex-shrink:0;padding-bottom:8px}
\n/* Image puzzle integrity: miss-layer behind pointer targets, no focusable answer labels. */
.spot-world .spot-miss-zone{position:absolute;inset:0;z-index:3;border:0;padding:0;background:transparent;cursor:crosshair}
.spot-world .scene-hotspot{z-index:5}
.keyboard-search-cursor{position:absolute;z-index:8;width:19px;height:19px;box-sizing:border-box;transform:translate(-50%,-50%);border:2px solid white;outline:2px solid #162638;border-radius:50%;box-shadow:0 0 8px #0008;pointer-events:none}
.keyboard-search-cursor[hidden]{display:none!important}

/* Visible mobile puzzle-integrity feedback without obscuring game navigation. */
.spot-status-row{display:flex;align-items:center;justify-content:center;min-height:18px;flex:0 0 auto;}
.game-spot .spot-wrong-count{color:var(--muted);font-weight:700;font-size:.75rem;line-height:18px;white-space:nowrap}
.game-spot .puzzle-surface,.game-hidden .puzzle-surface{position:relative}
.guess-guard-overlay{position:absolute;inset:0;z-index:30;display:flex;align-items:center;justify-content:center;padding:12px;background:rgba(16,23,37,.76);border-radius:12px}
.guess-guard-panel{display:flex;flex-direction:column;gap:10px;align-items:center;width:min(100%,360px);max-height:100%;overflow-y:auto;text-align:center;padding:16px;border-radius:14px;background:var(--card);color:var(--ink);box-shadow:0 4px 28px rgba(0,0,0,.24)}
.guess-guard-panel strong{font-size:1.05rem}
.guess-guard-panel p{margin:0;font-size:.85rem;line-height:1.35}
.guess-guard-panel button{width:100%;min-height:44px}

.result-spark-breakdown{margin:4px auto 9px;color:var(--muted);font-size:.82rem;font-weight:700;line-height:1.3;text-align:center;max-width:95%}

/* Graceful recovery when a Find the Scene asset fails on Safari or offline. */
.hidden-scene .hidden-art-error[hidden]{display:none!important}
.hidden-scene .hidden-art-error{position:absolute;inset:0;z-index:20;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:18px;background:rgba(26,45,59,.96);color:#fff;text-align:center}
.hidden-scene .hidden-art-error strong{font-size:1.1rem}
.hidden-scene .hidden-art-error p{margin:0;line-height:1.4;font-size:.9rem;max-width:25rem}
.hidden-scene .hidden-art-error .primary-button{min-height:44px;max-width:260px;width:100%}
.hidden-picture:has(.hidden-scene.artwork-unavailable) .hidden-search-badge{visibility:hidden}

/* Challenge Oddly: one distinct small corner detail, never a hidden answer label. */
.odd-sigil{display:inline-grid;place-items:center;position:relative;min-width:1.15em;min-height:1.15em;line-height:1}
.odd-detail{position:absolute;width:.25em;height:.25em;min-width:6px;min-height:6px;border-radius:50%;background:var(--tile-ink);box-shadow:0 0 0 1px var(--tile);pointer-events:none}
.odd-ne{top:0;right:0}.odd-nw{top:0;left:0}.odd-se{bottom:0;right:0}.odd-sw{bottom:0;left:0}

/* Detail spotting must remain legible on a 320px phone. */
.odd-detail{min-width:8px;min-height:8px}

/* Challenge Oddly: four large, readable answer choices beneath a missing tile. */
.odd-choice-grid { width:min(100%,480px);display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;flex:0 0 auto; }
.odd-choice { min-height:54px;padding:5px;background:var(--card);color:var(--tile-ink,var(--primary));font-size:clamp(1.2rem,4vw,1.8rem); }
.odd-choice .odd-sigil { display:inline-grid;place-items:center; }
.odd-empty { cursor:default;border:2px dashed var(--accent,#5970df);background:color-mix(in srgb,var(--card) 85%,var(--accent,#5970df));color:var(--accent,#5970df); }
.odd-board .odd-tile:disabled { cursor:default; }
@media(max-height:650px){.odd-choice { min-height:44px; }}

/* Stage 2B: layered logic grids and two-row sequences fit phone screens. */
.pattern-matrix{width:min(100%,248px);aspect-ratio:1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));gap:6px;flex:0 1 auto;}
.pattern-matrix .sequence-token,.pattern-matrix .sequence-question{min-width:0;min-height:0;aspect-ratio:auto;}
.pattern-challenge-sequence{width:min(100%,390px);grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:7px;flex:0 1 auto;}
.pattern-challenge-sequence .sequence-token,.pattern-challenge-sequence .sequence-question{min-width:0;min-height:0;}
.pattern-challenge-choices{width:min(100%,430px);flex:0 0 auto;}
.pattern-challenge-choices .choice-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;}
.pattern-challenge-choices .pattern-choice{min-height:clamp(52px,8dvh,86px);padding:4px;}
.pattern-blank{border:2px dashed var(--accent,var(--primary));background:color-mix(in srgb,var(--accent,var(--primary)) 8%,var(--card));}
@media(max-height:650px){.pattern-matrix{width:min(100%,190px)}.pattern-challenge-choices .pattern-choice{min-height:44px}.pattern-challenge-sequence{width:min(100%,340px)}}


/* Puzzle navigation: back to Endless Mix picker without hiding Home.
   Both remain visible and tappable without causing narrow-phone overflow. */
.game-nav-buttons { display:flex; align-items:center; gap:5px; flex:0 0 auto; }
.endless-game .game-back-button {
  flex:0 0 auto;
  width:auto;
  min-width:46px;
  height:46px;
  padding-inline:10px;
  border-radius:999px;
  gap:5px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  color:var(--ink);
}
.game-back-text { font-size:.8rem; }
@media(max-width:480px) {
  .endless-game .game-back-button { width:42px; min-width:42px; height:42px; padding:0; flex-basis:42px; }
  .endless-game .game-back-text { display:none; }
  .endless-game .game-topbar { gap:5px; }
}
@media(max-height:600px) {
  .endless-game .game-back-button { width:38px; min-width:38px; height:38px; padding:0; flex-basis:38px; }
  .endless-game .game-back-text { display:none; }
}

/* Stage 2D: spatial analogies and mirrored sequences stay readable on phones. */
.pattern-analogy {
  width:min(100%,240px); aspect-ratio:1;
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:repeat(2,minmax(0,1fr));
  gap:7px; flex:0 1 auto;
}
.pattern-mirror {
  width:min(100%,390px); aspect-ratio:2/1;
  display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); grid-template-rows:repeat(2,minmax(0,1fr));
  gap:7px; flex:0 1 auto;
}
.pattern-analogy .sequence-token,.pattern-analogy .sequence-question,
.pattern-mirror .sequence-token,.pattern-mirror .sequence-question {min-height:0;min-width:0;aspect-ratio:auto;}
.odd-region-choice {font-size:clamp(.75rem,2.6vw,1rem);font-weight:800;letter-spacing:0;}
@media(max-height:650px){
  .pattern-analogy{width:min(100%,170px);}
  .pattern-mirror{width:min(100%,320px);}
  .odd-region-choice{min-height:42px;}
}

/* Challenge Pattern Pulse: celebrate learning, not a timed flash of an answer. */
.game-pattern.pattern-review-open .game-stage { gap:4px; }
.game-pattern.pattern-review-open .puzzle-surface { gap:5px; justify-content:center; min-height:0; }
.game-pattern.pattern-review-open .pattern-matrix { width:min(100%,190px); }
.game-pattern.pattern-review-open .pattern-analogy { width:min(100%,160px); }
.game-pattern.pattern-review-open .pattern-mirror { width:min(100%,280px); }
.game-pattern.pattern-review-open .pattern-challenge-sequence { width:min(100%,300px); }
.game-pattern.pattern-review-open .pattern-challenge-choices .pattern-choice { min-height:42px; padding:2px; }
.game-pattern.pattern-review-open .pattern-solved-tile { outline:2px solid var(--success); outline-offset:1px; border-radius:14px; }
.pattern-review {
  box-sizing:border-box; width:min(100%,550px); max-height:min(35dvh,240px);
  overflow-y:auto; overscroll-behavior:contain; border:1px solid var(--line);
  border-radius:14px; background:var(--card); padding:10px 12px;
  display:flex; flex-direction:column; gap:6px;
}
.pattern-review-heading { display:flex; flex-wrap:wrap; gap:6px; justify-content:space-between; align-items:center; font-size:.875rem; }
.pattern-review-heading strong { color:var(--success); }
.pattern-review-heading span { font-weight:800; }
.pattern-review p { margin:0; line-height:1.3; font-size:.82rem; }
.pattern-review-steps { width:100%; font-size:.8rem; line-height:1.35; }
.pattern-review-steps summary { cursor:pointer; font-weight:750; padding:3px 0; }
.pattern-review-steps ol { margin:5px 0 8px; padding-left:22px; }
.pattern-review-steps li { margin-bottom:4px; }
.pattern-next-button { width:100%; min-height:42px; flex-shrink:0; }
@media(max-height:740px){
  .game-pattern.pattern-review-open .prompt-block p { font-size:.75rem; }
  .game-pattern.pattern-review-open .pattern-matrix { width:min(100%,150px); }
  .game-pattern.pattern-review-open .pattern-analogy { width:min(100%,135px); }
  .game-pattern.pattern-review-open .pattern-mirror { width:min(100%,240px); }
  .game-pattern.pattern-review-open .pattern-challenge-sequence { width:min(100%,260px); }
  .game-pattern.pattern-review-open .pattern-challenge-choices .pattern-choice { min-height:38px; }
  .pattern-review { max-height:38dvh; padding:7px 10px; }
}

/* The order key makes guided Pattern Pulse analogies logically deducible. */
.pattern-rule-key {
  display:flex; align-items:center; justify-content:center; flex-wrap:wrap;
  width:min(100%,520px); gap:5px 12px; flex:0 0 auto;
  padding:5px 8px; border-radius:10px; border:1px solid var(--line);
  background:var(--card); color:var(--ink); font-size:.72rem; line-height:1.25;
}
.pattern-rule-key > span { display:inline-flex; gap:4px; align-items:center; white-space:nowrap; }
.pattern-rule-key b { font-weight:750; }
.pattern-color-key {
  display:inline-flex; align-items:center; justify-content:center;
  width:21px; height:21px; border:2px solid var(--pattern-key-color);
  border-radius:50%; background:color-mix(in srgb,var(--pattern-key-color) 30%,var(--card));
  color:var(--ink); font-size:.68rem; font-weight:800; flex:none;
}
@media(max-width:370px),(max-height:670px) {
  .pattern-rule-key {font-size:.67rem; padding:3px 5px; gap:3px 8px;}
  .pattern-color-key {width:18px; height:18px; font-size:.6rem;}
  .game-pattern .puzzle-surface { gap:5px; }
}

/* Endless Pattern Pulse has no four-round finish line; the round counter is meaningful, the cyclic progress bar is not. */
.game-pattern.endless-game .progress-track { display:none; }

/* Oddly 2026: provided solver, three grid sizes and a calm two-step reveal. */
.game-oddly .oddly-v3-board {
  display:grid;grid-template-columns:repeat(var(--oddly-cols),minmax(0,1fr));
  gap:clamp(4px,1.1vw,9px);width:min(100%,min(49dvh,500px));
  max-width:500px;max-height:49dvh;aspect-ratio:var(--oddly-cols)/var(--oddly-rows);
  margin:auto;flex:none;
}
.oddly-v3-tile {
  position:relative;min-width:0;aspect-ratio:1;border:2px solid var(--line);
  background:var(--card);border-radius:12px;display:grid;place-items:center;
  cursor:pointer;padding:0;touch-action:manipulation;box-shadow:0 2px 6px #12203216;
}
.oddly-v3-shape{font-size:clamp(18px,5vw,38px);color:var(--oddly-color);line-height:1}
.oddly-v3-tile:focus-visible {outline:3px solid var(--primary);outline-offset:2px}
.oddly-v3-tile.is-correct {border-color:var(--success);box-shadow:inset 0 0 0 2px var(--success)}
.oddly-v3-tile.oddly-hint-row:not(.is-correct) {background:color-mix(in srgb,var(--accent) 13%,var(--card));border-color:var(--accent)}
.oddly-corner-dot{position:absolute;display:block;width:8px;height:8px;border-radius:50%;
  background:var(--oddly-color);border:1px solid var(--card);box-shadow:0 0 0 1px var(--oddly-color)}
.oddly-dot-tl{top:5px;left:5px}.oddly-dot-tr{top:5px;right:5px}
.oddly-dot-br{bottom:5px;right:5px}.oddly-dot-bl{bottom:5px;left:5px}
.oddly-wrong-tile {animation:oddly-gentle-shake .32s ease-in-out}
@keyframes oddly-gentle-shake {25%{transform:translateX(-3px)}50%{transform:translateX(3px)}75%{transform:translateX(-2px)}}
.oddly-rule-reveal{width:min(100%,520px);max-height:34dvh;overflow-y:auto;display:flex;
 flex-direction:column;gap:6px;padding:10px 12px;background:var(--card);
 border:1px solid var(--line);border-radius:14px;font-size:.82rem;line-height:1.3}
.oddly-rule-reveal>strong{color:var(--success);font-size:.92rem}
.oddly-rule-reveal p{margin:0}.oddly-rule-reveal ul{margin:4px 0;padding-left:20px}
.oddly-rule-reveal li{margin:0 0 3px}
.oddly-difficulty-suggestion{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.oddly-difficulty-suggestion button{min-height:36px}
.oddly-next-button{width:100%;min-height:42px;flex-shrink:0}
.game-oddly.oddly-review-open .oddly-v3-board {width:min(100%,min(35dvh,370px));max-height:35dvh}
@media(max-height:700px) {
 .game-oddly .oddly-v3-board{width:min(100%,min(43dvh,430px));max-height:43dvh}
 .game-oddly.oddly-review-open .oddly-v3-board{width:min(100%,min(28dvh,300px));max-height:28dvh}
 .oddly-rule-reveal{max-height:37dvh;padding:7px 9px}
 .oddly-corner-dot{width:6px;height:6px}
}
@media(prefers-reduced-motion:reduce){.oddly-wrong-tile{animation:none}}

/* IQ matrices: each tile displays a crisp 2×2 diagram of lit/unlit dots. */
.iq-pattern-token .pattern-glyph {width:80%;height:80%;display:grid;place-items:center;}
.iq-dot-grid {width:1.35em;height:1.35em;max-width:100%;max-height:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:.18em}
.iq-dot {display:block;border-radius:50%;background:var(--token-color,var(--primary));opacity:.13;box-shadow:inset 0 0 0 1px var(--token-color,var(--primary));}
.iq-dot.iq-on {opacity:1;box-shadow:none;}
.pattern-matrix .iq-dot-grid {width:1.55em;height:1.55em;}
.pattern-challenge-choices .iq-dot-grid {width:1.55em;height:1.55em;}
@media(max-width:370px){.pattern-matrix .iq-dot-grid{width:1.3em;height:1.3em}.pattern-challenge-choices .iq-dot-grid{width:1.3em;height:1.3em}}

/* Hard-mode 3×3 figures: nine individual dots within each IQ matrix tile. */
.iq-dot-grid {grid-template-columns:repeat(var(--iq-dimension,2),minmax(0,1fr));
  grid-template-rows:repeat(var(--iq-dimension,2),minmax(0,1fr));}
.iq-size-3 {width:1.68em;height:1.68em;gap:.10em}
.pattern-matrix .iq-size-3,.pattern-challenge-choices .iq-size-3 {width:1.74em;height:1.74em}
@media(max-width:370px){
  .pattern-matrix .iq-size-3,.pattern-challenge-choices .iq-size-3 {width:1.46em;height:1.46em;gap:.08em}
}

/* Short, single-reason Oddly completion panel (all difficulty levels). */
.oddly-brief-review{width:min(100%,420px);max-height:none;overflow:visible;gap:5px;padding:9px 11px;}
.oddly-brief-review .oddly-brief-reason{margin:0;font-size:.84rem;line-height:1.25;}
.oddly-brief-review .oddly-next-button{min-height:40px;}

/* Match Oddly's concise answer review across Pattern Pulse difficulties. */
.pattern-brief-review {width:min(100%,420px);max-height:none;overflow:visible;gap:5px;padding:9px 11px;}
.pattern-brief-review > strong {color:var(--success);font-size:.92rem;}
.pattern-brief-review .pattern-brief-reason {margin:0;font-size:.84rem;line-height:1.25;}
.pattern-brief-review .pattern-next-button {min-height:40px;}
