/* The original 720 × 1280 arcade layout owns combat UI and scaling. */
#cb-market-hud[hidden] { display: none; }
#cb-market-hud { position: absolute; inset: 0; z-index: 35; pointer-events: none; font-family: 'Space Mono', monospace; color: #fff; }
.cb-screen-reader { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.cb-market-round #game-container #combat-screen #balance-track-bg { left: 45px; top: calc(945px + var(--cb-arena-extra, 0px) - var(--cb-picker-lift, 0px)); width: 630px; height: 18px; }
.cb-market-round #game-container #combat-screen #balance-label { left: 45px; top: calc(980px + var(--cb-arena-extra, 0px) - var(--cb-picker-lift, 0px)); width: 630px; font-size: 24px; }
.cb-parry-panel { position: absolute; left: 202.5px; top: calc(887px + var(--cb-arena-extra, 0px) - var(--cb-picker-lift, 0px)); width: 315px; text-align: center; }
#cb-parry-label { font-size: 18px; line-height: 20px; color: #00f0ff; text-shadow: 0 0 8px #00f0ff66; }
#cb-parry-detail { font-size: 12px; line-height: 14px; color: #c5d8df; }
.cb-parry-track { position: relative; height: 9px; width: 100%; background: #1e293bcc; border: 1px solid #334155; margin-top: 5px; overflow: hidden; border-radius: 3px; }
.cb-parry-track::after { content: ''; position: absolute; left: 50%; height: 100%; border-left: 1px solid white; }
#cb-parry-fill { position: absolute; height: 100%; transition: width .15s, left .15s; }
.cb-market-controls { position: absolute; top: calc(1035px + var(--cb-arena-extra, 0px)); left: 45px; width: 630px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; pointer-events: auto; }
.cb-market-controls .action-btn { width: 100%; height: 132px; min-width: 0; padding: 4px; flex-direction: column; color: inherit; touch-action: manipulation; }
.cb-market-controls .action-btn-green { color: #00ff41; }
.cb-market-controls .action-btn-cyan { color: #00f0ff; }
.cb-market-controls button[aria-pressed="true"] { border-color: #ffcc00; color: #ffcc00; box-shadow: 0 0 18px #ffcc0066; }
.cb-market-controls button:disabled { opacity: .55; cursor: wait; }
.cb-market-controls button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
/* Move buttons: a round icon badge whose ring sweeps with the 1-second price tick (full = a new price just arrived). */
.cb-market-controls .action-btn { --cb-btn-bg: #0b1b25; justify-content: center; gap: 4px; padding: 6px 4px 6px; overflow: hidden; box-sizing: border-box; }   /* the game's button skin (cyber-controls.css) draws the surface and edge */
.cb-ring { position: relative; flex: none; width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(currentColor calc(var(--tick, 1) * 360deg), rgba(255,255,255,.13) 0); transition: transform .12s; }
.cb-ring::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: radial-gradient(circle at 50% 30%, color-mix(in srgb, currentColor 24%, #0b1b25), #07121a 78%); box-shadow: inset 0 0 14px color-mix(in srgb, currentColor 30%, transparent); }
.cb-move-icon { position: relative; z-index: 1; width: 46px; height: 46px; filter: drop-shadow(0 0 5px color-mix(in srgb, currentColor 60%, transparent)); }
.cb-market-controls .cb-move-icon svg { width: 100%; height: 100%; display: block; }
.cb-market-controls.cb-pending .cb-ring { animation: cb-ring-pending .6s ease-in-out infinite alternate; }
@keyframes cb-ring-pending { from { filter: brightness(1); } to { filter: brightness(1.5) drop-shadow(0 0 6px currentColor); } }
.cb-market-controls .cb-strike .cb-ring { animation: cb-ring-pop .32s ease-out; }
@keyframes cb-ring-pop { 0% { transform: scale(1.18); } 100% { transform: scale(1); } }
.cb-market-controls .cb-locked { filter: saturate(.55) brightness(.8); }
.cb-market-controls .cb-locked .cb-ring { background: conic-gradient(rgba(255,255,255,.35) calc(var(--tick, 1) * 360deg), rgba(255,255,255,.1) 0); }
.cb-ripple-wrap { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.cb-ripple { position: absolute; left: var(--rx, 50%); top: var(--ry, 50%); width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: currentColor; opacity: 0; transform: scale(0); }
.cb-ripple.go { animation: cb-ripple .55s ease-out; }
@keyframes cb-ripple { 0% { opacity: .5; transform: scale(0); } 100% { opacity: 0; transform: scale(26); } }
/* The button you pressed stays lit until the next price resolves it; the others step back. (The game's button skin owns
   the surface, so the edge/fill are changed through its own ::before/::after layers with matching priority.) */
html body #combat-screen #cb-market-hud .cb-market-controls button.cb-chosen::before { opacity: 1; }
html body #combat-screen #cb-market-hud .cb-market-controls button.cb-chosen::after { background: color-mix(in srgb, currentColor 28%, #0b1b25); }
.cb-market-controls button.cb-chosen, .cb-market-controls button.cb-chosen:disabled { opacity: 1; filter: drop-shadow(0 0 9px currentColor) brightness(1.15); }
.cb-market-controls .cb-chosen .cb-ring { background: conic-gradient(currentColor calc(var(--tick, 1) * 360deg), rgba(255,255,255,.2) 0); }
.cb-market-controls .cb-chosen .cb-ring::before { background: radial-gradient(circle at 50% 30%, color-mix(in srgb, currentColor 60%, #0b1b25), color-mix(in srgb, currentColor 28%, #07121a) 82%); }
.cb-market-controls .cb-chosen .cb-move-name, .cb-market-controls .cb-chosen .cb-move-state { color: #fff; }
.cb-market-controls.cb-has-choice button:not(.cb-chosen):disabled { opacity: .4; }
@media (prefers-reduced-motion: reduce) { .cb-ripple.go, .cb-market-controls.cb-pending .cb-ring, .cb-market-controls .cb-strike .cb-ring { animation: none; } }
.cb-move-name { font-size: 16px; line-height: 18px; text-align: center; font-weight: 800; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cb-move-state { font-size: 12px; line-height: 14px; text-align: center; margin-top: 0; font-weight: 700; opacity: .88; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cb-move-state[hidden], .cb-move-state:empty { display: none !important; }
.cb-market-controls kbd { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); font: bold 18px 'Space Mono', monospace; background: #030712; padding: 1px 8px; border: 1px solid currentColor; border-radius: 5px; }
#cb-quick-status:empty { display: none !important; }
#cb-quick-status { position: absolute; top: calc(1170px + var(--cb-arena-extra, 0px)); left: 45px; width: 630px; text-align: center; font-size: 13px; line-height: 16px; color: #a8c4cc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#cb-open-trades:empty { display: none !important; }
.cb-parry-panel[hidden] { display: none !important; }
#cb-flow { position:absolute;top:calc(840px + var(--cb-arena-extra, 0px) - var(--cb-picker-lift, 0px));left:45px;width:630px;display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:19px;line-height:25px;color:#b7d6d1; }
#cb-tick-wrap { display:flex;align-items:center;gap:10px; }
.cb-tick-gauge { position:relative;width:26px;height:26px;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0; }
.cb-tick-svg { position:absolute;transform:rotate(-90deg);width:26px;height:26px; }
.cb-tick-bg { fill:none;stroke:rgba(255,255,255,0.18);stroke-width:2.5; }
.cb-tick-circle { fill:none;stroke:#00f0ff;stroke-width:2.5;stroke-linecap:round;stroke-dasharray:81.68;stroke-dashoffset:0;transition:stroke-dashoffset .05s linear; }
#cb-tick-sec { position:absolute;font-size:8px;line-height:8px;color:#00f0ff;font-family:'Space Mono',monospace;font-weight:bold; }
#cb-flow.has-pending-orders .cb-tick-circle { stroke:#00ff41;filter:drop-shadow(0 0 6px #00ff41); }
#cb-flow.has-pending-orders #cb-tick-sec { color:#00ff41; }
#cb-flow.has-pending-orders #cb-open-trades { color:#00ff41;font-weight:bold;animation:cb-pending-pulse .6s infinite alternate; }
@keyframes cb-pending-pulse { from { opacity:.85;text-shadow:0 0 4px rgba(0,255,65,0.4); } to { opacity:1;text-shadow:0 0 12px rgba(0,255,65,0.9); } }
#cb-streak { color:#ffdc6b; }.cb-streak-hot { text-shadow:0 0 14px #ffcc00; }
.cb-market-controls .cb-recovering { background-image:linear-gradient(#ffe06618,#ffe06618); }
.cb-market-controls .cb-queued { outline:2px solid #ffcc00;outline-offset:2px; }
.cb-market-controls .cb-strike { animation:cb-button-strike .24s ease-out; }
@keyframes cb-button-strike { from { box-shadow:0 0 28px currentColor;background-color:#ffffff35;transform:translateY(2px); } to { transform:translateY(0); } }
@media(prefers-reduced-motion:reduce){.cb-market-controls .cb-strike{animation:none}}
.cb-market-round #cb-combat-hud, .cb-market-round #cb-live-run-hud, .cb-market-round #tutorial-callout { display: none !important; }
.cb-market-round #combat-screen #pause-btn { display: block !important; }
.cb-market-round .cb-practice { bottom: 190px; max-height: calc(100dvh - 270px); }
/* Four inline choices: no backdrop, modal, focus trap or blocked combat controls. */
#cb-parry-chooser[hidden] { display: none; }
#cb-parry-chooser { position: absolute; left: 45px; top: calc(915px + var(--cb-arena-extra, 0px)); width: 630px; height: 100px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; pointer-events: auto; }
#cb-parry-chooser button { min-width: 0; border: 2px solid #00ff41; border-radius: 6px; background: #071c13; color: #00ff41; font: bold 30px 'Space Mono', monospace; cursor: pointer; touch-action: manipulation; box-shadow: 0 0 12px #00ff4133; }
#cb-parry-chooser[data-direction="sell"] button { border-color: #ff6475; color: #ff8895; background: #220c15; box-shadow: 0 0 12px #ff647533; }
#cb-parry-chooser button:active { filter: brightness(1.5); }
#cb-parry-chooser button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
#combat-screen:has(#cb-parry-chooser:not([hidden])) { --cb-picker-lift: 125px; }
#tutorial-modal .modal-content { max-height: calc(100dvh - 32px); overflow: hidden; }
#tutorial-modal .modal-content > div:nth-child(2) { min-height: 0; flex: 1 1 auto; overflow-y: auto; }
#tutorial-modal .modal-header, #tutorial-dots, #tutorial-modal .modal-content > div:last-child { flex-shrink: 0; }
#tutorial-next-btn, #tutorial-prev-btn { min-height: 44px; }

#cb-market-hud #cb-move-cue,
.cb-rookie-controls #cb-market-hud #cb-move-cue { display:none !important; }
.cb-rookie-controls .cb-move-name { font-size:18px; line-height:20px; }
.cb-rookie-controls .cb-move-state { font-size:13px; line-height:15px; }
.cb-rookie-controls.cb-rookie-power .cb-move-name { font-size:16px; line-height:18px; }

/* Liquidation Danger Zone at <= -70% margin */
@keyframes cbDangerPulse {
  0%, 100% { box-shadow: inset 0 0 30px rgba(255, 0, 50, 0.7), inset 0 0 80px rgba(255, 0, 50, 0.35); }
  50% { box-shadow: inset 0 0 65px rgba(255, 0, 50, 0.95), inset 0 0 130px rgba(255, 0, 50, 0.55); }
}
.cb-danger-zone #combat-viewport {
  animation: cbDangerPulse 0.85s infinite ease-in-out !important;
  border: 3px solid #ff0033 !important;
}
.cb-danger-zone #cb-quick-status {
  color: #ff3366 !important;
  font-weight: bold;
  animation: cb-pending-pulse .5s infinite alternate;
}

/* Punch and Kick only until the player unlocks power or parry moves in the shop. */
body:not(.cb-has-power) #cb-market-hud [data-move^="SUPER"],
body:not(.cb-has-parry) #cb-market-hud [data-move^="PARRY"],
body:not(.cb-has-parry) .cb-parry-panel,
body:not(.cb-has-parry) #cb-parry-chooser { display: none !important; }
.cb-progress-strip { min-height: 18px; margin: 8px 0 0; font: 700 15px/1.3 'Space Mono', monospace; color: #7fe9ff; text-align: center; }
.cb-progress-strip:empty { display: none; }
.cb-next-hook { margin: 6px 0 0; color: #ffe18b; font-weight: 700; }
