/* A compact resting hand leaves the market on stage. Inspecting a card gets
   its own layer: no drag gesture, hover, or tiny embedded form is required. */
body[data-screen="game"] .battle-dock{padding-top:9px;background:linear-gradient(#162620f2,#0d1917);box-shadow:0 -14px 38px #06131255}
body[data-screen="game"] .fixed-strategies .strategy-deck-heading{min-height:24px;margin-top:1px}
body[data-screen="game"] .fixed-strategies .strategy-deck-heading p:not(.eyebrow){font-size:10px;color:#d1bf9b}
body[data-screen="game"] .strategy-hand .battle-card{cursor:pointer;touch-action:pan-x;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
body[data-screen="game"] .strategy-hand .battle-card:focus-visible{outline:3px solid #ffe39b;outline-offset:3px}
body[data-screen="game"] .strategy-hand .card-lock-reason{inset:auto 5px 5px;min-height:65px;max-height:116px;font-size:10px;padding:9px;justify-content:flex-start}
body[data-screen="game"] .strategy-hand .card-lock-reason::before{font-size:8px}
body[data-screen="game"] .strategy-hand .card-lock-reason small{font-size:9px}

/* Each grid cell is the exposed edge of a card; the card extends across the
   next cell. All nine choices remain in the viewport on desktop. */
@media(min-width:1000px){
 body[data-screen="game"] .battle-screen{--card-height:190px}
 body[data-screen="game"] .battle-dock{padding-inline:26px}
 body[data-screen="game"] .fixed-strategies .strategy-deck-heading{max-width:1320px;margin-inline:auto}
 body[data-screen="game"] .strategy-deck-nav{display:none}
 body[data-screen="game"] .strategy-hand{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));align-items:end;gap:0;width:100%;max-width:1360px;height:calc(var(--card-height) + 33px);padding:9px 31px 24px;margin:0 auto;overflow:visible;isolation:isolate;scroll-snap-type:none}
 body[data-screen="game"] .strategy-hand .battle-card{--fan-angle:0deg;--fan-drop:0px;position:relative;z-index:calc(var(--card-index) + 1);justify-self:center;flex:none;width:calc(100% + 43px);max-width:196px;height:var(--card-height);min-height:0;margin:0;translate:none;transform:translateY(var(--fan-drop)) rotate(var(--fan-angle));transform-origin:50% 100%;border:2px solid #bda275;border-radius:10px;box-shadow:-5px 1px 10px #06100d85,0 5px #05100b}
 body[data-screen="game"] .strategy-hand .battle-card:nth-child(1){--fan-angle:-5deg;--fan-drop:7px}
 body[data-screen="game"] .strategy-hand .battle-card:nth-child(2){--fan-angle:-3.7deg;--fan-drop:3px}
 body[data-screen="game"] .strategy-hand .battle-card:nth-child(3){--fan-angle:-2.5deg;--fan-drop:1px}
 body[data-screen="game"] .strategy-hand .battle-card:nth-child(4){--fan-angle:-1.2deg}
 body[data-screen="game"] .strategy-hand .battle-card:nth-child(6){--fan-angle:1.2deg}
 body[data-screen="game"] .strategy-hand .battle-card:nth-child(7){--fan-angle:2.5deg;--fan-drop:1px}
 body[data-screen="game"] .strategy-hand .battle-card:nth-child(8){--fan-angle:3.7deg;--fan-drop:3px}
 body[data-screen="game"] .strategy-hand .battle-card:nth-child(9){--fan-angle:5deg;--fan-drop:7px}
 body[data-screen="game"] .strategy-hand .battle-card .strategy-art{height:51px;min-height:51px;justify-content:flex-start;padding-left:27px}
 body[data-screen="game"] .strategy-hand .battle-card .strategy-glyph{height:56px;width:66px}
 body[data-screen="game"] .strategy-hand .battle-card .eyebrow{font-size:6.5px;letter-spacing:.15px;margin:7px 9px 4px;max-width:calc(100% - 53px);min-height:9px}
 body[data-screen="game"] .strategy-hand .battle-card .battle-card-name{font-size:19px;line-height:1.05;letter-spacing:-.4px;min-height:39px;margin:0 9px auto;max-width:calc(100% - 53px);overflow-wrap:normal}
 body[data-screen="game"] .strategy-hand .battle-card .battle-card-description{display:none}
 body[data-screen="game"] .strategy-hand .battle-card .battle-card-cost{font-size:8px;line-height:1.35;margin:6px 9px 6px;max-width:calc(100% - 50px);white-space:normal;min-height:22px;padding-top:5px}
 body[data-screen="game"] .strategy-hand .battle-card .card-link{font-size:8px;padding:5px 8px;min-height:26px;line-height:1.3}
 body[data-screen="game"] .strategy-hand .battle-card .card-lock-overlay{left:6px;right:auto;top:6px;width:22px;height:22px}
 body[data-screen="game"] .strategy-hand .battle-card.is-locked .battle-card-number{visibility:hidden}
 body[data-screen="game"] .strategy-hand .battle-card:hover:not(:disabled),body[data-screen="game"] .strategy-hand .battle-card:focus-visible{z-index:30;overflow:visible;translate:none;transform:translateY(-25px) rotate(0) scale(1.16);border-color:#ffe09c;box-shadow:0 0 0 1px #d9b570,0 17px 35px #000b}
 body[data-screen="game"] .strategy-hand .battle-card:is(:hover,:focus-visible) :is(.eyebrow,.battle-card-name,.battle-card-cost){max-width:none}
 body[data-screen="game"] .strategy-hand .battle-card:is(:hover,:focus-visible) .strategy-art{justify-content:center;padding-left:0}
 body[data-screen="game"] .strategy-hand .battle-card:is(:hover,:focus-visible) .battle-card-name{min-height:39px}
 body[data-screen="game"] .strategy-hand .battle-card .strategy-art{border-radius:8px 8px 0 0}
 body[data-screen="game"] .strategy-hand .battle-card .card-link{border-radius:0 0 8px 8px}
 body[data-screen="game"] .strategy-hand .battle-card .card-lock-reason{inset:4px auto auto calc(100% + 11px);width:190px;max-height:none;min-height:0;font-size:10px;line-height:1.5;padding:11px;box-shadow:0 5px 20px #0008}
 body[data-screen="game"] .strategy-hand .battle-card:nth-child(n+6) .card-lock-reason{left:auto;right:calc(100% + 11px)}
}
@media(min-width:1000px) and (max-height:820px){
 body[data-screen="game"] .battle-screen{--card-height:176px}
 body[data-screen="game"] .strategy-hand .battle-card .strategy-art{height:43px;min-height:43px}
 body[data-screen="game"] .strategy-hand .battle-card .strategy-glyph{height:49px;width:59px}
 body[data-screen="game"] .strategy-hand .battle-card .battle-card-name{font-size:18px;min-height:37px}
 body[data-screen="game"] .strategy-hand .battle-card .battle-card-cost{margin-top:4px;margin-bottom:4px}
}
@media(min-width:1000px) and (max-height:800px){
 body[data-screen="game"] .battle-screen .boss-hud{padding-top:8px}
 body[data-screen="game"] .battle-screen .boss-stage{padding-top:31px;padding-bottom:10px}
 body[data-screen="game"] .battle-screen .boss-title{font-size:32px;margin-top:4px;margin-bottom:3px}
 body[data-screen="game"] .battle-screen .boss-wallet{padding-block:6px}
 body[data-screen="game"] .battle-screen .chart-heading .market-price{font-size:22px}
}

/* A touch hand is a real, scrollable row. The partial next card and arrows
   signal more choices; activating any card opens the same full inspection. */
@media(max-width:999px){
 body[data-screen="game"] .battle-screen{--card-height:184px}
 body[data-screen="game"] .strategy-hand{display:flex;gap:11px;height:calc(var(--card-height) + 25px);padding:7px 5px 18px;margin:0 -5px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x proximity;scroll-padding-inline:5px;overscroll-behavior-x:contain}
 body[data-screen="game"] .strategy-hand .battle-card{flex:0 0 178px;width:178px;min-height:0;height:var(--card-height);margin:0;transform:none;translate:none;scroll-snap-align:start;border-width:2px;border-radius:10px}
 body[data-screen="game"] .strategy-hand .battle-card:hover:not(:disabled),body[data-screen="game"] .strategy-hand .battle-card:focus-visible{translate:none;transform:none}
 body[data-screen="game"] .strategy-hand .battle-card .strategy-art{height:48px;min-height:48px}
 body[data-screen="game"] .strategy-hand .battle-card .strategy-glyph{height:52px;width:64px}
 body[data-screen="game"] .strategy-hand .battle-card .eyebrow{font-size:7px;margin:7px 10px 4px}
 body[data-screen="game"] .strategy-hand .battle-card .battle-card-name{font-size:23px;min-height:25px;line-height:1.02;margin:0 10px auto}
 body[data-screen="game"] .strategy-hand .battle-card .battle-card-description{display:none}
 body[data-screen="game"] .strategy-hand .battle-card .battle-card-cost{font-size:10px;margin:6px 10px;padding-top:5px;white-space:normal}
 body[data-screen="game"] .strategy-hand .battle-card .card-link{font-size:9px;padding:7px 10px;min-height:29px}
 body[data-screen="game"] .strategy-hand .card-lock-reason{display:none}
 body[data-screen="game"] .strategy-deck-nav .button{width:44px;min-height:44px;padding:6px;font-size:14px}
 body[data-screen="game"] .fixed-strategies .strategy-deck-heading{min-height:44px}
}
@media(max-width:760px){
 body[data-screen="game"] .battle-dock{padding-bottom:env(safe-area-inset-bottom,0px)}
 body[data-screen="game"] .battle-primary-actions{grid-template-columns:minmax(0,1.6fr) repeat(3,minmax(0,.7fr));gap:5px}
 body[data-screen="game"] .battle-actionbar .button.primary{grid-column:auto;min-height:44px;padding:8px 7px;font-size:10px}
 body[data-screen="game"] .battle-actionbar .button{min-height:44px;padding:8px 5px}
 body[data-screen="game"] .battle-utilities .button{min-height:44px;font-size:9px}
 body[data-screen="game"] .battle-readout{font-size:9px;min-height:29px;padding-top:5px}
}

/* Card inspection is a theatrical overlay, with a stable close control and
   one bounded scroll surface so even long option forms remain reachable. */
body[data-screen="game"] .card-inspect-backdrop{padding:24px max(24px,env(safe-area-inset-right)) 24px max(24px,env(safe-area-inset-left));background:radial-gradient(ellipse at 37% 45%,#334234d9,#07100ef2 75%);backdrop-filter:blur(7px);overflow:hidden}
body[data-screen="game"] .card-inspect-modal{display:flex;flex-direction:column;width:min(1060px,100%);max-width:none;height:auto;max-height:calc(100dvh - 48px);margin:0;padding:0;overflow:hidden;border:0;border-radius:0;background:transparent;color:#f4e5c3;box-shadow:none}
.card-inspect-modal>.modal-heading{flex:0 0 auto;align-items:center;gap:18px;margin:0;padding:0 4px 18px;border:0;background:transparent}
.card-inspect-modal>.modal-heading h2{font:400 clamp(24px,3vw,35px)/1.15 Georgia,'Times New Roman',serif;color:#fff0cf;letter-spacing:-.5px}
.card-inspect-modal>.modal-heading .button{min-width:44px;min-height:44px;border:1px solid #dbc49288;background:#25372c;color:#fff0cf;box-shadow:none}
.card-inspect-modal>.modal-body{flex:1;min-height:0;padding:12px 13px 20px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-color:#a99060 #15231a;scrollbar-width:thin}
.card-inspect-layout{display:grid;grid-template-columns:minmax(245px,320px) minmax(0,1fr);gap:36px;align-items:start;padding:5px 4px 10px}
.inspect-card-preview{position:sticky;top:8px;padding:12px 9px 16px;filter:drop-shadow(0 15px 23px #0007)}
.inspect-card-preview>.battle-card{display:flex;flex-direction:column;position:relative;width:100%;min-width:0;min-height:430px;margin:0;padding:0;overflow:hidden;border:3px solid #d5b777;border-radius:17px;background:#f3e5c1;color:#23332a;text-align:left;transform:rotate(-3deg);transform-origin:center;box-shadow:0 0 0 4px #112319,0 7px #09160e;cursor:default;pointer-events:none}
.inspect-card-preview>.battle-card .strategy-art{position:relative;height:164px;min-height:164px;border-bottom:3px solid #293f2c;background:radial-gradient(ellipse at 50% 36%,#f6edc9,#a9c291);overflow:hidden}
.inspect-card-preview>.battle-card .strategy-glyph{width:182px;height:174px}
.inspect-card-preview>.battle-card .battle-card-number{top:11px;left:12px;width:32px;height:32px;font-size:12px;background:#fff0d0;border-color:#695d3c}
.inspect-card-preview>.battle-card .eyebrow{display:block;margin:20px 21px 8px;font:700 10px/1.4 ui-monospace,monospace;letter-spacing:1px;color:#785638}
.inspect-card-preview>.battle-card .battle-card-name{font:700 37px/1.03 Georgia,'Times New Roman',serif;letter-spacing:-1.2px;min-height:0;margin:0 21px 15px;color:#23362b}
.inspect-card-preview>.battle-card .battle-card-description{display:block;flex:1;font-size:14px;line-height:1.55;margin:0 21px 17px;color:#4e553b}
.inspect-card-preview>.battle-card .battle-card-cost{display:block;font:700 13px/1.5 ui-monospace,monospace;margin:0 21px 17px;padding-top:12px;border-color:#bdab7e;color:#263a2c;white-space:normal}
.inspect-card-preview>.battle-card .card-link{display:block;margin-top:auto;padding:12px 21px;min-height:44px;font-size:11px;line-height:1.5;background:#dfbe7b;border-top:1px solid #b79a60;color:#273b2c}
.inspect-card-preview>.battle-card .card-lock-overlay{top:12px;right:12px;width:33px;height:33px}
.inspect-card-preview>.battle-card .card-lock-reason{display:none}
.inspect-card-preview>.battle-card.is-locked{background:#d5d4c3;border-color:#97a086;filter:saturate(.6)}
.inspect-card-preview>.battle-card[data-strategy="call"] .strategy-art,.inspect-card-preview>.battle-card[data-strategy="bullcallspread"] .strategy-art{background:radial-gradient(ellipse at 50% 36%,#eee1ee,#b6a4cd)}
.inspect-card-preview>.battle-card[data-strategy="put"] .strategy-art,.inspect-card-preview>.battle-card[data-strategy="bearputspread"] .strategy-art{background:radial-gradient(ellipse at 50% 36%,#f8e2c6,#d89178)}
.inspect-card-preview>.battle-card[data-strategy="cash"] .strategy-art{background:radial-gradient(ellipse at 50% 36%,#fff0c0,#d8ad59)}
.inspect-card-preview>.battle-card[data-strategy="reduce"] .strategy-art{background:radial-gradient(ellipse at 50% 36%,#e1eeed,#9bbdba)}
.card-inspect-details{min-width:0;padding:27px 30px;border:1px solid #d4bd85;border-radius:14px;background:#f3ead3;color:#20332c;box-shadow:0 8px 30px #0004}
.card-inspect-details h3{font-family:Georgia,'Times New Roman',serif;line-height:1.2;font-size:25px}
.card-inspect-details>h3:first-child{margin-top:0}
.card-inspect-details p,.card-inspect-details label{font-size:14px;line-height:1.65}
.card-inspect-details .eyebrow{font-size:10px;color:#715636}
.card-inspect-details .small-note{font-size:12px;color:#526153}
.card-inspect-details :is(input:not([type="range"]):not([type="checkbox"]),select){min-height:44px;font-size:16px;max-width:100%}
.card-inspect-details .button{min-height:44px;white-space:normal}
.card-inspect-details form>.button[type="submit"]{width:100%;min-height:48px;margin-top:19px}
.card-inspect-details .button:focus-visible,.card-inspect-details input:focus-visible,.card-inspect-details select:focus-visible{outline:3px solid #995b24;outline-offset:3px}
.card-inspect-details .order-preview{background:#e4dec8}
.card-inspect-details .option-legs{overflow-wrap:anywhere;font-size:12px}
.card-inspect-details .allocation-shortcuts{flex-wrap:wrap}
.card-inspect-details .allocation-shortcuts .button{min-width:60px}

@media(max-width:760px){
 body[data-screen="game"] .card-inspect-backdrop{padding:max(12px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));background:linear-gradient(#10231bf2,#07100ef5)}
 body[data-screen="game"] .card-inspect-modal{height:calc(100dvh - 24px);max-height:calc(100dvh - 24px)}
 .card-inspect-modal>.modal-heading{padding:0 6px 10px;gap:10px}
 .card-inspect-modal>.modal-heading h2{font-size:25px}
 .card-inspect-modal>.modal-body{padding:9px 5px 22px}
 .card-inspect-layout{display:flex;flex-direction:column;gap:13px;padding:0;align-items:stretch}
 .inspect-card-preview{position:static;width:min(63vw,244px);align-self:center;padding:9px 8px 12px}
 .inspect-card-preview>.battle-card{min-height:300px;border-radius:13px;transform:rotate(-2deg)}
 .inspect-card-preview>.battle-card .strategy-art{height:94px;min-height:94px}
 .inspect-card-preview>.battle-card .strategy-glyph{width:116px;height:108px}
 .inspect-card-preview>.battle-card .eyebrow{font-size:8px;margin:12px 15px 6px;letter-spacing:.5px}
 .inspect-card-preview>.battle-card .battle-card-name{font-size:29px;margin:0 15px 10px;letter-spacing:-.6px}
 .inspect-card-preview>.battle-card .battle-card-description{font-size:11px;line-height:1.5;margin:0 15px 12px}
 .inspect-card-preview>.battle-card .battle-card-cost{font-size:11px;margin:0 15px 12px;padding-top:8px}
 .inspect-card-preview>.battle-card .card-link{font-size:9px;min-height:34px;padding:8px 15px}
 .inspect-card-preview>.battle-card .battle-card-number{top:7px;left:7px;width:27px;height:27px;font-size:10px}
 .inspect-card-preview>.battle-card .card-lock-overlay{top:7px;right:7px;width:27px;height:27px}
 .card-inspect-details{padding:20px 19px;border-radius:11px}
 .card-inspect-details h3{font-size:23px}
 .card-inspect-details p,.card-inspect-details label{font-size:13px}
 .card-inspect-details .order-preview{padding:13px}
 .card-inspect-details .order-preview p{gap:12px}
}
@media(max-height:650px){
 body[data-screen="game"] .battle-screen{overflow-y:auto;grid-template-rows:minmax(260px,1fr) auto}
 body[data-screen="game"] .card-inspect-backdrop{padding-top:10px;padding-bottom:10px}
 body[data-screen="game"] .card-inspect-modal{max-height:calc(100dvh - 20px)}
 .card-inspect-modal>.modal-heading{padding-bottom:8px}
 .card-inspect-modal>.modal-body{padding-top:7px}
 .inspect-card-preview{position:static}
}
@media(prefers-reduced-motion:reduce){
 body[data-screen="game"] .strategy-hand .battle-card,.card-inspect-modal *{transition:none!important;animation:none!important;scroll-behavior:auto!important}
}
body.motion-off .strategy-hand .battle-card,body.motion-off .card-inspect-modal *,body[data-speed="instant"] .strategy-hand .battle-card,body[data-speed="instant"] .card-inspect-modal *{transition:none!important;animation:none!important;scroll-behavior:auto!important}
