:root{color:#e9eee8;background:#101719;font-family:Segoe UI,Yu Gothic UI,sans-serif;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-optical-sizing:auto;font-weight:400}*{box-sizing:border-box;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}input,textarea,[contenteditable=true]{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}.orientation-pending .app-shell{visibility:hidden}body{min-width:320px;height:100vh;height:100dvh;margin:0;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);overflow:hidden;overscroll-behavior:none;background:radial-gradient(ellipse at 50% 40%,rgb(49 71 62 / 30%),transparent 55%),#101719}button,input{font:inherit}button{cursor:pointer;-webkit-tap-highlight-color:transparent}button:disabled{cursor:not-allowed;opacity:.5}.app-shell{display:flex;width:100%;height:100%;margin:0 auto;padding:0 24px;flex-direction:column}.join-controls{display:flex;align-items:center;gap:10px}.quiet-button,.secondary-button{min-height:38px;padding:8px 12px;border:1px solid rgb(191 216 197 / 22%);border-radius:9px;color:#dce5de;background:#202e2b}.quiet-button:hover,.secondary-button:hover{border-color:#c9a45e}.display-status{color:#e9bd72;font-size:.8rem}.screen{width:100%;min-height:0;margin:auto;flex:1}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;clip-path:inset(50%)}.matchmaking-screen{display:grid;padding:16px;place-items:center;overflow:auto}.matchmaking-card{width:100%;max-width:560px;padding:clamp(22px,5vw,40px);border:1px solid rgb(191 216 197 / 16%);border-radius:18px;background:linear-gradient(145deg,#1a2828,#121a1b);box-shadow:0 26px 80px #0000003d;text-align:center}.matchmaking-card h1{margin:12px 0;font-size:clamp(1.4rem,4vw,2rem)}.matchmaking-copy{color:#aebbb3;line-height:1.6}.matchmaking-code-row{display:flex;min-height:52px;margin-top:22px;padding:8px 10px;align-items:center;justify-content:space-between;gap:10px;border-radius:10px;background:#111a1a}.matchmaking-code-row .room-code{font-size:clamp(1.2rem,5vw,1.7rem)}.matchmaking-actions{display:flex;flex-direction:column;gap:10px;margin-top:10px}.matchmaking-actions>button{width:100%}.home-card>#start-tutorial,.home-card>#random-match{margin-bottom:10px}.home-card>#start-tutorial{width:100%}.tutorial-menu{margin-bottom:14px}.tutorial-chapters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:8px}.tutorial-chapter{min-width:0;text-align:left}.tutorial-chapter strong,.tutorial-chapter span{display:block}.tutorial-chapter span{margin-top:4px;font-size:.75rem;font-weight:400}.result-rematch-status{display:block;min-height:1.5em;margin:8px 0 12px;color:#b7c8bd;line-height:1.5}.game-result-card #game-result-home{margin-top:6px}.orientation-prompt:not([hidden]){position:fixed;z-index:10;inset:0;display:grid;padding:24px;place-items:center;background:radial-gradient(ellipse at 50% 35%,rgb(95 143 117 / 22%),transparent 58%),#101719}.orientation-card{display:grid;max-width:360px;justify-items:center;gap:14px;text-align:center}.orientation-icon{position:relative;width:72px;height:42px;border:3px solid #e9bd72;border-radius:8px;box-shadow:0 0 28px #e9bd722e}.orientation-icon:after{position:absolute;top:50%;right:5px;width:4px;height:4px;border-radius:50%;background:#e9bd72;content:"";transform:translateY(-50%)}.orientation-card h1{margin:8px 0 0;font-size:1.35rem}.orientation-card p{margin:0;color:#aebbb3;line-height:1.6}.home-screen{display:grid;max-width:1040px;grid-template-columns:minmax(0,1fr) minmax(240px,.8fr);align-items:center;gap:clamp(24px,7vw,96px);overflow:auto}.home-card{padding:clamp(26px,5vw,58px);border:1px solid rgb(191 216 197 / 16%);border-radius:22px;background:radial-gradient(ellipse at 100% 0%,rgb(95 143 117 / 18%),transparent 54%),linear-gradient(145deg,#1a2828,#121a1b);box-shadow:0 26px 80px #0000003d}.eyebrow{margin:0 0 8px;color:#91b6a3;font-size:.67rem;font-weight:700;letter-spacing:.18em}.home-card h1{margin:18px 0 12px;font-size:clamp(2rem,5vw,3.3rem);line-height:1.35;letter-spacing:.04em}.intro-copy,.control-hint{color:#aebbb3;font-size:.88rem;line-height:1.65}.intro-copy{margin-bottom:24px}.primary-button{width:100%;min-height:48px;border:0;border-radius:11px;color:#17201b;background:#e9bd72;font-size:.95rem;font-weight:750}.primary-button:hover{background:#f2ce8e}.join-divider{display:flex;margin:20px 0 15px;align-items:center;gap:12px;color:#77867e;font-size:.72rem}.join-divider:before,.join-divider:after{height:1px;flex:1;background:#e2ece21f;content:""}.join-form label{display:block;margin-bottom:7px;color:#c7d0c9;font-size:.75rem}.join-controls input{width:100%;min-width:0;height:40px;padding:0 11px;border:1px solid rgb(191 216 197 / 20%);border-radius:9px;outline:0;color:#e9eee8;background:#111a1a;font-family:ui-monospace,monospace;letter-spacing:.1em}.join-controls input:focus{border-color:#e9bd72}.notice{display:block;min-height:20px;margin-top:10px;color:#e9bd72;font-size:.8rem;line-height:1.45}.home-art{display:grid;width:min(100%,360px);margin:auto;aspect-ratio:1;grid-template-columns:repeat(3,1fr);transform:rotate(-7deg);filter:drop-shadow(0 28px 34px rgb(0 0 0 / 24%))}.art-tile{display:grid;place-items:center;border:1px solid rgb(16 23 25 / 14%);color:#31423a;background:#b8b9a4;font-size:clamp(1.7rem,5vw,3rem);font-weight:800}.art-tile:nth-child(2n){color:#e5e8d8;background:#53675b}.art-tile.active{color:#192426;background:#e9bd72}.game-screen{position:relative;display:flex;max-width:none;margin:0;padding:0;flex-direction:column}.settings-toggle{display:grid;width:32px;height:32px;flex:0 0 auto;place-items:center;border:1px solid rgb(191 216 197 / 32%);border-radius:50%;color:#e9eee8;background:#1a2828eb;font-size:1.2rem}.lobby-settings{flex:0 0 auto;max-height:60%;overflow:auto}.lobby-settings-controls{display:flex;justify-content:flex-end;padding:6px 0}.settings-panel .settings-card{width:100%;padding:10px;box-shadow:none}.interaction-panel>.settings-panel{min-height:0;flex:0 0 auto;overflow:visible}.interaction-panel.is-settings-open>.control-section{display:none}.panel-settings-controls{display:flex}#auto-placement{width:100%;margin-bottom:8px}#auto-placement[aria-pressed=true]{border-color:#e9bd72;color:#f2ce8e}.game-result-overlay{position:absolute;z-index:4;inset:0;display:grid;padding:16px;place-items:center;background:#070d0eb8}.game-result-card{width:min(100%,390px);padding:22px;border:1px solid rgb(233 189 114 / 48%);border-radius:16px;background:#1a2828;box-shadow:0 20px 60px #0000006b;text-align:center;max-height:100%;overflow:auto}.game-result-card .eyebrow{margin:0 0 8px;color:#e9bd72;font-size:.7rem;font-weight:800;letter-spacing:.16em}.game-result-card h2{margin:0;color:#f1d293;font-size:clamp(1.8rem,8vw,2.6rem)}.game-result-card p:not(.eyebrow){margin:12px 0 20px;color:#d4ded6;line-height:1.6}.game-result-card button{width:100%;min-height:44px}#game-result-map{margin-bottom:8px}#postgame-result{width:100%}.settings-card{width:min(100%,360px);padding:18px;border:1px solid rgb(191 216 197 / 20%);border-radius:14px;background:#1a2828;box-shadow:0 20px 60px #00000061;max-height:100%;overflow:auto}.mobile-start{position:fixed;z-index:11;inset:0;display:grid;padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));place-items:center;background:#101719}.mobile-start h1{margin:0;font-size:1.3rem}.mobile-start p{color:#aebbb3;font-size:.85rem}.mobile-display-help p{margin:8px 0;line-height:1.5}.mobile-start button{width:100%;margin-top:8px}.settings-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.settings-heading h2{margin:0;font-size:1.05rem}.settings-actions{display:grid;margin-top:14px;grid-template-columns:1fr 1fr;gap:8px}.settings-actions button{min-height:42px}.settings-actions #leave-room{border-color:#e38d6166;color:#ffe0c5}.settings-room-code{display:block;color:#e9bd72;font-family:ui-monospace,monospace;font-size:.75rem;overflow-wrap:anywhere}.app-shell.is-session-screen{padding:0}.app-shell.is-session-screen>footer{display:none}.app-shell.is-session-screen>.screen{margin:0}.room-code{color:#e9bd72;font-family:ui-monospace,monospace;font-weight:750;letter-spacing:.12em}.game-layout{position:relative;display:grid;width:100%;min-height:0;margin:0;flex:1;grid-template-columns:minmax(220px,300px) minmax(0,1fr);grid-template-rows:minmax(0,1fr);grid-template-areas:"panel board";align-items:stretch;gap:10px;overflow:hidden}[data-panel-side=left]{grid-template-columns:minmax(220px,300px) minmax(0,1fr);grid-template-areas:"panel board"}[data-panel-side=right]{grid-template-columns:minmax(0,1fr) minmax(220px,300px);grid-template-areas:"board panel"}.board-column{grid-area:board;display:flex;min-width:0;min-height:0;flex-direction:column;align-items:stretch}.turn-status{width:100%;min-height:22px;margin:0 0 7px;color:#e9bd72;font-size:.85rem;font-weight:700}.turn-status[data-own-turn=true]{color:#fff5bf;background:#3e6960;border-radius:5px;text-align:center}.turn-announcement{position:absolute;z-index:6;top:50%;left:50%;width:max-content;max-width:90%;padding:18px 48px 18px 28px;clip-path:polygon(0 0,calc(100% - 24px) 0,100% 50%,calc(100% - 24px) 100%,0 100%);background:#e9bd72;color:#172c2b;font-size:clamp(1.3rem,4vw,2.2rem);font-weight:900;pointer-events:none;animation:turn-pennant 1.6s ease both}.turn-announcement[data-own-turn=false]{background:#d2dfdf}@keyframes turn-pennant{0%{opacity:0;transform:translate(calc(-50vw - 100%),-50%)}22%,72%{opacity:1;transform:translate(-50%,-50%)}to{opacity:0;transform:translate(calc(-50% + 80px),-50%)}}.combat-presentation{position:absolute;z-index:5;inset:0;display:grid;place-items:center;padding:12px;background:#070d0ea6}.combat-card{width:min(100%,460px);padding:16px;border:1px solid #e9bd72;border-radius:16px;background:#1a2828;text-align:center;animation:combat-enter .18s ease both}.combat-heading{margin:0 0 8px;color:#e9bd72;font-weight:900}.combat-pair{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px}.combat-pair figure{margin:0;display:grid;justify-items:center;gap:6px}.combat-pair figcaption{font-size:.75rem;color:#d4ded6}.combat-pair img{width:clamp(58px,17vh,108px);height:clamp(58px,17vh,108px);object-fit:contain}.combat-pair strong{font-size:1.05rem}.combat-pair [data-side=north]{color:#96dbe6}.combat-pair [data-side=south]{color:#f2aa94}.combat-arrow{color:#e9bd72;font-size:1.6rem}#combat-skill{min-height:1.5em;margin:10px 0 0;color:#f1d293;font-size:.85rem}@keyframes combat-enter{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@media(max-height:400px){.combat-card{padding:10px}.combat-heading{margin-bottom:4px}.combat-pair figure{gap:4px}.combat-pair img{width:clamp(44px,16vh,76px);height:clamp(44px,16vh,76px)}#combat-skill{margin-top:6px}}@media(prefers-reduced-motion:reduce){.turn-announcement{animation-name:turn-pennant-still}.combat-card{animation:none}}@keyframes turn-pennant-still{0%,to{opacity:0;transform:translate(-50%,-50%)}15%,80%{opacity:1;transform:translate(-50%,-50%)}}.board-frame{position:relative;width:100%;min-height:0;flex:1 1 auto;overflow:hidden}.board,.board canvas{display:block;width:100%;height:100%}.board canvas{touch-action:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}.selected-piece-panel{display:grid;min-width:0;min-height:0;grid-template-columns:54px minmax(0,1fr);align-items:center;gap:8px}.selected-piece-panel.is-empty{display:none}.selected-piece-figure{display:grid;width:52px;height:52px;place-items:center;border-radius:9px;background:#101719b8}.selected-piece-figure svg{display:block;width:48px;height:44px}.selected-piece-details{min-width:0}.selected-piece-heading{display:flex;flex-wrap:wrap;align-items:baseline;gap:5px 9px}.selected-piece-heading h3{margin:0;font-size:.88rem}.selected-piece-kind{color:#e9bd72;font-size:.7rem}.selected-piece-ability{margin:3px 0 0;color:#c6d1c9;font-size:.72rem;line-height:1.4;overflow-wrap:anywhere}.piece-action-button{width:100%;min-height:36px;margin-top:5px;padding:5px 7px;font-size:.72rem}.interaction-panel{grid-area:panel;display:flex;min-width:0;min-height:0;padding:10px;flex-direction:column;gap:8px;border:1px solid rgb(191 216 197 / 14%);border-radius:13px;background:#111a1af0;overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch}.panel-header{display:flex;flex:0 0 auto;min-height:34px;align-items:center;justify-content:space-between;gap:8px}.panel-header h2{margin:0;font-size:.92rem}.panel-position-controls{display:flex;gap:4px}.panel-position-button{min-width:40px;min-height:30px;padding:4px 8px;border:1px solid rgb(191 216 197 / 22%);border-radius:7px;color:#dce5de;background:#202e2b;font-size:.75rem}.panel-position-button[aria-pressed=true]{border-color:#e9bd72;color:#192426;background:#e9bd72}.interaction-panel>.control-section{min-width:0;min-height:0;flex:0 0 auto}.control-section{padding:9px;border:1px solid rgb(191 216 197 / 14%);border-radius:13px;background:#1a2828d1}.tutorial-panel{border-color:#e9bd72}.tutorial-panel .eyebrow{margin:0 0 6px}.tutorial-panel>button{width:100%;margin-top:10px}.tutorial-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}.tutorial-panel .tutorial-details-heading{margin-top:16px}.tutorial-details{padding-left:20px;margin-bottom:0;font-size:.8rem;line-height:1.65}.tutorial-details li+li{margin-top:8px}.control-section h3{margin:0 0 7px;font-size:.9rem}.control-hint{margin:0;font-size:.75rem;line-height:1.45}.role-options{display:grid;margin-top:8px;grid-template-columns:repeat(8,minmax(0,1fr));gap:6px}.role-option{min-height:34px;border:1px solid rgb(191 216 197 / 20%);border-radius:8px;color:#e9eee8;background:#202e2b}.role-option:hover:not(:disabled),.role-option[aria-pressed=true]{border-color:#e9bd72;background:#35483d}.debug-button{width:100%;min-height:30px;margin-top:7px;padding:6px 9px;border:1px dashed #e38d61;border-radius:8px;color:#ffe0c5;background:#542f27;font-size:.72rem;font-weight:750}.debug-button:hover:not(:disabled){background:#704032}.action-status{display:block;min-height:18px;margin-top:9px;color:#e9bd72;font-size:.78rem;line-height:1.5}.ability-actions{display:grid;gap:8px}.ability-actions button{text-align:left}.tama-reposition-controls{display:grid;gap:8px;margin-top:8px}.tama-piece-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(76px,1fr));gap:6px}.tama-piece-options .role-option{min-height:34px;padding:6px;font-size:.72rem}footer{min-height:28px;padding:7px 0;color:#68766f;font-size:.6rem;letter-spacing:.14em;text-align:center;flex-shrink:0}[hidden]{display:none!important}@media(max-height:460px){.matchmaking-card{padding:16px}.matchmaking-card h1{margin:8px 0;font-size:1.4rem}.matchmaking-copy{margin:8px 0;line-height:1.4}.matchmaking-code-row{min-height:44px;margin-top:12px;padding:4px 8px}.matchmaking-actions{flex-direction:row}.matchmaking-actions>button{flex:1;min-width:0}}@media(max-width:760px){.app-shell{padding:0 14px}.home-screen{max-width:500px;grid-template-columns:1fr}.home-card{padding:24px}.home-art{display:none}.app-shell.is-session-screen{padding:0}.game-layout{grid-template-columns:minmax(200px,34vw) minmax(0,1fr);gap:8px}[data-panel-side=right]{grid-template-columns:minmax(0,1fr) minmax(200px,34vw)}.interaction-panel{padding:8px;gap:6px}.control-section{padding:8px}.selected-piece-panel{grid-template-columns:42px minmax(0,1fr);gap:6px}.selected-piece-figure{width:40px;height:40px}.selected-piece-figure svg{width:38px;height:36px}.selected-piece-heading{gap:2px 5px}.selected-piece-heading h3{font-size:.76rem}.selected-piece-kind{font-size:.6rem}.selected-piece-ability,.control-hint{font-size:.65rem;line-height:1.3}.role-options{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}}@media(max-width:600px){.game-layout{display:block}.board-column{position:absolute;inset:0}.interaction-panel{position:absolute;z-index:2;top:0;bottom:0;width:min(280px,calc(100% - 52px));border-radius:0;background:#111a1a;box-shadow:0 0 28px #00000061}[data-panel-side=left] .interaction-panel{left:0}[data-panel-side=right] .interaction-panel{right:0}.game-layout.is-panel-collapsed .interaction-panel{display:none}.panel-open-button{position:absolute;z-index:2;bottom:12px;min-height:38px;padding:7px 14px;border:1px solid rgb(191 216 197 / 30%);border-radius:9px;color:#e9eee8;background:#202e2b}[data-panel-side=left] .panel-open-button{left:12px}[data-panel-side=right] .panel-open-button{right:12px}.game-layout:not(.is-panel-collapsed) .panel-open-button{display:none}.panel-collapse-button{min-height:30px;padding:4px 8px;border:1px solid rgb(191 216 197 / 22%);border-radius:7px;color:#dce5de;background:#202e2b;font-size:.72rem}}@media(min-width:601px){.panel-collapse-button,.panel-open-button{display:none}}@media(max-height:500px){.app-shell:not(.is-session-screen){padding:0 12px}.home-screen{max-width:560px;grid-template-columns:minmax(0,1fr);padding:8px 0}.home-art,.home-card .eyebrow,.intro-copy,footer{display:none}.home-card{padding:12px 16px;border-radius:14px}.home-card h1{margin:0 0 8px;font-size:1.5rem;line-height:1.2}.home-card .primary-button{min-height:40px}.join-divider{margin:8px 0}.join-form label{margin-bottom:4px}.notice:empty{display:none}.matchmaking-screen{padding:8px 52px}.matchmaking-card{padding:12px}.matchmaking-card .eyebrow{display:none}}@media(max-height:300px){.matchmaking-card h1{margin:4px 0;font-size:1.1rem}.matchmaking-copy{margin:6px 0;font-size:.75rem;line-height:1.3}.matchmaking-code-row{min-height:40px;margin-top:8px}.matchmaking-card .notice{margin-top:6px;font-size:.72rem;line-height:1.25}.matchmaking-actions{margin-top:6px}}@media(max-width:360px){.interaction-panel{padding:6px;gap:5px}.control-section{padding:6px}.control-section h3,.panel-header h2{font-size:.76rem}.control-section h3{margin-bottom:4px}.selected-piece-panel{grid-template-columns:36px minmax(0,1fr);gap:4px}.selected-piece-figure{width:34px;height:34px}.selected-piece-figure svg{width:32px;height:30px}.selected-piece-heading h3{font-size:.68rem}.selected-piece-kind,.selected-piece-ability,.control-hint,.action-status{font-size:.58rem;line-height:1.2}.action-status{margin-top:3px}.role-option{min-height:30px}.debug-button{min-height:30px;margin-top:6px;padding:4px 6px}#placement-panel>.control-hint{display:none}}
