:root {
  color-scheme: light;
  --paper: #f6f3ed;
  --surface: #fffefa;
  --ink: #35323a;
  --muted: #77717b;
  --line: #e7e1da;
  --accent: #66546c;
  --accent-dark: #514156;
  --accent-light: #f1ebf3;
  --serif: 'Yu Mincho', 'Hiragino Mincho ProN', 'Noto Serif JP', serif;
  font-family: 'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 14px; line-height: 1.75; }
button, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button, a, select, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #94779c; outline-offset: 4px; }
button { transition: background .15s, border-color .15s, transform .15s; }
button:not(:disabled):active { transform: translateY(1px); }
[hidden] { display: none !important; }
.page-shell { max-width: 1300px; margin: 0 auto; padding: 0 48px; }
.site-header { display: flex; align-items: center; justify-content: space-between; height: 104px; border-bottom: 1px solid var(--line); }
.wordmark { display: flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; font-size: 16px; letter-spacing: .09em; font-weight: 700; }
.brand-mark { background: var(--accent); width: 34px; height: 34px; border-radius: 10px; color: #fff; font: 24px/34px var(--serif); text-align: center; transform: rotate(-6deg); }
.header-note { color: var(--muted); font-size: 12px; letter-spacing: .1em; }
.intro { position: relative; padding: 43px 0 35px; }
.eyebrow { margin: 0 0 10px; font-size: 10px; letter-spacing: .2em; color: var(--accent); font-weight: 700; }
h1 { margin: 0; font: 36px/1.6 var(--serif); letter-spacing: .07em; }
h1 span { color: var(--accent); }
.intro-copy { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.95; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.game-panel, .history-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.game-panel { padding: 25px 30px 0; min-height: 570px; }
.history-panel { padding: 25px 24px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-heading h2 { font-size: 15px; letter-spacing: .04em; margin: 0; font-weight: 700; }
.save-status { color: #827986; font-size: 10px; display: flex; align-items: center; gap: 6px; }
.save-status::before { content: ''; width: 5px; height: 5px; background: #a1aa93; border-radius: 50%; }
.section-copy { color: var(--muted); font-size: 12px; line-height: 1.9; }
.setup-view { text-align: center; padding: 34px 25px 26px; }
.setup-illustration { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 0 0 24px; }
.setup-illustration span { display: block; width: 63px; height: 77px; background: #f3eee5; color: #897a6d; border: 1px solid #e9e0d3; border-radius: 10px; font: 37px/77px var(--serif); transform: rotate(-8deg); }
.setup-illustration span:nth-child(2) { color: var(--accent); background: var(--accent-light); border-color: #dfd4e4; transform: translateY(-7px) rotate(3deg); }
.setup-illustration span:nth-child(3) { transform: rotate(9deg); }
.setup-view h3 { font: 22px/1.7 var(--serif); letter-spacing: .04em; margin: 0 0 8px; }
.setup-view > .section-copy { margin: 0 0 26px; }
.setting-row { max-width: 400px; margin: 0 auto 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 17px 0; text-align: left; }
.setting-row label { font-size: 12px; font-weight: 700; }
.setting-row p { font-size: 10px; color: var(--muted); margin: 3px 0 0; }
.limit-control { display: flex; align-items: center; gap: 7px; }
.icon-button { color: var(--accent); width: 29px; height: 29px; padding: 0; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); line-height: 1; }
.icon-button:hover:not(:disabled) { background: var(--accent-light); }
.icon-button:disabled { opacity: .35; }
.limit-control select { border: 0; background: transparent; color: var(--ink); padding: 4px; font-size: 13px; }
.button { border: 1px solid transparent; border-radius: 9px; padding: 12px 20px; display: inline-flex; align-items: center; justify-content: center; gap: 22px; font-size: 12px; font-weight: 700; line-height: 1.6; white-space: nowrap; }
.button.primary { background: var(--accent); color: #fff; }
.button.primary:hover:not(:disabled) { background: var(--accent-dark); }
.button.secondary { background: var(--surface); color: var(--accent); border-color: #dcd2df; }
.button.secondary:hover { background: var(--accent-light); }
.button:disabled { opacity: .42; }
.start-button { min-width: 250px; }
.quiet-note { font-size: 10px; line-height: 1.7; color: var(--muted); margin: 9px 0 0; }
.game-toolbar { display: flex; justify-content: space-between; align-items: center; margin: 28px 0 10px; }
.progress-label { color: var(--accent); font-size: 23px; font-weight: 500; line-height: 1; }
.progress-label span { font-size: 11px; color: var(--muted); }
.changes-badge { color: var(--accent); background: var(--accent-light); border-radius: 30px; padding: 5px 12px; font-size: 10px; }
.changes-badge strong { font-weight: 500; margin-left: 5px; }
.changes-badge.empty { color: var(--muted); background: #f1efeb; }
.progress-track { height: 3px; background: #efebe5; border-radius: 4px; margin-bottom: 24px; overflow: hidden; }
.progress-track span { display: block; height: 100%; background: #a594ac; transition: width .25s; }
.name-board { display: grid; grid-template-columns: repeat(var(--slot-count), minmax(0, 1fr)); gap: 8px; }
.letter-slot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: space-between; height: 109px; min-width: 0; padding: 8px 0 6px; border: 1px dashed #d6cdc2; border-radius: 8px; background: #fcfaf5; color: var(--ink); }
.letter-slot:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-light); }
.letter-slot.filled { background: #eee8df; border: 1px solid #e0d7cb; }
.letter-slot.selected { border: 2px solid var(--accent); background: var(--accent-light); padding-top: 7px; padding-bottom: 5px; }
.letter-slot.preview .slot-char { color: var(--accent); opacity: .6; }
.slot-number { font-size: 10px; line-height: 1; color: #a39a90; }
.slot-char { font: clamp(24px, 3vw, 36px)/1.2 var(--serif); }
.slot-dot { color: #c9c0b5; }
.slot-caption { font-size: 9px; color: #a3998d; line-height: 1; }
.letter-slot.selected .slot-caption { color: var(--accent); }
.round-section { padding-top: 28px; }
.round-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.round-heading h3 { font-size: 12px; font-weight: 500; margin: 0; }
.step-label { font-size: 9px; letter-spacing: .04em; color: #97899c; }
.candidate-grid { display: grid; grid-template-columns: repeat(var(--candidate-count, 3), 1fr); gap: 12px; }
.candidate { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; height: 110px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 7px; color: var(--ink); }
.candidate:hover:not(:disabled) { border-color: #b6a5bc; background: #faf7fb; }
.candidate.selected { border: 2px solid var(--accent); background: var(--accent-light); }
.candidate-char { font: 45px/1.25 var(--serif); }
.candidate-caption { font-size: 9px; color: var(--muted); }
.candidate.selected .candidate-caption { color: var(--accent); }
.candidate.unrevealed { border-style: dashed; background: #fcfaf7; color: #c7beb3; }
.candidate.unrevealed .candidate-caption { color: #b5aa9c; }
.draw-actions { text-align: center; padding: 25px 0 16px; }
.selection-placeholder { display: flex; gap: 10px; justify-content: center; align-items: center; color: #a097a5; font-size: 11px; min-height: 154px; }
.placeholder-arrow { color: #c8becb; padding: 0 6px; }
.selection-tools { margin-top: 20px; }
.variant-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 11px; }
.variant-header .quiet-note { margin: 0; }
.variant-options { display: flex; gap: 8px; }
.variant { display: flex; align-items: center; gap: 8px; padding: 7px 11px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; color: var(--ink); }
.variant span { font: 22px/1.3 var(--serif); }
.variant small { font-size: 9px; color: var(--muted); }
.variant.selected { border-color: var(--accent); background: var(--accent-light); }
.variant:disabled { opacity: .4; }
.placement-confirmation { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 20px 0 19px; }
.confirmation-title { margin: 0; font-size: 12px; }
.confirmation-title strong { color: var(--accent); font-weight: 700; }
.placement-confirmation .quiet-note { margin-top: 4px; }
.game-bottom { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--line); }
.game-bottom p { margin: 0; color: #a19a93; font-size: 10px; }
.text-button { background: transparent; border: 0; color: var(--muted); font-size: 10px; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover { color: var(--accent); }
.count-badge { font-size: 11px; background: #ede8e1; color: #8c8176; border-radius: 30px; min-width: 25px; padding: 0 7px; text-align: center; }
.history-panel > .section-copy { margin: 10px 0 0; font-size: 10px; }
.empty-history { text-align: center; padding: 56px 0 50px; }
.notebook-icon { display: inline-grid; place-items: center; height: 63px; width: 50px; border: 1px solid #d7cec2; border-radius: 3px 7px 7px 3px; background: repeating-linear-gradient(transparent, transparent 12px, #e8e0d5 12px, #e8e0d5 13px); transform: rotate(-7deg); box-shadow: 4px 2px 0 #f0ebe4; color: #bbad9d; }
.notebook-icon span { font: 27px/1 var(--serif); background: var(--surface); padding: 4px; }
.empty-history h3 { font: 13px/1.7 var(--serif); margin: 24px 0 7px; }
.empty-history p { color: #9a9187; font-size: 10px; line-height: 1.9; margin: 0; }
.history-list { list-style: none; padding: 0; margin: 20px 0 0; max-height: 510px; overflow-y: auto; scrollbar-width: thin; }
.history-entry { border-top: 1px solid var(--line); padding: 17px 0; display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.history-entry > div { min-width: 0; }
.history-name { display: block; font: 19px/1.6 var(--serif); overflow-wrap: anywhere; letter-spacing: .04em; }
.history-entry time { display: block; font-size: 9px; color: #a1958a; margin-top: 4px; }
.history-copy { font-size: 9px; border: 1px solid #e2dcd4; color: #8a7b90; background: transparent; padding: 5px 7px; border-radius: 5px; flex-shrink: 0; }
.history-copy:hover { background: var(--accent-light); }
.length-reveal { text-align: center; padding: 73px 0 90px; }
.length-number { color: var(--accent); font: 110px/1.5 var(--serif); }
.length-number span { font: 16px/1.5 var(--serif); margin-left: 12px; }
.length-reveal h3 { font-size: 13px; font-weight: 400; margin-top: 18px; }
.completed { text-align: center; padding: 32px 0 35px; }
.completed h3 { margin: 0; font: 20px/1.8 var(--serif); }
.completed-name { font: clamp(28px, 3.5vw, 42px)/1.7 var(--serif); letter-spacing: .06em; color: var(--accent); margin: 14px 0 6px; overflow-wrap: anywhere; }
.completed .section-copy { margin: 0; }
.completed-saved { font-size: 10px; color: #8e9680; margin: 17px 0 22px; }
.complete-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.rules { border-bottom: 1px solid var(--line); margin: 28px 0 0; padding-bottom: 14px; color: var(--muted); font-size: 11px; }
.rules summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; list-style: none; padding: 8px 0; }
.rules summary::-webkit-details-marker { display: none; }
.rules summary span { font-size: 16px; }
.rules[open] summary span { transform: rotate(45deg); }
.rules ol { padding-left: 21px; line-height: 2; }
.rules p { max-width: 880px; line-height: 1.9; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 25px 0 35px; color: #a1978c; font-size: 10px; }
footer > span { font-size: 9px; }
dialog { border: 1px solid var(--line); border-radius: 16px; padding: 32px; background: var(--surface); color: var(--ink); max-width: 470px; width: calc(100% - 40px); box-shadow: 0 15px 80px #35323a20; }
dialog::backdrop { background: #30293955; backdrop-filter: blur(3px); }
dialog h2 { font: 22px/1.5 var(--serif); margin: 5px 0 16px; }
dialog p:not(.eyebrow) { font-size: 12px; color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }
.storage-warning { background: #fff2df; color: #8b562b; border-radius: 8px; font-size: 11px; padding: 12px; margin: 15px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.copy-buffer { position: fixed; top: 0; left: -9999px; }
noscript { display: block; text-align: center; padding: 20px; }
@media (max-width: 1050px) {
  .page-shell { padding: 0 28px; }
  .workspace { grid-template-columns: minmax(0, 1fr) 250px; gap: 18px; }
  .game-panel { padding-left: 22px; padding-right: 22px; }
  .history-panel { padding-left: 19px; padding-right: 19px; }
  .name-board { gap: 6px; }
  .letter-slot { height: 97px; }
  .slot-char { font-size: 28px; }
}
@media (max-width: 820px) {
  .workspace { grid-template-columns: 1fr; }
  .history-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 25px; max-height: 300px; }
  .empty-history { padding: 25px 0; }
  .empty-history .notebook-icon { display: none; }
  .empty-history h3 { margin-top: 0; }
  footer { flex-direction: column; gap: 5px; }
}
@media (max-width: 520px) {
  .page-shell { padding: 0 16px; }
  .site-header { height: 76px; }
  .header-note { display: none; }
  .intro { padding-top: 30px; }
  h1 { font-size: 27px; }
  .game-panel { padding: 20px 16px 0; min-height: auto; }
  .setup-view { padding: 32px 0; }
  .setup-view h3 { font-size: 19px; }
  .setting-row { gap: 8px; }
  .name-board { gap: 4px; }
  .letter-slot { height: 83px; border-radius: 5px; }
  .slot-char { font-size: 23px; }
  .slot-number, .slot-caption { font-size: 8px; }
  .candidate-grid { gap: 8px; }
  .candidate-caption { font-size: 8px; }
  .round-heading { gap: 8px; }
  .round-heading h3 { font-size: 11px; }
  .placement-confirmation { align-items: stretch; flex-direction: column; }
  .variant-header { align-items: flex-start; flex-direction: column; }
  .variant { padding: 7px 9px; gap: 6px; }
  .game-bottom p { display: none; }
  .game-bottom { justify-content: flex-end; }
  .history-list { grid-template-columns: 1fr; }
  .selection-placeholder { gap: 6px; font-size: 10px; }
  .completed-name { font-size: 29px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
