/* Trace mazes — tablet-friendly */
html, body { height: 100%; }
body.trace-page { background: #FFF8E6; }
.trace-app { display: flex; flex-direction: column; min-height: calc(100vh - 0px); }
.trace-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 20px 8px; }
.trace-bar h1 { margin: 0; font-size: 1.55rem; }
.trace-bar .sub { margin: 0; color: var(--muted, #4A4178); font-weight: 600; }
.trace-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.levels { display: flex; gap: 6px; flex-wrap: wrap; }
.levels button, .maze-picks button, .trace-controls button {
  font: inherit; font-weight: 700; border: 0; border-radius: 999px; padding: 10px 16px; cursor: pointer;
  background: #fff; color: #2B2350; box-shadow: 0 3px 0 #E6DCC2;
}
.levels button[aria-pressed="true"], .maze-picks button[aria-pressed="true"] { background: #2B2350; color: #fff; box-shadow: 0 3px 0 #1a1633; }
.trace-controls .pri { background: #FFC234; box-shadow: 0 3px 0 #F08A00; }
.maze-picks { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 20px 8px; }
.stage-wrap { flex: 1; min-height: 0; padding: 0 16px 16px; display: flex; }
.stage {
  flex: 1; min-height: 280px; position: relative; background: #fff; border-radius: 24px;
  box-shadow: 0 10px 30px rgba(43,35,80,.12); overflow: hidden; touch-action: none;
}
#maze { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.bump .stage { animation: bump .28s ease; }
@keyframes bump { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.win {
  position: absolute; inset: 0; display: none; place-items: center; text-align: center;
  background: rgba(255,248,230,.92); padding: 24px;
}
.win.show { display: grid; }
.win h2 { font-size: 2rem; margin: 0 0 8px; }
.sticker { width: 140px; height: 140px; margin: 0 auto 12px; filter: drop-shadow(0 8px 12px rgba(43,35,80,.2)); }
.hint { padding: 0 20px 16px; font-weight: 600; color: #4A4178; }
@media (max-width: 700px) {
  .trace-bar h1 { font-size: 1.25rem; }
  .trace-controls button, .levels button, .maze-picks button { padding: 12px 14px; font-size: 1rem; }
}
body.trace-page .site-footer { display: none; }
body.trace-page .trace-app { min-height: calc(100vh - 72px); }
body.trace-page .site-header { position: sticky; top: 0; z-index: 8; }

body.trace-page, body.trace-page html { overflow: hidden; }
body.trace-page #main { padding: 0; margin: 0; }
body.trace-page .trace-app { height: calc(100dvh - 77px); max-height: calc(100dvh - 77px); min-height: 0; overflow: hidden; }
