:root { color-scheme: light; --paper:#f7f6ef; --white:#fffefa; --ink:#243d32; --green:#245746; --muted:#778276; --line:#dce1d4; --selected:#e5edd4; --focus:#f9e6a8; --correct:#c9e5ba; font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif; color:var(--ink); background:var(--paper); }
* { box-sizing:border-box; }
body { margin:0; }
button, input { font:inherit; }
button { cursor:pointer; }
button:disabled { cursor:default; }
button:focus-visible, a:focus-visible, label:has(input:focus-visible) { outline:3px solid #bd903a; outline-offset:3px; }
button { -webkit-tap-highlight-color:transparent; }
.app-shell { max-width:1440px; margin:auto; padding:0 46px; }
.site-header { min-height:100px; display:flex; justify-content:space-between; align-items:center; border-bottom:1px solid var(--line); }
.brand { display:flex; align-items:center; gap:12px; color:var(--ink); text-decoration:none; font-size:17px; font-weight:700; letter-spacing:1px; }
.brand-icon { display:grid; place-items:center; height:39px; width:39px; background:var(--green); color:var(--paper); border-radius:12px 12px 12px 2px; font-size:27px; }
.brand-en { display:block; margin-top:5px; color:var(--muted); font-size:9px; letter-spacing:1.9px; font-weight:500; }
.edition { color:var(--green); font:12px ui-monospace, monospace; letter-spacing:1px; }
.edition span { color:var(--muted); border-left:1px solid var(--line); padding-left:15px; margin-left:15px; font:12px "Microsoft YaHei",sans-serif; letter-spacing:0; }
.intro { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:34px 0 28px; }
.eyebrow { font-size:10px; letter-spacing:2px; font-weight:700; color:var(--green); margin:0 0 14px; }
h1 { font-size:34px; letter-spacing:-1.2px; line-height:1.4; margin:0 0 10px; font-weight:650; }
h1 span { color:#739062; }
.intro-copy { font-size:13px; line-height:1.7; color:var(--muted); margin:0; }
.puzzle-meta { text-align:right; }
.puzzle-meta>span { display:block; color:var(--muted); font-size:11px; margin-bottom:10px; }
.puzzle-meta strong { font-size:20px; font-weight:500; }
.puzzle-meta i { color:#a3b18f; font-style:normal; margin:0 9px; }
.game-toolbar { border:1px solid var(--line); border-radius:12px; background:#eeefe5; padding:12px 16px; display:flex; justify-content:space-between; gap:15px; align-items:center; margin-bottom:22px; min-height:62px; }
.toolbar-main,.toolbar-right { display:flex; align-items:center; gap:12px; }
.live-dot { width:7px; height:7px; flex-shrink:0; background:#7f9474; border-radius:50%; }
#game-status { font-size:12px; white-space:nowrap; }
.mode-switch { display:flex; padding:3px; background:#e1e5d8; border-radius:7px; margin-left:6px; }
.mode-switch button { border:0; color:var(--muted); padding:6px 14px; background:none; border-radius:5px; font-size:12px; }
.mode-switch button[aria-pressed=true] { color:var(--green); background:var(--white); box-shadow:0 1px 3px #243d3210; font-weight:600; }
.mode-description { color:var(--muted); font-size:11px; }
.timer-label { color:var(--muted); font-size:11px; }
#timer { font:20px ui-monospace, "Consolas", monospace; font-variant-numeric:tabular-nums; min-width:62px; }
.toolbar-divider { height:20px; border-left:1px solid #d1d7c8; margin:0 5px; }
.text-button { border:0; background:none; color:var(--green); padding:6px 0; font-size:12px; }
.text-button:hover { color:#809651; }
.game-layout { display:grid; grid-template-columns:minmax(0, 1.45fr) minmax(310px, 1fr); gap:24px; align-items:start; }
.board-panel { background:var(--white); border:1px solid var(--line); border-radius:14px; padding:22px; min-width:0; }
.board-heading { display:flex; justify-content:space-between; margin-bottom:18px; gap:12px; font-size:11px; color:var(--muted); }
.board-heading>span:first-child { letter-spacing:1.6px; color:var(--green); font-size:10px; font-weight:700; }
.board-scroll { width:100%; overflow:auto; padding:2px; }
.board { display:grid; grid-template-columns:repeat(24, minmax(0,1fr)); width:100%; min-width:460px; aspect-ratio:1; background:#e4e8dc; border:1px solid #b8c3ae; gap:1px; padding:1px; user-select:none; }
.cell { position:relative; min-width:0; min-height:0; background:#e4e8dc; }
.cell.white { background:#fffefa; }
.cell.active-word { background:var(--selected); }
.cell.correct { background:var(--correct); }
.cell.selected { background:var(--focus); box-shadow:inset 0 0 0 2px #b38b3c; z-index:1; }
.cell.correct.selected { background:#b8dca5; }
.cell-number { position:absolute; top:1px; left:2px; font:clamp(6px,.6vw,9px) Arial,sans-serif; color:#52654b; pointer-events:none; z-index:1; line-height:1; }
.cell input { width:100%; height:100%; padding:5px 0 0; margin:0; border:0; border-radius:0; outline:0; background:transparent; color:var(--ink); text-align:center; text-transform:uppercase; caret-color:transparent; font:600 clamp(10px,1.12vw,17px) "Segoe UI",sans-serif; -webkit-appearance:none; }
.cell input::selection { background:transparent; }
.cell input:disabled { opacity:1; }
.active-clue { margin-top:18px; display:flex; align-items:center; gap:12px; border-top:1px solid var(--line); border-bottom:1px solid var(--line); padding:14px 0; min-height:72px; }
.clue-badge { font-size:11px; line-height:1.7; color:var(--white); background:var(--green); padding:5px 7px; border-radius:5px; white-space:nowrap; }
.active-clue p { flex:1; margin:0; font-size:12px; line-height:1.8; }
#change-direction { border:1px solid var(--line); color:var(--green); background:transparent; height:30px; width:30px; border-radius:6px; flex-shrink:0; }
#change-direction:disabled { color:#bdc7b8; }
.board-help { display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-top:16px; color:var(--muted); font-size:10px; }
kbd { display:inline-block; padding:1px 4px; background:#f5f5ee; border:1px solid var(--line); border-radius:3px; font:10px "Segoe UI",sans-serif; margin-right:3px; }
.input-note { margin:12px 0 0; color:var(--muted); font-size:10px; line-height:1.8; }
.clues-panel { min-width:0; background:var(--white); border:1px solid var(--line); border-radius:14px; overflow:hidden; }
.clues-heading { padding:21px 22px 16px; display:flex; align-items:center; justify-content:space-between; gap:10px; }
h2 { font-size:18px; margin:0; letter-spacing:.3px; }
.clues-heading>span { color:var(--muted); font-size:10px; }
.clue-tabs { display:flex; margin:0 22px; border-bottom:1px solid var(--line); gap:20px; }
.clue-tabs button { background:none; border:0; padding:11px 0 13px; color:var(--muted); position:relative; font-size:13px; flex:1; text-align:left; }
.clue-tabs button span { font:9px ui-monospace,monospace; margin-left:6px; letter-spacing:.7px; }
.clue-tabs button b { float:right; background:#eff1e7; padding:2px 6px; border-radius:4px; font-size:10px; font-weight:500; }
.clue-tabs button.selected { color:var(--green); font-weight:600; }
.clue-tabs button.selected::after { content:""; height:2px; background:var(--green); position:absolute; bottom:-1px; left:0; right:0; }
.clue-list { position:relative; padding:12px; max-height:690px; overflow-y:auto; scrollbar-width:thin; scrollbar-color:#cbd5c0 transparent; }
.clue-item { display:flex; width:100%; align-items:flex-start; padding:12px 10px; border:1px solid transparent; border-radius:8px; background:none; text-align:left; color:var(--ink); gap:11px; margin-bottom:2px; }
.clue-item:hover { background:#f5f6ef; }
.clue-item.active { background:#eef3e4; border-color:#dce6cc; }
.clue-item.solved { color:#517743; }
.clue-item.solved .clue-index { background:#d7e9cb; }
.clue-index { font:600 11px ui-monospace,monospace; color:var(--green); background:#eff1e8; border-radius:4px; min-width:25px; height:25px; display:grid; place-items:center; flex-shrink:0; }
.clue-copy { font-size:12px; line-height:1.85; flex:1; }
.clue-copy>span:first-child, #active-clue-text, #revealed-clue { white-space:pre-line; overflow-wrap:anywhere; }
.clue-length { color:#8c9684; white-space:nowrap; font-size:11px; }
.solved-mark { color:#4d7a38; font-size:14px; margin-top:3px; }
footer { display:flex; justify-content:space-between; gap:15px; padding:25px 0 28px; color:#8a9383; font-size:10px; line-height:1.6; }
.game-dialog { border:1px solid var(--line); border-radius:22px; padding:35px; width:min(560px, calc(100% - 32px)); max-height:calc(100dvh - 32px); color:var(--ink); background:var(--white); box-shadow:0 25px 120px #152e3133; text-align:center; }
.game-dialog::backdrop { background:#263c324d; backdrop-filter:blur(4px); }
.dialog-emblem { display:grid; place-items:center; height:52px; width:52px; margin:0 auto 20px; border:1px solid #dae3ce; background:#eff3e7; color:var(--green); border-radius:50%; font-size:30px; }
.game-dialog .eyebrow { font-size:9px; letter-spacing:2px; }
.game-dialog h2 { font-size:25px; letter-spacing:-.6px; line-height:1.5; }
.dialog-copy { font-size:12px; color:var(--muted); line-height:1.7; margin:10px 0 23px; }
.mode-options { display:grid; grid-template-columns:1fr 1fr; gap:12px; text-align:left; }
.mode-card { display:block; position:relative; border:1px solid var(--line); padding:17px 15px; border-radius:10px; cursor:pointer; background:#fafaf5; }
.mode-card:has(input:checked) { background:#edf3e5; border-color:#77965e; }
.mode-card input { position:absolute; opacity:0; width:1px; height:1px; }
.mode-card-top { display:flex; align-items:center; justify-content:space-between; font-size:14px; font-weight:600; margin-bottom:12px; }
.radio-mark { border:1px solid #b4c0a7; width:15px; height:15px; border-radius:50%; display:grid; place-items:center; }
.mode-card input:checked+.mode-card-top .radio-mark { border-color:var(--green); }
.mode-card input:checked+.mode-card-top .radio-mark::after { content:""; width:7px; height:7px; border-radius:50%; background:var(--green); }
.mode-card-copy { display:block; font-size:11px; line-height:1.9; color:var(--muted); }
.dialog-note { font-size:10px; line-height:1.8; color:var(--muted); margin:18px 0; }
.primary-button { width:100%; border:0; border-radius:8px; color:#fffefa; background:var(--green); padding:14px 20px; text-align:left; font-weight:600; font-size:13px; }
.primary-button span { float:right; }
.primary-button:hover { background:#326854; }
.dialog-cancel { margin-top:12px; }
[hidden] { display:none !important; }
.finish-stats { display:flex; justify-content:center; gap:60px; padding:22px 0 32px; font-size:11px; color:var(--muted); }
.finish-stats strong { display:block; margin-top:9px; font-size:24px; font-weight:500; color:var(--green); font-variant-numeric:tabular-nums; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
@media (min-width:1280px) { .clue-list { max-height:760px; } }
@media (max-width:1050px) { .app-shell { padding:0 25px; } .game-layout { gap:16px; grid-template-columns:minmax(0, 1.3fr) minmax(280px, 1fr); } .board-panel { padding:15px; } .board { min-width:400px; } .mode-description { display:none; } h1 { font-size:29px; } .clue-item { padding:9px 6px; } }
@media (max-width:800px) { .app-shell { padding:0 18px; } .site-header { min-height:77px; } .game-layout { grid-template-columns:1fr; } .intro { padding:25px 0 22px; } .puzzle-meta { display:none; } h1 { font-size:29px; } .game-toolbar { flex-wrap:wrap; gap:9px; padding:11px 12px; } .toolbar-main { gap:8px; } .toolbar-right { margin-left:auto; gap:8px; } .mode-switch { margin:0; } .mode-switch button { padding:5px 12px; } .timer-label { display:none; } #timer { font-size:17px; min-width:51px; } .toolbar-divider { margin:0; } .text-button { font-size:11px; } .board { min-width:0; } .cell input { font-size:clamp(11px,2.3vw,17px); } .cell-number { font-size:clamp(6px,1vw,8px); } .clue-list { max-height:460px; } .edition span { display:none; } .board-help { justify-content:flex-start; gap:16px; } footer { flex-wrap:wrap; } }
@media (max-width:430px) { .app-shell { padding:0 12px; } .brand { font-size:15px; } .brand-en { font-size:8px; } h1 { font-size:25px; } .intro-copy { font-size:11px; } .eyebrow { font-size:9px; } .game-toolbar { gap:12px; } .toolbar-main,.toolbar-right { flex:1; } .toolbar-right { justify-content:flex-end; } #game-status { font-size:10px; } .mode-switch button { padding:5px 9px; font-size:11px; } .board-panel { padding:12px; } .board-scroll { overflow:visible; } .cell input { font-size:11px; } .cell-number { font-size:6px; left:1px; } .board-help { display:none; } .active-clue { gap:8px; } .active-clue p { font-size:11px; } .game-dialog { padding:26px 20px; } .game-dialog h2 { font-size:22px; } .mode-options { grid-template-columns:1fr; } .mode-card { padding:13px; } .mode-card-copy br { display:none; } .mode-card-top { margin-bottom:6px; } }
@media (prefers-reduced-motion:no-preference) { button { transition:background .15s,color .15s; } .game-dialog[open] { animation:enter .2s ease-out; } @keyframes enter { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } } }

/* v0.2: collection selection, localization and the independent name dictionary. */
.header-actions { display:flex; align-items:center; gap:20px; }
.language-control { display:flex; align-items:center; gap:8px; font-size:10px; color:var(--muted); }
select { background:var(--white); border:1px solid #cbd5c0; border-radius:7px; color:var(--ink); padding:8px 10px; font:inherit; min-width:0; }
select:focus-visible,input:focus-visible { outline:2px solid #a2b784; outline-offset:2px; }
.language-control select { font-size:12px; }
.puzzle-meta { max-width:330px; }
.puzzle-meta strong { font-size:18px; line-height:1.6; }
h1 { max-width:850px; }
.game-toolbar { flex-wrap:wrap; }
.toolbar-main { flex-wrap:wrap; }
.toolbar-right { flex-wrap:wrap; margin-left:auto; }
.tool-button { border:1px solid #bbcbb0; border-radius:6px; background:#fafff4; color:var(--green); padding:7px 11px; font-size:11px; }
.tool-button:hover { background:#e5edd9; }
.tool-button:disabled { opacity:.45; }
.load-status { color:#805c27; font-size:13px; }
.load-status:empty { display:none; }
.clue-tabs button>span { font:inherit; margin:0; letter-spacing:normal; }
.clue-tabs small { margin-left:5px; font:9px ui-monospace,monospace; }
.active-clue-body { flex:1; min-width:0; }
.active-clue-body p { font-size:12px; }
.answer-names { display:flex; flex-direction:column; gap:4px; border-top:1px solid #d8e4ce; padding-top:7px; margin-top:7px; color:#41633a; }
.name-row { display:flex; align-items:baseline; gap:8px; min-width:0; }
.name-row small { color:#7b8d71; min-width:48px; font-size:9px; flex-shrink:0; }
.name-row strong { font-size:11px; font-weight:550; overflow-wrap:anywhere; line-height:1.55; }
.clue-copy>.answer-names { padding-bottom:2px; }
.clue-item { align-items:flex-start; }
.setup-dialog { width:min(680px,calc(100% - 28px)); padding:28px; }
.dialog-toolbar { display:flex; align-items:center; justify-content:space-between; gap:15px; margin-bottom:23px; }
.dialog-toolbar .eyebrow { margin:0; }
.dialog-toolbar .language-control { flex-wrap:wrap; justify-content:flex-end; }
.setup-dialog h2 { font-size:26px; }
.setup-dialog .dialog-copy { font-size:12px; margin:8px 0 20px; }
.setup-fields { display:grid; grid-template-columns:1fr 1fr; gap:12px; text-align:left; }
.setup-fields label { display:flex; flex-direction:column; gap:7px; font-size:12px; font-weight:600; }
.setup-fields label small { font-size:10px; font-weight:400; color:var(--muted); min-height:15px; }
.setup-fields select { width:100%; font-weight:400; }
.level-field { grid-column:1 / -1; }
.level-description { text-align:left; padding:11px 14px; background:#f3f5ed; border-radius:7px; margin:12px 0 20px; font-size:11px; line-height:1.7; }
.level-description p { margin:0 0 3px; }
.level-description>span { color:var(--muted); font-size:10px; }
.mode-section-label { display:flex; gap:12px; justify-content:space-between; align-items:center; text-align:left; margin-bottom:10px; }
.mode-section-label strong { font-size:12px; }
.mode-section-label>span { font-size:10px; color:var(--muted); }
.settings-rule { text-align:left; font-size:10px; line-height:1.7; color:#876b3b; margin:13px 0 7px; }
.settings-rule.preserve-rule { color:var(--muted); margin:0 0 17px; }
.selection-note { padding:9px 12px; background:#fff3d7; color:#856625; font-size:11px; line-height:1.6; text-align:left; border-radius:6px; }
.setup-actions { position:sticky; bottom:-28px; background:var(--white); padding:12px 0 8px; margin-top:4px; box-shadow:0 -9px 16px var(--white); z-index:2; }
.statistics-panel { position:relative; margin:14px 0 20px; padding:16px 18px; border:1px solid var(--line); border-radius:10px; background:var(--white); }
.statistics-title { font-size:12px; color:var(--green); }
.statistics-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin:12px 0; }
.statistics-metrics div { min-width:0; }
.statistics-metrics dt { color:var(--muted); font-size:11px; line-height:1.5; }
.statistics-metrics dd { margin:5px 0 0; font-size:23px; font-variant-numeric:tabular-nums; color:var(--ink); }
.statistics-panel p,.statistics-panel small { margin:8px 0 0; font-size:10px; line-height:1.7; color:var(--muted); }
.statistics-panel small { display:block; padding-right:40px; }
.statistics-refresh { position:absolute; right:14px; top:10px; font-size:10px; }
.statistics-compact { padding:12px 14px; text-align:left; margin:12px 0; background:#f7faf2; }
.statistics-compact .statistics-metrics dd { font-size:19px; }
.answer-actions { display:flex; gap:9px; align-items:center; flex-wrap:wrap; margin-top:13px; }
.answer-actions>span { color:var(--muted); font-size:10px; line-height:1.8; }
#answer-action-note { flex-basis:100%; }
.danger-button { color:#8c4c38; background:#fff5ef; border-color:#dec4b7; }
.danger-button:hover { background:#f9e6dc; }
.danger-primary { background:#88513f; }
.danger-primary:hover { background:#754333; }
.literal-answer { font-size:24px; font-weight:650; letter-spacing:1px; padding:16px 10px; background:#eef3e4; border-radius:8px; overflow-wrap:anywhere; }
.answer-dialog .answer-names { text-align:left; padding:14px; }
.answer-dialog .name-row strong { font-size:14px; }
.answer-dialog .dialog-copy { margin-bottom:17px; }
.revealed-label { display:block; margin-top:6px; color:#807448; font-size:9px; }
.cell.solution { background:#e0edf4; }
.cell.solution.selected { background:#c4dce9; }
.primary-button { display:flex; align-items:center; justify-content:space-between; }
.primary-button span { float:none; }
.primary-button:disabled { opacity:.5; }
.game-dialog { overflow-y:auto; }
.search-dialog { width:min(620px,calc(100% - 28px)); text-align:left; }
.search-heading { display:flex; justify-content:space-between; gap:15px; align-items:flex-start; }
.search-heading h2 { font-size:22px; }
.search-allowance { display:inline-block; font-size:11px; padding:6px 9px; background:#edf3e4; color:var(--green); border-radius:5px; margin:16px 0; }
.search-bar { display:flex; gap:9px; }
.search-bar input { flex:1; min-width:0; padding:11px; border:1px solid #bbcbb0; color:var(--ink); background:var(--white); border-radius:7px; font-size:12px; }
.search-policy,.dictionary-count { font-size:10px; line-height:1.8; color:var(--muted); }
#search-query { font-size:11px; font-weight:600; overflow-wrap:anywhere; }
#search-message { font-size:12px; line-height:1.8; color:var(--muted); }
.search-results { display:grid; gap:10px; max-height:330px; overflow-y:auto; }
.character-result { padding:12px 14px; border:1px solid var(--line); border-radius:8px; background:#f7faf2; }
.character-result .answer-names { border:0; padding:0; margin:0; }
.character-result .name-row { gap:12px; }
.character-result .name-row strong { font-size:14px; }
.character-result .name-row small { min-width:65px; font-size:10px; }
.kana-board .cell input { font-family:'Yu Gothic','Meiryo','Microsoft YaHei',sans-serif; font-weight:500; }
html[lang=en] .brand { font-size:15px; letter-spacing:0; }
html[lang=en] .game-dialog h2 { font-size:24px; }
html[lang=en] .clue-copy { line-height:1.6; }
@media(max-width:1100px) { .header-actions .language-control>span { display:none; } .edition { display:none; } .toolbar-main { gap:8px; } }
@media(max-width:800px) { .header-actions { gap:10px; } .language-control select { max-width:115px; padding:7px; } .game-toolbar { padding:12px; } .toolbar-main,.toolbar-right { flex:initial; } .toolbar-right { width:100%; justify-content:space-between; } .puzzle-meta { display:none; } .clue-list { max-height:540px; } }
@media(max-width:430px) { .language-control>span { display:none; } .setup-dialog { padding:20px; } .setup-actions { bottom:-20px; } .setup-dialog h2 { font-size:22px; } .dialog-toolbar { gap:8px; margin-bottom:15px; } .setup-fields { gap:10px; } .mode-section-label { gap:8px; align-items:baseline; } .mode-options { grid-template-columns:1fr; gap:8px; } .mode-card-copy { line-height:1.65; } .setup-dialog .dialog-copy { font-size:11px; } .settings-rule { font-size:10px; } .search-dialog { padding:20px; } .search-heading h2 { font-size:19px; } .search-bar { flex-wrap:wrap; } .search-bar input { flex-basis:100%; } .search-bar .tool-button { width:100%; } html[lang=en] .brand { font-size:12px; } .brand-en { font-size:7px; letter-spacing:.7px; } html[lang=en] h1 { font-size:25px; } .cell input { padding-top:4px; } .board-help { display:none; } }
