:root{color:#20231f;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;background:radial-gradient(circle at top left,rgba(220,65,52,.18),transparent 32rem),linear-gradient(135deg,#f3f0e8,#dfe8e1 48%,#ece3d4);font-synthesis:none;text-rendering:optimizeLegibility}*{box-sizing:border-box}body{margin:0;min-width:320px;min-height:100vh}button,input{font:inherit}button{cursor:pointer}.app-shell{display:grid;grid-template-columns:minmax(320px,720px) minmax(300px,420px);gap:28px;width:min(1180px,calc(100vw - 32px));min-height:100vh;margin:0 auto;padding:28px 0;align-items:center}.board-section{display:grid;gap:18px}.title-block p,.panel-label{margin:0 0 6px;color:#6c7168;font-size:.76rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.title-block h1{margin:0;font-size:clamp(2rem,5vw,4.3rem);line-height:.94;letter-spacing:0}.board-frame{padding:14px;border:1px solid rgba(38,42,36,.2);border-radius:8px;background:#fffcf49e;box-shadow:0 28px 70px #342f2538}.board{display:grid;grid-template-columns:repeat(8,1fr);aspect-ratio:1;overflow:hidden;border-radius:6px;border:2px solid #262a24}.square{position:relative;display:grid;place-items:center;width:100%;aspect-ratio:1;border:0;padding:0;isolation:isolate}.square.light{background:#f1e4ca}.square.dark{background:#617056}.square.selected{box-shadow:inset 0 0 0 4px #dc4134}.square.last-move:before{position:absolute;inset:0;content:"";background:#f4be4357}.square.check:before{position:absolute;inset:0;content:"";background:radial-gradient(circle,rgba(220,65,52,.65) 0%,rgba(220,65,52,.18) 62%,transparent 75%)}.square.legal:after{position:absolute;width:28%;aspect-ratio:1;border-radius:999px;content:"";background:#20231f57;z-index:1}.piece{position:relative;z-index:2;font-family:Times New Roman,Georgia,serif;font-size:clamp(2rem,7vw,4.7rem);line-height:1;text-shadow:0 2px 5px rgba(30,30,30,.28)}.white-piece{color:#fff9ed}.black-piece{color:#1b201b}.coord{position:absolute;z-index:3;color:#20231f9e;font-size:clamp(.58rem,1.4vw,.74rem);font-weight:800}.dark .coord{color:#fff9edb8}.file-label{right:6px;bottom:4px}.rank-label{top:4px;left:6px}.control-panel{display:grid;gap:16px;padding:18px;border:1px solid rgba(38,42,36,.18);border-radius:8px;background:#fffcf4c7;box-shadow:0 24px 60px #36322b2e;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px)}.status-card{display:flex;gap:14px;align-items:center;padding:14px;border-radius:8px;background:#20231f;color:#fff9ed}.status-icon{display:grid;place-items:center;width:44px;height:44px;border-radius:8px;background:#dc4134}.status-card h2{margin:0;font-size:1.12rem;line-height:1.25}.status-card .icon-button{display:grid;place-items:center;width:36px;height:36px;margin-left:auto;flex-shrink:0;border:0;border-radius:999px;background:#fff9ed24;color:#fff9ed;transition:background .15s ease}.status-card .icon-button:hover{background:#fff9ed42}.conn-dot{display:inline-block;width:9px;height:9px;margin-left:8px;border-radius:999px;vertical-align:middle}.conn-dot.connected{background:#4c8f5a}.conn-dot.lost{background:#dc4134}.conn-dot.reconnecting{background:#e0a63f;animation:pulse 1.2s ease-in-out infinite}.conn-banner,.draw-banner,.resume-banner{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between;padding:12px 14px;border:1px solid rgba(220,65,52,.35);border-radius:8px;background:#dc413414;font-weight:700;color:#20231f}.draw-banner{border-color:#61705673;background:#6170561a}.resume-banner{border-color:#61705673;background:#6170561a;font-size:.92rem}.banner-actions{display:flex;gap:8px}.conn-banner button,.banner-actions button{min-height:36px;padding:0 14px;border:0;border-radius:6px;background:#20231f;color:#fff9ed;font-weight:800}.banner-actions button.ghost{border:1px solid rgba(38,42,36,.25);background:transparent;color:#20231f}.toast-stack{position:fixed;top:18px;left:50%;z-index:30;display:grid;gap:8px;transform:translate(-50%)}.toast{padding:10px 18px;border-radius:999px;background:#20231f;color:#fff9ed;font-size:.9rem;font-weight:700;box-shadow:0 12px 30px #00000040;animation:toast-in .2s ease}@keyframes toast-in{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.game-over-card{display:grid;gap:14px;text-align:center;justify-items:center}.game-over-card h2{margin:0;font-size:1.5rem}.game-over-card .panel-label{margin:0}.game-over-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;width:100%}.status-card .panel-label{color:#fff9eda8}.clock-stack{display:grid;grid-template-columns:1fr 1fr;gap:12px}.clock-card{display:grid;gap:6px;padding:14px;border:1px solid rgba(38,42,36,.16);border-radius:8px;background:#ffffff8a}.clock-card span{color:#666d63;font-size:.86rem;font-weight:800}.clock-card strong{font-variant-numeric:tabular-nums;font-size:clamp(1.7rem,4vw,2.4rem);line-height:1}.clock-card.active{border-color:#dc4134;background:#fff7ea;box-shadow:inset 0 0 0 2px #dc41341f}.clock-card.low strong,.board-clock.low strong{color:#c0392b}.clock-card.urgent strong,.board-clock.urgent strong{animation:blink .8s step-start infinite}@keyframes blink{50%{opacity:.35}}.captured-row{display:flex;flex-wrap:wrap;gap:2px;align-items:center;min-height:18px;font-family:Times New Roman,Georgia,serif;font-size:1rem;line-height:1;color:#444a42}.captured-row em{margin-left:4px;color:#b23527;font-family:Inter,ui-sans-serif,system-ui,sans-serif;font-size:.78rem;font-style:normal;font-weight:800}.board-clock{display:none;justify-content:space-between;align-items:center;padding:10px 14px;border:1px solid rgba(38,42,36,.16);border-radius:8px;background:#fffcf4c7}.board-clock span{color:#666d63;font-size:.82rem;font-weight:800}.board-clock strong{font-variant-numeric:tabular-nums;font-size:1.4rem;line-height:1}.board-clock.active{border-color:#dc4134;background:#fff7ea}.button-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}label{display:grid;gap:6px;color:#5f675d;font-size:.86rem;font-weight:800}input{width:100%;min-height:42px;border:1px solid rgba(38,42,36,.22);border-radius:6px;padding:0 10px;background:#ffffffb8;color:#20231f}input:disabled{opacity:.58}.button-grid button,.promotion-options button,.game-over-actions button{display:inline-flex;min-height:42px;align-items:center;justify-content:center;gap:8px;border:0;border-radius:6px;padding:0 12px;background:#20231f;color:#fff9ed;font-weight:800}.button-grid button:disabled{cursor:not-allowed;opacity:.45}.button-grid button.secondary,.game-over-actions button.secondary{border:1px solid rgba(38,42,36,.2);background:#ffffff9e;color:#20231f}.button-grid button.danger{background:#dc4134}.button-grid button.danger.armed{animation:pulse-bg .8s ease-in-out infinite}@keyframes pulse-bg{0%,to{filter:brightness(1)}50%{filter:brightness(1.25)}}.notation-card{display:grid;min-height:240px;max-height:340px;overflow:hidden;border:1px solid rgba(38,42,36,.16);border-radius:8px;background:#ffffff80}.notation-header{display:flex;justify-content:space-between;gap:12px;padding:14px 14px 8px}.notation-header span{color:#687065;font-size:.86rem;font-weight:800}.notation-list{overflow:auto;padding:0 14px 14px}.empty-note{margin:24px 0 0;color:#747a70}.notation-row{display:grid;grid-template-columns:42px 1fr 1fr;gap:10px;align-items:center;min-height:34px;border-bottom:1px solid rgba(38,42,36,.1);font-weight:700}.move-number{color:#747a70}.lobby-shell{display:grid;place-items:center;width:min(1180px,calc(100vw - 32px));min-height:100vh;margin:0 auto;padding:28px 0}.lobby-card{display:grid;gap:22px;width:min(560px,100%);padding:32px;border:1px solid rgba(38,42,36,.18);border-radius:8px;background:#fffcf4c7;box-shadow:0 24px 60px #36322b2e;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px)}.lobby-sub{margin:-8px 0 0;color:#5f675d;line-height:1.6}.lobby-section{display:grid;gap:10px}.lobby-section .panel-label{margin:0}.name-grid,.custom-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.preset-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.preset{display:grid;gap:2px;padding:12px 8px;border:1px solid rgba(38,42,36,.2);border-radius:6px;background:#ffffff9e;color:#20231f;transition:border-color .15s ease,background .15s ease,transform .15s ease}.preset:hover{transform:translateY(-1px)}.preset strong{font-size:1.15rem;font-variant-numeric:tabular-nums}.preset span{color:#6c7168;font-size:.78rem;font-weight:800}.preset.selected{border-color:#dc4134;background:#fff7ea;box-shadow:inset 0 0 0 2px #dc41342e}.start-button{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:52px;border:0;border-radius:6px;background:#dc4134;color:#fff9ed;font-size:1.05rem;font-weight:800;transition:filter .15s ease,transform .15s ease}.start-button:hover{filter:brightness(1.06);transform:translateY(-1px)}.start-button:disabled{cursor:wait;opacity:.6;transform:none}.mode-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:6px;border:1px solid rgba(38,42,36,.16);border-radius:8px;background:#ffffff80}.mode-tab{min-height:40px;border:0;border-radius:6px;background:transparent;color:#5f675d;font-weight:800;transition:background .15s ease,color .15s ease}.mode-tab.selected{background:#20231f;color:#fff9ed}.mode-tab:disabled{cursor:not-allowed;opacity:.6}.color-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.code-input{font-weight:800;letter-spacing:.12em;text-transform:uppercase}.hint-note{margin:-6px 0 0;color:#6c7168;font-size:.9rem}.error-note{margin:-6px 0 0;color:#dc4134;font-weight:700}.room-panel{display:grid;gap:12px;justify-items:center;padding:22px 18px;border:1px dashed rgba(38,42,36,.32);border-radius:8px;background:#ffffff80;text-align:center}.room-panel .panel-label{margin:0}.room-code{font-size:2.3rem;font-variant-numeric:tabular-nums;letter-spacing:.16em}.waiting-note{display:flex;gap:8px;align-items:center;margin:0;color:#5f675d}.waiting-note:before{content:"";width:10px;height:10px;border-radius:999px;background:#dc4134;animation:pulse 1.2s ease-in-out infinite}@keyframes pulse{0%,to{opacity:.35;transform:scale(.85)}50%{opacity:1;transform:scale(1)}}.copy-row{display:flex;flex-wrap:wrap;gap:10px;justify-content:center}.copy-row button{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:0 14px;border:1px solid rgba(38,42,36,.2);border-radius:6px;background:#ffffff9e;color:#20231f;font-weight:800}.cancel-button{min-height:40px;padding:0 14px;border:0;border-radius:6px;background:transparent;color:#dc4134;font-weight:800}.promotion-backdrop{position:fixed;inset:0;display:grid;place-items:center;padding:24px;background:#181b186b;z-index:10}.promotion-card{width:min(420px,100%);padding:20px;border-radius:8px;background:#fff9ed;box-shadow:0 30px 80px #00000047}.promotion-card h2{margin:0 0 14px}.promotion-options{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.promotion-options button{display:grid;min-height:92px;background:#617056}.promotion-options span{font-family:Times New Roman,Georgia,serif;font-size:2.4rem;line-height:1}@media(max-width:920px){.app-shell{grid-template-columns:1fr;align-items:start;padding:20px 0}.control-panel{order:2}.title-block h1{font-size:clamp(2.2rem,12vw,3.4rem)}.board-clock{display:flex}.clock-stack{display:none}.game-over-actions{grid-template-columns:1fr}}@media(max-width:520px){.app-shell{width:min(100vw - 20px,1180px);gap:16px}.board-frame,.control-panel{padding:10px}.lobby-card{padding:20px}.button-grid,.clock-stack,.name-grid,.custom-grid{grid-template-columns:1fr}.preset-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.promotion-options{grid-template-columns:repeat(2,1fr)}}.game-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.game-choice strong{font-size:1.4rem;line-height:1.1}.log-row{grid-template-columns:34px 1fr}.board-captured{padding:0 4px}.shogi-frame{padding:12px}.shogi-board{display:grid;grid-template-columns:repeat(9,1fr);grid-template-rows:repeat(9,1fr);aspect-ratio:1;overflow:hidden;border:2px solid #262a24;border-radius:6px;background:#e9cb92}.shogi-cell{position:relative;display:grid;place-items:center;border:1px solid rgba(70,50,20,.5);background:transparent;padding:0}.shogi-cell.selected{box-shadow:inset 0 0 0 3px #dc4134}.shogi-cell.legal:after{position:absolute;width:26%;aspect-ratio:1;border-radius:999px;content:"";background:#20231f59}.shogi-cell.last-move{background:#f4be4366}.shogi-piece{display:grid;place-items:center;width:80%;aspect-ratio:.9;clip-path:polygon(50% 0%,88% 22%,100% 100%,0% 100%,12% 22%);background:linear-gradient(160deg,#f8e8c4,#e2b678);box-shadow:0 1px 2px #0000004d;color:#241a08;font-family:Hiragino Mincho ProN,Yu Mincho,"Noto Serif TC",Georgia,serif;font-size:clamp(.8rem,2.6vw,1.45rem);font-weight:800;padding-top:12%;box-sizing:border-box}.shogi-piece.facing-away{transform:rotate(180deg)}.shogi-piece.promoted{color:#b8281a}.hand-tray{display:flex;flex-wrap:wrap;gap:8px;align-items:center;min-height:48px;padding:6px 12px;border:1px solid rgba(38,42,36,.16);border-radius:8px;background:#fffcf4b8}.hand-label{color:#6c7168;font-size:.76rem;font-weight:800}.hand-empty{color:#9aa094;font-size:.82rem}.hand-piece{position:relative;display:grid;place-items:center;width:38px;height:40px;border:0;padding:4px 0 0;clip-path:polygon(50% 0%,88% 22%,100% 100%,0% 100%,12% 22%);background:linear-gradient(160deg,#f8e8c4,#e2b678);color:#241a08;font-family:Hiragino Mincho ProN,Yu Mincho,"Noto Serif TC",Georgia,serif;font-size:1.05rem;font-weight:800}.hand-piece:disabled{cursor:default;opacity:.7}.hand-piece.selected{filter:drop-shadow(0 0 3px #dc4134) drop-shadow(0 0 2px #dc4134)}.hand-piece em{position:absolute;right:4px;bottom:2px;color:#7a1f14;font-size:.62rem;font-style:normal}.promotion-options.two{grid-template-columns:repeat(2,1fr)}.promotion-options.two button{min-height:56px;font-size:1.05rem}.junqi-frame{max-width:500px;margin:0 auto;padding:12px;width:100%}.junqi-board{display:grid;grid-template-columns:repeat(5,1fr);grid-template-rows:repeat(12,1fr);gap:4px;aspect-ratio:.62;padding:8px;border:2px solid #262a24;border-radius:6px;background:#59684f}.junqi-cell{position:relative;display:grid;place-items:center;border:1px solid rgba(255,255,255,.22);border-radius:6px;background:#f0ebd71f;padding:0}.junqi-cell.terrain-rail{border-style:double;border-width:3px;border-color:#fff6;background:#f0ebd742}.junqi-cell.terrain-camp{border:2px dashed rgba(255,252,244,.65);border-radius:999px;background:#f0ebd733}.junqi-cell.terrain-hq{border:2px solid rgba(244,190,67,.75);background:#20231f4d}.junqi-cell.terrain-hq:before{position:absolute;content:"★";color:#f4be4373;font-size:1.1rem}.junqi-cell.selected{box-shadow:0 0 0 3px #dc4134}.junqi-cell.legal:after{position:absolute;width:22%;aspect-ratio:1;border-radius:999px;content:"";background:#fffcf4c7;z-index:2}.junqi-cell.last-move{box-shadow:0 0 0 3px #f4be43d9}.junqi-piece{position:relative;z-index:1;display:grid;place-items:center;width:88%;height:80%;border-radius:6px;color:#fff9ed;font-size:clamp(.68rem,2.1vw,1rem);font-weight:800;letter-spacing:.06em;box-shadow:0 2px 4px #00000059}.junqi-piece.side-w{background:linear-gradient(160deg,#c8473a,#9b2f24)}.junqi-piece.side-b{background:linear-gradient(160deg,#3f5f8a,#2a4265)}.junqi-piece.back.side-w{background:repeating-linear-gradient(45deg,#a63527,#a63527 6px,#8d2b1f 6px 12px)}.junqi-piece.back.side-b{background:repeating-linear-gradient(45deg,#33507a,#33507a 6px,#263c5c 6px 12px)}.setup-bar{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between;padding:10px 14px;border:1px solid rgba(97,112,86,.45);border-radius:8px;background:#6170561f;font-weight:700}.setup-bar .banner-actions button{display:inline-flex;gap:6px;align-items:center}
