:root{color-scheme:dark;--bg:#10191b;--panel:#172225;--line:#344042;--muted:#acb7b6;--gold:#dfbd80;--light:#d8b977;--dark:#aa93ca;--serif:"Palatino Linotype","Book Antiqua",Georgia,serif;--sans:"Segoe UI",system-ui,sans-serif;font:16px var(--sans)}
*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0;background:var(--bg);color:#f0ece3;min-height:100vh}button,a,input,select{font:inherit}button,a{touch-action:manipulation}button{cursor:pointer;color:inherit}button:focus-visible,a:focus-visible,summary:focus-visible,canvas:focus-visible{outline:3px solid #f7d68e;outline-offset:3px}button:disabled{cursor:default;opacity:.52}button{border:0}a{color:inherit;text-decoration:none}button svg,i svg{display:block;width:100%;height:100%}i[data-icon]{display:inline-block;width:18px;height:18px;flex:none;font-style:normal}
.top{background:#101719;border-bottom:1px solid #373c36;position:relative;z-index:2}.top-inner{max-width:1260px;margin:auto;display:flex;align-items:center;padding:0 42px;height:68px;gap:50px}.brand{display:flex;align-items:center;gap:12px;color:#ecdfc8;font:600 29px var(--serif);letter-spacing:4px}.brand img{width:37px;height:37px}nav{align-self:stretch;display:flex;gap:30px}.nav-link{position:relative;padding:0 2px;background:none;font-size:.9rem;color:#aeb7b7}.nav-link.active{color:#f0dfbe}.nav-link.active:after{content:"";position:absolute;bottom:0;left:0;right:0;height:2px;background:var(--gold)}.top-actions{margin-left:auto;display:flex;align-items:center;gap:18px}.icon-button{background:transparent;display:grid;place-items:center;height:36px;width:36px;color:#c1c9c6;border-radius:4px}.icon-button:hover,.nav-link:hover{color:#fff}.icon-button>svg{width:19px;height:19px}.gold-button,.small-button,.copy-button{display:inline-flex;align-items:center;justify-content:center;gap:9px;background:linear-gradient(120deg,#e4c68a,#c9a465);color:#242420;border:1px solid #e2c58f;font-weight:650;font-size:.88rem;border-radius:5px;padding:10px 16px}.gold-button:hover,.copy-button:hover{filter:brightness(1.09)}
.landscape{position:absolute;top:68px;left:0;right:0;height:355px;background:linear-gradient(0deg,var(--bg) 0%,transparent 75%),linear-gradient(90deg,rgba(12,21,23,.64),rgba(15,24,27,.10) 65%,rgba(16,25,27,.3)),url('./art/realm.webp') center 43% / cover;pointer-events:none;opacity:.89}
main{position:relative;max-width:1100px;margin:auto;padding:0 32px 30px}.heading{min-height:154px;display:flex;justify-content:space-between;gap:14px;align-items:center}.kicker,.section-label,.turn-count,.tiny{letter-spacing:.15em;text-transform:uppercase;font-size:.715rem;font-weight:650}.kicker{color:#e3c48d;display:flex;align-items:center;gap:10px;text-shadow:0 1px 4px #12201f}.k-line{width:25px;height:1px;background:var(--gold)}h1,h2,h3,p{margin:0}h1{font:400 clamp(2.5rem,4.5vw,4rem)/1.1 var(--serif);letter-spacing:-.045em;margin:8px 0 0;text-shadow:0 2px 12px #122325}.mode-tag{display:flex;align-items:center;gap:9px;font-size:.82rem;background:#162224db;border:1px solid #596361;color:#e6e6de;border-radius:30px;padding:8px 13px}.mode-tag i[data-icon]{width:15px;height:15px}.war-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(235px,.465fr);gap:20px;align-items:start}.left-stack,aside{min-width:0}aside{display:grid;gap:14px}
.board-panel,.turn-card,.info-card,.history,.guide-panel{background:linear-gradient(125deg,#1b282b,#151f22);border:1px solid var(--line);border-radius:9px;box-shadow:0 8px 26px #0002}.board-panel{padding:0 16px}.panel-head{display:flex;align-items:center;justify-content:space-between;padding:15px 3px 13px}.section-label{display:flex;align-items:center;gap:8px;color:#cbd2cc;font-size:.74rem;letter-spacing:.14em}.section-label i[data-icon]{color:#cfb17b;width:16px;height:16px}.turn-count{font:500 .67rem var(--sans);letter-spacing:.14em;color:#b7c0bd}
.board-coords{display:grid;grid-template-columns:18px minmax(0,1fr);grid-template-rows:auto 19px;max-width:min(100%,max(410px,65vh));margin:auto}.numbers,.letters{display:grid;color:#a0a6a0;font-size:.66rem;text-align:center;font-weight:600}.numbers{grid-template-rows:repeat(9,1fr);align-items:center;padding-right:4px}.letters{grid-column:2;grid-template-columns:repeat(9,1fr);align-items:end}
#board{display:grid;grid-template-columns:repeat(9,1fr);grid-template-rows:repeat(9,1fr);aspect-ratio:1;border:3px solid #958665;outline:1px solid #374344;box-shadow:0 0 0 3px #0c1315,0 5px 16px #0007;isolation:isolate}.cell{padding:0;position:relative;min-width:0;min-height:0;display:grid;place-items:center;border:1px solid #0b151920;appearance:none;background-color:var(--tile);background-image:linear-gradient(135deg,#ffffff0f,#00000012),repeating-linear-gradient(117deg,#ffffff04 0px,#ffffff04 1px,transparent 1px,transparent 5px)}.cell.l{--tile:#bbad8d}.cell.d{--tile:#40535b}.cell.f{--tile:var(--shift,#698282)}.cell img{width:96%;height:96%;object-fit:contain;filter:drop-shadow(0 2px 1px #000a);pointer-events:none;z-index:1;transition:transform .15s}.cell:hover img{transform:scale(1.085)}.cell:hover{box-shadow:inset 0 0 0 2px #f4d79dc2}.cell:focus-visible{outline-offset:-4px;z-index:3}.cell.selected{box-shadow:inset 0 0 0 3px #fff0ae;background-color:#b1a36b}.cell.legal:after{content:"";width:18%;aspect-ratio:1;border-radius:50%;background:#f5e5a3;box-shadow:0 0 0 3px #303c3645;position:absolute}.cell.legal:has(img):after{width:88%;height:88%;border-radius:0;border:3px solid #ecc47a;background:none;z-index:2}.cell.bound:before{content:"×";position:absolute;bottom:0;right:2px;color:#fff;background:#573e7c;z-index:2;font-size:.8rem}.power-rune{position:absolute;inset:15%;margin:auto;width:70%;height:70%;color:#e6cf8d;opacity:.82;pointer-events:none}.cell:has(img) .power-rune{inset:1%;width:95%;height:95%;opacity:.68}.legend{display:flex;align-items:center;justify-content:center;gap:clamp(10px,2.2vw,29px);padding:13px 0 15px;color:#c4ccc7;font-size:.755rem}.legend span,.cycle span{display:inline-flex;align-items:center;gap:7px}.sw{display:inline-block;width:10px;height:10px;border-radius:2px}.light-tile{background:#c0ad85}.dark-tile{background:#4a5c66}.shifting-tile{background:#758e87}.legend i[data-icon]{width:14px;height:14px;color:var(--gold)}.board-tip{display:flex;align-items:center;gap:9px;padding:12px 5px;font-size:.83rem;color:#bbc5bf}.board-tip i{color:#c6ad7d}
.turn-card,.info-card{padding:18px 20px}.turn-card{background:radial-gradient(ellipse at 103% 90%,#a9904a15,transparent 70%),linear-gradient(120deg,#202c28,#1b2729);border-color:#525441}.live-spark{width:7px;height:7px;background:#d1b57a;transform:rotate(45deg)}.turn-row{display:flex;align-items:center;justify-content:space-between;gap:7px;margin-top:13px}.turn-row h2{font:400 clamp(1.5rem,2.25vw,2.1rem)/1.05 var(--serif);letter-spacing:-.04em}.turn-row p,#focusMove{font-size:.8rem;color:#bdc5c0;line-height:1.45}.turn-row p{margin-top:6px}.realm-seal{display:grid;place-items:center;color:var(--gold);flex:none;width:43px;height:43px}.realm-seal svg{width:100%;height:100%}.realm-line,.army-line,.point-line,.cycle{display:flex;align-items:center;justify-content:space-between}.realm-line{margin-top:15px;font-size:.85rem}.realm-line span:first-child,.army-line>span:first-child{color:#e9c988}.realm-line span:last-child,.army-line>span:last-child{color:#c9b1df}.army-line{margin:2px 0 7px}.army-line>span:not(.army-caption){font:400 1.7rem var(--serif)}.army-caption,.point-line,.cycle{font-size:.79rem;color:#bcc5c0}.balance{height:4px;background:#947aad;overflow:hidden;border-radius:3px}.balance b{display:block;background:#d3b373;width:50%;height:100%;border-right:2px solid var(--panel)}.point-line{padding:13px 0 16px}.point-line>div{display:flex;gap:6px}.gem{width:8px;height:8px;transform:rotate(45deg);background:#3f4c50;border:1px solid #74807d}.gem.light{background:var(--light);border-color:var(--light)}.gem.dark{background:var(--dark);border-color:var(--dark)}.cycle{border-top:1px solid var(--line);padding-top:13px}.cycle strong{font-weight:500;color:#d1d9d2}.cycle i[data-icon]{width:14px;height:14px;color:var(--gold)}#phaseBar{display:flex;gap:4px;margin-top:9px}#phaseBar b{flex:1;height:5px;border-radius:2px}#phaseBar b.current{outline:1px solid #eee4c7;outline-offset:2px}.focus-body{display:flex;align-items:center;gap:15px;margin-top:13px}.focus-body img{width:66px;height:68px;object-fit:contain;background:radial-gradient(ellipse,#b29b6b25,transparent 70%)}.tiny{font-size:.62rem;color:#d6b87d}.focus-body h3{font:400 1.55rem var(--serif);margin:3px 0}.small-button{background:#222e2e;color:#e5cc94;border:1px solid #53615a;padding:7px 12px;margin-top:12px}.history{padding:12px 18px;color:#c1cbc4;font-size:.85rem}.history summary{cursor:pointer}.history ol{margin:10px 0 0;padding-left:22px;line-height:1.6}
dialog{width:min(460px,calc(100% - 24px));max-height:85dvh;background:#1b282b;border:1px solid #65706a;border-radius:10px;color:#f1ecdc;padding:23px;box-shadow:0 24px 80px #0009}dialog::backdrop{background:#071014c9;backdrop-filter:blur(4px)}.dialog-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.dialog-head .icon-button{height:28px;width:28px}.dialog-head .section-label{color:var(--gold)}dialog h2,.guide-panel h2{font:400 2rem var(--serif);margin-bottom:10px}dialog p,.guide-panel p{font-size:.94rem;color:#c8d0ca;line-height:1.55;margin:7px 0 14px}dialog .gold-button{margin:5px 0}.split{border:0;border-top:1px solid #485553;margin:20px 0}label{display:block;color:#e0e5db;font-size:.88rem;margin-bottom:8px}.join-row{display:flex;gap:9px}input,select{background:#101b1d;color:#eae8de;padding:10px;border:1px solid #596660;border-radius:4px;min-width:0}.join-row input{flex:1;text-transform:uppercase;letter-spacing:.15em}.notice{color:#f5ca91!important}.room-code{font:500 2rem monospace;letter-spacing:.18em;color:var(--gold);margin:10px 0}.text-button{background:none;color:#dac492;text-decoration:underline;padding:6px 0}.spell-list{display:grid;gap:6px}.spell-list button{padding:9px 11px;display:flex;justify-content:space-between;text-align:left;background:#253436;border:1px solid #495550;border-radius:4px}.spell-list small{color:#c4c7ba}
#guide{display:grid;gap:16px;padding-bottom:35px}.guide-panel{padding:24px}.guide-panel h2{font-size:1.65rem}.guide-panel h3{font:400 1.25rem var(--serif);color:#ebc994;margin-bottom:5px}.guide-rules{display:grid;grid-template-columns:repeat(3,1fr);gap:20px}.roster{display:grid;grid-template-columns:repeat(4,1fr);gap:9px}.roster article{display:flex;align-items:center;gap:9px;padding:9px;background:#142022;border:1px solid #354442;border-radius:5px}.roster img{width:43px;height:49px;object-fit:contain}.roster b,.roster small{display:block}.roster small{color:#b8c2bb;font-size:.73rem;margin-top:4px}
#arena{width:100%;height:auto;display:block;border:1px solid #7d8068;border-radius:4px;background:#344541;touch-action:none}.duel-hud{display:flex;justify-content:space-between;gap:20%;padding:2px 0 10px}.fighter-hud{flex:1;font-size:.85rem}.fighter-hud:last-child{text-align:right}.bar{height:6px;background:#39464b;overflow:hidden;margin-top:4px;border-radius:3px}.bar div{background:var(--light);height:100%}.fighter-hud:last-child .bar div{background:var(--dark);margin-left:auto}.arena-help{font-size:.84rem;line-height:1.5;color:#bdc7c0;padding:12px 0}.touch-controls{display:none;align-items:center;justify-content:space-between;padding:10px 8px 0;gap:15px}.pad,#fire{touch-action:none;border:1px solid #66746b;border-radius:50%;display:grid;place-items:center;width:58px;height:58px;background:#2c3b3c;font-size:.8rem}
@media(min-width:1400px){main{max-width:1170px}.heading{min-height:164px}.board-panel{padding:0 20px}}
@media(max-width:850px){.top-inner{padding:0 24px;gap:27px}main{padding:0 18px 20px}.war-layout{grid-template-columns:minmax(0,1fr) 225px;gap:12px}.heading{min-height:127px}.board-panel{padding:0 8px}.info-card,.turn-card{padding:15px}.realm-seal{width:33px}.roster{grid-template-columns:repeat(3,1fr)}}@media(max-width:680px){.top-inner{padding:0 13px;height:59px;gap:14px}.brand{font-size:20px;letter-spacing:2px;gap:6px}.brand img{width:28px}.top-actions{gap:3px}.gold-button{padding:8px 10px}.top-actions .gold-button{font-size:.77rem}.top-actions .gold-button i{width:14px;height:14px}.nav-link{font-size:.76rem}nav{gap:12px}.icon-button{width:27px}.landscape{top:59px;height:255px}main{padding:0 11px 16px}.heading{min-height:113px}.kicker{font-size:.60rem}.mode-tag{font-size:.72rem;padding:6px 9px}.war-layout{display:block}.board-coords{max-width:100%;grid-template-columns:14px minmax(0,1fr)}aside{grid-template-columns:1fr 1fr;gap:10px}.turn-card{grid-column:1/-1}.turn-row{margin-top:6px}.legend{gap:14px;font-size:.7rem}.history{grid-column:1/-1}.guide-rules{grid-template-columns:1fr;gap:8px}.roster{grid-template-columns:1fr 1fr}.focus-body{gap:6px;flex-wrap:wrap}.focus-body img{width:55px;height:55px}.guide-panel{padding:16px}.section-label{font-size:.66rem}}
@media(max-width:410px){.brand span{font-size:17px}nav{gap:7px}.top-inner{gap:8px}.mode-tag i{display:none}.top-actions .gold-button i{display:none}.legend{gap:9px}.info-card{padding:11px}.heading h1{font-size:2.35rem}}
@media(pointer:coarse){.touch-controls{display:flex}}@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
#board{position:relative}.cell.in-transit img{visibility:hidden}
.traveler{position:absolute;top:0;left:0;width:calc(100% / 9);height:calc(100% / 9);z-index:5;pointer-events:none;display:grid;place-items:center}
.traveler img{width:92%;height:92%;object-fit:contain;filter:drop-shadow(0 2px 1px #151014b3);transform-origin:50% 85%}
.traveler.fly:before{content:"";position:absolute;left:24%;right:24%;bottom:12%;height:17%;border-radius:50%;background:#0c171863;filter:blur(2px)}
.cell img.sheet-pose{object-fit:cover;object-position:0 50%;image-rendering:pixelated}
.travel-pose{display:block;width:96%;height:96%;background-repeat:no-repeat;background-position:0 50%;image-rendering:pixelated;filter:drop-shadow(0 2px 1px #15101488)}
@media(max-width:410px){.top-inner{gap:7px;padding:0 8px}.brand span{font-size:16px}.brand img{width:24px}.brand{gap:3px}.nav-link{font-size:.7rem;white-space:nowrap}.top-actions .gold-button{font-size:.7rem;white-space:nowrap;padding:8px}.top-actions .icon-button{width:23px}}

