:root{font-family:Inter,system-ui,Arial,sans-serif;color:#f2f0e8;background:#0c0e13;font-synthesis:none}*{box-sizing:border-box}body{margin:0;background:radial-gradient(circle at 50% 0%,#28212b,#0c0e13 60%)}button{font:inherit;cursor:pointer}button:disabled{opacity:.38;cursor:not-allowed}.top{display:flex;align-items:center;justify-content:space-between;padding:16px 25px;border-bottom:1px solid #403d40;background:#121419}.brand{display:flex;align-items:center;gap:15px}.mark{font-size:21px;line-height:.85;font-weight:1000;font-style:italic;transform:rotate(-8deg);color:#f7f0e5;text-shadow:3px 3px #b12b1d}.brand h1{font-size:20px;margin:0;letter-spacing:1.5px}.brand small{font-size:10px;color:#f6ac51;vertical-align:middle}.brand p{margin:4px 0 0;font-size:11px;color:#a7a5a5;letter-spacing:2px}.chip,.tag{border:1px solid #78513b;padding:4px 8px;border-radius:4px;color:#ffba60;font-size:10px}.status{display:flex;align-items:center;gap:15px;color:#a9aab0;font-size:12px;font-weight:800}.turn{color:#ffbd67;background:#392219;padding:10px 13px;border-radius:5px}.shell{display:grid;grid-template-columns:245px minmax(500px,1fr) 240px;gap:14px;max-width:1800px;margin:auto;padding:16px}.panel{background:#181a21;border:1px solid #34343c;border-radius:12px;padding:16px;min-width:0}.panel h2,.battle h2{font-size:14px;letter-spacing:1.3px;margin:0 0 15px}.panel h3{color:#f4a75d;font-size:11px;letter-spacing:1.1px;margin:23px 0 11px}.score{display:grid;grid-template-columns:1fr 1fr;gap:8px}.score>div{background:#24242b;border:1px solid #42404a;border-radius:9px;padding:10px;text-align:center}.score small,.score span{display:block;color:#bbb4b0;font-size:10px}.score strong{display:block;font-size:34px;color:#ffd076}.score em{font-size:14px;color:#aaa;font-style:normal}.pips{display:flex;gap:7px}.pips span{height:11px;flex:1;border-radius:10px;background:#39343a}.pips .lit{background:linear-gradient(90deg,#ffad40,#e84923);box-shadow:0 0 9px #f4793970}.actions{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:14px}.actions button,.reset{background:#303039;color:#eee;border:1px solid #4e4b54;border-radius:6px;padding:11px 6px;font-size:11px;font-weight:800}.actions button:hover:not(:disabled),.reset:hover{background:#5b3931}.actions .primary{grid-column:span 2;background:linear-gradient(110deg,#bd3a24,#f17a2c);border-color:#ec713a}.toggle{display:flex;align-items:flex-start;gap:8px;font-size:11px;color:#ddd;margin:10px 0;line-height:1.4}.toggle input{accent-color:#ff8a32}.hint{font-size:11px;color:#9b9da6;line-height:1.7}.selected{border-top:1px solid #36343b;margin-top:17px}.selected img{width:65px;float:left;margin-right:9px;border-radius:5px}.selected b{font-size:12px}.selected p,.selected small{font-size:11px;color:#b6b6c0}.battle{min-width:0}.battle-head,.hand-head{display:flex;justify-content:space-between;align-items:center}.battle-head h2,.hand-head h2{margin:0}.battle-head p{font-size:11px;color:#aaa;margin:5px 0 12px}.board-wrap{position:relative;width:100%;aspect-ratio:1448/1086;border:2px solid #5e4340;border-radius:9px;overflow:hidden;box-shadow:0 12px 35px #0008}.board-image{width:100%;height:100%;display:block}.tile-grid{position:absolute;left:15.72%;top:13.95%;width:60.55%;height:71.87%;display:grid;grid-template-columns:repeat(8,1fr);grid-template-rows:repeat(6,1fr)}.tile{position:relative;cursor:pointer;border:1px solid transparent;min-width:0;min-height:0}.tile.valid{background:#ffcc3270;outline:2px solid #fff26c;outline-offset:-2px;z-index:2;animation:pulse 1.2s infinite alternate}@keyframes pulse{to{background:#ffd76e33}}.tile-name{position:absolute;left:3px;top:2px;font-size:clamp(7px,.75vw,12px);font-weight:900;color:#171115;text-shadow:0 1px #fff9;opacity:.7;pointer-events:none}.tile.gate .tile-name,.tile.utility .tile-name{color:white;text-shadow:0 1px #000}.piece{position:absolute;inset:3px;z-index:3;border:2px solid #409cf7;border-radius:5px;background:#101318;box-shadow:0 3px 10px #000b;overflow:hidden;cursor:grab}.piece.p2{border-color:#ff5d45}.piece img{width:100%;height:100%;object-fit:cover}.piece span{position:absolute;bottom:0;left:0;right:0;text-align:center;background:#111d;color:white;font-size:clamp(7px,.7vw,11px);font-weight:800}.piece b{position:absolute;right:1px;top:1px;background:#121212df;color:#fff;padding:2px;border-radius:3px;font-size:10px}.piece.ko{transform:rotate(90deg) scale(.85);filter:grayscale(.65);border-color:#ffdb59}.piece.vault-piece{border-color:#d6b14e;opacity:.9}.battle-foot{display:flex;justify-content:space-between;gap:10px;color:#a7a6aa;font-size:10px;margin:9px 0 18px}.hand-area{background:#181a21;border:1px solid #39373e;border-radius:10px;padding:14px}.hand-head{gap:10px}.hand-head h2 span{font-size:10px;color:#aaa}.hand-head>div{display:flex;gap:12px;color:#a9a7a8;font-size:10px}.hand{display:flex;gap:8px;overflow-x:auto;min-height:165px;padding:15px 3px 8px}.hand-card{flex:0 0 97px;border:2px solid transparent;background:#24242a;border-radius:7px;padding:4px;color:white;transition:transform .15s}.hand-card:hover,.hand-card.chosen{transform:translateY(-9px);border-color:#ffc16b}.hand-card img{width:100%;aspect-ratio:600/825;object-fit:contain;display:block}.hand-card span{display:block;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.empty{color:#888;font-size:13px}.phase-card{background:#2d2929;border:1px solid #634232;padding:12px;border-radius:8px}.phase-card>*{display:block;margin:5px 0}.phase-card small,.phase-card span{color:#b9a9a1;font-size:11px}.phase-card strong{color:#ffbe71;font-size:14px}.reset{width:100%;margin-top:10px}.duel{background:#22232a;padding:10px;border-radius:7px;font-size:12px;color:#c6c3c4}.duel p{font-size:11px}.duel strong{display:block;color:#ffbc72}.duel small{color:#999}.resource{display:flex;justify-content:space-between;gap:4px;font-size:10px;margin:8px 0;background:#25252d;padding:9px 6px;border-radius:5px}.log{height:310px;overflow:auto;background:#0e1116;border-radius:7px;padding:5px 10px}.log p{font-size:10px;line-height:1.5;color:#b9b9be;border-bottom:1px solid #292c32;padding-bottom:7px}footer{text-align:center;color:#777;font-size:11px;padding:18px}@media(max-width:1180px){.shell{grid-template-columns:210px minmax(400px,1fr)}.right{grid-column:1/-1}.log{height:150px}}@media(max-width:760px){.top{padding:12px;flex-wrap:wrap;gap:10px}.shell{display:flex;flex-direction:column;padding:8px}.left{order:2}.battle{order:1}.right{order:3}.status{font-size:10px}.board-wrap{border-width:1px}.tile-name{font-size:7px}.piece{inset:1px;border-width:1px}.piece span,.piece b{font-size:7px}.battle-foot{flex-wrap:wrap}.hand-card{flex-basis:80px}}

/* V1.1 gate scoring selection */
.gate-overlay{position:fixed;inset:0;z-index:1000;background:rgba(0,0,0,.78);display:flex;align-items:center;justify-content:center;padding:20px}.gate-dialog{max-width:780px;width:100%;max-height:90vh;overflow:auto;background:#17191f;color:#fff;border:2px solid #ffb42c;border-radius:16px;padding:24px;box-shadow:0 20px 70px #000}.gate-dialog h2{color:#ffbd3f;margin-top:0}.gate-choices{display:flex;gap:12px;flex-wrap:wrap;margin-top:20px}.gate-choice{width:130px;display:flex;flex-direction:column;gap:8px;align-items:center;padding:8px;background:#2b3038;border:1px solid #ffb42c;border-radius:10px;color:white;cursor:pointer}.gate-choice:hover{background:#534025}.gate-choice img{width:100%;height:145px;object-fit:contain}.gate-choice span{font-size:12px;text-align:center}

/* V1.2 interactive Quick Fix defense */
.defense-overlay{z-index:1000;background:rgba(0,0,0,.84)}
.defense-dialog{max-width:760px;max-height:90vh;overflow:auto}
.defense-choice{border:3px solid #39e47b!important;box-shadow:0 0 15px #39e47b77;background:#163d28!important;cursor:pointer}
.defense-choice.defense-picked{background:#23854b!important;box-shadow:0 0 0 3px #c8ffd8,0 0 25px #39e47b}
.defense-hint{color:#a9ffc6}.defense-buttons{display:flex;gap:12px;flex-wrap:wrap;margin-top:16px}.defense-buttons button,.no-defense button{padding:12px 16px;cursor:pointer}.defense-buttons button:disabled{opacity:.4;cursor:not-allowed}.no-defense{border:2px solid #e59b43;padding:16px;border-radius:12px}.no-defense strong{color:#ffd08a}
