*{margin:0;padding:0;box-sizing:border-box}html{-webkit-text-size-adjust:100%}body{font-family:Arial,sans-serif;background:linear-gradient(135deg,#667eea,#764ba2);min-height:100vh;min-height:100dvh;color:#333}.screen{width:100%;min-height:100vh;min-height:100dvh;display:flex;align-items:center;justify-content:center;padding:clamp(8px,2vw,24px)}.screen.hidden{display:none}.container{text-align:center;background:#fff;width:100%;max-width:578px;padding:clamp(12px,3.5vw,40px);border-radius:clamp(12px,3vw,20px);box-shadow:0 20px 60px #0000004d}h1{color:#667eea;margin-bottom:20px;font-size:clamp(1.6rem,7vw,2.5rem)}p{margin-bottom:30px;font-size:clamp(1rem,4vw,1.2rem);color:#666}.btn{background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;border:none;padding:15px clamp(24px,8vw,40px);font-size:clamp(1rem,4vw,1.1rem);border-radius:50px;cursor:pointer;transition:transform .2s,box-shadow .2s;font-weight:700;max-width:100%;touch-action:manipulation}@media(hover:hover){.btn:hover:not(:disabled){transform:translateY(-2px);box-shadow:0 10px 20px #0003}}.btn:active:not(:disabled){transform:translateY(0)}.btn:disabled{opacity:.5;cursor:not-allowed}.setup{display:flex;flex-direction:column;gap:16px;text-align:left;margin-bottom:28px}.slot{border:1px solid #e4e4ea;border-radius:14px;padding:8px clamp(12px,3vw,16px) clamp(12px,3vw,16px);background:#fafafb}.slot-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px}.slot-label{display:flex;align-items:center;gap:8px;font-size:clamp(.86rem,3.4vw,.95rem);font-weight:700;color:#444}.slot-label svg{width:18px;height:18px;flex:0 0 auto}.slot--vs .slot-label svg{color:#667eea}.slot--eval .slot-label svg{color:#1976d2}.slot--eval .slot-head{cursor:pointer}.model-row{display:flex;align-items:center;gap:clamp(10px,3vw,14px);width:100%;min-height:68px;padding:12px clamp(12px,3vw,14px);background:#fff;border:2px solid #667eea;border-radius:12px;font:inherit;color:inherit;text-align:left;cursor:pointer;touch-action:manipulation}.slot--eval .model-row{border-color:#1976d2}.model-row:disabled{border-color:#e4e4ea;background:#fafafb;cursor:default}.model-row.error{border-color:#e57373}.model-main{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:4px}.model-name{font-size:clamp(.95rem,3.8vw,1.05rem);font-weight:700;display:flex;align-items:center;gap:8px;flex-wrap:wrap}.model-meta{font-size:clamp(.71rem,2.9vw,.8rem);color:#888}.model-meta.error-text{color:#c62828}.tag{font-size:.68rem;font-weight:700;padding:2px 8px;border-radius:20px;background:#eef0fd;color:#5563d6;white-space:nowrap}.slot--eval .tag{background:#e3f2fd;color:#1565c0}.strength{display:flex;flex-direction:column;align-items:flex-end;gap:5px;flex:0 0 auto}.elo{font-size:clamp(.7rem,2.8vw,.78rem);color:#777;white-space:nowrap}.meter{display:flex;gap:3px}.meter i{display:block;width:clamp(7px,2.2vw,9px);height:14px;border-radius:2px;background:#e6e6ec}.meter i.on{background:#667eea}.slot--eval .meter i.on,.sheet--eval .meter i.on{background:#1976d2}.chev{width:20px;height:20px;color:#bbb;flex:0 0 auto}.switch-wrap{display:flex;align-items:center;flex:0 0 auto}.switch-input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.switch{position:relative;display:block;width:48px;height:28px;border-radius:999px;background:#ccccd4;cursor:pointer;transition:background .2s}.switch:after{content:"";position:absolute;top:3px;left:3px;width:22px;height:22px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #0000004d;transition:left .2s}.switch-input:checked+.switch{background:#1976d2}.switch-input:checked+.switch:after{left:23px}.switch-input:focus-visible+.switch{outline:2px solid #1976d2;outline-offset:2px}.off-note{display:flex;align-items:center;gap:8px;margin:0;padding:12px 2px 4px;font-size:clamp(.74rem,3vw,.8rem);color:#a8a8b2}.off-note svg{width:16px;height:16px;flex:0 0 auto}.off-note.hidden,.slot-hint.hidden,.model-row.hidden{display:none}.slot-hint{margin:10px 2px 0;font-size:clamp(.73rem,2.9vw,.8rem);color:#888;line-height:1.5}.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.model-status{padding:4px 10px;border-radius:20px;font-size:.72rem;font-weight:700;white-space:nowrap}.model-status.loading{background:#fff3e0;color:#f57c00}.model-status.ready{background:#e8f5e9;color:#2e7d32}.model-status.error{background:#ffebee;color:#c62828}.game-info{margin-bottom:20px}.player-info{display:flex;flex-wrap:wrap;justify-content:center;gap:clamp(8px,3vw,24px);margin-bottom:15px;font-size:clamp(.9rem,3.6vw,1.2rem)}.player,.ai{display:flex;align-items:center;gap:10px;padding:10px clamp(10px,3vw,20px);background:#f5f5f5;border-radius:10px;flex:1 1 auto;justify-content:center;min-width:0;white-space:nowrap}#player-color,#ai-color{font-size:1.5em}.turn-indicator{font-size:clamp(.9rem,3.6vw,1.1rem);font-weight:700;padding:10px;border-radius:8px;background:#e3f2fd;color:#1976d2}.who{font-size:.7rem;font-weight:700;color:#6f6f7a;background:#e6e6ec;padding:3px 9px;border-radius:20px;white-space:nowrap}.who.hidden{display:none}.evalbar{display:flex;align-items:center;gap:9px;margin:14px auto 0;max-width:498px;padding:10px 14px;background:#e3f2fd;color:#1565c0;border-radius:8px;font-size:clamp(.76rem,3.2vw,.85rem)}.evalbar.hidden{display:none}.evalbar svg{width:17px;height:17px;flex:0 0 auto}.evalbar-meta{margin-left:auto;font-size:clamp(.68rem,2.8vw,.75rem);color:#5b8fc4;text-align:right}.board{display:grid;grid-template-columns:repeat(8,1fr);grid-template-rows:repeat(8,1fr);width:100%;max-width:498px;aspect-ratio:1 / 1;gap:2px;background:#333;padding:2px;border-radius:8px;margin:0 auto;box-shadow:0 10px 30px #0000004d}.cell{width:100%;height:100%;background:#2d7a2d;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background .2s;position:relative;container-type:inline-size;touch-action:manipulation;-webkit-tap-highlight-color:transparent}@media(hover:hover){.cell:hover{background:#3a8f3a}}.cell.valid-move{background:#4da64d}.cell.valid-move:after{content:"";width:33%;aspect-ratio:1 / 1;border-radius:50%;background:#ffffff4d;position:absolute}.debug-score{position:absolute;bottom:4%;right:4%;background:#0009;color:#fff;font-size:clamp(7px,20cqw,11px);line-height:1.2;padding:2px 5px;border-radius:6px;pointer-events:none;opacity:.95}.piece{width:83%;aspect-ratio:1 / 1;border-radius:50%;box-shadow:inset 0 -2px 5px #0000004d;animation:placepiece .3s ease}@keyframes placepiece{0%{transform:scale(0)}50%{transform:scale(1.2)}to{transform:scale(1)}}.piece.black{background:radial-gradient(circle at 30% 30%,#555,#000)}.piece.white{background:radial-gradient(circle at 30% 30%,#fff,#ddd)}.result{margin-top:clamp(16px,5vw,30px);padding:clamp(16px,5vw,30px);background:#f5f5f5;border-radius:15px}.result.hidden{display:none}.result h2{color:#667eea;margin-bottom:15px;font-size:clamp(1.4rem,6vw,2rem)}.result p{margin-bottom:20px;font-size:clamp(1rem,4.2vw,1.3rem);color:#333}#result-message.win{color:#4caf50}#result-message.lose{color:#f44336}#result-message.draw{color:#ff9800}@media(min-width:481px){.board{max-width:clamp(320px,calc(100vh - 400px),498px);max-width:clamp(320px,calc(100dvh - 400px),498px)}}@media(max-width:480px){h1{margin-bottom:12px}.setup{gap:10px;margin-bottom:14px}.slot{padding:6px 12px 12px}.model-row{min-height:62px;padding:10px 12px}.slot-hint{margin-top:8px}.hint-more{display:none}.btn{padding:13px 28px}p{margin-bottom:16px}.game-info{margin-bottom:12px}.player-info{margin-bottom:10px}.player,.ai{gap:6px;flex:1 1 45%}#player-color,#ai-color{font-size:1.3em}}@media(max-height:560px)and (orientation:landscape){.screen{padding:8px}h1{font-size:clamp(1.2rem,3.5vh,1.8rem);margin-bottom:8px}#main-screen{align-items:flex-start}#main-screen p{margin-bottom:12px}#main-screen .setup{gap:10px;margin-bottom:16px}#main-screen .slot-hint{display:none}#main-screen .container{padding:16px 24px}#game-screen .container{max-width:900px;padding:12px 16px;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"title  board" "info   board" "eval   board" "result board";align-content:center;gap:8px 16px}#game-screen h1{grid-area:title;margin-bottom:0;align-self:end}#game-screen .game-info{grid-area:info;margin-bottom:0}#game-screen .board{grid-area:board;align-self:center;width:auto;max-width:none;height:min(498px,calc(100vh - 40px));height:min(498px,calc(100dvh - 40px))}#game-screen .evalbar{grid-area:eval;margin:8px 0 0;max-width:none;padding:8px 10px;flex-wrap:wrap;gap:6px}#game-screen .evalbar-meta{margin-left:0;text-align:left;flex-basis:100%}#game-screen .who{display:none}#game-screen .result{grid-area:result;margin-top:8px;padding:12px}.player-info{flex-direction:column;flex-wrap:nowrap;gap:6px;margin-bottom:8px}.player,.ai{flex:0 0 auto;padding:6px 10px;white-space:normal}.result h2{font-size:1.3rem;margin-bottom:6px}.result p{font-size:1rem;margin-bottom:10px}.result .btn{padding:10px 20px}}.picker{position:fixed;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;padding:clamp(10px,3vw,20px)}.picker.hidden{display:none}.picker-dim{position:absolute;inset:0;background:#18123094}.sheet{position:relative;display:flex;flex-direction:column;width:100%;max-width:520px;max-height:calc(100vh - 20px);max-height:calc(100dvh - 20px);background:#fff;border-radius:clamp(14px,3vw,20px);overflow:hidden;box-shadow:0 30px 80px #00000073;text-align:left}.sheet-head{display:flex;align-items:flex-start;gap:12px;padding:clamp(16px,4vw,22px) clamp(16px,4vw,24px) 18px;border-bottom:1px solid #eeeef2}.sheet-title{flex:1 1 auto;min-width:0}.sheet-title h2{margin:0 0 6px;font-size:clamp(1.05rem,4.4vw,1.25rem);color:#333}.sheet-title p{margin:0;font-size:clamp(.75rem,3vw,.83rem);color:#8a8a94;line-height:1.55}.sheet-close{width:36px;height:36px;border-radius:50%;border:none;background:#f2f2f6;display:flex;align-items:center;justify-content:center;cursor:pointer;flex:0 0 auto;touch-action:manipulation}.sheet-close svg{width:18px;height:18px;color:#666}.sheet-list{padding:8px 10px 12px;display:flex;flex-direction:column;gap:4px;overflow-y:auto;-webkit-overflow-scrolling:touch}.sep{padding:12px 8px 4px;font-size:.72rem;font-weight:700;color:#a8a8b2;letter-spacing:.04em}.opt{display:flex;align-items:center;gap:12px;width:100%;min-height:72px;padding:12px 14px;border:2px solid transparent;border-radius:12px;background:#fff;font:inherit;color:inherit;cursor:pointer;text-align:left;touch-action:manipulation}@media(hover:hover){.opt:hover{background:#fafafb}}.opt.sel{border-color:#667eea;background:#f5f6fd}.sheet--eval .opt.sel{border-color:#1976d2;background:#f1f8fd}.opt-check{width:22px;height:22px;flex:0 0 auto;color:#667eea}.sheet--eval .opt-check{color:#1976d2}.opt-main{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:4px}.opt-name{font-size:clamp(.9rem,3.7vw,1rem);font-weight:700;display:flex;align-items:center;gap:8px;flex-wrap:wrap}.opt-meta{font-size:clamp(.7rem,2.9vw,.78rem);color:#8a8a94}.dot{font-size:.68rem;font-weight:700;padding:2px 8px;border-radius:20px;white-space:nowrap}.dot--cached{background:#e8f5e9;color:#2e7d32}.dot--dl{background:#f1f1f5;color:#80808a}.sheet-foot{padding:14px clamp(16px,4vw,24px) 18px;border-top:1px solid #eeeef2;display:flex;align-items:center;gap:9px;font-size:clamp(.72rem,2.9vw,.78rem);color:#8a8a94;line-height:1.5}.sheet-foot svg{width:16px;height:16px;flex:0 0 auto;color:#b0b0ba}
