:root {
  --paper: #f6f6ef;
  --white: #fffef9;
  --ink: #294536;
  --muted: #8a9483;
  --green: #275f4d;
  --line: #e0e5d7;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #e6ebe1;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:disabled { opacity: .35; cursor: default; }
button:focus-visible, a:focus-visible { outline: 3px solid #b0a064; outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
svg:not(#board) { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.app-shell {
  width: 100%;
  max-width: 460px;
  height: 100dvh;
  min-height: 560px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 22px max(8px, env(safe-area-inset-bottom));
  background: var(--paper);
  display: flex;
  flex-direction: column;
}
.site-header { height: 64px; flex: 0 0 64px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; gap: 9px; align-items: center; font-size: 31px; letter-spacing: -1.5px; font-weight: 720; }
.brand-mark { width: 29px; color: var(--green); }
.brand-mark svg { stroke-width: 3.5; }
.brand-period { color: #79915e; }
.brand-copy { display: flex; flex-direction: column; line-height: 1; gap: 2px; }
.brand-studio { font-size: 8px; letter-spacing: 1.7px; font-weight: 650; text-transform: uppercase; color: var(--muted); }
.header-actions { display: flex; gap: 5px; }
.icon-button { height: 44px; width: 44px; border-radius: 50%; display: grid; place-items: center; }
.icon-button svg { width: 22px; height: 22px; color: #7f8e74; }
.icon-button:active { background: #e5ebdd; }
main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.mode-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 8px 0 20px; flex-shrink: 0; }
.main-nav { display: flex; padding: 4px; border-radius: 15px; background: #e8ecdf; height: 46px; width: 240px; gap: 3px; }
.nav-link { display: flex; align-items: center; justify-content: center; gap: 7px; flex: 1; font-size: 13px; font-weight: 600; color: #8c977f; border-radius: 11px; transition: .2s; }
.nav-link svg { width: 16px; height: 16px; stroke-width: 1.9; }
.nav-link.active { background: #fffef9; color: var(--green); box-shadow: 0 2px 5px #2e452d09; }
.journey-button { height: 46px; min-width: 74px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; font-weight: 550; color: #75856a; border-radius: 12px; }
.journey-button svg { width: 18px; height: 18px; stroke-width: 1.5; }
.journey-button:active { background: #e8eddf; }
.play-layout { flex: 1; min-height: 0; display: flex; }
.game-column { width: 100%; min-height: 0; display: flex; flex-direction: column; }
.board-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 17px; flex: 0 0 auto; }
.level-info { display: flex; align-items: center; gap: 12px; }
.level-number { display: grid; place-items: center; width: 44px; height: 48px; border: 1px solid #dce3d0; border-radius: 14px; font-size: 21px; font-weight: 500; font-variant-numeric: tabular-nums; color: #678051; background: #ecf0e4; }
.small-label { font-size: 8px; letter-spacing: 1.4px; font-weight: 650; color: #8f9a82; }
.level-info h2 { font-size: 21px; letter-spacing: -.5px; font-weight: 600; margin: 5px 0 0; line-height: 1.2; }
.board-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 9px; }
.time-display { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #94a088; font-variant-numeric: tabular-nums; }
.time-display svg { width: 14px; height: 14px; }
.difficulty { display: flex; align-items: center; gap: 2px; font-size: 7px; color: #97a18d; white-space: nowrap; }
.difficulty span { width: 3px; height: 4px; background: #8fa47b; border-radius: 1px; }
.difficulty span:nth-child(2) { height: 6px; background: #d5ddc9; }
.difficulty span:nth-child(3) { height: 8px; background: #d5ddc9; margin-right: 4px; }
.difficulty.medium span:nth-child(2), .difficulty.hard span { background: #8fa47b; }
.board-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-height: 420px;
  min-height: 200px;
  flex: 0 1 auto;
  margin: auto 0;
  background: var(--white);
  border: 1px solid #dce3d2;
  border-radius: 27px;
  box-shadow: 0 6px 22px #2e422307;
  overflow: hidden;
}
#board { width: 100%; height: 100%; display: block; touch-action: manipulation; overflow: hidden; user-select: none; -webkit-user-select: none; }
.board-corner { position: absolute; width: 9px; height: 9px; color: #c6d0b9; pointer-events: none; }
.top-left { top: 19px; left: 19px; border-top: 1px solid; border-left: 1px solid; }
.top-right { top: 19px; right: 19px; border-top: 1px solid; border-right: 1px solid; }
.bottom-left { bottom: 19px; left: 19px; border-bottom: 1px solid; border-left: 1px solid; }
.bottom-right { bottom: 19px; right: 19px; border-bottom: 1px solid; border-right: 1px solid; }
.edge-label { position: absolute; font-size: 15px; color: #c4cfb9; pointer-events: none; }
.edge-top { top: 8px; left: calc(50% - 5px); }
.edge-right { right: 10px; top: calc(50% - 10px); }
.edge-bottom { bottom: 8px; left: calc(50% - 5px); }
.edge-left { left: 10px; top: calc(50% - 10px); }
.arrow { cursor: pointer; outline: none; }
.arrow-line, .arrow-head { fill: none; stroke: var(--arrow-color); stroke-width: 4.7; stroke-linecap: round; stroke-linejoin: round; }
.arrow-hit { fill: none; stroke: transparent; pointer-events: stroke; stroke-linecap: round; stroke-linejoin: round; }
.arrow:focus-visible .arrow-line, .arrow:focus-visible .arrow-head { stroke: #bc9250; }
.arrow.blocked .arrow-line, .arrow.blocked .arrow-head { stroke: #c17a66; }
.arrow.blocker .arrow-line, .arrow.blocker .arrow-head { stroke: #d69a86; }
.arrow.hinted .arrow-line, .arrow.hinted .arrow-head { stroke: #c39836; animation: hint-pulse 1s ease-in-out infinite; }
.arrow.pressed .arrow-line, .arrow.pressed .arrow-head { stroke: #a98b45; }
.arrow.flyout { pointer-events: none; }
.arrow.flyout.waiting { opacity: .65; }
.arrow.flyout .arrow-line, .arrow.flyout .arrow-head { stroke: #578567; }
.ray-indicator { fill: none; stroke: #c39836; stroke-width: 1.5; stroke-dasharray: 4 7; opacity: .5; pointer-events: none; }
.dot-grid { fill: #dfe5d6; opacity: .9; pointer-events: none; }
.board-toast { position: absolute; bottom: 16px; left: 50%; transform: translate(-50%, 8px); padding: 10px 14px; border: 1px solid #dfe4d6; border-radius: 16px; background: #f7f7efed; color: #607651; font-size: 11px; line-height: 1.5; opacity: 0; pointer-events: none; transition: .2s; width: max-content; max-width: 88%; text-align: center; backdrop-filter: blur(8px); }
.board-toast.visible { opacity: 1; transform: translate(-50%, 0); }
.board-toast.error { color: #ac705a; border-color: #e7ccbd; }
.progress-card { padding: 19px 2px 0; flex: 0 0 auto; }
.progress-summary { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: #8e9c7e; }
.arrows-left { font-weight: 600; color: #708664; }
.arrows-left>span { font-size: 13px; font-variant-numeric: tabular-nums; margin-right: 3px; }
.freed-count { font-size: 10px; }
.progress-percent { margin-left: 8px; padding-left: 8px; border-left: 1px solid #dce3d1; }
.progress-track { height: 4px; margin-top: 11px; border-radius: 4px; background: #e1e7d7; overflow: hidden; }
#progress-fill { height: 100%; width: 0; background: #87a06e; border-radius: 4px; transition: width .4s; }
.game-controls { display: grid; grid-template-columns: 1fr 1fr 1.35fr; gap: 10px; margin-top: 22px; flex: 0 0 auto; }
.control-button { min-height: 56px; display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 11px; font-weight: 550; color: #829473; background: #e9eddf; border: 1px solid #e0e7d4; border-radius: 17px; }
.control-button svg { width: 17px; height: 17px; }
.control-button:active:not(:disabled) { background: #dfe7d3; transform: scale(.97); }
.hint-button { min-height: 56px; display: flex; align-items: center; justify-content: center; gap: 8px; background: #ead799; border: 1px solid #decd91; border-radius: 17px; font-size: 13px; font-weight: 650; color: #80733e; }
.hint-button svg { width: 20px; height: 20px; }
.hint-button:active:not(:disabled) { background: #e3ca83; transform: scale(.97); }
.hint-spark { font-size: 17px; color: #af994c; margin-left: 5px; }
.board-footnote { text-align: center; color: #a0ac91; font-size: 10px; padding: 17px 0; flex: 0 0 auto; }
.chapter-progress { margin-top: auto; flex: 0 0 auto; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 49px; padding: 10px 13px; border-radius: 14px; background: #ebefdf; font-size: 10px; color: #8b9c76; text-align: left; }
.chapter-progress svg { width: 16px; height: 16px; margin-left: auto; }
.journey-emblem { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; background: #e1e8d3; font-size: 20px; color: #8da36e; }
.site-footer { flex: 0 0 auto; min-height: 31px; display: flex; justify-content: center; align-items: center; gap: 9px; font-size: 7px; letter-spacing: 1px; color: #b2bca2; padding-top: 9px; }
.site-footer>span { font-size: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.modal { position: fixed; inset: auto 0 0; margin: 0 auto; width: 100%; max-width: 460px; max-height: calc(100dvh - 30px - env(safe-area-inset-top)); border: 1px solid #dce4d1; border-bottom: 0; border-radius: 29px 29px 0 0; color: var(--ink); background: var(--paper); padding: 42px 25px max(26px, env(safe-area-inset-bottom)); box-shadow: 0 -10px 80px #1b392b25; overflow-y: auto; overscroll-behavior: contain; }
.modal:before { content: ''; position: absolute; top: 12px; left: calc(50% - 18px); width: 36px; height: 4px; border-radius: 4px; background: #cdd7c0; }
.modal::backdrop { background: #233c3559; backdrop-filter: blur(5px); }
.modal[open] { animation: sheet-in .28s cubic-bezier(.2,.8,.2,1); }
.modal-close { position: absolute; right: 13px; top: 21px; width: 44px; height: 44px; border-radius: 50%; font-size: 25px; color: #93a380; line-height: 1; z-index: 2; }
.modal-close:active { background: #e6eddb; }
.eyebrow { display: flex; align-items: center; gap: 10px; font-size: 8px; letter-spacing: 1.5px; font-weight: 650; color: #8b9a7d; }
.modal h2 { font-size: 28px; letter-spacing: -.8px; line-height: 1.2; font-weight: 600; margin: 15px 0; }
.modal p { font-size: 12px; color: #8b9a7d; line-height: 1.7; }
.help-steps { padding-left: 18px; margin: 23px 0; }
.help-steps li { font-size: 12px; line-height: 1.7; color: #8b9a7d; padding-left: 5px; margin: 15px 0; }
.help-steps strong { display: block; color: #647c54; font-weight: 600; }
.help-tip { background: #e8eedc; border-radius: 14px; padding: 13px 15px; }
.keyboard-help { display: none; }
.primary-button { width: 100%; min-height: 54px; border-radius: 16px; background: var(--green); color: #fffdf4; display: flex; justify-content: center; gap: 20px; align-items: center; font-size: 13px; font-weight: 600; padding: 15px 16px; margin-top: 22px; }
.primary-button:active { background: #1d503e; transform: scale(.98); }
.primary-button>span { font-size: 20px; }
.journey-chapter { margin-top: 24px; }
.journey-chapter h3 { font-size: 12px; font-weight: 600; color: #788d65; margin-bottom: 12px; }
.journey-chapter h3>span { display: block; font-size: 8px; letter-spacing: 1.2px; color: #a3b08f; margin-bottom: 5px; }
.level-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.level-tile { position: relative; border: 1px solid #dde5cf; background: #fffdf6; border-radius: 13px; min-height: 48px; min-width: 0; font-size: 16px; color: #8c9f77; font-weight: 500; font-variant-numeric: tabular-nums; }
.level-tile.current { border-color: #8fa773; box-shadow: 0 0 0 1px #8fa773; background: #e8efd9; color: #668b4f; }
.level-tile.completed { background: #e0ead1; color: #618147; }
.level-tile.completed:after { content: '✓'; position: absolute; font-size: 8px; right: 5px; top: 4px; }
.level-tile:active { background: #dce8cd; transform: scale(.97); }
.win-modal { text-align: center; }
.win-modal .eyebrow { justify-content: center; }
.win-art { display: flex; justify-content: center; margin: 5px 0 22px; }
.win-art svg { width: 145px; color: #7d9666; stroke-width: 2.8; }
.win-art .win-spark { color: #c7b46a; stroke-width: 1.5; }
.win-stats { display: flex; justify-content: space-around; gap: 14px; margin: 28px 0; }
.win-stats>div { display: grid; gap: 8px; }
.win-stats strong { font-size: 22px; font-weight: 500; color: #849b69; }
.win-stats span { font-size: 9px; color: #a0ad8f; }
.text-button { min-height: 44px; font-size: 12px; color: #8b9e75; padding: 12px 0 0; margin-top: 6px; }
@keyframes hint-pulse { 50% { opacity: .65; } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@media (hover: hover) {
  .arrow:not(.blocked):not(.blocker):not(.hinted):hover .arrow-line, .arrow:not(.blocked):not(.blocker):not(.hinted):hover .arrow-head { stroke: #bc9250; }
  .icon-button:hover, .journey-button:hover { background: #e7eddd; }
  .control-button:hover:not(:disabled) { background: #e0e8d3; }
  .hint-button:hover:not(:disabled) { background: #e3ce8c; }
  .level-tile:hover { background: #e6edd8; }
}
@media (min-width: 600px) {
  body { min-height: 100dvh; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 30%, #f4f5ed, #e4e9de); }
  .app-shell { width: 430px; height: min(900px, calc(100dvh - 32px)); min-height: 560px; padding: 16px 24px 10px; border: 1px solid #d6dfcc; border-radius: 34px; box-shadow: 0 25px 70px #425b3412, 0 3px 10px #425b3405; }
  .modal { max-width: 430px; bottom: max(16px, calc((100dvh - 900px) / 2)); border-radius: 29px; border-bottom: 1px solid #dce4d1; }
  .keyboard-help { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; font-size: 10px; color: #8b9a7d; margin: 22px 0; }
  kbd { border: 1px solid #d5dfc7; background: #fffdf5; border-radius: 5px; font-family: inherit; font-size: 10px; padding: 4px 6px; margin-right: 6px; }
}
@media (max-height: 760px) {
  .app-shell { padding-top: max(8px, env(safe-area-inset-top)); }
  .site-header { height: 54px; flex-basis: 54px; }
  .brand { font-size: 28px; }
  .brand-mark { width: 26px; }
  .mode-row { margin: 4px 0 14px; }
  .main-nav, .journey-button { height: 44px; }
  .board-toolbar { padding-bottom: 13px; }
  .level-number { height: 44px; width: 41px; }
  .level-info h2 { font-size: 19px; }
  .progress-card { padding-top: 14px; }
  .progress-track { margin-top: 9px; }
  .game-controls { margin-top: 16px; }
  .control-button, .hint-button { min-height: 52px; border-radius: 15px; }
  .board-footnote { padding: 14px 0 9px; }
  .chapter-progress { display: none; }
  .site-footer { min-height: 26px; padding-top: 6px; }
}
@media (max-width: 360px) {
  .app-shell { padding-inline: 16px; }
  .main-nav { width: 205px; }
  .journey-button { min-width: 65px; font-size: 11px; }
  .level-info { gap: 9px; }
  .level-info h2 { font-size: 18px; }
  .difficulty { display: none; }
  .control-button { font-size: 10px; gap: 5px; }
  .game-controls { gap: 8px; }
  .modal { padding-inline: 22px; }
  .level-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-height: 640px) {
  .site-header { height: 44px; flex-basis: 44px; }
  .brand { font-size: 26px; }
  .mode-row { margin-bottom: 8px; }
  .board-toolbar { padding-bottom: 10px; }
  .level-number { height: 38px; width: 38px; font-size: 18px; }
  .level-info h2 { font-size: 17px; }
  .progress-card { padding-top: 10px; }
  .progress-track { margin-top: 7px; }
  .game-controls { margin-top: 12px; }
  .control-button, .hint-button { min-height: 44px; border-radius: 13px; }
  .board-footnote { padding: 10px 0 5px; font-size: 9px; }
  .site-footer { min-height: 20px; padding-top: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* The playable maze fills the remaining screen; its silhouette comes from the arrows. */
.site-header { height: 44px; flex-basis: 44px; }
.brand { font-size: 26px; }
.brand-mark { width: 24px; }
.mode-row { margin: 3px 0 10px; }
.main-nav, .journey-button { height: 44px; }
.board-toolbar { padding-bottom: 12px; }
.level-number { width: 38px; height: 40px; font-size: 18px; border-radius: 12px; }
.level-info { gap: 10px; }
.level-info h2 { font-size: 20px; margin-top: 4px; }
.board-meta { gap: 5px; }
.difficulty { display: none; }
#lives-status { display: flex; gap: 5px; align-items: center; }
.heart { width: 18px; height: 18px; color: #b78067; transition: opacity .2s; }
.heart path { fill: currentColor; stroke: currentColor; stroke-width: 1.1; }
.heart.empty { color: #c9d1bd; }
.heart.empty path { fill: none; }
.time-display { font-size: 9px; gap: 4px; }
.time-display svg { width: 11px; height: 11px; }
.board-frame { flex: 1 1 0; aspect-ratio: auto; max-height: none; min-height: 210px; margin: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.board-corner, .edge-label { display: none; }
.progress-card { padding-top: 10px; }
.progress-track { margin-top: 7px; height: 3px; }
.game-controls { margin-top: 14px; }
.control-button, .hint-button { min-height: 48px; }
.board-footnote { font-size: 9px; padding: 10px 0 2px; }
.chapter-progress, .site-footer { display: none; }
.lose-art { font-size: 38px; color: #bba188; letter-spacing: 6px; margin: 8px 0 28px; }
[hidden] { display: none !important; }
.arrow-line, .arrow-head { stroke-width: var(--line-width, 4.7); }
.special-badge { pointer-events: none; fill: var(--arrow-color); }
.special-badge circle { fill: var(--paper); stroke: var(--arrow-color); stroke-width: 1.5; }
.special-badge text { font-family: -apple-system, BlinkMacSystemFont, sans-serif; font-weight: 700; }
.obstacle { pointer-events: none; }
.obstacle rect { stroke-width: 1.7; fill: #d4d4c9; stroke: #919990; }
.obstacle path { fill: none; stroke: #8e9687; stroke-width: 1.7; stroke-linecap: round; }
.obstacle.gate rect { fill: #e3daeb; stroke: #9476aa; }
.obstacle.gate path { stroke: #8869a2; }
.obstacle.gate text { fill: #8869a2; font-weight: 700; }
.obstacle.blocker rect { stroke: #c17a66; fill: #ebccbe; }
#board { touch-action: none; }
.zoomed #board { cursor: grab; }
.zoomed #board:active { cursor: grabbing; }
.game-controls { grid-template-columns: 44px 44px minmax(0, 1fr) 44px 44px; gap: 8px; }
.game-controls #restart-button span, .game-controls #undo-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.zoom-readout { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); padding: 5px 9px; border-radius: 12px; background: #f5f6eceb; color: #6c8060; font-size: 10px; pointer-events: none; white-space: nowrap; }
.zoom-button { padding: 0; }
.zoom-button.active { color: var(--green); background: #dae6cc; }
.hint-spark { display: none; }
.flow-status { color: #a17c26; font-size: 10px; font-weight: 650; }
.small-label { display: block; max-width: 160px; font-size: 7px; letter-spacing: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.level-number { min-width: 38px; width: auto; padding-inline: 7px; font-size: 16px; }
.level-jump { display: grid; grid-template-columns: 1fr 82px 60px; gap: 8px; align-items: center; margin: 20px 0 6px; }
.level-jump label { font-size: 12px; color: #75856a; }
.level-jump input { width: 100%; min-width: 0; height: 44px; border: 1px solid #d7dfca; border-radius: 12px; padding: 8px; background: #fffdf6; color: var(--green); font: inherit; font-size: 16px; }
.level-jump button { min-height: 44px; border-radius: 12px; background: #e1ead5; font-size: 13px; }
.journey-paging { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: #7c8e6b; }
.journey-paging button { width: 44px; min-height: 44px; font-size: 22px; }
.journey-chapter { margin-top: 6px; }
.level-grid { grid-template-columns: repeat(5, 1fr); gap: 7px; }
.level-tile { font-size: 12px; padding: 8px 2px 14px; min-height: 48px; }
.level-mechanics { position: absolute; bottom: 3px; left: 0; width: 100%; font-size: 9px; color: #ad9658; letter-spacing: 2px; }
.mechanic-guide { padding: 4px 0; }
.mechanic-guide p { position: relative; padding-left: 37px; min-height: 32px; }
.mechanic-guide strong { color: #647c54; display: block; }
.mechanic-icon { display: grid; place-items: center; position: absolute; left: 0; top: 2px; width: 27px; height: 27px; border: 1px solid; border-radius: 50%; font-size: 18px; }
.auto-icon { color: #238b87; }.bonus-icon { color: #b18a29; }.key-icon { color: #8869a2; }
.site-header { margin-bottom: 9px; }
.header-actions { gap: 0; }
.header-actions .nav-link { flex: none; width: 44px; padding: 0; border-radius: 50%; box-shadow: none; }
.header-actions .nav-link.active { background: #e5eddb; }
.header-actions .nav-link svg { width: 20px; height: 20px; }
.board-footnote { display: none; }
.ad-banner { flex: 0 0 56px; display: flex; gap: 10px; align-items: center; margin-top: 10px; padding: 5px 6px 5px 9px; border: 1px solid #dbe2ce; border-radius: 12px; background: #edf0e6; }
.ad-banner-mark { color: #8b9c71; width: 30px; flex: 0 0 30px; }
.ad-banner-mark svg { stroke-width: 2; }
.ad-banner-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ad-label { font-size: 7px; letter-spacing: 1px; color: #929c83; font-weight: 600; }
.ad-banner-copy strong { font-size: 11px; font-weight: 600; color: #738567; }
.ad-banner-copy small { font-size: 8px; color: #949f85; }
.ad-banner button { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; background: #e3ead8; border-radius: 9px; }
.ad-banner button svg { width: 18px; height: 18px; color: #7b8e68; }
.ad-modal { inset: 0; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; padding: max(16px, env(safe-area-inset-top)) 24px max(20px, env(safe-area-inset-bottom)); }
.ad-modal[open] { display: flex; flex-direction: column; }
.ad-modal:before { display: none; }
.ad-topline { display: flex; justify-content: space-between; align-items: center; }
.ad-close { width: 44px; height: 44px; border-radius: 50%; background: #e7eddd; font-size: 26px; color: #7b8e68; }
.ad-creative { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px 0; }
.ad-art { position: relative; width: min(200px, 32dvh); height: min(200px, 32dvh); border-radius: 32%; background: #e5edda; display: grid; place-items: center; margin-bottom: 32px; }
.ad-art svg { width: 77%; color: #698b5e; stroke-width: 4; }
.ad-art>span { position: absolute; top: 10px; right: -12px; font-size: 38px; color: #c6ac61; }
.ad-creative h2 { margin: 18px 0; font-size: 31px; }
.ad-creative p { max-width: 280px; }
.ad-bottom { flex: 0 0 auto; text-align: center; }
.ad-bottom p { margin: 12px 0 0; font-size: 9px; }
@media (min-width: 600px) {
  .ad-modal { inset: 0; margin: auto; max-width: 430px; height: min(900px, calc(100dvh - 32px)); border-radius: 34px; }
}
@media (max-height: 640px) {
  .ad-banner { margin-top: 7px; flex-basis: 54px; }
  .ad-art { width: min(155px, 26dvh); height: min(155px, 26dvh); margin-bottom: 18px; }
  .ad-creative { padding-block: 12px; }
  .ad-creative h2 { font-size: 25px; }
}
@media (max-width: 360px) {
  .brand-mark { display: none; }
  .brand { font-size: 22px; }
  .small-label { max-width: 127px; }
  .level-info { gap: 7px; }
  .progress-percent { display: none; }
}
@media (max-height: 640px) {
  .mode-row { margin: 2px 0 7px; }
  .board-toolbar { padding-bottom: 8px; }
  .level-info h2 { font-size: 18px; }
  .level-number { height: 36px; }
  .control-button, .hint-button { min-height: 44px; }
  .game-controls { margin-top: 10px; }
  .board-footnote { padding-top: 8px; }
}

/* Original candy colors; finite effects keep the maze responsive at 135 arrows. */
:root { --paper: #faf7ff; --white: #fffdfd; --ink: #443765; --muted: #84769b; --green: #7355c5; --line: #e9ddf5; background: #ebe5f7; }
.app-shell { background: radial-gradient(ellipse at 0 0, #e1f7f1 0, transparent 42%), radial-gradient(ellipse at 100% 65%, #ffecdd 0, transparent 50%), var(--paper); }
.brand-mark { color: #8a61cf; animation: brand-bob 4s ease-in-out infinite; }
.brand-period { color: #e56991; }
.brand-studio, .small-label { color: #8a729f; }
.brand { color: #574376; }
.header-actions .icon-button svg { color: #8572ac; }
#daily-nav svg { color: #ca8726; }
#journey-nav svg { color: #328f9c; }
#help-button svg { color: #d36c8b; }
.icon-button:active, .icon-button:hover { background: #e9e0f7; }
.level-number { background: #eee5fb; border-color: #dfcff6; color: #8860c5; font-weight: 700; }
.level-info h2 { color: #594277; }
.time-display { color: #8d7b9a; }
.heart { color: #e05b88; }
.heart.empty { color: #cec1dc; }
.board-frame { border-radius: 22px; background: linear-gradient(155deg, #ffffffb3, #fffcfc70); }
.dot-grid { fill: #d4c4e1; opacity: .7; }
.arrow.flyout .arrow-line, .arrow.flyout .arrow-head { stroke: var(--arrow-color); }
.arrow.pressed .arrow-line, .arrow.pressed .arrow-head { stroke: var(--arrow-color); opacity: .72; }
.arrow.previewed .arrow-line, .arrow.previewed .arrow-head { stroke: var(--preview-color); opacity: 1; }
.arrow.blocked .arrow-line, .arrow.blocked .arrow-head { stroke: #c84944; }
.arrow.blocker .arrow-line, .arrow.blocker .arrow-head { stroke: #d97649; }
.arrow:focus, .arrow:focus-visible { outline: none; }
.arrow-line, .arrow-head, .arrow-hit { filter: none; }
.arrow:focus-visible:not(.flyout) .arrow-line, .arrow:focus-visible:not(.flyout) .arrow-head { stroke: #6240b6; stroke-width: calc(var(--line-width, 4.7) * 1.3); }
@media (hover: hover) {
  .arrow:not(.blocked):not(.blocker):not(.hinted):not(.previewed):hover .arrow-line,
  .arrow:not(.blocked):not(.blocker):not(.hinted):not(.previewed):hover .arrow-head { stroke: var(--arrow-color); opacity: .78; }
}
.control-button { background: #eee8fa; border-color: #e1d7f1; color: #8266af; transition: transform .15s, background .15s; }
#restart-button { background: #ffe9ef; border-color: #f3d5e0; color: #bd6084; }
#undo-button { background: #e0f4ef; border-color: #cee8e2; color: #398b7c; }
.control-button:hover:not(:disabled) { background: #e6dcf7; }
.hint-button { background: #ffe8aa; border-color: #f4d68e; color: #946822; transition: transform .15s; }
.hint-button:hover:not(:disabled) { background: #ffdfa0; }
.hint-button svg { animation: hint-wiggle 5s ease-in-out infinite; }
.arrows-left, .arrows-left>span, .freed-count { color: #85709f; }
.progress-percent { color: #7b60aa; }
#remaining-count { color: #7550b5; font-weight: 750; display: inline-block; }
.progress-track { height: 5px; background: #e8ddf4; border-radius: 8px; }
#progress-fill { background: linear-gradient(90deg, #ee80a7, #9b7be1, #57b6b2); border-radius: inherit; transition: width .2s ease-out; }
.zoom-button.active { background: #ddcef4; color: #7351b5; }
.board-toast { background: #fffcfff5; color: #705990; border-color: #e0d0f0; backdrop-filter: none; }
.board-toast.error { color: #b95244; border-color: #f2c7bd; }
.zoom-readout { background: #f5edfff0; color: #8062a3; }
.path-readout { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); width: max-content; max-width: 94%; border-radius: 15px; padding: 9px 12px; font-size: 10px; line-height: 1.4; font-weight: 650; color: #087f76; background: #e8fff8f5; border: 1px solid #a7dcca; pointer-events: none; text-align: center; }
.path-readout.blocked-path { color: #b34c37; background: #fff0e7f7; border-color: #edc7ad; }
.previewing .zoom-readout, .previewing .board-toast { visibility: hidden; }
.path-preview { --projection-color: #087f76; }
.path-preview.blocked-path { --projection-color: #c65a43; }
.path-preview path, .path-preview circle { vector-effect: non-scaling-stroke; pointer-events: none; fill: none; }
.projection-halo { stroke: #fffdfc; stroke-width: 7; stroke-linecap: round; }
.projection-ray { stroke: var(--projection-color); stroke-width: 2.5; stroke-dasharray: 5 5; stroke-linecap: round; animation: path-march .9s linear infinite; }
.projection-beyond { stroke: #aa929f; opacity: .45; stroke-width: 1.5; stroke-dasharray: 3 6; }
.projection-marker { fill: #fffdfc !important; stroke: var(--projection-color); stroke-width: 2; }
.projection-symbol { stroke: var(--projection-color); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#board { -webkit-touch-callout: none; }
.modal { background: #faf7ff; color: #544171; border-color: #e8dbf5; }
.modal:before { background: #d9c8ee; }
.modal p, .help-steps li, .settings-note { color: #887498; }
.modal h2 { color: #61467f; }
.eyebrow, .text-button, .modal-close, .journey-chapter h3 { color: #9876b2; }
.help-steps strong, .mechanic-guide strong { color: #6d5588; }
.help-tip { background: #eee5fa; }
.primary-button { background: linear-gradient(115deg, #936cda, #7456c5); box-shadow: 0 5px 14px #9270c525; }
.primary-button:active { background: #7754bf; }
.level-tile { color: #9274b0; border-color: #e6d8f2; background: #fffbff; }
.level-tile.current { color: #7750b4; background: #eee2fd; border-color: #a483d2; box-shadow: 0 0 0 1px #a483d2; }
.level-tile.completed { color: #348879; background: #e2f5eb; }
.level-tile:hover { background: #eee2fd; }
.journey-paging, .level-jump label, .journey-chapter h3>span { color: #9878b4; }
.level-jump input { border-color: #dfd0ed; color: #7955b4; background: #fffbff; }
.level-jump button { background: #eadcf9; }
.win-art svg { color: #9d7bd4; animation: win-float 3s ease-in-out infinite; }
.win-art .win-spark { color: #e8aa43; }
.win-stats strong { color: #9471c6; }
#win-rating { color: #d79b27; animation: star-pop .65s .2s both; }
.win-stats span { color: #9e8bac; }
.ad-banner { background: #f0eaf7; border-color: #e3d8ed; }
.ad-banner-mark, .ad-banner-copy strong { color: #9580ad; }
.ad-label, .ad-banner-copy small { color: #8f7e9f; }
.ad-banner button { background: #e8dff2; }
.ad-banner button svg { color: #9275b2; }
.settings-list { margin-top: 20px; background: #fffcff; border: 1px solid #e9def3; border-radius: 20px; padding: 0 16px; }
.setting-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 18px 0; cursor: pointer; min-height: 84px; }
.setting-row+.setting-row { border-top: 1px solid #f0e8f7; }
.setting-row span { display: grid; gap: 5px; }
.setting-row strong { font-size: 13px; color: #6c528b; }
.setting-row small { font-size: 10px; color: #927fa3; line-height: 1.6; }
.setting-row input { appearance: none; -webkit-appearance: none; margin: 0; flex: 0 0 46px; width: 46px; height: 28px; border-radius: 20px; background: #d9cee5; position: relative; cursor: pointer; }
.setting-row input:checked { background: #9471d2; }
.setting-row input:after { content: ''; position: absolute; width: 22px; height: 22px; border-radius: 50%; top: 3px; left: 3px; background: white; box-shadow: 0 1px 3px #67547f25; transition: transform .18s; }
.setting-row input:checked:after { transform: translateX(18px); }
.setting-row input:focus-visible { outline: 3px solid #c6a8ec; outline-offset: 4px; }
.settings-note { font-size: 10px !important; }
.effect-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; border-radius: inherit; }
.cheer-particle { position: absolute; width: 5px; height: 5px; margin: -2.5px; background: var(--particle-color); border-radius: 50%; opacity: 0; animation: sparkle-out .5s var(--delay) ease-out forwards; }
.confetti-piece { width: 6px; height: 10px; border-radius: 2px; animation: confetti-out 1.2s var(--delay) cubic-bezier(.1,.45,.5,1) forwards; }
.maze-arrival { animation: maze-arrive .35s ease-out; }
.count-pop { animation: count-pop .25s ease-out; }
.heart-nudge { animation: heart-nudge .3s ease-in-out; }
.quiet-motion *, .quiet-motion *:before, .quiet-motion *:after { animation: none !important; transition: none !important; }
@keyframes brand-bob { 50% { transform: translateY(-2px) rotate(4deg); } }
@keyframes hint-wiggle { 0%, 85%, 100% { transform: rotate(0); } 90% { transform: rotate(-8deg); } 95% { transform: rotate(8deg); } }
@keyframes path-march { to { stroke-dashoffset: -10; } }
@keyframes win-float { 50% { transform: translateY(-5px) rotate(2deg); } }
@keyframes star-pop { from { opacity: 0; transform: scale(.5); } 70% { transform: scale(1.15); } to { opacity: 1; transform: scale(1); } }
@keyframes maze-arrive { from { opacity: .5; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes count-pop { 40% { transform: scale(1.2); } }
@keyframes heart-nudge { 30% { transform: translateX(-3px); } 70% { transform: translateX(3px); } }
@keyframes sparkle-out { 0% { opacity: .9; transform: translate(0, 0) scale(.5); } 35% { opacity: .85; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--turn)) scale(.1); } }
@keyframes confetti-out { 0% { opacity: 0; transform: translate(0, 0) rotate(0); } 10% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--turn)); } }
