* { box-sizing: border-box; }
:root { color-scheme: light; --ink: #435344; --green: #52734e; --paper: #fffaf0; --line: #d5d8bd; }
body { margin: 0; color: var(--ink); background: linear-gradient(130deg, #f0e7d2, #f8f3e7 52%, #e4eddf); 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 #b7c5a5; border-radius: 10px; color: #506b45; background: #fffdf5; font-size: 12px; font-weight: 650; cursor: pointer; touch-action: manipulation; }
button:hover:not(:disabled) { background: #edf1df; border-color: #7b9768; }
button:disabled { cursor: default; opacity: .48; }
button:focus-visible, a:focus-visible, input:focus-visible, [tabindex="-1"]:focus-visible { outline: 3px solid #a96b38; outline-offset: 4px; }
[hidden] { display: none !important; }
.page { max-width: 1100px; margin: auto; padding: 22px 30px 0; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid #d1d7bc; }
.back-home { min-height: 44px; display: inline-flex; align-items: center; color: #56744d; font-size: 13px; text-underline-offset: 4px; }
.header-note { font-size: 11px; color: #8a987a; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 32px 0 28px; }
.eyebrow { font-size: 10px; font-weight: 750; letter-spacing: 1.7px; color: #8b9779; margin: 0 0 8px; }
h1 { font-size: clamp(36px, 5vw, 52px); color: #486641; letter-spacing: 1px; line-height: 1.25; margin: 0 0 12px; }
h1 > span { color: #b78047; }
.lead { margin: 0; color: #7c8b6d; font-size: 15px; line-height: 1.9; }
.hero-lights { width: 245px; flex: 0 0 245px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; transform: rotate(4deg); }
.hero-lights > span { display: grid; place-items: center; height: 64px; border: 1px solid #b5c69d; border-radius: 14px; background: #dfe9cb; color: #7c9767; font-size: 27px; }
.hero-lights > span:nth-child(2) { background: #efdbc0; border-color: #d6b891; color: #b08455; }
.hero-lights > span:nth-child(3) { background: #d6e6e8; border-color: #b3cdd0; color: #76969c; }
.hero-lights > span:nth-child(4) { background: #e4ddec; border-color: #c9bbd4; color: #9a85ad; }
.hero-lights > p { grid-column: 1 / -1; text-align: center; font-size: 10px; color: #9ca688; margin: 5px 0 0; }
.puzzle-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.puzzle-actions button { min-height: 46px; background: #52714f; border-color: #718960; color: #f8f4e4; }
.puzzle-actions button:hover:not(:disabled) { background: #66875c; }
.notice { background: #fff0cc; border: 1px solid #d8b36e; color: #806230; font-size: 12px; border-radius: 10px; padding: 12px 15px; margin: 0 0 12px; }
.notice p { margin: 2px 0; }
.echo-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 #b3bea244; }
.puzzle-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #929e7b; font-size: 11px; border-bottom: 1px dashed #d5dcc0; padding-bottom: 12px; }
.puzzle-meta code { font-family: ui-monospace, monospace; letter-spacing: 1.4px; color: #70865e; }
.scoreboard { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 22px; }
.scoreboard > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid #d7e0c3; border-radius: 10px; background: #eff2df; }
.scoreboard span { font-size: 11px; color: #869775; }
.scoreboard strong { color: #56784b; font-size: 24px; line-height: 1.3; }
.scoreboard b { font-weight: 750; }
.scoreboard small { font-size: 11px; font-weight: 500; color: #9ba98b; }
.phase-kicker { color: #97a57d; font-size: 10px; letter-spacing: 1.1px; margin: 0 0 7px; }
h2 { font-size: 21px; line-height: 1.45; color: #52714b; margin: 0; }
.phase-copy { color: #82966c; font-size: 12px; margin: 9px 0 17px; min-height: 40px; }
.pads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pad { min-width: 44px; min-height: 155px; width: 100%; border: 2px solid #b4c698; border-radius: 15px; background: #e5eed9; color: #5b7c49; padding: 13px 15px; display: grid; grid-template-columns: auto auto; grid-template-rows: 1fr auto; gap: 8px; text-align: left; }
.pad[data-pad="1"] { background: #f3e1c9; border-color: #ddbb90; color: #a57742; }
.pad[data-pad="2"] { background: #dcebed; border-color: #adccd1; color: #537f8a; }
.pad[data-pad="3"] { background: #e9e1f0; border-color: #cbb8dd; color: #8b6d9f; }
.pad:disabled { opacity: 1; cursor: default; }
.pad:hover:not(:disabled) { background: #d6e6c5; border-color: #8ca771; }
.pad[data-pad="1"]:hover:not(:disabled) { background: #efdab7; border-color: #c59b64; }
.pad[data-pad="2"]:hover:not(:disabled) { background: #c9e0e4; border-color: #81b0ba; }
.pad[data-pad="3"]:hover:not(:disabled) { background: #ddcfea; border-color: #b398cb; }
.pad-number { font-family: ui-monospace, monospace; font-size: 16px; align-self: start; }
.pad-shape { font-family: sans-serif; font-size: 44px; line-height: 1.15; align-self: center; justify-self: end; }
.pad-name { font-size: 11px; align-self: end; }
.pad-state { font-size: 11px; justify-self: end; align-self: end; font-weight: 750; }
.pad[data-lit="true"] { border-color: #a3752f; background: #fff0a1; color: #705422; box-shadow: inset 0 0 0 3px #e4bd55, 0 0 0 3px #e4c66f55; }
.pad[data-lit="true"] .pad-state { color: #705422; }
.input-progress { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 14px 0; color: #899b75; font-size: 11px; }
.input-progress b { color: #64824f; font-size: 14px; }
.phase-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.phase-actions button { min-height: 46px; font-size: 12px; }
.primary { background: #597b4d; border-color: #597b4d; color: #fff9e9; }
.primary:hover:not(:disabled) { background: #42673b; border-color: #42673b; }
.live-status { min-height: 44px; font-size: 12px; color: #6f8b5c; margin: 16px 0 0; }
.result { margin-top: 10px; padding: 14px; background: #eef2dc; border: 1px solid #d4dfb9; border-radius: 10px; }
.result h3 { font-size: 14px; color: #58794b; margin: 0 0 5px; }
.result p { font-size: 11px; color: #80966c; margin: 0; }
.result[data-phase="won"] { background: #e6efd1; border-color: #b4c994; }
.result[data-phase="lost"] { background: #f7ecdc; border-color: #dfc39c; }
.save-note { font-size: 10px; color: #9daa88; margin: 12px 0 0; }
.side-stack { min-width: 0; display: grid; gap: 22px; }
.rules { padding-left: 20px; color: #81966f; font-size: 12px; margin: 18px 0; }
.rules li { padding-left: 2px; margin-bottom: 12px; }
.rules b { color: #617f51; }
.note-card { border-left: 3px solid #bfce9f; padding: 11px 13px; background: #eef1da; font-size: 12px; color: #7b9269; margin: 17px 0; }
.small-note { font-size: 10px; color: #93a37e; line-height: 1.9; margin: 13px 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.count { font-size: 11px; color: #8ba478; white-space: nowrap; }
.records { max-height: 320px; overflow-y: auto; padding: 2px 3px 2px 0; }
.empty-record { color: #a6b18e; text-align: center; padding: 25px 5px; font-size: 12px; }
.record-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px dashed #dbe2c6; padding: 10px 0; }
.record-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.record-seed { font-family: ui-monospace, monospace; color: #708e60; font-size: 12px; }
.record-score, .record-date { color: #95a780; font-size: 10px; }
.record-item button { min-width: 72px; padding: 8px; font-size: 11px; }
.share-panel { border: 1px solid #a9bc91; border-radius: 11px; background: #e7edd8; padding: 15px 18px; margin-top: 25px; color: #80976d; 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 #afc396; border-radius: 7px; color: #657f54; background: #fffef5; font-size: 12px; }
footer { color: #a0ad8a; text-align: center; padding: 28px 0; font-size: 10px; letter-spacing: 1px; }
footer span { color: #b79861; padding-inline: 4px; }
dialog { width: min(450px, calc(100% - 32px)); padding: 25px; border: 1px solid #c3d0ad; border-radius: 17px; background: #fffaf0; color: var(--ink); box-shadow: 0 20px 70px #36452d44; }
dialog::backdrop { background: #3b4c3299; backdrop-filter: blur(3px); }
dialog > p:not(.eyebrow) { font-size: 13px; color: #82926c; margin: 15px 0 20px; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; }
.dialog-actions button { padding: 10px 5px; min-width: 0; }
@media (max-width: 900px) {
  .page { padding-inline: 22px; }
  .echo-layout { grid-template-columns: minmax(0, 1.2fr) minmax(0, .85fr); gap: 16px; }
  .panel { padding: 17px; }
  .game { padding: 15px; }
  .side-stack { gap: 16px; }
  h2 { font-size: 19px; }
  .pad { min-height: 140px; padding: 12px; }
  .pad-shape { font-size: 38px; }
}
@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-lights { display: none; }
  .lead { font-size: 14px; }
  .puzzle-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
  .echo-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .panel { padding: 22px 18px; }
  .game { padding: 16px 13px; }
  .scoreboard { gap: 8px; margin-bottom: 20px; }
  .scoreboard > div { padding: 9px 10px; }
  .scoreboard strong { font-size: 23px; }
  h2 { font-size: 20px; }
  .pads { gap: 10px; }
  .pad { min-height: 135px; padding: 12px 10px; }
  .pad-shape { font-size: 39px; }
  .phase-actions { grid-template-columns: 1fr; gap: 8px; }
  .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; }
}
