* { box-sizing: border-box; }
:root { color-scheme: light; --ink: #3d483c; --muted: #76796b; --green: #385d4b; --rust: #a74e34; --paper: #fffaf0; }
body { margin: 0; color: var(--ink); background: linear-gradient(135deg, #f3e6cc, #f8f2e7 48%, #e8eddf); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.65; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { min-height: 44px; border: 1px solid #bdc5b0; border-radius: 9px; padding: 9px 12px; background: #fffdf5; color: var(--ink); font-weight: 650; cursor: pointer; touch-action: manipulation; }
button:hover:not(:disabled):not(.cell) { border-color: #6b8a70; background: #eff2e7; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .48; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #b25230; outline-offset: 3px; }
[hidden] { display: none !important; }
.page { max-width: 1110px; margin: auto; padding: 22px 30px 0; }
.site-header { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #d7d4bd; padding-bottom: 12px; }
.back-home { display: inline-flex; align-items: center; min-height: 44px; color: #47634e; font-size: 13px; text-underline-offset: 4px; }
.station-mark { color: #777c68; font-size: 11px; letter-spacing: 1px; white-space: nowrap; }
.station-mark span { color: var(--rust); font-size: 20px; margin-right: 5px; }
.hero { display: flex; justify-content: space-between; gap: 30px; align-items: center; padding: 32px 0 28px; }
.eyebrow { margin: 0 0 7px; font-size: 10px; letter-spacing: 1.8px; font-weight: 750; color: #858873; }
.hero .eyebrow { color: #7a846c; }
h1 { margin: 0 0 12px; font-size: clamp(35px, 5vw, 50px); letter-spacing: 1px; line-height: 1.25; color: #3b5845; }
h1 span { color: var(--rust); }
.lead { font-size: 15px; color: #747b66; margin: 0; line-height: 1.9; }
.hero-ticket { width: 180px; flex: 0 0 180px; display: flex; align-items: center; flex-direction: column; padding: 16px 10px 0; border: 1px solid #c88b62; background: #f0d2a0; border-radius: 13px; transform: rotate(5deg); color: #735638; overflow: hidden; box-shadow: 5px 6px 0 #bfa98933; }
.hero-ticket > span { font-size: 10px; letter-spacing: 1px; }
.hero-ticket b { font-family: ui-monospace, monospace; font-size: 62px; font-weight: 800; line-height: 1.15; }
.hero-ticket i { width: 100%; height: 27px; margin-top: 13px; border-top: 1px dashed #bb8d60; background: repeating-linear-gradient(90deg, #775b3d 0 2px, transparent 2px 5px, #775b3d 5px 6px, transparent 6px 10px) center / 85% 12px no-repeat; }
.puzzle-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.puzzle-actions button { font-size: 12px; min-height: 46px; border-color: #7c9076; background: #3c5d49; color: #f7f1dc; }
.puzzle-actions button:hover { background: #507059; border-color: #688263; }
.notice { margin: 0 0 12px; border: 1px solid #d6ac65; border-radius: 10px; background: #fff0c9; color: #77562c; padding: 12px 15px; font-size: 12px; }
.notice p { margin: 3px 0; }
.station-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 22px; align-items: start; }
.panel { min-width: 0; padding: 23px; border: 1px solid #d2d3bc; border-radius: 17px; background: var(--paper); box-shadow: 0 5px 0 #b4b89a4d; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }
h2 { margin: 0; font-size: 20px; line-height: 1.4; letter-spacing: .3px; }
.platform-mark { font-family: ui-monospace, monospace; font-size: 32px; color: #b6bd9c; line-height: 1; font-weight: 800; }
.puzzle-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11px; color: #8b8c76; border-bottom: 1px dashed #d6d5bc; padding-bottom: 12px; }
.puzzle-meta code { color: #64755e; letter-spacing: 1.3px; font-family: ui-monospace, monospace; }
.scoreboard { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 15px 0; }
.scoreboard > div { border: 1px solid #d9dcc5; border-radius: 10px; background: #f0f1e3; display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; gap: 8px; }
.scoreboard span { font-size: 11px; color: #7c846d; }
.scoreboard strong { font-size: 24px; color: #4b6852; line-height: 1.3; }
.scoreboard b { font-weight: 750; }
.scoreboard small { font-size: 11px; font-weight: 500; color: #959c83; }
.board { display: grid; grid-template-columns: repeat(3, minmax(44px, 1fr)); gap: 9px; padding: 10px; width: 100%; border: 1px solid #8d9a7c; border-radius: 13px; background: #536a50; }
.cell { position: relative; min-width: 44px; min-height: 44px; width: 100%; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 4px; border: 1px solid #cfbd91; border-radius: 9px; background: #f0dfb8; color: #705b38; overflow: hidden; box-shadow: 0 3px 0 #314c384d; }
.cell::before { content: ""; position: absolute; inset: 9px; border: 1px solid #ccae7f; border-radius: 4px; pointer-events: none; }
.cell[aria-disabled="false"]:hover { background: #f8e9c7; border-color: #dfc48a; }
.cell[aria-disabled="true"] { cursor: default; }
.cell[data-movable="true"][data-tile]:not([data-tile="0"]) { border: 2px dashed #fdf5da; background: #f6d698; }
.cell[data-movable="true"][aria-disabled="false"]:not([data-tile="0"]):hover { background: #ffe3a9; }
.cell[data-tile="0"][data-last="true"] { box-shadow: inset 0 0 0 2px #e2c583, inset 0 0 0 5px #9baa83, inset 0 2px 7px #253c3144; }
.cell:focus-visible { z-index: 1; outline-offset: -5px; }
.cell-position { position: absolute; left: 8px; top: 5px; font-family: ui-monospace, monospace; font-size: 8px; color: #a48e61; }
.tile-number { font-family: ui-monospace, monospace; font-size: clamp(32px, 5vw, 55px); font-weight: 750; line-height: 1.15; z-index: 1; }
.tile-note { font-size: 10px; line-height: 1.8; z-index: 1; color: #8c774c; }
.cell[data-tile="0"] { border: 1px dashed #a9b590; background: #405b43; color: #bccc9f; box-shadow: inset 0 2px 7px #253c3144; }
.cell[data-tile="0"]::before { border-style: dashed; border-color: #829675; }
.cell[data-tile="0"] .tile-number { font-size: clamp(16px, 2vw, 23px); font-family: inherit; font-weight: 500; color: #c4d2af; }
.cell[data-tile="0"] .tile-note { color: #adbd97; font-size: 9px; }
.cell[data-tile="0"] .cell-position { color: #7d9670; }
.board-legend { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-top: 11px; font-size: 9px; color: #8b947a; }
.board-legend span { display: inline-flex; align-items: center; gap: 5px; }
.board-legend i { display: inline-block; width: 10px; height: 10px; border: 1px solid #9ca681; border-radius: 2px; }
.board-legend .movable-example { background: #edd39a; border-style: dashed; }
.last-example { box-shadow: inset 0 0 0 2px #cfbb7e; }
.play-actions { display: flex; align-items: center; gap: 12px; margin-top: 17px; }
#undo { flex: 0 0 145px; border-color: #cbd2b5; background: #fbfcf0; font-size: 12px; }
.play-actions > span { font-size: 10px; color: #939980; }
.live-status { margin: 13px 0 0; min-height: 48px; color: #617552; font-size: 12px; }
.result { margin-top: 12px; border: 1px solid #d5dec4; border-radius: 10px; background: #eef2df; padding: 14px; }
.result h3 { margin: 0 0 5px; font-size: 14px; color: #4c6a47; }
.result p { margin: 0; font-size: 11px; color: #7c8c68; }
.result[data-phase="won"] { border-color: #b4c99c; background: #e7efcf; }
.save-note { margin: 12px 1px 0; color: #969e84; font-size: 10px; }
.side-stack { min-width: 0; display: grid; gap: 22px; }
.goal-board { max-width: 210px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 18px auto; padding: 10px; border: 1px dashed #c6ceb0; border-radius: 11px; background: #eef0df; }
.goal-board > span { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border: 1px solid #d6c198; border-radius: 5px; background: #efdfb9; color: #8c7046; font-family: ui-monospace, monospace; font-size: 21px; }
.goal-board .goal-blank { color: #8b9a75; background: #dce5cb; border: 1px dashed #b4c09f; font-family: inherit; font-size: 11px; }
.rules { padding-left: 20px; margin: 15px 0; color: #7d8a6c; font-size: 12px; }
.rules li { margin-bottom: 10px; padding-left: 2px; }
.rules strong { color: #5d7556; font-weight: 700; }
.strategy-note { color: #71805e; background: #eef0dc; border-left: 3px solid #c0ce9f; margin: 16px 0 12px; padding: 11px 12px; font-size: 12px; }
.small-note { font-size: 10px; color: #8e9a7a; line-height: 1.85; }
.count { font-size: 11px; white-space: nowrap; color: #83996f; }
.records { max-height: 320px; overflow-y: auto; padding: 2px 3px 2px 0; }
.empty-record { color: #a3ac89; text-align: center; padding: 25px 5px 29px; font-size: 12px; }
.record-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed #dce2c7; }
.record-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.record-seed { color: #6c825e; font-family: ui-monospace, monospace; font-size: 12px; }
.record-score, .record-date { font-size: 10px; color: #91a07c; }
.record-item button { min-width: 72px; font-size: 11px; padding: 8px; border-color: #d2dfbb; }
.share-panel { margin-top: 25px; border: 1px solid #9eaf87; padding: 15px 18px; background: #e5e9d4; color: #718160; font-size: 11px; border-radius: 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 #a6b789; border-radius: 7px; color: #536e46; background: #fcfdef; font-size: 12px; }
footer { padding: 28px 0; text-align: center; color: #98a17f; font-size: 10px; letter-spacing: 1px; }
footer span { color: #b0724b; padding-inline: 4px; }
dialog { width: min(440px, calc(100% - 32px)); padding: 26px; border: 1px solid #c8d0ad; border-radius: 17px; color: var(--ink); background: #fffaf0; box-shadow: 0 20px 70px #35432b55; }
dialog::backdrop { background: #34412e99; backdrop-filter: blur(3px); }
dialog h2 { font-size: 23px; }
dialog > p:not(.eyebrow) { font-size: 13px; color: #82906e; margin: 14px 0 22px; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; }
.dialog-actions button { min-width: 0; padding: 10px 5px; font-size: 12px; }
.primary { background: #4d7051; border-color: #4d7051; color: #faf5df; }
.primary:hover:not(:disabled) { background: #3c5e43; border-color: #3c5e43; }
@media (max-width: 900px) {
  .page { padding-inline: 22px; }
  .station-layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 16px; }
  .panel { padding: 17px; }
  .game { padding: 13px; }
  .side-stack { gap: 16px; }
  h2 { font-size: 18px; }
  .board { gap: 7px; padding: 8px; }
  .cell::before { inset: 7px; }
  .play-actions { gap: 8px; }
  #undo { flex-basis: 116px; }
}
@media (max-width: 700px) {
  .page { padding: 14px 16px 0; }
  .site-header { gap: 8px; }
  .back-home { font-size: 12px; }
  .station-mark { font-size: 10px; letter-spacing: 0; }
  .hero { padding: 25px 0 23px; }
  .hero-ticket { display: none; }
  .lead { font-size: 14px; }
  .puzzle-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
  .station-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .panel { padding: 20px 18px; }
  .game { padding: 12px; }
  .game .section-heading { padding: 4px 2px 0; }
  .scoreboard { gap: 8px; margin: 13px 0; }
  .scoreboard > div { padding: 9px 10px; }
  .scoreboard strong { font-size: 23px; }
  .board { gap: 7px; padding: 8px; border-radius: 11px; }
  .cell-position { left: 6px; top: 3px; font-size: 8px; }
  .tile-number { font-size: 40px; }
  .tile-note { font-size: 9px; }
  .play-actions > span { font-size: 9px; }
  .live-status { min-height: 43px; }
  .goal-board { max-width: 205px; }
  .share-panel { margin-top: 23px; }
  dialog { padding: 22px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  button:active:not(:disabled) { transform: none; }
}
