:root{color-scheme:light;--ink:#2e392f;--muted:#535e50;--paper:#f7f8f4;--line:#d9e0d5;--green:#f0f4ec;--accent:#dce6d6;--dark:#4c5d4a}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font:16px/1.6 system-ui,"Hiragino Sans",sans-serif}button,input{font:inherit}button{cursor:pointer}button:disabled{cursor:default}button:focus-visible,input:focus-visible{outline:3px solid #657c5f;outline-offset:3px}.wrap{width:min(1056px,calc(100% - 40px));margin:auto}header{border-bottom:1px solid var(--line)}header .wrap{height:74px;display:flex;align-items:center;justify-content:space-between}.brand{display:flex;align-items:center;gap:11px;font-weight:900;letter-spacing:.06em}.logo{display:grid;place-items:center;width:36px;height:36px;border-radius:11px;background:var(--dark);color:white}.outline{border:1px solid var(--line);background:transparent;border-radius:100px;padding:8px 16px;color:var(--ink);font-size:.875rem;font-weight:700}.intro{margin:40px 0 25px}.intro h1{font-size:clamp(2.4rem,6vw,4.35rem);line-height:1.12;letter-spacing:-.065em;margin:0 0 12px;font-weight:950}.intro p{margin:0;color:var(--muted)}.layout{display:grid;grid-template-columns:minmax(0,2.1fr) minmax(265px,1fr);gap:20px;align-items:start}.panel{border:1px solid var(--line);border-radius:22px;background:#fefefa;overflow:hidden}.game{padding:20px}.score{display:flex;justify-content:space-between;align-items:center;margin:0 2px 13px;font-weight:800}.score span:last-child{font-variant-numeric:tabular-nums}.track{height:7px;background:#e8eee5;border-radius:20px;overflow:hidden;margin-bottom:18px}.bar{height:100%;width:100%;background:#657c5f;transition:width .15s linear}.board{background:var(--green);border-radius:15px;padding:22px;text-align:center;position:relative;overflow:hidden}.board:before,.board:after{content:"";position:absolute;border:1px solid #cdd7c7;border-radius:50%;width:205px;height:205px;pointer-events:none}.board:before{left:-115px;top:65px}.board:after{right:-108px;top:-90px}.board p{margin:0;font-weight:800;font-size:.875rem}.tiles{display:flex;justify-content:center;align-items:center;gap:14px;margin:12px 0}.tile{display:grid;place-items:center;width:90px;height:86px;background:#fefefa;border:1px solid #c6d0c0;border-radius:15px;box-shadow:0 4px #c6d0c0;font-size:3rem;line-height:1;font-weight:950}.tile:last-child{background:var(--accent);border-color:#b8c3b1;box-shadow:0 4px #b8c3b1}.tile small{font-size:.85rem;margin-left:2px}.tile span{white-space:nowrap}.times{font-size:1.35rem;color:#586651}form{display:flex;gap:10px;margin-top:17px}input{min-width:0;width:100%;border:1px solid #becbb8;background:white;border-radius:11px;padding:12px 14px;color:var(--ink)}.primary{color:white;background:var(--dark);border:0;border-radius:11px;padding:12px 20px;font-weight:800;white-space:nowrap}.primary:hover{background:#3e513c}.primary:disabled{opacity:.5}.status{min-height:1.6em;margin:9px 0 0;font-size:.875rem;color:var(--muted)}.error{color:#9a3525}.side{padding:18px}.side h2{font-size:1.1rem;margin:0 0 12px}.side ol{list-style:none;margin:0;padding:0;max-height:290px;overflow:auto}.side li{display:flex;align-items:center;gap:10px;padding:9px 0;border-bottom:1px solid #ecf0e8;overflow-wrap:anywhere}.side li:last-child{border:0}.tag{flex:none;min-width:3.1rem;text-align:center;border-radius:7px;background:#ecf2e9;padding:2px 5px;font-size:.75rem;font-weight:800}.tag.player{background:#e5ece1}.side .empty{color:var(--muted);font-size:.875rem}.foot{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:15px 0 30px;color:var(--muted);font-size:.875rem}dialog{width:min(470px,calc(100% - 35px));border:1px solid var(--line);border-radius:22px;background:var(--paper);color:var(--ink);padding:24px}dialog::backdrop{background:#29312888}dialog h2{margin-top:0}dialog li{margin-bottom:8px}@media(max-width:700px){.layout{grid-template-columns:1fr}.intro{margin-top:30px}.side ol{max-height:190px}}@media(max-width:370px){.wrap{width:calc(100% - 24px)}.game{padding:13px}.primary{padding-inline:12px}}
.settings{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-bottom:15px;font-size:.875rem;font-weight:800}.settings input{width:7rem;padding:5px 9px}.settings input:disabled{background:#edf0eb;color:var(--muted)}
.mode-tabs{display:flex;gap:8px;margin-bottom:16px}.mode-tabs [aria-pressed=true]{background:var(--dark);color:white}[hidden]{display:none!important}
.mode-tabs{flex-wrap:wrap}.local-clocks{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}.local-clocks span{padding:4px 10px;border:1px solid var(--line);border-radius:9px;font-size:.875rem}.local-clocks [aria-current=true]{background:var(--green);font-weight:800}
.name-settings{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,12rem),1fr));gap:8px 12px;margin-bottom:12px}.name-settings label{display:grid;gap:4px;font-size:.875rem;font-weight:800}.name-settings input{padding:6px 9px}.score,.local-clocks span,.tag{overflow-wrap:anywhere}.score #time{flex:none;margin-left:8px}
#kana-panel{margin-top:10px}#kana-panel summary{cursor:pointer;font-size:.875rem}#kana-keys{display:grid;grid-template-columns:repeat(auto-fit,minmax(2.5rem,1fr));gap:4px;margin-top:8px}#kana-keys button{border:1px solid var(--line);border-radius:7px;background:white;color:var(--ink);min-height:40px}#kana-keys .erase{grid-column:span 2}#word[readonly]:not(:disabled){cursor:text}
.tile:last-child > span{display:flex;align-items:baseline;justify-content:center;gap:3px;width:100%;padding-inline:4px}.tile small{margin-left:0}#length.long-length{font-size:2rem}
.mobile-match header .wrap{height:48px}
.mobile-match main{display:flex;flex-direction:column}
.mobile-match .mode-tabs{order:2;margin-bottom:20px}
.mobile-match .foot{order:1}
.mobile-match .intro,.mobile-match .settings,.mobile-match #name-settings{display:none}
.mobile-match .layout{margin-top:10px;grid-template-columns:1fr;gap:10px;overflow-anchor:none}
.mobile-match .game{display:flex;flex-direction:column;padding:12px}
.mobile-match .score,.mobile-match .local-clocks{margin-bottom:6px}
.mobile-match .track{margin-bottom:8px}
.mobile-match #form{order:1;margin:0}
.mobile-match #status{order:2;margin:6px 0;min-height:2.8em}
.mobile-match .board{order:3;padding:10px}
.mobile-match .tiles{margin:6px 0 9px}
.mobile-match .tile{width:70px;height:60px;font-size:2.2rem}
.mobile-match #length.long-length{font-size:1.6rem}

.board::before,.board::after{display:none}
.panel{box-shadow:0 6px 22px #303e2910}
.mode-tabs{width:fit-content;padding:4px;border:1px solid var(--line);border-radius:18px;background:#eff3ec}
.mode-tabs button{border:0;border-radius:13px}
.track{height:5px}
.mobile-match .board{order:0;display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px;text-align:left}
.mobile-match #prompt{min-width:0;overflow-wrap:anywhere}
.mobile-match .tiles{flex:none;gap:6px;margin:0}
.mobile-match .tile{width:auto;min-width:36px;height:34px;padding-inline:6px;border-radius:8px;box-shadow:none;font-size:1.2rem}
.mobile-match .tile:last-child{min-width:60px}
.mobile-match .tile:last-child>span{padding:0}
.mobile-match .tile small{font-size:.72rem}
.mobile-match .times{font-size:.9rem}
.mobile-match #length.long-length{font-size:1.15rem}
.mobile-match #hint{display:none}
.mobile-match #status{min-height:1.6em;margin-bottom:0}
.mobile-match #word{font-size:16px}

.tile:last-child{background:#eaddb9;border-color:#c6af77;color:#483b21;box-shadow:0 4px #c6af77}
.mobile-match .tile:last-child{box-shadow:none}

.show-results main > :not(.results) { display: none; }
.results { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(240px, 1fr); align-items: start; gap: 18px; margin: 28px 0; }
.result-summary { border-top: 5px solid #c6af77; padding: clamp(18px, 4vw, 38px); background: linear-gradient(150deg, #f6f1df, #fefefa 60%); }
.result-mode { display: inline-block; padding: 3px 11px; border-radius: 20px; background: #dce6d6; font-weight: 750; font-size: .875rem; }
#result-title { margin: 12px 0 6px; font-size: clamp(1.8rem, 6vw, 3.5rem); line-height: 1.2; overflow-wrap: anywhere; }
#result-reason { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.result-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 22px 0; }
.result-stats > div:first-child { grid-column: 1 / -1; }
.result-stats div { display: flex; flex-direction: column; min-width: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fefefa; }
.result-stats dt { font-size: .875rem; color: var(--muted); overflow-wrap: anywhere; }
.result-stats dd { margin: auto 0 0; padding-top: 3px; overflow-wrap: anywhere; font-weight: 850; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.result-history ol { max-height: 350px; }
.result-history li { flex-wrap: wrap; }
.result-history .tag { max-width: 100%; overflow-wrap: anywhere; }
.result-ending { padding: 2px 6px; border-radius: 6px; background: #eaddb9; color: #483b21; font-size: .75rem; }
@media (max-width: 700px) {
  .results { grid-template-columns: 1fr; gap: 12px; margin: 14px 0 24px; }
  .result-history ol { max-height: 270px; }
}

.result-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
#result-settings { min-height: 44px; }
#rematch { width: 100%; min-height: 44px; }


header .brand{letter-spacing:.06em}
.score,.local-clocks{font-variant-numeric:tabular-nums}
.board .tile:last-child>span{gap:5px}
.results .result-top{gap:10px}
.result-history li{padding-block:10px}
@media(max-width:700px){
  .mobile-match .board{padding-block:8px;margin-bottom:8px}
  .mobile-match .board .tiles{margin:0}
  .mobile-match .tile{min-height:34px}
}

:root{--paper:#f4f0e7;--ink:#292c24;--muted:#575e50;--line:#d6cdb8;--dark:#374c3d;--green:#e7e9dc}
body{background:var(--paper)}
header{background:#eee8da}
.brand,.intro h1,.board .tile,#result-title{font-family:"Hiragino Mincho ProN","Yu Mincho",serif}
.intro h1{letter-spacing:.045em}
.panel,dialog{background:#fffcf4;border-radius:10px;box-shadow:0 5px 16px #3a332913}
.mode-tabs{background:#ede7d8;border-radius:10px}.mode-tabs button{border-radius:6px}
.board{background:#e7e9dc;border:1px solid #c9cdb7;border-radius:8px}
.board .tile{border-radius:8px;box-shadow:none;background:#faf9f0;border-color:#bdc4aa}
.board .tile:last-child{background:#eaddb9;color:#483b21;border-color:#baab81}
.bar{background:#607e65}.track{background:#e3e5d9}
.primary{border-radius:7px}.primary:hover{background:#496251}.outline{border-radius:7px}
.result-summary{background:#fffcf4;border-top:4px double #9c8554}
.result-mode,.result-stats div{background:#f1ecde}.result-stats div{border-radius:7px}
.result-history h2{border-bottom:1px solid var(--line);padding-bottom:8px}

.brand img{flex:none}.header-actions{display:flex;align-items:center;gap:clamp(6px,2vw,14px)}.header-actions a{color:var(--dark);white-space:nowrap}
