* { box-sizing: border-box; }
:root { color-scheme: light; --ink: #455549; --green: #526f50; --paper: #fffaf0; --line: #d1d5bb; }
body { margin: 0; background: linear-gradient(140deg, #eee4ce, #f8f2e6 52%, #e4eddf); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.75; }
button, input { font: inherit; }
button { min-width: 44px; min-height: 44px; border: 1px solid #b3c2a3; border-radius: 10px; padding: 9px 12px; color: #4b6946; background: #fffdf5; font-size: 12px; font-weight: 650; cursor: pointer; touch-action: manipulation; }
button:hover:not(:disabled) { border-color: #6f905e; box-shadow: 0 0 0 1px #7b976455; }
button:disabled { cursor: default; opacity: .5; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #ac6e35; outline-offset: 4px; }
[hidden] { display: none !important; }
.page { max-width: 1120px; margin: auto; padding: 22px 30px 0; }
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid #cbd3b9; padding-bottom: 12px; }
.back-home { min-height: 44px; display: inline-flex; align-items: center; color: #55744c; font-size: 13px; text-underline-offset: 4px; }
.header-note { color: #809173; font-size: 11px; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 30px 0; }
.eyebrow { font-size: 10px; font-weight: 750; color: #829374; letter-spacing: 1.5px; margin: 0 0 8px; }
h1 { font-size: clamp(36px, 5vw, 52px); margin: 0 0 12px; color: #486b45; letter-spacing: 1px; line-height: 1.25; }
h1 > span { color: #bb874d; }
.lead { margin: 0; color: #738668; font-size: 15px; line-height: 1.9; }
.hero-chart { flex: 0 0 220px; width: 220px; height: 120px; position: relative; transform: rotate(5deg); }
.tiny-star { position: absolute; width: 28px; height: 28px; display: grid; place-items: center; font-style: normal; font-size: 29px; line-height: 1; color: #a8894d; }
.tiny-star.a { left: 14px; top: 58px; }
.tiny-star.b { left: 73px; top: 5px; color: #859c76; }
.tiny-star.c { left: 135px; top: 58px; color: #859c76; }
.tiny-star.d { left: 184px; top: 12px; }
.tiny-line { position: absolute; height: 2px; background: #b6c29d; transform-origin: left center; }
.tiny-line.one { width: 75px; left: 34px; top: 68px; transform: rotate(-42deg); }
.tiny-line.two { width: 78px; left: 92px; top: 26px; transform: rotate(40deg); }
.tiny-line.three { width: 65px; left: 154px; top: 70px; transform: rotate(-43deg); }
.hero-chart p { position: absolute; width: 100%; bottom: -21px; margin: 0; text-align: center; color: #8e9b7d; font-size: 10px; }
.puzzle-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.puzzle-actions button { min-height: 46px; color: #fff8e7; background: #55744f; border-color: #748d65; }
.puzzle-actions button:hover:not(:disabled) { background: #43653e; }
.notice { padding: 12px 15px; border: 1px solid #d4ae6e; border-radius: 10px; background: #fff0cc; color: #7d5f2d; font-size: 12px; margin: 0 0 12px; }
.trail-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr); gap: 22px; align-items: start; }
.panel { min-width: 0; padding: 23px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 5px 0 #aeba9f44; }
.puzzle-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px dashed #d4dcc0; padding-bottom: 12px; font-size: 11px; color: #849576; }
.puzzle-meta code { color: #617e52; font-family: ui-monospace, monospace; letter-spacing: 1.4px; }
.game-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 15px; }
.game-heading .eyebrow { margin-bottom: 5px; }
h2 { color: #52734a; font-size: 21px; line-height: 1.45; margin: 0; }
.little-stamp { border: 1px solid #c9b68c; border-radius: 6px; padding: 2px 7px; color: #a1844d; font-size: 10px; white-space: nowrap; transform: rotate(4deg); }
.scoreboard { display: grid; grid-template-columns: 1.2fr 1.1fr 1fr; gap: 8px; margin: 0 0 13px; }
.scoreboard > div { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 5px; background: #edf1df; border: 1px solid #d1ddbe; border-radius: 9px; padding: 8px 11px; }
.scoreboard span { color: #79906c; font-size: 11px; }
.scoreboard strong { color: #597d4f; font-size: 24px; line-height: 1.3; }
.scoreboard b { font-weight: 750; }
.scoreboard small { font-size: 10px; color: #8b9e7c; font-weight: 500; }
.goal-label { font-size: 11px; color: #8d7d4f; margin: 0 0 14px; min-height: 20px; }
.board { width: 100%; aspect-ratio: 1; position: relative; border-radius: 15px; overflow: hidden; background: radial-gradient(circle at 20% 15%, #294657, #182f40 68%); box-shadow: inset 0 0 0 2px #567065, 0 5px 0 #a9b69c99; }
#edge-layer, #node-layer { position: absolute; width: 100%; height: 100%; inset: 0; }
#edge-layer { display: block; }
#edge-layer line { stroke: #90a6a0; stroke-width: 6; stroke-dasharray: 7 8; stroke-linecap: round; }
#edge-layer line[data-used="true"] { stroke: #e2bf72; stroke-width: 8; stroke-dasharray: none; }
.star-node { position: absolute; width: 52px; height: 52px; min-width: 44px; min-height: 44px; padding: 4px; transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px; border-radius: 50%; border: 2px solid #78988a; background: #e7eddb; color: #3f6655; box-shadow: 0 2px 0 #0c26384d; line-height: 1; font-size: 15px; }
.star-node .node-marker { min-height: 9px; font-size: 8px; color: #53725d; letter-spacing: 1px; line-height: 1; }
.star-node[data-available="true"] { border-style: dashed; border-color: #c7b47a; }
.star-node[data-goal="true"] { box-shadow: inset 0 0 0 2px #b99e5d, 0 2px 0 #0c26384d; }
.star-node[data-current="true"] { border: 3px solid #e6c272; color: #5f4c25; background: #f0d795; }
.star-node[data-current="true"] .node-marker { color: #806334; }
.star-node:hover:not(:disabled) { border-color: #f2d68e; box-shadow: 0 0 0 3px #e4cd8f44; }
.star-node:focus-visible { outline-color: #f7df9e; outline-offset: 4px; }
.star-node:disabled { opacity: 1; cursor: default; }
.legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px 15px; font-size: 10px; color: #839675; margin: 18px 0 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; }
.legend-current { width: 12px; height: 12px; border: 2px solid #c4a461; border-radius: 50%; background: #efd795; }
.legend-available { width: 12px; height: 12px; border: 1px dashed #a58f58; border-radius: 50%; background: #e4ead8; }
.legend-unused { width: 21px; height: 0; border-top: 2px dashed #84978a; }
.legend-used { width: 21px; height: 0; border-top: 3px solid #bfa15b; }
.undo-area button { width: 100%; min-height: 46px; }
.live-status { color: #69845a; font-size: 12px; min-height: 44px; margin: 16px 0 10px; }
.result { padding: 14px; background: #eef2de; border: 1px solid #d0debb; border-radius: 10px; }
.result h3 { color: #55774a; font-size: 14px; margin: 0 0 5px; }
.result p { color: #7e946b; font-size: 11px; margin: 0; }
.result[data-phase="won"] { background: #e6efcd; border-color: #afc48f; }
.result[data-trapped="true"] { background: #f5ecd6; border-color: #d8c295; }
.save-note { color: #91a07e; font-size: 10px; margin: 12px 0 0; }
.side-stack { min-width: 0; display: grid; gap: 22px; }
.rules { font-size: 12px; color: #7c936d; padding-left: 20px; margin: 18px 0; }
.rules li { padding-left: 2px; margin-bottom: 13px; }
.rules b { color: #5f7e4f; }
.note-card { border-left: 3px solid #becb99; padding: 11px 13px; background: #eff0d8; color: #80936a; font-size: 12px; margin: 17px 0; }
.small-note { font-size: 10px; line-height: 1.9; color: #8c9e79; margin: 14px 0; }
.mini-trail { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 17px 0 2px; }
.mini-trail span { width: 37px; height: 37px; display: grid; place-items: center; color: #ac8b49; background: #f2e6bb; border: 1px solid #d9cc99; border-radius: 50%; font-size: 22px; }
.mini-trail i { width: 26px; border-top: 2px dashed #a5b98b; }
.share-panel { padding: 15px 18px; margin-top: 25px; border: 1px solid #adc097; border-radius: 11px; background: #e7eed9; color: #789365; font-size: 11px; }
.share-panel p { margin: 0; }
.share-panel label { display: block; margin: 10px 0 5px; }
#share-fallback { width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid #adc398; border-radius: 7px; color: #658153; background: #fffdf4; font-size: 12px; }
footer { text-align: center; color: #9ca987; font-size: 10px; letter-spacing: 1px; padding: 28px 0; }
footer span { color: #b59151; padding-inline: 4px; }
dialog { width: min(460px, calc(100% - 32px)); padding: 25px; border: 1px solid #c4d1ac; border-radius: 17px; background: #fffaf0; color: var(--ink); box-shadow: 0 20px 70px #34472d44; }
dialog::backdrop { background: #344a3299; backdrop-filter: blur(3px); }
dialog > p:not(.eyebrow) { font-size: 13px; color: #81936d; margin: 15px 0 20px; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dialog-actions button { min-width: 0; padding: 10px 6px; }
.primary { color: #fff8e5; background: #597a4c; border-color: #597a4c; }
.primary:hover:not(:disabled) { background: #44663a; }
@media (max-width: 900px) {
  .page { padding-inline: 22px; }
  .trail-layout { gap: 16px; }
  .panel { padding: 17px; }
  .game { padding: 15px; }
  .side-stack { gap: 16px; }
  h2 { font-size: 19px; }
  .little-stamp { display: none; }
  .star-node { width: 48px; height: 48px; }
}
@media (max-width: 700px) {
  .page { padding: 14px 16px 0; }
  .site-header { gap: 8px; }
  .back-home { font-size: 12px; }
  .header-note { font-size: 10px; }
  .hero { padding: 25px 0; }
  .hero-chart { display: none; }
  .lead { font-size: 14px; }
  .puzzle-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
  .trail-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .panel { padding: 22px 18px; }
  .game { padding: 16px 13px; }
  h2 { font-size: 19px; }
  .scoreboard { gap: 6px; }
  .scoreboard > div { padding: 8px; gap: 3px; }
  .scoreboard span { font-size: 10px; }
  .scoreboard strong { font-size: 22px; }
  .star-node { width: 44px; height: 44px; font-size: 14px; padding: 3px; }
  .star-node .node-marker { font-size: 7px; }
  dialog { padding: 22px 19px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
