:root{color-scheme:dark;font-family:"Segoe UI","Microsoft JhengHei",sans-serif;background:#131716;color:#f0ecdf}
*{box-sizing:border-box}
body{margin:0;min-width:320px;min-height:100vh;background:radial-gradient(ellipse at 50% 16%,#758b7530,transparent 48%),radial-gradient(ellipse at 82% 72%,#b99a5720,transparent 38%),#131716}
.shell{width:min(760px,calc(100% - 32px));margin:0 auto;padding:28px 0 40px}
.topbar{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:18px}
.eyebrow{margin:0 0 4px;color:#d7b875;font-size:12px;font-weight:700;letter-spacing:.16em}
.topbar h1{margin:0;font-family:"Noto Serif TC","Microsoft JhengHei",serif;font-size:34px}
.sub,.muted{color:#aeb4a8;line-height:1.6}.sub{margin:6px 0 0;font-size:13px}
.topbar nav{display:flex;gap:14px;flex-wrap:wrap;padding-top:8px}
.topbar a,.bottom-actions a{color:#e3c77f;text-decoration:none;font-size:13px;font-weight:700}
.topbar a:hover,.bottom-actions a:hover{text-decoration:underline}
[hidden]{display:none!important}
button:focus-visible,a:focus-visible{outline:2px solid #e3c77f;outline-offset:3px}
.panel{padding:14px;border:1px solid #aeb9ad38;border-radius:12px;background:#d7e5d408;box-shadow:0 8px 24px #0002}
.panel h2{margin:0 0 8px;font-size:18px}
.muted{margin:0 0 12px;font-size:13px}
.roster{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.role{display:grid;grid-template-columns:38px minmax(0,1fr);align-items:center;gap:8px;min-width:0;padding:9px;border:1px solid #42483f;border-radius:10px;background:linear-gradient(145deg,#232923,#191e1b);color:#f0ecdf;text-align:left;font:inherit;cursor:pointer;transition:border-color .16s,background .16s,transform .16s}
.role:hover{transform:translateY(-2px);border-color:#9a8254}
.role[aria-pressed=true]{border-color:#d7b875;background:linear-gradient(145deg,#38372c,#232923);box-shadow:inset 0 0 0 1px #d7b87530}
.role b{display:block;overflow:hidden;font-size:14px;text-overflow:ellipsis;white-space:nowrap}
.role small{display:block;margin-top:3px;color:#b5b8af;font-size:10px;white-space:nowrap}
.role-icon{display:grid;width:38px;height:38px;place-items:center;border:1px solid #d7b87577;border-radius:50%;background:#d7b87514;color:#e3c77f;font-size:19px}
.setup-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:13px;color:#b5b8af;font-size:13px}
button{min-height:42px;padding:9px 18px;border:1px solid #d7b875;border-radius:999px;background:linear-gradient(145deg,#d7b875,#b99755);color:#171a18;font:inherit;font-weight:700;cursor:pointer;transition:filter .16s,transform .16s,opacity .16s}
button:hover:not(:disabled){transform:translateY(-1px);filter:brightness(1.08)}
button:disabled{cursor:not-allowed;opacity:.45}
.secondary{border-color:#596254;background:#252b25;color:#e9e4d7}
.floorbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.floorbar h2{margin:0;font-size:23px}
.enemy-label{display:flex;align-items:center;gap:10px}
.enemy-label>span{color:#e3c77f;font-size:30px}
.enemy-label strong{font-size:14px}
.enemy-label small{display:block;margin-top:3px;color:#aeb4a8;font-size:11px}
.status-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:10px}
.status{padding:11px 12px}
.status-head{display:flex;justify-content:space-between;gap:8px;margin-bottom:7px;font-size:13px;font-weight:700}
.status-head span:last-child{color:#c4c8bd;font-variant-numeric:tabular-nums}
.bar{height:7px;overflow:hidden;border-radius:999px;background:#ffffff19}
.bar i{display:block;width:100%;height:100%;border-radius:inherit;background:linear-gradient(90deg,#8cae77,#c0d98a);transition:width .25s}
.bar.enemy i{background:linear-gradient(90deg,#bd6258,#e38b72)}
.status p{margin:7px 0 0;color:#aeb4a8;font-size:11px;line-height:1.5}
.status .skill-state{color:#e3c77f}
.battle{margin-top:10px}
.battle-head{display:flex;align-items:center;justify-content:space-between;gap:14px}
.battle-head h2{margin:0;font-size:18px}
.battle-head>p{max-width:62%;margin:0;color:#c7c9bd;font-size:13px;line-height:1.5;text-align:right}
.dice-row{display:flex;align-items:center;gap:7px;margin:12px 0}
.dice-row>div{display:grid;justify-items:center;gap:4px;min-width:70px;padding:7px 9px;border:1px solid #e3c77f99;border-radius:10px;background:linear-gradient(145deg,#f0ecdf,#d5c9a8);color:#252923;box-shadow:0 5px 14px #0005,inset 0 1px 2px #fff9}
.dice-row small{font-size:10px;font-weight:700}
.dice-row strong{font-size:23px;line-height:1;font-variant-numeric:tabular-nums}
.dice-row button{margin-left:auto}
.board{display:grid;grid-template-columns:repeat(15,minmax(0,1fr));gap:2px;width:min(100%,560px);aspect-ratio:1;margin:12px auto;padding:clamp(14px,3vw,24px);border:1px solid #aeb9ad38;border-radius:16px;background:#d7e5d408;box-shadow:0 18px 50px #0006,inset 0 1px 0 #ffffff12}
.cell{display:grid;min-width:0;min-height:0;place-items:center;border:1px solid #b9c9bd26;border-radius:3px;background:#dce8df08;color:#f0ecdf;font-size:clamp(9px,2vw,17px)}
.cell.player{border-color:#dfc1848c;background:radial-gradient(circle at center,#d7b87535,transparent 70%),#d7b87512;box-shadow:inset 0 0 0 1px #d7b87555}
.cell.enemy{border-color:#f07d6899;background:radial-gradient(circle at center,#f07d6840,transparent 70%),#f07d6815}
.cell.in-range{box-shadow:inset 0 0 0 1px #d7b87580}
.controls{display:flex;align-items:center;justify-content:space-between;gap:12px}
.pad{display:grid;grid-template-columns:repeat(3,42px);grid-template-rows:repeat(2,38px);gap:4px}
.pad button{min-height:36px;padding:3px;border:1px solid #d7b87577;border-radius:8px;background:#252b25;color:#e3c77f;font-size:19px}
.pad button:hover:not(:disabled){background:#39372b}
.pad-mid{display:grid;place-items:center;color:#aeb4a8;font-size:10px;font-weight:700}
.actions{display:flex;gap:8px}
.bottom-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:13px}
.bottom-actions a{margin-left:auto}
.bottom-actions button{min-width:150px}
@media(max-width:560px){.shell{width:calc(100% - 24px);padding-top:20px}.topbar{display:block}.topbar nav{margin-top:12px;padding:0}.roster{grid-template-columns:repeat(2,minmax(0,1fr))}.battle-head{display:block}.battle-head>p{max-width:none;margin-top:7px;text-align:left}.dice-row{gap:5px}.dice-row>div{min-width:56px;padding:7px 5px}.dice-row button{padding:9px 13px}.board{padding:14px}.controls{align-items:flex-end}.actions{flex-direction:column}.actions button{min-width:108px}.status-grid{gap:6px}.status{padding:10px}.status-head{font-size:12px}.floorbar{padding:12px}.floorbar h2{font-size:21px}}

.skill-panel{margin-top:10px}.skill-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.skill-heading h2{margin:0;font-size:17px}.skill-cooldown{color:#e3c77f;font-size:12px;font-weight:700;white-space:nowrap}.skill-panel .muted{margin:9px 0 12px}.skill-controls{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.skill-controls label{color:#aeb4a8;font-size:12px}.skill-controls select{min-height:40px;max-width:100%;padding:7px 10px;border:1px solid #596254;border-radius:8px;background:#202620;color:#f0ecdf;font:inherit}@media(max-width:560px){.skill-heading{align-items:flex-start}.skill-controls select{flex:1;min-width:0}}


/* 與雙人戰鬥介面同步的青綠淺色主題 */
:root{color-scheme:light;background:#f2faf7;color:#23413b}
body{background:radial-gradient(ellipse at 12% 8%,#c9eee466,transparent 38%),radial-gradient(ellipse at 92% 18%,#d7edff77,transparent 34%),#f2faf7;color:#23413b}
h1,.panel h2,.battle-head h2,.floorbar h2{color:#23413b}
.eyebrow{color:#278778}
.sub,.muted,.setup-foot,.status p{color:#70877f}
.topbar a,.bottom-actions a{color:#248374}
button:focus-visible,a:focus-visible{outline-color:#238b7b}
.panel{border-color:#d4e6df;background:#ffffffd9;box-shadow:0 8px 24px #477f6b12}
.role{border-color:#d3e6df;background:linear-gradient(145deg,#fff,#f3faf7);color:#294941;box-shadow:0 3px 12px #477f6b12}
.role:hover{border-color:#80c4b1}
.role[aria-pressed=true]{border-color:#48a994;background:linear-gradient(145deg,#e8f8f2,#dff3ed);box-shadow:inset 0 0 0 1px #48a99424}
.role small{color:#70877f}
.role-icon{border-color:#90cdbb;background:#e5f6ef;color:#238b7b}
button{border-color:#238b7b;background:linear-gradient(145deg,#45b39d,#278b7c);color:#fff;box-shadow:0 4px 10px #258a781f}
button:hover:not(:disabled){filter:brightness(1.04)}
.secondary{border-color:#afd3c7;background:#fff;color:#278778;box-shadow:none}
.floorbar .enemy-label>span{color:#278778}
.enemy-label small{color:#70877f}
.status-head span:last-child{color:#536e65}
.bar{background:#e4eee9}
.bar i{background:linear-gradient(90deg,#43ae91,#8bd1a5)}
.bar.enemy i{background:linear-gradient(90deg,#e98578,#f3aa89)}
.status .skill-state,.skill-cooldown{color:#278778}
.battle-head>p{color:#60796f}
.dice-row>div{border-color:#b7d8ca;background:linear-gradient(145deg,#fff,#e9f5ef);color:#294941;box-shadow:0 4px 12px #477f6b1a,inset 0 1px 2px #fff}
.board{border-color:#bfdbcf;background:#dcece3;box-shadow:0 14px 34px #477f6b18}
.cell{border-color:#c8ded2;background:#f8fcf9;color:#294941}
.cell.player{border-color:#238b7b;background:radial-gradient(circle at center,#71b89b55,transparent 70%),#e5f6ef;box-shadow:inset 0 0 0 1px #238b7b55}
.cell.enemy{border-color:#e68172;background:radial-gradient(circle at center,#ef9b8a77,transparent 70%),#fbe5df}
.cell.in-range{box-shadow:inset 0 0 0 2px #9dc986;background:#e8f4dc}
.pad button{border-color:#55ab9580;background:#fff;color:#238b7b}
.pad button:hover:not(:disabled){border-color:#55ab95;background:#d9f3e8}
.pad button:active:not(:disabled){border-color:#238b7b;background:#a9dec9}
.pad button:disabled{border-color:#afd3c766;background:#f4faf7;color:#71877e;opacity:.58}
.pad-mid{color:#82988e}
.skill-panel{border-color:#c5e3d6;background:linear-gradient(120deg,#f1faf5,#f6fbff)}
.skill-cooldown{border:1px solid #b9ddce;border-radius:999px;background:#ffffffb8;padding:5px 9px}
.skill-controls label{color:#60796f}
.skill-controls select{border-color:#afd3c7;border-radius:9px;background:#fff;color:#294941}
@media(max-width:560px){.panel{padding:12px}}

/* 場景障礙物 */
.cell.obstacle-cell{font-size:clamp(9px,2vw,16px);font-weight:800}
.cell.obstacle-wall{background:#aeb8b5;border-color:#71827d;color:#334640}
.cell.obstacle-glass{background:#d8f3f7;border-color:#69b8c3;color:#287987}
.cell.obstacle-spike{background:#ffe8e3;border-color:#df8b7d;color:#a94e43}
.cell.obstacle-grass{background:#e3f5df;border-color:#86bd78;color:#397a3a}
.cell.obstacle-cell.attack-option{cursor:pointer;outline:2px solid #df8b45;outline-offset:-2px}

.cell{position:relative}
.facing-indicator{position:absolute;right:1px;bottom:0;z-index:2;padding:0 2px;border-radius:4px;background:#ffffffdf;color:#176b5e;font-size:10px;font-weight:900;line-height:1.1}

.cell{position:relative}
.facing-indicator{position:absolute;right:1px;bottom:0;z-index:2;padding:0 2px;border-radius:4px;background:#ffffffdf;color:#176b5e;font-size:10px;font-weight:900;line-height:1.1}
