/* Battle UI: resources, selection and outcome have distinct places. */
body { font-family: 'Yu Gothic UI','Meiryo',sans-serif; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; }
.hidden { display:none !important; }
#topbar{padding:3px 0 6px;margin-bottom:6px;}#topbar button{font-size:12px;padding:5px 8px;}
button:focus-visible, summary:focus-visible { outline: 3px solid #a8edff; outline-offset: 3px; }
#app { max-width: 1580px; }
.gamehead { font-size: 11px; margin: 2px 0 5px; }
.battle-overview { display:grid;grid-template-columns:1fr 1fr 1fr;gap:24px;align-items:center;margin-bottom:8px; }
.health { display:grid;grid-template-columns:1fr auto;align-items:center;gap:3px 8px; }
.health>span { color:#80e2de;font-weight:700; }.health.foe>span{color:#ffaca5;}
.health strong{font-size:22px;}.health small{font-size:12px;color:#aebbd1;}
.health progress{grid-column:1/-1;width:100%;height:5px;accent-color:#69d9cc;}.health.foe progress{accent-color:#ff8078;}
.match-clock{text-align:center;display:grid;gap:2px;font-size:12px;}.match-clock b{font-size:16px;}.match-clock small{color:#aebbd1;font-size:10px;}
.resource-bar{display:flex;gap:12px;background:#111c2b;border:1px solid #30455b;border-radius:8px;padding:10px 14px;margin-bottom:10px;}
.resource{display:flex;flex-direction:column;justify-content:center;min-width:144px;gap:2px;}.resource>span{font-size:12px;color:#b4c5d8;}.resource strong{font-size:24px;line-height:1.1;}.resource strong small{font-size:12px;color:#b4c5d8;}.resource>small{font-size:10px;color:#afbed0;}.resource progress{width:110px;height:4px;accent-color:#61cfff;}.energy strong{color:#8cddff;}.material strong{color:#f5d893;}
.mana-resources{flex:1;border-left:1px solid #30455b;padding-left:18px;}.mana-caption{display:flex;align-items:center;gap:12px;font-size:12px;margin-bottom:5px;}.mana-caption>span{color:#aebed2;font-size:11px;}.mana-row{display:flex;gap:8px;}.mana-cell{flex:1;position:relative;display:flex;align-items:baseline;justify-content:center;gap:7px;border-bottom:3px solid var(--mana);background:#1b2939;border-radius:4px;padding:5px;color:var(--mana);}.mana-cell>span{font-size:12px;}.mana-cell strong{font-size:25px;line-height:1.1;}.mana-cell small{font-size:10px;color:#c1cede;}.mana-cell .mana-gain{position:absolute;right:2px;top:-12px;color:#b4ffd5;font-size:11px;font-weight:bold;background:#183c30;}
#screen-game .gamegrid{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:12px;align-items:stretch;}
#screen-game #stageWrap{position:static;min-width:0;padding:0;display:flex;align-items:center;justify-content:center;background:#060c17;border:1px solid #30455b;border-radius:7px;overflow:hidden;}
.board-column{min-width:0;}.board-notice{font-size:12px;padding:7px 10px;background:#142131;color:#bcd3e9;border-radius:0 0 5px 5px;min-height:30px;box-sizing:border-box;}
#screen-game #sidePanel{width:auto;min-width:0;max-height:360px;display:flex;gap:7px;padding:12px;background:#172337;border:1px solid #46617c;border-radius:8px;overflow:auto;box-sizing:border-box;}
#cardInspector{flex:1;}#cardInspector h2{font-size:20px;line-height:1.35;margin:4px 0 10px;color:#f5f8ff;}.selection-type{color:#95b4d0;font-size:11px;}.payment{display:flex;flex-wrap:wrap;align-items:center;gap:5px;font-size:11px;margin-bottom:12px;}.payment>span{color:#aabed1;margin-right:4px;}.payment b{background:#263c53;border-radius:4px;padding:4px 6px;}.effect-copy b,.price-copy b{font-size:11px;color:#8fdec9;}.effect-copy p,.price-copy p{font-size:13px;line-height:1.65;margin:4px 0 10px;}.price-copy{border-left:3px solid #ff937d;padding-left:9px;}.price-copy b{color:#ffb199;}.combo-copy{font-size:11px;color:#b8c9db;margin:8px 0;}.use-status{font-size:12px;padding:7px;border-radius:4px;font-weight:700;}.available{color:#a4f2cc;background:#133f34;}.waiting{color:#ffe0a5;background:#493c23;}.resolution-note{font-size:11px;line-height:1.6;color:#a9bfd5;margin:8px 0 0;}.target-summary{font-size:11px;margin:9px 0 4px;color:#c0d3e6;}.target-choices{display:flex;gap:4px;flex-wrap:wrap;max-height:90px;overflow:auto;}.target-choices button{font-size:11px;padding:4px 6px;}.target-choices .selected{border-color:#77e7df;background:#265052;}
.card-actions{display:flex;gap:6px;position:sticky;bottom:0;background:#172337;padding-top:5px;}.card-actions button{font-size:12px;min-height:40px;flex:1;padding:7px 4px;border-radius:5px;}.card-actions .primary{background:#a2efcf;color:#102d28;border-color:#a2efcf;font-weight:800;}.card-actions .primary:disabled{background:#283a4a;color:#9daebc;border-color:#3c5166;}.action-feedback{font-size:12px;line-height:1.5;color:#ffe0a5;}.action-feedback:empty{display:none;}.empty-selection{padding:10px 8px;}.empty-selection p{font-size:13px;line-height:1.8;color:#bacddd;}.step-number{display:inline-grid;place-items:center;background:#294c5b;color:#a9f6e9;border-radius:50%;width:30px;height:30px;font-size:17px;font-weight:800;}
.hand-tray{margin:12px 0 10px;background:#101c2e;border:1px solid #344b65;border-radius:8px;padding:10px 12px;}.hand-heading{display:flex;gap:18px;align-items:center;margin-bottom:8px;}.hand-heading h2{font-size:15px;margin:0;white-space:nowrap;}.hand-heading h2 span{color:#88cfc4;margin-left:6px;font-size:13px;}#drawInfo{color:#c1cddd;font-size:12px;}.hand-help{margin-left:auto;color:#a8bad0;font-size:11px;}
#screen-game .hand{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;overflow:visible;max-height:none;padding:0;}
#screen-game .card{display:flex;flex-direction:column;gap:3px;position:relative;min-height:160px;padding:28px 9px 9px;border:1px solid #415670;border-top:3px solid var(--fc);border-radius:6px;background:#1b2a40;text-align:left;opacity:1;transition:background .12s,border-color .12s;}
#screen-game .card:hover{background:#263c55;border-color:#9bd4e0;}#screen-game .card.selected{outline:2px solid #a6f4d8;outline-offset:1px;background:#203f47;}#screen-game .card.disabled{opacity:1;background:#172235;color:#c2cbd8;}#screen-game .card.armed{box-shadow:inset 0 -3px #e2c680;}
#screen-game .card .key{top:6px;left:8px;font-size:10px;border:1px solid #62798e;border-radius:3px;width:15px;height:15px;text-align:center;line-height:15px;color:#c7d5e3;}
#screen-game .card .cost{top:5px;right:6px;gap:4px;font-size:10px;display:flex;}#screen-game .card .cost b{background:none;padding:0;}#screen-game .card .cost .ce{color:#92d8f8;}#screen-game .card .cost .cs{color:#e9d39d;}
#screen-game .card .cname{font-size:14px;line-height:1.35;color:#ecf3ff;min-height:19px;}#screen-game .card .cmana{color:#d7caa0;font-size:11px;min-height:15px;}#screen-game .card .cdescription{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:11px;line-height:1.55;margin:0 0 3px;color:#b9c9dc;min-height:34px;}
#screen-game .card .crequirement{display:block;font-size:10px;line-height:1.35;margin-top:auto;color:#a2efcd;font-weight:600;}#screen-game .card.disabled .crequirement{color:#f1ce96;}#screen-game .card .ctag{font-size:9px;margin:1px 0 0;color:#8fa5be;}#screen-game .card .tmark,#screen-game .card .chint{display:none;}#screen-game .card .cplan{position:static;color:#f5de9e;font-size:10px;background:none;padding:0;}#screen-game .card .ccd{display:none;}
.hand-footer{display:flex;justify-content:space-between;gap:12px;font-size:10px;color:#94aac1;margin-top:9px;}
.battle-bottom{display:grid;grid-template-columns:minmax(0,1fr) 270px;gap:12px;}#effectsPanel{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;align-items:start;}.effect-group{border:1px solid #2f435a;border-radius:6px;background:#111d2c;padding:10px;}.effect-group h3{font-size:12px;color:#bed9ec;margin:0 0 8px;}.effect-group .muted{font-size:11px;color:#829ab3;line-height:1.6;}.effect-row{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px;border-left:2px solid #7cc5b5;background:#1c2c40;padding:7px;margin:5px 0;font-size:11px;}.effect-row b{font-weight:600;}.effect-row small{display:block;width:100%;font-size:10px;line-height:1.5;color:#b7c9dd;}.effect-row>span{color:#a1d4df;}.effect-row.pending{border-color:#d9bd77;}.effect-row.danger{border-color:#fa917f;}.history-item{font-size:11px;line-height:1.5;padding:5px 0;border-bottom:1px solid #2a3c50;}.history-item>span{color:#8cd9c2;}.history-item>small{display:block;color:#7f98b2;font-size:10px;}.battle-tools .ult{width:100%;margin:0 0 8px;}.battle-tools .log{max-height:100px;overflow:auto;font-size:11px;}.battle-details{margin-top:12px;border:1px solid #2f435a;padding:10px;border-radius:6px;font-size:12px;}.battle-details>summary{cursor:pointer;color:#aabfd3;}.battle-details #meter{font-size:11px;margin:10px;}.battle-details .arcana-panel{margin-top:10px;}
@media(min-width:1440px){#screen-game #sidePanel{max-height:430px;}#screen-game .card{min-height:170px;}}
@media(max-width:1000px){#screen-game .gamegrid{grid-template-columns:minmax(0,1fr) 300px;}#screen-game .hand{grid-template-columns:repeat(4,minmax(0,1fr));}.resource{min-width:100px;}.mana-caption>span{font-size:10px;}.mana-cell{gap:3px;}.mana-cell small{font-size:9px;}.resource-bar{gap:8px;padding:8px;}.mana-resources{padding-left:8px;}.hand-help{display:none;}}
@media(max-width:720px){#app{padding:8px;}#screen-game .gamegrid{grid-template-columns:1fr;}#screen-game #sidePanel{max-height:none;}.battle-overview{gap:10px;}.health strong{font-size:18px;}.match-clock b{font-size:13px;}.match-clock small{display:none;}.resource-bar{flex-wrap:wrap;}.resource{flex:1;min-width:0;}.mana-resources{flex-basis:100%;padding:6px 0 0;border-left:0;border-top:1px solid #30455b;}.mana-cell{gap:5px;}.mana-cell strong{font-size:22px;}.mana-caption>span{font-size:9px;}.hand-heading{gap:10px;}#drawInfo{font-size:11px;}#screen-game .hand{grid-template-columns:repeat(2,minmax(0,1fr));}.hand-footer{flex-direction:column;gap:4px;}.battle-bottom{grid-template-columns:1fr;}#effectsPanel{grid-template-columns:1fr;}.gamehead .deckinfo{display:none;}.empty-selection{padding:0;}.empty-selection p{margin:3px 0;font-size:12px;}.empty-selection br{display:none;}.empty-selection .step-number{display:none;}.card-actions{position:static;}}
/* Keep controls outside the scrolling rules text. */
#screen-game #sidePanel{overflow:hidden;}
#screen-game #cardInspector{min-height:0;flex:1 1 auto;overflow-y:auto;padding-right:5px;}
#screen-game .card-actions{position:static;flex-shrink:0;}
#screen-game .card .ctag{position:static;left:auto;bottom:auto;}
#screen-game .hand{margin:0;}
.resource-bar{padding:7px 12px;}.resource strong{font-size:22px;}.mana-cell{padding:3px 5px;}
#screen-game .card{min-height:142px;}
@media(max-width:720px){#screen-game #cardInspector{overflow:visible;}#topbar{flex-wrap:wrap;gap:8px;}#topbar h1{font-size:17px;}.mana-caption{gap:7px;}}
.payment-after{font-size:11px;color:#b9cede;line-height:1.6;margin:-5px 0 10px}.payment-after small{display:block;color:#8fa7bc;font-size:10px}
#screen-game #stageWrap{position:relative;}
.quick-effects{position:absolute;left:12px;top:12px;bottom:12px;width:calc((100% - var(--canvas-width))/2 - 24px);overflow-y:auto;font-size:11px;line-height:1.5;color:#aabed2;}
.quick-effects>b{display:block;color:#82d4c2;font-size:11px;margin:3px 0 7px;}.quick-effects p{margin:4px 0 9px;}.quick-effects .quick-danger{color:#ffc3a9;}.quick-effects .quick-result{border-left:2px solid #7acdbd;padding-left:7px;}.quick-effects small{font-size:10px;}
@media(max-width:1100px){.quick-effects{display:none;}}
@media(max-width:720px){#topbar .topActions{width:100%;gap:4px;}#topbar .topActions button{font-size:10px;padding:5px;white-space:nowrap;flex:1;}.mana-cell{display:grid;grid-template-columns:auto auto;gap:2px;text-align:center;}.mana-cell small{grid-column:1/-1;white-space:nowrap;}.mana-cell .mana-gain{display:block;}.health{grid-template-columns:auto auto;}.health>span{white-space:nowrap;font-size:11px;}.match-clock{font-size:10px;}}
#screen-game #stageWrap{top:auto;}
.board-notice{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:8px 9px;}
.pulse-item{min-width:0;display:flex;align-items:baseline;gap:6px;border-left:2px solid #7abcb6;padding-left:7px;white-space:nowrap;overflow:hidden;}
.pulse-item:first-child{border-color:#f0bf77;}.pulse-item:last-child{border-color:#8eabf2;}
.pulse-item span{font-size:11px;color:#b1c5dc;flex:none;}.pulse-item strong{font-size:12px;color:#e7f2ff;overflow:hidden;text-overflow:ellipsis;font-weight:650;}
.mana-caption .mana-source{font-size:10px;font-style:normal;color:#a5f3cb;margin-left:auto;white-space:nowrap;}
.history-item.receipt{background:#213648;border-left:2px solid #8fe8cb;padding:6px;}.history-item.receipt>b{color:#f0f6fe;}
@media(max-width:720px){.board-notice{grid-template-columns:1fr;gap:5px;padding:7px 9px;}.pulse-item{display:grid;grid-template-columns:110px minmax(0,1fr);align-items:start;white-space:normal;overflow:visible;min-height:16px;}.pulse-item span{white-space:nowrap;}.pulse-item strong{overflow:visible;text-overflow:clip;white-space:normal;line-height:1.35;}.mana-caption{flex-wrap:wrap;}.mana-caption .mana-source{margin-left:0;flex-basis:100%;}}
