:root {
  color-scheme: light;
  --paper: #eef3eb;
  --ink: #344e4b;
  --muted: #8a9b8a;
  --line: #d7e0d3;
  --green: #527d6a;
  --cream: #fffdf5;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.6; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; opacity: .42; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #315d56; outline-offset: 4px; }
a { color: inherit; }
.page-shell { max-width: 1280px; margin: auto; padding: 0 36px; }
.site-header { min-height: 87px; display: flex; justify-content: space-between; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); }
.home-link { display: inline-flex; align-items: center; min-height: 44px; gap: 10px; text-decoration: none; font-size: 12px; font-weight: 650; }
.home-link > span { font-size: 23px; }
.wordmark { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 750; letter-spacing: .03em; }
.brand-island { width: 20px; height: 19px; background: #bdd5ae; border: 2px solid #88a882; border-radius: 4px 9px 4px 7px; transform: rotate(-9deg); box-shadow: inset 3px 3px 0 #e7ebcc; }
.header-note { font-size: 11px; color: #96a18c; letter-spacing: .1em; }
main { max-width: 1112px; margin: auto; }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 27px; padding: 35px 0 31px; }
.eyebrow { font-size: 10px; letter-spacing: .1em; color: #7f9985; font-weight: 650; margin: 0 0 12px; }
.eyebrow > span { margin-right: 8px; font-size: 17px; color: #c29b77; }
h1 { margin: 0; font-size: clamp(29px, 3.5vw, 44px); letter-spacing: -.055em; font-weight: 800; line-height: 1.45; }
h1 > span { color: #688b70; }
.intro { color: #8d9c88; font-size: 12px; line-height: 1.9; margin: 12px 0 0; }
.mobile-break { display: none; }
.seed-card { flex-shrink: 0; width: 222px; padding: 17px 22px; border: 1px solid #d4ddc8; border-radius: 18px 18px 18px 5px; background: #e8eddd; transform: rotate(2deg); }
.seed-card > span, .seed-card > small { display: block; font-size: 10px; color: #879a78; }
.seed-card > strong { display: block; font: 650 20px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .15em; margin: 6px 0 3px; }
.notice { padding: 12px 16px; border-radius: 12px; border: 1px solid #e5d0a4; color: #7d6236; background: #fff2d8; font-size: 12px; margin-bottom: 13px; }
.notice p { margin: 0; }
.notice p + p { margin-top: 6px; }
.play-layout { display: grid; grid-template-columns: minmax(0, 1fr) 311px; gap: 25px; align-items: start; }
.map-card { min-width: 0; padding: 23px 26px 20px; background: #e2ede2; border: 1px solid #cdddcf; border-radius: 25px; box-shadow: 0 15px 25px #6c8a6907; }
.map-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.map-heading h2 { margin: 0; font-size: 13px; font-weight: 650; }
.map-heading h2 > span { color: #7ca58f; margin-right: 5px; font-size: 20px; vertical-align: -1px; }
.map-heading > span { font-size: 10px; color: #91a18a; white-space: nowrap; }
.board { width: 100%; max-width: 505px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; margin: 27px auto 20px; padding: 8px; background: #c7dfd9; border: 1px solid #b7d0c4; border-radius: 15px; box-shadow: inset 0 3px 0 #bad3cc50; }
.cell { aspect-ratio: 1; min-width: 0; min-height: 44px; position: relative; border: 1px solid #c2d9d0; border-radius: 8px; padding: 0; background: #eaf4ed; color: #9ab9a4; display: flex; align-items: center; justify-content: center; isolation: isolate; }
.cell::before { content: '·'; position: absolute; font-size: 17px; color: #c0d3bf; }
.cell:disabled { opacity: 1; }
.cell .cell-coordinate { position: absolute; left: 6px; top: 4px; font: 9px ui-monospace, monospace; color: #a7bca7; }
.cell .cell-letter { font: 700 24px/1 ui-rounded, "PingFang SC", sans-serif; z-index: 1; }
.cell[data-owner]:not([data-owner=""]) { background: var(--piece-fill); border-color: var(--piece-edge); color: var(--piece-ink); box-shadow: inset 3px 3px 0 #ffffff55, inset -2px -3px 0 #00000006; }
.cell[data-owner]:not([data-owner=""])::before { content: ''; }
.cell[data-owner]:not([data-owner=""]) .cell-coordinate { color: var(--piece-ink); opacity: .45; }
.cell[data-preview]:not([data-preview=""]) { background: var(--preview-fill); color: var(--preview-ink); border: 2px dashed var(--preview-edge); }
.cell[data-preview="invalid"] { border-color: #ab725d; background-image: repeating-linear-gradient(135deg, transparent 0 7px, #af6d5316 7px 10px); }
.cell[data-preview]:not([data-preview=""])::before { content: ''; }
.cell[data-anchor="true"]::after { content: '⌜'; position: absolute; left: -4px; top: -10px; color: #456d5d; font: 700 31px/1 sans-serif; z-index: 2; }
.cell[data-selected="true"] { outline: 3px solid #4b7866; outline-offset: -4px; }
.cell[data-owner="0"] { background-image: radial-gradient(#6d926b20 1.5px, transparent 1.8px); background-size: 10px 10px; }
.cell[data-owner="1"] { background-image: repeating-linear-gradient(135deg, transparent 0 8px, #ad73601c 8px 10px); }
.cell[data-owner="2"] { background-image: repeating-linear-gradient(0deg, transparent 0 8px, #8e779e1c 8px 10px); }
.cell[data-owner="3"] { background-image: radial-gradient(#ad954629 2px, transparent 2.3px); background-size: 13px 13px; }
.cell[data-owner="4"] { background-image: repeating-linear-gradient(90deg, transparent 0 8px, #5b8c971c 8px 10px); }
.map-footer { display: flex; justify-content: space-between; gap: 12px; font-size: 9px; color: #8da08a; margin-top: 9px; line-height: 1.8; }
.anchor-dot { display: inline-block; width: 7px; height: 7px; border-left: 2px solid #6c8f74; border-top: 2px solid #6c8f74; margin-right: 4px; }
.tray-heading { display: flex; justify-content: space-between; gap: 10px; align-items: center; border-top: 1px solid #d1dfce; padding-top: 20px; margin-top: 21px; }
.tray-heading h3 { font-size: 12px; margin: 0; }
.tray-heading > span { font-size: 9px; color: #93a28a; }
.tray { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; margin-top: 14px; }
.piece { padding: 9px 5px 8px; min-width: 0; min-height: 44px; border: 1px solid #d4dfcd; border-radius: 12px; background: #f3f6e9; text-align: center; }
.piece:disabled { opacity: .72; }
.piece[aria-pressed="true"] { border: 2px solid #71977b; padding: 8px 4px 7px; background: #f8fbe9; box-shadow: 0 0 0 3px #9bb79725; }
.piece-heading { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 10px; line-height: 1; min-height: 16px; }
.piece-heading strong { font: 750 14px ui-rounded, sans-serif; color: var(--piece-ink); }
.piece-heading span { color: #9aab8f; font-size: 8px; }
.mini-shape { width: 100%; display: block; max-width: 78px; height: auto; margin: 4px auto 0; }
.mini-frame { fill: none; stroke: #d6dfca; stroke-width: 1; stroke-dasharray: 3 3; }
.mini-anchor { fill: none; stroke: #6c8c71; stroke-width: 2.2; stroke-linecap: round; }
.piece-caption { display: block; font-size: 9px; color: #92a185; margin-top: 2px; }
.tray-note { margin: 13px 0 0; font-size: 9px; color: #98a68d; line-height: 1.8; }
.side-panel { min-width: 0; }
.tool-card { border: 1px solid #e1dfce; border-radius: 23px; background: var(--cream); padding: 22px 23px 19px; }
.section-kicker { font-size: 9px; letter-spacing: .1em; color: #a2a28b; margin: 0 0 9px; }
.tool-card h2 { margin: 0; font-size: 19px; line-height: 1.6; letter-spacing: -.03em; }
.orientation-row { display: flex; gap: 16px; align-items: center; margin: 12px 0 14px; }
.orientation-preview { flex: 0 0 91px; width: 91px; height: 91px; border: 1px dashed #d7dec9; border-radius: 14px; background: #f5f6e8; display: flex; align-items: center; justify-content: center; }
.orientation-preview .mini-shape { width: 80px; margin: 0; }
.orientation-preview > span { color: #bec9a6; font-size: 37px; }
.angle-caption { font-size: 10px; color: #9ba98d; margin: 0 0 3px; }
#rotation { font-size: 28px; line-height: 1.3; color: #6e8c6b; }
.orientation-row small { display: block; color: #a9ac95; font-size: 8px; margin-top: 5px; }
.rotate-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rotate-actions button { min-height: 44px; border: 1px solid #dde1cf; border-radius: 9px; background: #f1f4e7; font-size: 11px; padding: 8px; }
.rotate-actions button span { font-size: 18px; margin-right: 3px; }
.preview-status { min-height: 39px; font-size: 11px; color: #8d9b81; line-height: 1.8; margin: 14px 0; }
.preview-status[data-valid="true"] { color: #537f61; }
.preview-status[data-valid="false"] { color: #a87860; }
.place-button { display: block; width: 100%; min-height: 48px; border: 1px solid #567f66; background: #567f66; color: #fffef1; border-radius: 10px; font-size: 13px; font-weight: 650; box-shadow: 0 3px 0 #3f654d; }
.place-button > span { font-size: 20px; margin-left: 9px; }
.remove-button { display: block; width: 100%; min-height: 44px; margin-top: 10px; border: 1px solid #dedfce; background: #f7f5e9; color: #a08a73; border-radius: 9px; font-size: 11px; padding: 8px; }
.status { min-height: 34px; font-size: 10px; color: #9ca68d; line-height: 1.8; margin: 13px 0 0; }
.result-card { margin-top: 17px; border: 1px solid #e7d9bf; border-radius: 22px; background: #f3e9d5; padding: 20px 22px; }
.result-card h2 { margin: 0 0 8px; font-size: 19px; letter-spacing: -.03em; }
.result-card > p:not(.section-kicker) { font-size: 10px; line-height: 1.8; color: #a19378; min-height: 36px; margin: 0; }
.result-card[data-phase="won"] { background: #e1edce; border-color: #c6d8ae; }
.score-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 17px; }
.score-grid > div { display: flex; flex-direction: column; align-items: flex-start; padding-left: 12px; border-left: 1px solid #ded4bd; }
.score-grid > div:first-child { padding-left: 0; border-left: 0; }
.score-grid strong { font-size: 28px; line-height: 1.2; letter-spacing: -.05em; }
.score-grid small { font-size: 11px; font-weight: 400; color: #aa9c80; letter-spacing: 0; }
.score-grid > div > span { font-size: 8px; color: #aa9c80; margin-top: 7px; }
.puzzle-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.puzzle-actions button { min-height: 44px; border: 1px solid #d8dfcd; background: transparent; border-radius: 9px; font-size: 10px; color: #82947b; font-weight: 600; padding: 8px; }
.puzzle-actions button span { font-size: 16px; margin-right: 3px; }
.share-status { margin: 10px 0 0; font-size: 9px; line-height: 1.8; color: #a3ad93; text-align: center; }
.manual-link { margin-top: 11px; border: 1px solid #dde1cf; padding: 11px; border-radius: 10px; background: #fffdf4; }
.manual-link label { display: block; font-size: 11px; color: #87977c; margin-bottom: 7px; }
.manual-link input { display: block; min-width: 0; min-height: 44px; width: 100%; border: 1px solid #dde1cf; border-radius: 6px; background: white; color: var(--ink); font-size: 12px; padding: 8px; }
.how-to { margin: 34px 0 0; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 23px; }
.how-to > div { display: flex; gap: 12px; align-items: flex-start; }
.how-to > div > span { flex-shrink: 0; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #e2e9d8; color: #94a47f; font-size: 9px; }
.how-to p { margin: 0; }
.how-to strong { display: block; font-size: 12px; margin: 2px 0 6px; font-weight: 650; }
.how-to small { display: block; font-size: 10px; color: #9aa68b; line-height: 1.8; }
.collection { margin-top: 29px; }
.collection-heading { display: flex; justify-content: space-between; gap: 18px; align-items: flex-end; margin-bottom: 19px; }
.collection-heading h2 { margin: 0; font-size: 21px; letter-spacing: -.03em; }
#record-count { font-size: 10px; color: #9ba88e; letter-spacing: .08em; font-weight: 400; margin-left: 12px; white-space: nowrap; }
.collection-heading > p { margin: 0; text-align: right; color: #9fa78f; font-size: 10px; line-height: 1.8; }
.records { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.empty-record { grid-column: 1/-1; padding: 30px 17px; border: 1px dashed #cfdabb; border-radius: 16px; color: #a5b18f; text-align: center; font-size: 12px; margin: 0; }
.record-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border: 1px solid #d3dfc6; border-radius: 13px; background: #e9efdd; }
.record-info { display: flex; flex-direction: column; min-width: 0; }
.record-seed { font: 650 13px ui-monospace, monospace; letter-spacing: .07em; }
.record-score { font-size: 10px; color: #91a17b; margin-top: 6px; }
.record-item button { min-height: 44px; flex-shrink: 0; border: 1px solid #d0dcc0; background: #fffef1; border-radius: 8px; padding: 9px; font-size: 10px; }
.page-footer { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin: 27px 0 31px; color: #a5b091; font-size: 10px; }
.page-footer p { margin: 0; }
.page-footer p:last-child { text-align: right; font-size: 9px; }
dialog { width: min(440px, calc(100% - 36px)); max-height: calc(100% - 36px); border: 1px solid #d0ddc4; border-radius: 21px; background: #fffef4; color: var(--ink); padding: 27px; box-shadow: 0 24px 80px #3c56322b; }
dialog::backdrop { background: #344e3866; backdrop-filter: blur(4px); }
dialog h2 { font-size: 22px; margin: 0 0 10px; }
dialog > p:not(.section-kicker) { font-size: 12px; color: #8d9f7d; line-height: 1.9; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.dialog-actions button { min-height: 46px; border: 1px solid #d4e0c7; border-radius: 10px; background: #eff4e4; padding: 9px; font-size: 12px; }
#confirm-change { background: #567f66; border-color: #567f66; color: #fffef1; }
@media (hover: hover) { button:not(:disabled):hover { filter: brightness(.985); } a:hover { color: #527d6a; } }
@media (max-width: 1100px) {
  .page-shell { padding: 0 25px; }
  .play-layout { grid-template-columns: minmax(0, 1fr) 278px; gap: 19px; }
  .map-card { padding: 21px 20px 18px; }
  .board { gap: 6px; padding: 7px; }
  .tool-card { padding: 20px; }
  .tray { gap: 7px; }
  .piece-heading { display: block; }
  .piece-heading span { display: block; margin-top: 3px; }
}
@media (min-width: 651px) and (max-width: 920px) {
  .play-layout { grid-template-columns: minmax(0, 1fr) 246px; gap: 17px; }
  .map-card { padding: 20px 16px 16px; }
  .board { gap: 5px; padding: 6px; }
  .tray { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; }
  .piece { grid-column: span 2; }
  .piece:nth-child(4) { grid-column: 2 / span 2; }
  .piece:nth-child(5) { grid-column: 4 / span 2; }
  .mini-shape { max-width: 73px; }
  .piece-heading { display: flex; }
  .piece-heading span { display: inline; margin: 0; }
  .tool-card { padding: 18px; }
  .tool-card h2 { font-size: 17px; }
  .orientation-row { gap: 11px; }
  .orientation-preview { flex-basis: 78px; width: 78px; height: 78px; }
  .orientation-preview .mini-shape { width: 72px; }
  .result-card { padding: 19px 17px; }
  .score-grid > div { padding-left: 7px; }
  .records { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .how-to { gap: 16px; }
  .map-heading { align-items: flex-start; }
  .map-heading > span { padding-top: 4px; font-size: 9px; }
}
@media (max-width: 650px) {
  .page-shell { padding: 0 18px; }
  .site-header { min-height: 72px; gap: 10px; }
  .home-link { font-size: 11px; gap: 6px; }
  .wordmark { font-size: 13px; }
  .header-note { display: none; }
  .hero { display: block; padding: 25px 0 22px; }
  h1 { font-size: 32px; }
  h1 > span { display: block; }
  .eyebrow { font-size: 9px; letter-spacing: .07em; }
  .intro { font-size: 11px; margin-top: 10px; }
  .mobile-break { display: block; }
  .seed-card { width: 100%; transform: none; margin-top: 18px; display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 11px 13px; border-radius: 12px; }
  .seed-card > span { font-size: 9px; }
  .seed-card > strong { font-size: 17px; margin: 0; letter-spacing: .12em; }
  .seed-card > small { display: none; }
  .play-layout { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  .map-card { padding: 18px 15px 16px; border-radius: 22px; }
  .map-heading h2 { font-size: 11px; }
  .map-heading > span { font-size: 9px; }
  .board { gap: 5px; padding: 6px; margin-top: 22px; border-radius: 12px; }
  .cell { border-radius: 6px; }
  .cell .cell-coordinate { font-size: 7px; left: 4px; top: 3px; }
  .cell .cell-letter { font-size: 21px; }
  .cell[data-anchor="true"]::after { font-size: 27px; top: -8px; }
  .map-footer { font-size: 8px; gap: 7px; }
  .map-footer > span { max-width: 53%; }
  .tray-heading { margin-top: 17px; padding-top: 17px; }
  .tray-heading h3 { font-size: 11px; }
  .tray-heading > span { font-size: 8px; }
  .tray { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px 9px; }
  .piece { grid-column: span 2; padding: 9px 8px 8px; }
  .piece:nth-child(4) { grid-column: 2 / span 2; }
  .piece:nth-child(5) { grid-column: 4 / span 2; }
  .piece[aria-pressed="true"] { padding: 8px 7px 7px; }
  .piece-heading { display: flex; gap: 6px; }
  .piece-heading span { display: inline; margin: 0; }
  .mini-shape { max-width: 75px; }
  .tray-note { font-size: 9px; }
  .tool-card { padding: 21px; border-radius: 21px; }
  .tool-card h2 { font-size: 21px; }
  .orientation-row { gap: 20px; margin-top: 13px; }
  .orientation-preview { width: 96px; height: 96px; flex-basis: 96px; }
  .orientation-preview .mini-shape { width: 84px; }
  #rotation { font-size: 31px; }
  .orientation-row small { font-size: 9px; }
  .rotate-actions button { min-height: 46px; font-size: 12px; }
  .preview-status { font-size: 12px; min-height: 38px; }
  .place-button { min-height: 49px; font-size: 13px; }
  .remove-button { min-height: 45px; font-size: 12px; }
  .status { font-size: 10px; }
  .result-card { padding: 20px 23px; border-radius: 20px; }
  .score-grid > div { padding-left: 24px; }
  .score-grid > div:first-child { padding-left: 0; }
  .score-grid > div > span { font-size: 9px; }
  .puzzle-actions button { min-height: 46px; font-size: 12px; }
  .share-status { font-size: 10px; }
  .how-to { display: block; padding: 22px 0; margin-top: 27px; }
  .how-to > div + div { margin-top: 17px; }
  .how-to strong { font-size: 12px; margin-bottom: 3px; }
  .how-to small { font-size: 11px; }
  .collection { margin-top: 25px; }
  .collection-heading { display: block; margin-bottom: 17px; }
  .collection-heading > p { text-align: left; margin-top: 10px; }
  .records { grid-template-columns: minmax(0, 1fr); }
  .record-item { padding: 14px 16px; }
  .record-item button { padding-left: 13px; padding-right: 13px; font-size: 11px; }
  .record-score { font-size: 11px; }
  .empty-record { padding: 26px 12px; font-size: 11px; }
  .page-footer { display: block; font-size: 10px; margin-top: 23px; }
  .page-footer p:last-child { text-align: left; margin-top: 10px; }
  dialog { padding: 24px; }
  dialog h2 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
