/* The board keeps its original renderer. Cards expose their purpose and price. */
.croles,.proles{display:flex;flex-wrap:wrap;gap:3px;margin:2px 0;}
.croles span,.proles span{color:var(--role);border:1px solid color-mix(in srgb,var(--role) 38%,transparent);background:#111e2c;border-radius:3px;padding:2px 4px;font-size:10px;line-height:1.3;}
#screen-game .card{min-height:210px;padding-bottom:10px;}
#screen-game .card .ctiming{font-size:10px;color:#d4dfeb;line-height:1.4;}
#screen-game .card .cdescription{-webkit-line-clamp:3;min-height:49px;font-size:11px;color:#d0dced;}
#screen-game .card .cprice{font-size:10px;color:#ffc0ad;border-left:2px solid #f08b72;padding-left:5px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;}
#screen-game .card .ccombo{font-size:10px;color:#e2d291;line-height:1.4;}
#screen-game .card .ctag{color:#9eafc4;}
#screen-game .card .crequirement{padding-top:4px;}
.hand-heading{flex-wrap:wrap;gap:8px 12px;}.hand-heading button{font-size:11px;min-height:32px;padding:5px 8px;}
#btnCycleMode[aria-pressed=true]{background:#5b4522;color:#ffe2a1;border-color:#efc770;}
#screen-game .cycle-mode .card{border-color:#dfbc72;background:#2b2b29;}
#screen-game .cycle-mode .card .crequirement{color:#ffe2a1;}
#screen-game .cycle-mode .card.cycle-blocked{border-color:#66717a;background:#202631;}
.tactical-desk{display:flex;gap:12px;align-items:center;margin:8px 0 0;padding:7px 10px;border:1px solid #354a5c;background:#111c29;border-radius:6px;min-height:40px;}
.queue-heading{display:grid;gap:3px;min-width:84px;}.queue-heading b{font-size:12px;color:#e6cf94;}.queue-heading small{font-size:10px;color:#a0b5c9;}
.queue-slots{display:flex;gap:8px;flex:1;min-width:0;}.queue-slots>p{font-size:11px;color:#b2c5d6;margin:0;line-height:1.6;}
.queue-card{display:flex;flex:1;min-width:0;border-left:2px solid #e6c67b;background:#1a2a3a;border-radius:3px;align-items:center;}
.queue-card>button{background:none;border:none;text-align:left;padding:5px 8px;min-width:0;flex:1;}
.queue-card b{display:block;font-size:11px;color:#f1e2bc;}.queue-card small{display:block;font-size:10px;color:#b3c8dc;margin-top:3px;}
.queue-card .queue-cancel{flex:0 0 auto;font-size:10px;color:#e9b9ac;text-decoration:underline;padding:8px;}
.strategy-search{display:flex;gap:12px;align-items:end;flex-wrap:wrap;padding:12px;margin-bottom:12px;background:#152437;border:1px solid #344d69;border-radius:6px;}
.strategy-search label{display:grid;gap:5px;font-size:12px;color:#bed3e5;}.strategy-search label:first-child{flex:1;min-width:180px;}
.strategy-search input,.strategy-search select{box-sizing:border-box;background:#0c1827;color:#f2f6fc;border:1px solid #516c85;border-radius:4px;padding:9px;font:inherit;min-height:38px;width:100%;}
#dbSearchCount{font-size:12px;color:#8fdaca;align-self:center;}.pool-empty{padding:25px;color:#bed1e3;grid-column:1/-1;}
.deck-strategy{background:#0c1928;border:1px solid #3d586e;border-radius:5px;padding:11px;font-size:12px;line-height:1.5;}
.strategy-note{font-size:11px;color:#a4b8cb;margin:7px 0;}.role-counts{display:grid;grid-template-columns:1fr 1fr;gap:4px;}
.role-counts>span{display:flex;justify-content:space-between;gap:8px;color:var(--role);border-left:2px solid var(--role);background:#192b3b;padding:4px 7px;font-size:11px;}
.strategy-subtitle{font-size:12px;color:#ead8a2;}.strategy-links{list-style:none;margin:5px 0;padding:0;}
.strategy-links li{border-bottom:1px solid #2b4052;padding:6px 0;font-size:11px;}.strategy-links small{display:block;color:#aac1d4;margin-top:3px;line-height:1.5;}
.strategy-tip{border-left:2px solid #d3af72;padding-left:7px;color:#e3cea9;font-size:11px;}
.strategy-goals{padding:2px 8px;background:#20372f;border-radius:4px;color:#b0e8c9;font-size:11px;}
.pcard{border-width:1px;border-top-width:3px;border-radius:5px;}.pcard .ptext{font-size:12px;line-height:1.7;color:#d2dfee;}.pcard .pprice{font-size:11px;color:#ffc4b1;border-left:2px solid #e7a088;padding-left:6px;margin:7px 0;line-height:1.6;}
.pcard .ptiming{font-size:11px;color:#b7c9df;}.pcard .padd{min-width:38px;min-height:32px;}
.inspector-close{display:none;}
#screen-game #sidePanel.expanded-inspector{position:fixed;z-index:30;right:18px;top:60px;width:min(420px,calc(100vw - 36px));height:min(640px,calc(100vh - 80px));max-height:calc(100vh - 80px)!important;box-shadow:0 14px 60px #000b;border:2px solid #8acbc1;}
#sidePanel.expanded-inspector .inspector-close{display:block;align-self:flex-end;flex:none;font-size:12px;padding:7px 10px;}
#screen-game #sidePanel.expanded-inspector #cardInspector{overflow:auto;min-height:80px;}
@media(max-width:1000px){.hand-help{display:block;flex-basis:100%;margin-left:0;}.queue-slots{flex-wrap:wrap;}.queue-card{flex-basis:45%;}.deckwrap{grid-template-columns:minmax(0,1fr) 300px;}}
@media(max-width:720px){.tactical-desk{align-items:start;flex-direction:column;gap:6px;}.queue-heading{display:flex;align-items:center;gap:12px;}.queue-slots{width:100%;}.queue-card{flex-basis:100%;}.deckwrap{grid-template-columns:1fr;}.deckwrap>.side{grid-row:1;}.strategy-search{align-items:stretch;}.strategy-search label{flex:1;}.hand-heading{gap:6px;}#screen-game .card{min-height:220px;}.hand-footer{font-size:11px;line-height:1.6;}}
@media(min-width:1001px) and (max-height:820px){
  #screen-game .gamehead{display:none;}.battle-overview{margin-bottom:5px;gap:15px;}.match-clock small{display:none;}.match-clock b{font-size:14px;}.health strong{font-size:18px;}.health>span{font-size:11px;}
  .resource-bar{padding:5px 10px;margin-bottom:7px;}.resource strong,.mana-cell strong{font-size:20px;}.mana-caption{margin-bottom:3px;}.mana-caption>span,.mana-caption .mana-source{display:none;}.resource>span{font-size:10px;}.resource>small{font-size:9px;}
  #screen-game .card{min-height:185px;gap:2px;}#screen-game .card .cdescription{-webkit-line-clamp:2;min-height:34px;}#screen-game .card .ctag{display:none;}#screen-game .card .cprice{-webkit-line-clamp:2;}#screen-game .card .crequirement{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
  .hand-tray{margin-top:8px;padding:8px 10px;}.hand-heading{margin-bottom:6px;}.hand-footer{margin-top:6px;}.tactical-desk{margin-top:6px;padding:5px 9px;}
  #screen-game #sidePanel:not(.expanded-inspector) .action-feedback{max-height:29px;overflow:auto;font-size:10px;line-height:1.4;}
  #screen-game #sidePanel:not(.expanded-inspector) #cardInspector h2{font-size:16px;margin:4px 0 6px;}
}

/* Pending declarations are live clocks, independent of the reserve desk. */
.cast-forecast{margin:10px 0;padding:12px;border:1px solid #3d556b;border-radius:10px;background:linear-gradient(120deg,#142538,#0c1726);color:#dce8ef}
.forecast-heading{display:flex;gap:15px;align-items:center;margin-bottom:8px}.forecast-heading b{color:#ebd3a1;letter-spacing:.12em}.forecast-heading span,.forecast-empty{font-size:11px;color:#a9becf}
.cast-intents{display:flex;gap:8px;overflow-x:auto;align-items:stretch}.cast-intent{min-width:220px;max-width:320px;padding:9px 11px;border:1px solid #457484;border-radius:6px;background:#102735;flex:0 0 auto}.cast-intent.enemy{border-color:#965c49;background:#302024}.cast-intent.focused{box-shadow:inset 0 0 0 1px #dfa779}.cast-intent>div{display:flex;justify-content:space-between;gap:14px;font-size:12px}.cast-intent strong{color:#f5d49d;white-space:nowrap}.cast-intent progress{width:100%;height:3px;accent-color:#e4b97a}.cast-intent small{display:block;font-size:11px;line-height:1.55;max-width:290px;max-height:3.1em;overflow:hidden;color:#becbd5}.cast-intent button{font-size:11px;margin-top:6px;padding:4px 8px}
.response-tray{display:flex;flex-wrap:wrap;align-items:center;gap:7px;margin-top:9px;border-top:1px solid #324c63;padding-top:9px}.response-tray>b{font-size:12px;color:#f1cd9b}.response-tray>span{font-size:10px;color:#b3c7d5}.response-tray button{font-size:12px;background:#1e3c46;border-color:#5d999c;padding:6px 10px}.response-tray button small{display:block;font-size:10px;opacity:.8}.response-tray button:disabled{opacity:.45}
@media(max-width:700px){.forecast-heading{align-items:flex-start;gap:6px;flex-direction:column}.cast-intent{min-width:190px}.cast-forecast{padding:9px}.response-tray button{font-size:11px}}

/* Keep hand slots still when casts enter/leave. Optional responses open upward. */
.cast-forecast{height:116px;box-sizing:border-box;position:relative;padding:8px 10px;overflow:visible}
.forecast-heading{height:15px;margin:0 0 5px}.forecast-heading b{font-size:12px}.forecast-heading span{font-size:10px}.cast-intents{height:80px}.cast-intent{padding:5px 8px;box-sizing:border-box;min-width:230px}.cast-intent small{white-space:nowrap;text-overflow:ellipsis;max-height:16px;line-height:1.35}.cast-intent button{font-size:10px;padding:2px 6px;margin-top:3px}.cast-intent>div{font-size:11px}.response-tray{display:none;position:absolute;bottom:calc(100% + 5px);left:0;right:0;z-index:20;background:#122b39;border:1px solid #7f9a9c;box-shadow:0 10px 30px #0008;border-radius:8px;padding:9px;max-height:110px;overflow:auto;margin:0;flex-wrap:nowrap}.response-tray.open{display:flex}
/* The forecast sits at the top of the board in battle: an upward tray lands under the header and
   is clipped by the panel. There it opens in place, and the panel grows to hold it. */
#screen-game .cast-forecast.answering{max-height:none;height:auto;overflow:visible}
#screen-game .cast-forecast .response-tray{position:static;width:auto;max-height:none;margin-top:6px;flex-wrap:wrap}
/* While a catalyst is chosen, its colour choice and instruction sit in the header rows, off the flask. */
:is(#screen-game,#tutorialBattle) .alchemy-panel .alchemy-colors:not([hidden]){top:7px;bottom:auto;left:92px;right:86px;padding:2px 4px;flex-wrap:nowrap;justify-content:center}
:is(#screen-game,#tutorialBattle) .alchemy-panel .alchemy-colors:not([hidden]) button{min-height:26px;padding:2px 6px}
:is(#screen-game,#tutorialBattle) .alchemy-panel.using-catalyst .cauldron-mode:not([hidden]){top:44px;bottom:auto}
@media(max-width:480px){:is(#screen-game,#tutorialBattle) .alchemy-panel .alchemy-colors:not([hidden]){left:8px;right:8px}}
@media(max-width:900px){#screen-game .cast-forecast:not(.answering){max-height:136px}}
/* A short panel has no row left for the catalyst control: it takes the empty corner beside the flask. */
@media(min-width:901px) and (max-height:820px){
#screen-game .alchemy-panel .flask-tool-slot{height:0;min-height:0}
#screen-game .alchemy-panel .flask-catalysts:not([open]){position:absolute;left:12px;bottom:36px;width:min(132px,calc(50% - 86px));height:auto;min-height:0}
}
/* Automatic intake is a status, not a control. */
:is(#screen-game,#tutorialBattle) .cauldron-next .auto-intake{border-color:transparent;padding-inline:0}
/* Touch has no Alt+click, so the switch to the card detail stays reachable on narrow screens. */
@media(max-width:900px){#screen-game .hand-heading #btnQuickMode{display:inline-block}}
/* The next-draw choice lasts only until the next draw, so it sits on the board. */
.forecast-scry{display:flex;flex-wrap:wrap;align-items:center;gap:5px;margin-bottom:5px}
.forecast-scry>b{font-size:11px;color:#f1cd9b}
.forecast-scry button{font-size:11px;padding:3px 7px;min-height:24px}
.forecast-scry button[aria-pressed=true]{background:#75532d;border-color:#f4d186}.response-tray>b{min-width:140px;max-width:200px}.response-tray>span{min-width:100px;max-width:140px}.response-tray button{flex-shrink:0;max-width:180px}.response-tray button small{white-space:normal}
@media(max-width:700px){.cast-forecast{height:132px}.forecast-heading{height:31px}.cast-intent{min-width:210px}.response-tray>b{min-width:100px;font-size:11px}}

.cast-intent{height:72px;display:grid;grid-template-columns:1fr auto;grid-template-rows:16px 4px 14px 18px;row-gap:1px;overflow:hidden;padding:5px 7px}.cast-intent>div,.cast-intent progress,.cast-intent>small{grid-column:1/-1}.cast-intent>div>b{max-width:195px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cast-intent progress{margin:0}.cast-intent>button{grid-column:2;grid-row:4;margin:0;padding:1px 5px;line-height:1.2;height:18px;white-space:nowrap;justify-self:end}

#screen-game .card .tmark{display:block;top:27px;bottom:auto;right:5px;z-index:2;font-size:9px;line-height:13px;padding:0 4px;background:#0b1725ed;border-radius:3px;pointer-events:none}
/* Forecasts share the board sidebar, so the hand never moves below them. */
#screen-game #sidePanel{overflow:visible}
#sidePanel .cast-forecast{width:100%;min-width:0;height:112px;margin:0;padding:6px;flex:0 0 112px}
#sidePanel .forecast-heading{height:19px;line-height:18px}
#sidePanel .forecast-heading>span{display:none}
#sidePanel .cast-intents{height:80px;min-width:0}
#sidePanel .cast-intent{min-width:100%;max-width:100%}
#sidePanel .cast-intent>div{gap:5px;font-size:10px}
#sidePanel .cast-intent>div>b{max-width:125px}
#sidePanel .forecast-empty{font-size:10px;line-height:1.6}
#sidePanel .response-tray{width:min(740px,90vw);left:auto;right:0;max-height:130px}
#screen-game #sidePanel:not(.expanded-inspector) .battle-casts{min-height:60px;flex:1 1 0;overflow:auto}
#sidePanel.expanded-inspector .cast-forecast{display:none}
@media(max-width:1000px){#sidePanel .cast-forecast{flex-basis:112px}.forecast-heading{flex-direction:row}.cast-forecast .forecast-heading{height:19px}}
