/* Elementum v0.5.0: charged-element turn system */
.opponent-overview,.player-overview{position:relative}.reserve-zone{display:flex;align-items:center;gap:.55rem;min-width:0;padding:.35rem .55rem;border:1px solid rgba(208,171,93,.3);background:linear-gradient(90deg,rgba(9,11,18,.86),rgba(30,23,22,.72));box-shadow:inset 0 0 18px rgba(0,0,0,.5);border-radius:7px}.reserve-zone>span{font:700 .64rem/1 Cinzel,serif;letter-spacing:.12em;text-transform:uppercase;color:#d9bf82;white-space:nowrap}.reserve-runes{display:flex;gap:.3rem;min-height:36px;align-items:center;flex-wrap:wrap}.reserve-empty{margin:0;color:#8f887d;font-size:.68rem;font-style:italic}.reserve-rune{width:42px;height:42px;padding:2px;border-radius:50%;border:1px solid color-mix(in srgb,var(--card-color,#b99b62) 65%,#fff 10%);background:radial-gradient(circle,rgba(32,34,45,.96),rgba(5,7,12,.98));box-shadow:inset 0 0 12px color-mix(in srgb,var(--card-color,#b99b62) 35%,transparent),0 2px 8px #0008;color:#eee;cursor:pointer}.reserve-rune small{display:block;max-width:36px;overflow:hidden;text-overflow:ellipsis;font-size:.46rem;color:#c9c2b5}.reserve-rune.selected{outline:2px solid #f2cf76;outline-offset:2px;filter:brightness(1.35)}.reserve-rune:disabled{cursor:default;opacity:.82}.reserve-player{grid-column:2;margin:0 auto .35rem;max-width:min(780px,72vw)}.player-overview .hand-section{grid-column:2}.player-overview>.player-zone{grid-row:1/3}.reserve-opponent{position:absolute;left:50%;bottom:-3px;transform:translate(-50%,100%);z-index:6;max-width:60vw}.instability-head{display:flex;justify-content:space-between;align-items:end;gap:.5rem;width:100%;margin-bottom:.25rem}.instability-head span{font:700 .65rem Cinzel,serif;text-transform:uppercase;letter-spacing:.1em}.instability-head small{font-size:.55rem;color:#a89c89}.instability-row{display:grid;grid-template-columns:repeat(5,1fr);gap:.25rem;width:100%}.instability-item{display:grid;grid-template-columns:auto auto;gap:0 .25rem;align-items:center;padding:.2rem;border:1px solid #ffffff17;border-radius:4px;background:#05070c88}.instability-item b{font-size:.72rem}.instability-item i{grid-column:1/-1;display:block;height:3px;background:#ffffff13}.instability-item i span{display:block;height:100%;background:var(--card-color,#b99b62);box-shadow:0 0 6px var(--card-color,#b99b62)}
.market-cards{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:.7rem!important;overflow:visible!important}.market-slot{position:relative;display:grid;grid-template-columns:minmax(0,1fr);justify-items:center;padding-top:1.4rem}.market-cost{position:absolute;top:0;left:50%;transform:translateX(-50%);z-index:3;display:flex;align-items:center;gap:.35rem;padding:.18rem .55rem;border-radius:999px;background:#160f0c;border:1px solid #d6ae61;color:#f0d593;white-space:nowrap;box-shadow:0 2px 8px #000}.market-cost b{font-size:.76rem}.market-cost span{font-size:.55rem;text-transform:uppercase;letter-spacing:.08em}.market-slot .card{width:min(100%,145px)}
.turn-actions{display:grid!important;grid-template-columns:repeat(5,minmax(86px,1fr));gap:.45rem;width:min(760px,95%)}.turn-action,.study-choice{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;min-height:58px;padding:.55rem .65rem;border:1px solid #9e7b4599;border-radius:6px;background:linear-gradient(#28221d,#17130f);color:#eee;text-align:left;cursor:pointer;box-shadow:inset 0 1px #ffffff12,0 3px 9px #0007}.turn-action strong,.study-choice b{font:700 .72rem Cinzel,serif;color:#f1d493}.turn-action small,.study-choice span{font-size:.56rem;color:#bcb4a8;margin-top:.15rem}.turn-action:disabled{opacity:.35;cursor:not-allowed}.mode-head{display:flex;align-items:center;gap:.75rem;justify-content:center;margin-bottom:.5rem}.mode-head strong{font:700 .8rem Cinzel,serif;color:#ead197}#mode-options{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:.45rem;max-width:720px;margin:auto}#mode-options>p{width:100%;margin:.15rem;color:#c6beb0;font-size:.7rem}.study-choice{min-width:170px}.study-choice.selected{border-color:#f2cf76;box-shadow:inset 0 0 12px #d5a94733,0 0 10px #d5a94733}.cast-preview{display:flex;align-items:center;justify-content:center;gap:.8rem}.cast-preview>p{font:700 .72rem Cinzel,serif;color:#d8c08b}.cast-preview .card{width:112px}.turn-resolved,.cpu-thinking{color:#c8b990;font:700 .75rem Cinzel,serif}.cpu-thinking i{display:inline-block;width:9px;height:9px;margin-right:.45rem;border:2px solid #9d7b46;border-top-color:transparent;border-radius:50%;animation:v050-spin .8s linear infinite}@keyframes v050-spin{to{transform:rotate(1turn)}}
.card .card-elements{margin:.22rem 0 0;text-align:center}.card .card-elements .element-symbol{font-size:.72rem}.card-compact .card-copy p.upper{font-size:.52rem}.card-copy .upper b{color:#e5c980}.player-zone,.player-overview .player-own{display:grid;grid-template-columns:72px minmax(0,1fr);gap:.65rem;padding:.45rem;border:1px solid rgba(208,171,93,.2);border-radius:7px;background:linear-gradient(90deg,rgba(8,10,16,.88),rgba(25,18,17,.72));overflow:hidden}.player-zone .mage-portrait{width:72px;height:72px}.player-copy{display:flex;align-items:flex-start;gap:.45rem;min-width:0}.player-copy>.mage-name{display:block;flex:0 0 auto;max-width:72px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transform:none}.player-stats{display:flex;flex:1;gap:.35rem;margin-top:.35rem;min-width:0}.player-stats>span{min-width:0;flex:1}.player-stats .stat{grid-template-columns:minmax(0,1fr) auto}.player-stats .stat small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.player-stats .stat b{margin-left:0}.opponent-hand{margin-left:auto}
@media(min-width:1200px) and (min-height:680px){
  /* Keep the compact desktop hand at a readable 5:7 size. The reserve belongs
     under the mage plaque, not above the hand where it steals card height. */
  .player-overview>.player-zone{grid-column:1;grid-row:1}
  .player-overview>.reserve-player{grid-column:1;grid-row:2;width:100%;max-width:none;margin:0}
  .player-overview>.hand-section{grid-column:2;grid-row:1/3}
}
@media(max-width:1100px){.turn-actions{grid-template-columns:repeat(3,minmax(90px,1fr))}.reserve-opponent{max-width:50vw}.reserve-zone>span{display:none}}
@media(max-width:800px){.reserve-opponent{position:static;transform:none;max-width:none;margin:.25rem auto}.reserve-player{max-width:none;margin:.25rem 0}.reserve-runes{flex-wrap:nowrap;overflow-x:auto}.reserve-rune{flex:0 0 38px;width:38px;height:38px}.turn-actions{grid-template-columns:repeat(2,minmax(0,1fr));width:100%}.turn-action{min-height:52px}.market-cards{grid-template-columns:repeat(2,minmax(120px,1fr))!important}.market-slot .card{width:132px}.instability-head small{display:none}.instability-item{padding:.12rem}.instability-item .element-symbol{font-size:.65rem}.cast-preview .card{width:94px}}
@media(max-width:480px){.market-cards{grid-template-columns:1fr!important}.market-slot .card{width:145px}.turn-actions{gap:.3rem}.turn-action{padding:.45rem}.player-stats>span{min-width:70px}.reserve-zone{padding:.25rem}.study-choice{min-width:145px}}
