* { box-sizing: border-box; }
:root { color-scheme: light; --ink: #354f58; --muted: #748b86; --sea: #385f69; --paper: #fffaf0; --line: #cfd8c3; }
body { margin: 0; color: var(--ink); background: linear-gradient(135deg, #e8eee2, #f6f0e3 52%, #dcece8); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.7; }
button, input { font: inherit; }
button { min-width: 44px; min-height: 44px; padding: 9px 12px; border: 1px solid #b0c1ae; border-radius: 10px; color: #456353; background: #fffdf5; font-size: 12px; font-weight: 650; cursor: pointer; touch-action: manipulation; }
button:hover:not(:disabled) { background: #e8efdf; border-color: #719580; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, #map:focus-visible { outline: 3px solid #b76f3e; outline-offset: 4px; }
[hidden] { display: none !important; }
.page { max-width: 1100px; margin: auto; padding: 22px 30px 0; }
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid #ced8c5; padding-bottom: 12px; }
.back-home { display: inline-flex; align-items: center; min-height: 44px; color: #466e61; font-size: 13px; text-underline-offset: 4px; }
.header-note { color: #879a89; font-size: 11px; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 32px 0 27px; }
.eyebrow { color: #81967e; font-size: 10px; font-weight: 750; letter-spacing: 1.7px; margin: 0 0 7px; }
h1 { margin: 0 0 12px; color: #3b645b; font-size: clamp(36px, 5vw, 52px); line-height: 1.25; letter-spacing: 1px; }
h1 > span { color: #bd8551; }
.lead { color: #778c7b; margin: 0; font-size: 15px; line-height: 1.9; }
.postcard { position: relative; width: 265px; flex: 0 0 265px; height: 175px; border: 1px solid #b7cbb9; border-radius: 12px; background: #e5efe0; padding: 14px 17px; transform: rotate(5deg); box-shadow: 5px 6px 0 #8ca88b22; overflow: hidden; }
.postcard > span { color: #8ba386; font-size: 9px; letter-spacing: 2px; }
.island-shape { width: 137px; height: 71px; margin: 14px 0 0 10px; border: 9px solid #bcd3c6; border-radius: 51% 43% 56% 38%; background: #cdd9b1; transform: rotate(-13deg); position: relative; }
.island-shape i { position: absolute; width: 64px; height: 20px; left: 20px; top: 17px; border-left: 5px dotted #f5f0d3; border-bottom: 5px dotted #f5f0d3; transform: rotate(-10deg); }
.island-shape b { position: absolute; top: 2px; right: 6px; width: 25px; height: 25px; border-radius: 50%; color: #fbf5d8; background: #5c8371; font-size: 12px; display: grid; place-items: center; }
.postcard > p { color: #8da081; font-size: 10px; margin: 8px 0 0; }
.postmark { position: absolute; right: 16px; top: 25px; width: 63px; height: 63px; border: 2px dotted #c79f6b; border-radius: 50%; color: #bc996d; font: 28px/1 Georgia,serif; display: flex; align-items: center; justify-content: center; flex-direction: column; transform: rotate(-16deg); }
.postmark small { font: 8px/1.2 ui-monospace,monospace; margin-top: 4px; }
.puzzle-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.puzzle-actions button { min-height: 46px; color: #f5f3df; background: #446c61; border-color: #668f78; }
.puzzle-actions button:hover:not(:disabled) { background: #5c8571; border-color: #668f78; }
.notice { border: 1px solid #d3b575; border-radius: 10px; background: #fff0ce; color: #7b6335; padding: 12px 15px; font-size: 12px; margin: 0 0 12px; }
.notice p { margin: 2px 0; }
.island-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .85fr); gap: 22px; align-items: start; }
.panel { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 23px; box-shadow: 0 5px 0 #a7b79a33; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
h2 { font-size: 20px; line-height: 1.45; margin: 0; color: #466a5a; }
.post-icon { font-size: 34px; color: #a5bc9a; line-height: 1; }
.puzzle-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #8e9d83; border-bottom: 1px dashed #d2dcc2; padding-bottom: 12px; font-size: 11px; }
.puzzle-meta code { color: #6d8972; font-family: ui-monospace,monospace; letter-spacing: 1.4px; }
.scoreboard { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 12px; }
.scoreboard > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #edf1df; border: 1px solid #d1dec2; border-radius: 10px; padding: 9px 13px; }
.scoreboard span { color: #819675; font-size: 11px; }
.scoreboard strong { color: #4b735b; font-size: 24px; line-height: 1.3; }
.scoreboard b { font-weight: 750; }
.scoreboard small { color: #9aab89; font-size: 11px; font-weight: 500; }
.map-status { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 10px; color: #8da18c; margin: 9px 1px; }
.map-status b { font-weight: 500; color: #6d8c7b; }
.map-shell { padding: 5px; border-radius: 11px; background: #93b1ad; border: 1px solid #7f9e9a; }
.map { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); width: 100%; background: #dbe8db; border: 3px solid #37566a; border-radius: 5px; }
.room { min-width: 0; aspect-ratio: 1; border: 3px solid #37566a; background: #e7edd2; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; overflow: hidden; line-height: 1.1; color: #678566; }
.room[data-visible="false"] { background: #9ab5b1; border-color: #9ab5b1; color: #dce8da; font-size: 10px; }
.room[data-current="true"] { background: #4e8275; color: #fff3cd; box-shadow: inset 0 0 0 2px #d8b36e; }
.room-icon { font-size: clamp(13px, 1.9vw, 22px); line-height: 1.05; font-weight: 700; }
.room-note { font-size: 8px; margin-top: 2px; white-space: nowrap; }
.room[data-stamp="true"]:not([data-current="true"]) .room-icon { color: #ad7940; }
.room[data-collected="true"]:not([data-current="true"]) .room-icon { color: #678966; }
.room[data-exit="true"]:not([data-current="true"]) { background: #f1dfb8; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 13px; margin-top: 11px; font-size: 10px; color: #8a9e85; }
.legend > span { display: inline-flex; align-items: center; gap: 4px; }
.legend i { font-style: normal; width: 17px; height: 17px; border-radius: 4px; display: inline-grid; place-items: center; font-size: 10px; }
.legend-current { color: #fff0cc; background: #4e8275; }
.legend-stamp { color: #aa773d; background: #eef0d9; }
.legend-exit { color: #8c7546; background: #f1dfb8; }
.legend-fog { color: #e4eddf; background: #9ab5b1; }
.walk-tools { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 19px 0 0; }
.direction-pad { width: 170px; flex: 0 0 170px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 44px); gap: 5px; }
.direction-pad button { padding: 4px; min-height: 44px; color: #4d745b; font-size: 19px; line-height: 1; background: #f0f3e2; border-color: #c3d3b2; }
.direction-pad button span { font-size: 10px; display: inline-block; margin-left: 2px; }
.direction-pad button:hover:not(:disabled) { background: #dce8cd; border-color: #8eae7c; }
#move-n { grid-column: 2; grid-row: 1; }
#move-w { grid-column: 1; grid-row: 2; }
#move-e { grid-column: 3; grid-row: 2; }
#move-s { grid-column: 2; grid-row: 3; }
.pad-center { grid-column: 2; grid-row: 2; display: grid; place-items: center; color: #a4b68c; font-size: 14px; }
.undo-area { flex: 1; min-width: 0; text-align: center; }
#undo { width: 100%; }
.undo-area p { font-size: 10px; color: #93a385; margin: 9px 0 0; }
.live-status { min-height: 42px; font-size: 12px; color: #6e8d68; margin: 17px 0 0; }
.result { border: 1px solid #d0dfbb; border-radius: 10px; padding: 14px; background: #edf2de; margin-top: 10px; }
.result h3 { margin: 0 0 5px; font-size: 14px; color: #55774c; }
.result p { margin: 0; font-size: 11px; color: #7b936c; }
.result[data-phase="won"] { background: #e3efd0; border-color: #adc994; }
.save-note { color: #99aa8b; font-size: 10px; margin: 12px 1px 0; }
.side-stack { display: grid; gap: 22px; min-width: 0; }
.route-example { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 24px 0 21px; }
.route-example span { width: 45px; height: 45px; border: 1px solid #b2c89c; border-radius: 10px; display: grid; place-items: center; color: #6a8d5c; background: #e6eed5; font-size: 21px; }
.route-example span:last-child { background: #f2e1b9; border-color: #d2bb88; color: #a08850; }
.route-example i { width: 22px; height: 0; border-top: 3px dotted #b8cba2; }
.rules { padding-left: 20px; margin: 15px 0; color: #7f9774; font-size: 12px; }
.rules li { padding-left: 2px; margin-bottom: 11px; }
.rules b { color: #5d7d54; }
.note-card { border-left: 3px solid #bed0a5; color: #7d916c; background: #eff1dc; padding: 11px 13px; font-size: 12px; margin: 16px 0; }
.small-note { font-size: 10px; color: #91a283; line-height: 1.9; margin: 13px 0; }
.count { font-size: 11px; color: #85a076; white-space: nowrap; }
.records { max-height: 320px; overflow-y: auto; padding: 2px 3px 2px 0; }
.empty-record { color: #a1b18c; padding: 24px 5px; text-align: center; font-size: 12px; }
.record-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed #d9e1c8; }
.record-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.record-seed { color: #709064; font-family: ui-monospace,monospace; font-size: 12px; }
.record-score, .record-date { color: #91a780; font-size: 10px; }
.record-item button { min-width: 72px; font-size: 11px; padding: 8px; }
.share-panel { margin-top: 25px; border: 1px solid #9fb88d; border-radius: 11px; background: #e3ecd7; color: #7b946c; font-size: 11px; padding: 15px 18px; }
.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 #afc299; border-radius: 7px; color: #5e7b50; background: #fbfdf2; font-size: 12px; }
footer { padding: 28px 0; color: #9aab8b; text-align: center; font-size: 10px; letter-spacing: 1px; }
footer span { color: #b2996b; padding-inline: 4px; }
dialog { width: min(440px, calc(100% - 32px)); border: 1px solid #c1d1af; border-radius: 17px; background: #fffaf0; color: var(--ink); padding: 25px; box-shadow: 0 20px 70px #354e4144; }
dialog::backdrop { background: #354f4299; backdrop-filter: blur(3px); }
dialog > p:not(.eyebrow) { font-size: 13px; color: #819575; margin: 14px 0 20px; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; }
.dialog-actions button { min-width: 0; padding: 10px 5px; }
.primary { background: #52774f; border-color: #52774f; color: #fbf6de; }
.primary:hover:not(:disabled) { background: #3e623d; border-color: #3e623d; }
@media (max-width: 900px) {
  .page { padding-inline: 22px; }
  .island-layout { gap: 16px; grid-template-columns: minmax(0, 1.2fr) minmax(0, .85fr); }
  .panel { padding: 17px; }
  .game { padding: 14px; }
  .side-stack { gap: 16px; }
  h2 { font-size: 18px; }
  .room { border-width: 2px; }
  .map { border-width: 2px; }
  .room-note { font-size: 7px; }
  .direction-pad { width: 155px; flex-basis: 155px; }
  .walk-tools { gap: 10px; }
}
@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; }
  .postcard { display: none; }
  .lead { font-size: 14px; }
  .puzzle-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
  .island-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .panel { padding: 20px 18px; }
  .game { padding: 15px 12px; }
  .scoreboard { gap: 8px; }
  .scoreboard > div { padding: 9px 10px; }
  .scoreboard strong { font-size: 23px; }
  .room-icon { font-size: 15px; }
  .room-note { font-size: 7px; margin-top: 1px; }
  .legend { font-size: 9px; gap: 6px 10px; }
  .direction-pad { width: 150px; flex-basis: 150px; }
  .undo-area p { font-size: 9px; }
  .walk-tools { gap: 12px; }
  .small-note { font-size: 10px; }
  dialog { padding: 22px 19px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
