@property --edge-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

:root {
  --bg: #0b0e11;
  --panel: #161a1e;
  --panel2: #1e2329;
  --border: #2b3139;
  --text: #eaecef;
  --muted: #848e9c;
  --yellow: #f0b90b;
  --green: #0ecb81;
  --red: #f6465d;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.4 "Segoe UI", Roboto, Arial, sans-serif; }
button { font: inherit; }

body::after {
  content: "";
  position: fixed;
  inset: 2px;
  z-index: 0;
  border: 1px solid transparent;
  pointer-events: none;
  background: linear-gradient(var(--bg), var(--bg)) padding-box,
    conic-gradient(from var(--edge-angle), transparent 0 66%, rgba(14, 203, 129, .85) 74%, rgba(240, 185, 11, .9) 81%, transparent 89%) border-box;
  animation: edgeOrbit 14s linear infinite;
}
body { position: relative; isolation: isolate; }
.topbar, .layout { position: relative; z-index: 1; }

.topbar { height: 62px; display: flex; align-items: center; gap: 18px; padding: 0 18px; background: var(--panel); border-bottom: 1px solid var(--border); }
.brand { display: flex; flex-direction: column; align-items: center; width: 116px; color: var(--yellow); letter-spacing: 1px; }
.brand-name { width: 100%; text-align: center; font-size: 20px; font-weight: 800; line-height: 1.05; }
.brand-credit { width: 100%; margin-top: 3px; color: var(--muted); font-size: 8px; font-weight: 500; letter-spacing: 0; line-height: 1; text-align: center; white-space: nowrap; transform: scaleX(.92); }
.status { display: flex; align-items: center; gap: 8px; margin-left: auto; color: var(--muted); font-size: 13px; }
.trend-banner { min-width: 260px; max-width: 570px; height: 50px; flex: 1 1 420px; display: flex; align-items: center; gap: 12px; padding: 3px 12px; overflow: hidden; border: 1px solid rgba(14,203,129,.28); border-radius: 9px; background: linear-gradient(100deg, rgba(14,203,129,.12), rgba(22,26,30,.96) 45%); transition: background .25s ease, border-color .25s ease, box-shadow .25s ease; }
.trend-banner[data-trend="declining"] { border-color: rgba(246,70,93,.7); background: linear-gradient(100deg, rgba(246,70,93,.44), rgba(91,20,32,.92) 42%, rgba(32,18,23,.98)); box-shadow: inset 0 0 18px rgba(246,70,93,.16), 0 0 10px rgba(246,70,93,.14); }
.robot-track { position: relative; align-self: stretch; width: 92px; flex: 0 0 92px; }
.robot-walkway { position: absolute; left: 0; right: 0; bottom: 4px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, rgba(100,217,255,.65), transparent); }
.trend-copy { z-index: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.trend-copy strong { overflow: hidden; color: #b6f5da; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.trend-copy span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.trend-banner[data-trend="declining"] .trend-copy strong,
.trend-banner[data-trend="declining"] .trend-copy span { color: #fff; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.live-dot.on { background: var(--green); animation: pulse 1.4s infinite; }
.scan-progress { appearance: none; width: 76px; height: 6px; flex: 0 0 76px; border: 0; border-radius: 5px; background: var(--border); }
.scan-progress::-webkit-progress-bar { border-radius: 5px; background: var(--border); }
.scan-progress::-webkit-progress-value { border-radius: 5px; background: var(--green); transition: width .2s ease; }
.scan-progress::-moz-progress-bar { border-radius: 5px; background: var(--green); }

.layout { display: flex; height: calc(100% - 62px); }
.sidebar { flex: 0 0 clamp(280px, 22vw, 360px); width: auto; min-width: 280px; display: flex; flex-direction: column; gap: 10px; padding: 10px; border-right: 1px solid var(--border); overflow-y: auto; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.panel h2 { margin: 0 0 8px; font-size: 15px; display: flex; flex-direction: column; }
.panel h2 small { font-size: 11px; color: var(--muted); font-weight: 400; }
.empty { color: var(--muted); font-size: 12px; padding: 6px 2px; }

#search { width: 100%; padding: 7px 10px; margin-bottom: 8px; background: var(--panel2); border: 1px solid var(--border); border-radius: 6px; color: var(--text); outline: none; }
#search:focus { border-color: var(--yellow); }

.coin-list { list-style: none; margin: 0; padding: 0; }
.list-panel { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.list-panel .coin-list { flex: 1; overflow-y: auto; }
.coin { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 18px; gap: 8px; align-items: center; padding: 7px 6px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; }
.coin:hover { background: var(--panel2); }
.coin.selected { background: var(--panel2); border-color: var(--yellow); }
.coin img { width: 28px; height: 28px; border-radius: 50%; background: var(--panel2); }
.coin .sym { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.coin .nm { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.coin-mini-chart { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px; margin-top: 3px; }
.coin-mini-status { color: var(--green); font-size: 9px; white-space: nowrap; }
.coin-mini-status::before { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 4px 1px 0; border-radius: 50%; background: var(--green); }
.coin-mini-status.error { color: var(--red); }
.coin-mini-status.error::before { background: var(--red); }
.coin-mini-status.stale { color: var(--yellow); }
.coin-mini-status.stale::before { background: var(--yellow); }
.coin-mini-chart svg { display: block; width: 100%; height: 24px; overflow: visible; }
.coin-mini-line { fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.coin-mini-line.up { stroke: var(--green); }
.coin-mini-line.down { stroke: var(--red); }
.coin-mini-placeholder { min-width: 0; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.coin .right { text-align: right; font-size: 12px; }
.coin .px { font-weight: 600; }
.up { color: var(--green); }
.down { color: var(--red); }
.bar { height: 3px; background: var(--border); border-radius: 2px; margin-top: 3px; width: 70px; margin-left: auto; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--yellow), var(--green)); }

/* Upward blinking arrow for rising coins */
.arrow { display: inline-block; color: var(--green); font-size: 16px; font-weight: 900; line-height: 1; text-shadow: 0 0 8px var(--green); animation: arrowUp 1s ease-in-out infinite; }
.best-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); animation: pulse 1s infinite; }
.rising-ball { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3a6, var(--yellow) 68%); box-shadow: 0 0 8px rgba(240, 185, 11, .9); animation: risingPulse 1.2s ease-in-out infinite; }
.chain { font-size: 9px; color: var(--muted); border: 1px solid var(--border); border-radius: 3px; padding: 0 3px; font-weight: 400; }
.new-tag { font-size: 9px; font-weight: 800; color: #000; background: #00e5ff; border-radius: 3px; padding: 0 4px; }

.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; color: var(--muted); font-size: 12px; }
.pager button, .controls button { background: var(--panel2); color: var(--text); border: 1px solid var(--border); border-radius: 5px; padding: 4px 10px; cursor: pointer; }
.pager button:disabled { opacity: .4; cursor: default; }
.pager button:hover:not(:disabled), .controls button:hover { border-color: var(--yellow); }

.main { flex: 1; display: flex; flex-direction: column; padding: 10px; min-width: 0; overflow-y: auto; }
.chart-header { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px 8px 0 0; padding: 10px 14px; }
.coin-title { display: flex; align-items: center; gap: 10px; }
.coin-title img { width: 34px; height: 34px; border-radius: 50%; }
.coin-title img:not([src]) { visibility: hidden; }
.sel-name { font-size: 18px; font-weight: 700; }
.sel-meta { color: var(--muted); font-size: 12px; }
.sel-price #selPrice { font-size: 18px; font-weight: 700; }
.controls { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.intervals { display: flex; gap: 2px; }
.intervals button.active { background: var(--yellow); color: #000; border-color: var(--yellow); }
.binance-link { background: var(--yellow); color: #000; text-decoration: none; font-weight: 700; padding: 5px 10px; border-radius: 5px; }

.legend { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; background: var(--panel); border-left: 1px solid var(--border); border-right: 1px solid var(--border); padding: 4px 14px; font-size: 12px; }
.legend span::before { content: ""; display: inline-block; width: 14px; height: 3px; margin-right: 5px; vertical-align: middle; border-radius: 2px; }
.l9::before { background: #00e5ff; } .l21::before { background: #f0b90b; } .l50::before { background: #c86bff; } .l100::before { background: #ff7a45; }
.lsig::before, .lmarkers::before { display: none !important; }
.lgrowth::before { background: #32e58c; }
.ball-mini { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); vertical-align: middle; }
.ball-mini.yellow { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.signal-info { margin-left: auto; color: var(--green); }
.signal-info::before { display: none !important; }

.chart-wrap { position: relative; flex-shrink: 0; height: 420px; min-height: 250px; background: var(--panel); border: 1px solid var(--border); border-top: none; }
.chart { position: absolute; inset: 0; z-index: 0; }
.overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.robot-guide { position: absolute; z-index: 2; left: 3px; bottom: 5px; width: 44px; height: 42px; animation: robotWalk 5s ease-in-out infinite alternate-reverse; }
.robot-antenna { position: absolute; left: 20px; top: -3px; width: 2px; height: 5px; background: #64d9ff; }
.robot-antenna::before { content: ""; position: absolute; top: -3px; left: -2px; width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 5px rgba(240,185,11,.8); }
.robot-head { position: absolute; left: 8px; top: 2px; width: 27px; height: 19px; border: 1px solid #63d8ca; border-radius: 9px 9px 7px 7px; background: linear-gradient(145deg, #287d7c 0 48%, #26343c 50%); box-shadow: inset 0 1px 3px rgba(255,255,255,.2), 0 0 7px rgba(99,216,202,.3); }
.watch-eye { position: absolute; top: 5px; display: grid; width: 8px; height: 7px; place-items: center; overflow: hidden; border: 1px solid rgba(240,248,255,.76); border-radius: 50%; background: #e8fff5; }
.robot-eye:first-child { left: 3px; }
.robot-eye:nth-child(2) { right: 3px; }
.eye-iris { position: relative; display: grid; width: 5px; height: 5px; place-items: center; border-radius: 50%; background: #0ecb81; transform: translate(var(--look-x, 0px), var(--look-y, 0px)); transition: transform .12s ease-out; }
.eye-pupil { width: 2px; height: 3px; border-radius: 50%; background: #07110e; box-shadow: 0 0 2px #000; }
.eye-glint { position: absolute; top: 1px; left: 1px; width: 1px; height: 1px; border-radius: 50%; background: #fff; }
.eye-lid { position: absolute; inset: 0; border-radius: inherit; background: #15252c; transform: scaleY(0); transform-origin: top; animation: eyeBlink 5.2s ease-in-out infinite; }
.robot-mouth { position: absolute; bottom: 2px; left: 10px; width: 6px; height: 1px; background: #64d9ff; }
.robot-torso { position: absolute; left: 14px; top: 21px; width: 15px; height: 12px; border: 1px solid #63c8bb; border-radius: 5px 5px 7px 7px; background: linear-gradient(145deg,#287d7c,#26343c); }
.robot-core { position: absolute; top: 4px; left: 5px; width: 4px; height: 4px; border: 1px solid #72ebbc; border-radius: 50%; background: var(--green); box-shadow: 0 0 4px rgba(14,203,129,.7); }
.robot-arm, .robot-leg { position: absolute; width: 4px; border-radius: 4px; border: 1px solid #63c8bb; background: #344a52; transform-origin: 50% 2px; }
.robot-arm { top: 22px; height: 12px; transform: none; }
.robot-arm-left { left: 11px; }
.robot-arm-right { left: 29px; }
.robot-hand { position: absolute; left: -2px; bottom: -4px; width: 6px; height: 5px; border: 1px solid #77e4d3; border-radius: 45% 45% 55% 55%; background: #344a52; }
.robot-leg { top: 31px; height: 8px; }
.robot-leg-left { left: 17px; }
.robot-leg-right { left: 24px; }
.robot-foot { position: absolute; left: -2px; bottom: -1px; width: 6px; height: 3px; border-radius: 3px 3px 2px 2px; background: #65bad4; }
.robot-guide[data-trend="declining"] .robot-head,
.robot-guide[data-trend="declining"] .robot-torso { border-color: #ff8291; }
.robot-guide[data-trend="declining"] .robot-core { background: var(--red); border-color: #ffb3bc; }
.robot-guide[data-trend="declining"] .robot-leg { animation-play-state: paused; }
.robot-leg-left { animation: robotStep .42s ease-in-out infinite alternate; }
.robot-leg-right { animation: robotStep .42s ease-in-out infinite alternate-reverse; }
.robot-guide[data-trend="declining"] { animation-play-state: paused; }
.graph-robot { position: absolute; z-index: 4; display: none; width: 36px; height: 44px; scale: 1.15; pointer-events: none; transform-origin: 50% 50%; }
.graph-robot.active { display: block; transition: left 1.4s cubic-bezier(.22,.72,.24,1), top 1.4s cubic-bezier(.22,.72,.24,1); }
.graph-robot[data-action="run"].active { animation: graphRun .48s ease-in-out infinite; }
.graph-robot[data-action="climb"].active { animation: graphClimb .72s ease-in-out infinite alternate; transform-origin: 50% 85%; }
.graph-robot[data-action="hang"].active { animation: graphHang 1.2s ease-in-out infinite alternate; transform-origin: 50% 5%; }
.graph-robot[data-action="swing"].active { animation: graphSwing 1.25s cubic-bezier(.45,.05,.55,.95) infinite alternate; transform-origin: 50% 0; }
.graph-robot[data-action="slide"].active { animation: graphSlide .9s ease-in-out infinite alternate; transform-origin: 50% 75%; }
.graph-robot[data-action="jump"].active { animation: graphLeap 1.1s cubic-bezier(.35,.05,.55,.95) infinite; transform-origin: 50% 90%; }
.graph-robot[data-action="point"].active { animation: graphPointBody .9s ease-in-out infinite alternate; }
.graph-robot[data-action="dance"].active { animation: graphDance .42s ease-in-out infinite alternate; }
.graph-robot[data-action="wave"].active { animation: graphWave .9s ease-in-out infinite alternate; }
.graph-robot-web { position: absolute; z-index: -1; top: -34px; left: 17px; height: 34px; border-left: 1px dashed rgba(216,244,255,.82); opacity: 0; transform-origin: 50% 100%; }
.graph-robot[data-action="climb"] .graph-robot-web,
.graph-robot[data-action="hang"] .graph-robot-web,
.graph-robot[data-action="swing"] .graph-robot-web { opacity: .8; }
.graph-robot[data-action="swing"] .graph-robot-web { animation: webTension 1.25s ease-in-out infinite alternate; }
.graph-robot-head { position: absolute; top: 0; left: 8px; width: 20px; height: 16px; border: 1px solid #63d8ca; border-radius: 6px 6px 8px 8px; background: linear-gradient(145deg,#287d7c 0 42%,#26343c 44% 100%); box-shadow: 0 0 8px rgba(99,216,202,.3); }
.graph-robot-head::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: 1px; height: 2px; border-top: 1px solid rgba(99,216,202,.55); border-radius: 50%; }
.graph-robot-eye { position: absolute; top: 5px; width: 4px; height: 4px; border: 1px solid #344d50; border-radius: 50%; background: #9cffe0; box-shadow: 0 0 4px #63d8ca; }
.graph-robot-eye:first-child { left: 3px; }
.graph-robot-eye:last-child { right: 3px; }
.graph-robot-body { position: absolute; top: 16px; left: 11px; width: 14px; height: 14px; border: 1px solid #58bcb5; border-radius: 5px 5px 7px 7px; background: linear-gradient(100deg,#276c69 0 20%,#283942 22% 78%,#276c69 80%); box-shadow: inset 0 0 4px rgba(255,255,255,.2); }
.graph-robot-body::after { content: ""; position: absolute; top: 4px; left: 5px; width: 3px; height: 4px; border-radius: 50%; background: #f0b90b; box-shadow: 0 0 5px rgba(240,185,11,.8); }
.graph-robot-arm { position: absolute; top: 18px; width: 4px; height: 10px; border: 1px solid #63c8bb; border-radius: 4px; background: #344a52; transform-origin: 50% 2px; }
.graph-robot-arm::before { content: ""; position: absolute; top: 7px; left: -1px; width: 4px; height: 8px; border-radius: 3px; background: #277c78; transform-origin: 50% 1px; }
.graph-robot-arm::after { content: ""; position: absolute; top: 6px; left: -2px; width: 5px; height: 5px; border: 1px solid #7be8d6; border-radius: 50%; background: #344a52; }
.graph-robot-arm-left { left: 8px; transform: rotate(22deg); }
.graph-robot-arm-right { left: 24px; transform: rotate(-30deg); }
.graph-robot-hand { position: absolute; z-index: 1; bottom: -7px; left: -2px; width: 5px; height: 6px; border: 1px solid #77e4d3; border-radius: 45% 45% 55% 55%; background: #334b51; box-shadow: 0 0 3px rgba(99,216,202,.45); }
.graph-robot-leg { position: absolute; top: 28px; width: 5px; height: 9px; border: 1px solid #63c8bb; border-radius: 3px; background: #344a52; transform-origin: 50% 1px; }
.graph-robot-leg::after { content: ""; position: absolute; top: 6px; left: -1px; width: 6px; height: 5px; border-radius: 2px 3px 2px 2px; background: #286d70; transform-origin: 50% 1px; }
.graph-robot-leg-left { left: 12px; }
.graph-robot-leg-right { left: 21px; }
.graph-robot[data-action="run"] .graph-robot-arm-left { animation: graphArmRun .48s ease-in-out infinite alternate; }
.graph-robot[data-action="run"] .graph-robot-arm-right { animation: graphArmRun .48s ease-in-out infinite alternate-reverse; }
.graph-robot[data-action="run"] .graph-robot-leg-left { animation: robotStep .24s ease-in-out infinite alternate; }
.graph-robot[data-action="run"] .graph-robot-leg-right { animation: robotStep .24s ease-in-out infinite alternate-reverse; }
.graph-robot[data-action="climb"] .graph-robot-arm-left { animation: graphReach .55s ease-in-out infinite alternate; }
.graph-robot[data-action="climb"] .graph-robot-arm-right { animation: graphReach .55s ease-in-out infinite alternate-reverse; }
.graph-robot[data-action="climb"] .graph-robot-leg-left { animation: graphClimbLeg .55s ease-in-out infinite alternate; }
.graph-robot[data-action="climb"] .graph-robot-leg-right { animation: graphClimbLeg .55s ease-in-out infinite alternate-reverse; }
.graph-robot[data-action="hang"] .graph-robot-arm-left,
.graph-robot[data-action="hang"] .graph-robot-arm-right { transform: rotate(170deg); }
.graph-robot[data-action="hang"] .graph-robot-leg-left { animation: graphKick .7s ease-in-out infinite alternate; }
.graph-robot[data-action="hang"] .graph-robot-leg-right { animation: graphKick .7s ease-in-out infinite alternate-reverse; }
.graph-robot[data-action="swing"] .graph-robot-arm-left,
.graph-robot[data-action="swing"] .graph-robot-arm-right { transform: rotate(165deg); }
.graph-robot[data-action="swing"] .graph-robot-leg-left { animation: graphKick .6s ease-in-out infinite alternate; }
.graph-robot[data-action="swing"] .graph-robot-leg-right { animation: graphKick .6s ease-in-out infinite alternate-reverse; }
.graph-robot[data-action="slide"] .graph-robot-arm-left { transform: rotate(100deg); }
.graph-robot[data-action="slide"] .graph-robot-arm-right { transform: rotate(-70deg); }
.graph-robot[data-action="slide"] .graph-robot-leg-left { transform: rotate(-55deg); }
.graph-robot[data-action="slide"] .graph-robot-leg-right { transform: rotate(55deg); }
.graph-robot[data-action="jump"] .graph-robot-arm-left,
.graph-robot[data-action="jump"] .graph-robot-arm-right { animation: graphJumpArms .55s ease-in-out infinite alternate; }
.graph-robot[data-action="jump"] .graph-robot-leg-left { animation: graphTuck .55s ease-in-out infinite alternate; }
.graph-robot[data-action="jump"] .graph-robot-leg-right { animation: graphTuck .55s ease-in-out infinite alternate-reverse; }
.graph-robot[data-action="point"] .graph-robot-arm-right { animation: graphPoint .6s ease-in-out infinite alternate; }
.graph-robot[data-action="point"] .graph-robot-arm-left { transform: rotate(35deg); }
.graph-robot[data-action="dance"] .graph-robot-arm-left { animation: graphDanceArm .42s ease-in-out infinite alternate; }
.graph-robot[data-action="dance"] .graph-robot-arm-right { animation: graphDanceArm .42s ease-in-out infinite alternate-reverse; }
.graph-robot[data-action="dance"] .graph-robot-leg-left { animation: graphDanceLeg .42s ease-in-out infinite alternate; }
.graph-robot[data-action="dance"] .graph-robot-leg-right { animation: graphDanceLeg .42s ease-in-out infinite alternate-reverse; }
.graph-robot[data-action="wave"] .graph-robot-arm-right { animation: graphWaveArm .62s ease-in-out infinite alternate; }
.graph-robot[data-action="wave"] .graph-robot-arm-left { transform: rotate(18deg); }
.graph-robot[data-action="confront"].active { animation: graphConfront .55s ease-in-out infinite alternate; }
.graph-robot[data-action="punch"].active { animation: graphAttack .45s ease-in-out infinite alternate; }
.graph-robot[data-action="kick"].active { animation: graphKickBody .52s ease-in-out infinite alternate; }
.graph-robot[data-action="knockdown"].active { animation: graphVictory .45s ease-in-out infinite alternate; }
.graph-robot[data-action="victory"].active { animation: graphVictory .45s ease-in-out infinite alternate; }
.graph-robot[data-action="block"] .graph-robot-arm-left { transform: rotate(-120deg); }
.graph-robot[data-action="block"] .graph-robot-arm-right { transform: rotate(-145deg); }
.graph-robot[data-action="block"]::after { content: "BLOCK!"; position: absolute; top: -10px; left: -9px; color: #b7f4ff; font-size: 7px; font-weight: 900; text-shadow: 0 1px 3px #1f7eac; }
.graph-robot[data-action="punch"] .graph-robot-arm-right { animation: graphPunch .28s ease-in-out infinite alternate; }
.graph-robot[data-action="punch"] .graph-robot-arm-left { transform: rotate(55deg); }
.graph-robot[data-action="kick"] .graph-robot-arm-left { transform: rotate(-65deg); }
.graph-robot[data-action="kick"] .graph-robot-arm-right { transform: rotate(80deg); }
.graph-robot[data-action="kick"] .graph-robot-leg-right { animation: graphFightKick .42s ease-in-out infinite alternate; }
.graph-robot[data-action="kick"] .graph-robot-leg-left { transform: rotate(25deg); }
.graph-robot[data-action="knockdown"] .graph-robot-arm-left,
.graph-robot[data-action="knockdown"] .graph-robot-arm-right { animation: graphCelebrate .45s ease-in-out infinite alternate; }
.graph-robot[data-action="victory"] .graph-robot-arm-left,
.graph-robot[data-action="victory"] .graph-robot-arm-right { animation: graphCelebrate .45s ease-in-out infinite alternate; }
.graph-rival { z-index: 5; display: none; scale: 1.28; transform: scaleX(-1); }
.graph-rival.active { display: block; transition: left .65s cubic-bezier(.2,.8,.25,1), top .65s ease-out; }
.graph-rival .graph-robot-head { border-color: #bf82ed; border-radius: 4px 8px 7px 5px; background: linear-gradient(145deg,#664889 0 42%,#292434 44% 100%); box-shadow: 0 0 8px rgba(181,115,230,.38); }
.graph-rival .graph-robot-head::after { left: 3px; right: 3px; height: 3px; border-top-color: #ff8e86; }
.graph-rival .graph-robot-eye { width: 5px; height: 3px; border-color: #592c44; border-radius: 55% 40%; background: #ff796e; box-shadow: 0 0 5px rgba(255,98,95,.9); }
.graph-rival .graph-robot-eye:first-child { transform: rotate(-24deg); }
.graph-rival .graph-robot-eye:last-child { transform: rotate(24deg); }
.graph-rival .graph-robot-body { border-color: #a26dca; border-radius: 3px 7px 5px 5px; background: linear-gradient(100deg,#723b72 0 22%,#392d49 24% 76%,#723b72 78%); }
.graph-rival .graph-robot-body::after { background: #ff5f68; box-shadow: 0 0 6px rgba(255,65,84,.9); }
.graph-rival .graph-robot-arm,
.graph-rival .graph-robot-leg { border-color: #a26dca; background: #633d78; }
.graph-rival .graph-robot-arm::before { background: #4a355d; }
.graph-rival .graph-robot-arm::after { border-color: #d095ee; background: #592f69; }
.graph-rival .graph-robot-leg::after { background: #462e5b; }
.graph-rival[data-enemy="1"] .graph-robot-head { border-color: #e99857; background: linear-gradient(145deg,#a84f39 0 42%,#392b2c 44% 100%); }
.graph-rival[data-enemy="1"] .graph-robot-body { border-color: #e99857; background: linear-gradient(100deg,#a84f39 0 22%,#443333 24% 76%,#a84f39 78%); }
.graph-rival[data-enemy="1"] .graph-robot-arm,
.graph-rival[data-enemy="1"] .graph-robot-leg { border-color: #e99857; }
.graph-rival[data-enemy="2"] .graph-robot-head { border-color: #84a1e9; background: linear-gradient(145deg,#4361a2 0 42%,#292f49 44% 100%); }
.graph-rival[data-enemy="2"] .graph-robot-body { border-color: #84a1e9; background: linear-gradient(100deg,#4a64ab 0 22%,#303957 24% 76%,#4a64ab 78%); }
.graph-rival[data-enemy="2"] .graph-robot-arm,
.graph-rival[data-enemy="2"] .graph-robot-leg { border-color: #84a1e9; }
.graph-rival[data-phase="arrive"] { animation: graphRivalEnter .55s cubic-bezier(.18,.75,.3,1) both; }
.graph-rival[data-phase="approach"] { animation: graphRivalEnter .55s cubic-bezier(.18,.75,.3,1) both; }
.graph-rival[data-phase="approach"] .graph-robot-arm-left { animation: graphArmRun .48s ease-in-out infinite alternate; }
.graph-rival[data-phase="approach"] .graph-robot-arm-right { animation: graphArmRun .48s ease-in-out infinite alternate-reverse; }
.graph-rival[data-phase="approach"] .graph-robot-leg-left,
.graph-rival[data-phase="escape"] .graph-robot-leg-left { animation: robotStep .24s ease-in-out infinite alternate; }
.graph-rival[data-phase="approach"] .graph-robot-leg-right,
.graph-rival[data-phase="escape"] .graph-robot-leg-right { animation: robotStep .24s ease-in-out infinite alternate-reverse; }
.graph-rival[data-phase="approach"] .graph-robot-arm-left,
.graph-rival[data-phase="approach"] .graph-robot-arm-right,
.graph-rival[data-phase="escape"] .graph-robot-arm-left,
.graph-rival[data-phase="escape"] .graph-robot-arm-right { animation: graphArmRun .48s ease-in-out infinite alternate; }
.graph-rival.graph-robot.active[data-phase="escape"] { animation: graphRivalEscape .65s ease-out both; transform: scaleX(1); }
.graph-rival[data-phase="enemy-punch"] .graph-robot-arm-right { animation: graphPunch .28s ease-in-out infinite alternate; }
.graph-rival[data-phase="enemy-punch"] .graph-robot-arm-left { transform: rotate(55deg); }
.graph-rival[data-phase="enemy-punch"] .graph-rival-impact { opacity: 1; animation: impactPop .3s ease-in-out infinite alternate; }
.graph-rival[data-phase="enemy-punch"] .graph-rival-impact::before { content: "POW!"; color: #ff9a94; }
.graph-rival[data-phase="punched"] { animation: graphRivalPunched .42s ease-out; }
.graph-rival[data-phase="kicked"] { animation: graphRivalKicked .55s cubic-bezier(.25,.7,.25,1) both; }
.graph-rival[data-phase="fallen"] { animation: graphRivalFall .65s ease-in forwards; }
.graph-rival[data-phase="down"] { opacity: .88; translate: 5px 15px; rotate: 90deg; }
.graph-rival-impact { position: absolute; z-index: 3; top: 3px; left: -9px; width: 26px; height: 26px; opacity: 0; pointer-events: none; }
.graph-rival[data-phase="punched"] .graph-rival-impact,
.graph-rival[data-phase="kicked"] .graph-rival-impact,
.graph-rival[data-phase="fallen"] .graph-rival-impact { opacity: 1; animation: impactPop .3s ease-in-out infinite alternate; }
.graph-rival-impact::before { content: "POW!"; position: absolute; z-index: 2; top: -8px; left: -3px; color: #fff0a8; font-size: 8px; font-weight: 900; letter-spacing: -.5px; text-shadow: 0 1px 3px #f6465d; }
.graph-rival-impact::after { content: ""; position: absolute; inset: 0; background: #fff0a8; clip-path: polygon(50% 0,62% 36%,100% 50%,62% 62%,50% 100%,38% 62%,0 50%,38% 36%); }
.graph-rival[data-phase="kicked"] .graph-rival-impact::before { content: "WHAM!"; color: #ffaf73; }
.graph-rival[data-phase="fallen"] .graph-rival-impact { top: -5px; left: -18px; }
.graph-rival[data-phase="fallen"] .graph-rival-impact::before { content: "BONK!"; color: #ffaf73; }
.graph-rival[data-phase="fallen"] .graph-rival-impact::after { transform: rotate(45deg) scale(.62); background: #ff8d78; }
.chart-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 15px; pointer-events: none; }
.chart-msg.hidden { display: none; }
.chart-msg:not(.hidden)::after { content: ""; position: absolute; bottom: 24%; width: 120px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, transparent, var(--yellow), transparent); animation: loadingSweep 1.1s ease-in-out infinite; }
.chart-load-status { min-height: 17px; padding: 0 14px; background: var(--panel); color: var(--muted); font-size: 11px; }
.resizer { height: 8px; cursor: ns-resize; background: var(--panel2); border: 1px solid var(--border); border-top: none; border-radius: 0 0 8px 8px; }
.resizer:hover { background: var(--border); }
.chart-wrap:fullscreen { height: 100% !important; }

.indicator-panel { flex: 0 0 220px; background: var(--panel); border: 1px solid var(--border); border-top: none; }
.indicator-heading { min-height: 32px; display: flex; align-items: center; gap: 16px; padding: 5px 14px; color: var(--text); font-size: 12px; }
.obv-legend { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.obv-legend i { width: 14px; height: 3px; border-radius: 2px; }
.obv-line-key { background: var(--green); }
.obv-ema-key { background: #4d9fff; margin-left: 8px; }
#obvStatus { margin-left: auto; padding: 3px 8px; border-radius: 999px; background: rgba(132, 142, 156, .12); color: var(--muted); font-size: 11px; font-weight: 700; }
#obvStatus[data-state="rising"] { background: rgba(14, 203, 129, .14); color: var(--green); }
#obvStatus[data-state="building"], #obvStatus[data-state="pausing"], #obvStatus[data-state="approaching"] { background: rgba(240, 185, 11, .14); color: var(--yellow); }
#obvStatus[data-state="declining"] { background: rgba(246, 70, 93, .14); color: var(--red); }
#obvStatus[data-state="below"] { background: rgba(132, 142, 156, .12); color: var(--muted); }
.obv-chart-wrap { position: relative; height: 180px; min-height: 150px; }
.obv-chart { position: absolute; inset: 0; }

.signal-ball { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #7dffc4, var(--green) 60%); box-shadow: 0 0 12px 4px rgba(14, 203, 129, .8); animation: blink .8s ease-in-out infinite; }
.signal-ball.latest { width: 20px; height: 20px; margin: -10px 0 0 -10px; }
.signal-ball.latest::after { content: ""; position: absolute; inset: -8px; border: 2px solid var(--green); border-radius: 50%; animation: ring 1.4s ease-out infinite; }
.signal-ball[data-color="yellow"] { background: radial-gradient(circle at 35% 35%, #fff3a6, var(--yellow) 62%); box-shadow: 0 0 12px 4px rgba(240, 185, 11, .8); }
.signal-ball[data-color="yellow"].latest::after { border-color: var(--yellow); }

.disclaimer { color: var(--muted); font-size: 11px; margin-top: 8px; }

.ohlc { background: var(--panel); border-left: 1px solid var(--border); border-right: 1px solid var(--border); padding: 4px 14px 0; font-size: 12px; color: var(--muted); min-height: 20px; }
.ohlc b { color: var(--text); font-weight: 600; margin-right: 10px; }
.ohlc b.up { color: var(--green); } .ohlc b.down { color: var(--red); }

.market-sidebar { flex: 0 0 clamp(270px, 20vw, 330px); min-width: 270px; padding: 10px; border-left: 1px solid var(--border); overflow-y: auto; }
.market-panel { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.market-panel h2 { color: var(--yellow); }
.market-status { margin: 0 2px 6px; color: var(--muted); font-size: 10px; }
.market-list { flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 0; }
.market-coin { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 5px; border-bottom: 1px solid rgba(43, 49, 57, .7); }
.market-main, .market-right { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.market-main { flex: 1; }
.market-main .coin-mini-chart { grid-template-columns: auto minmax(0, 1fr); }
.market-symbol { color: var(--text); font-size: 12px; font-weight: 700; }
.market-volume { color: var(--muted); font-size: 10px; }
.market-right { align-items: flex-end; text-align: right; }
.market-price { color: var(--text); font-size: 12px; font-weight: 600; }
.market-change { font-size: 10px; font-weight: 700; }
.market-change.up { color: var(--green); }
.market-change.down { color: var(--red); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes eyeBlink { 0%, 45%, 48%, 100% { transform: scaleY(0); } 46.5% { transform: scaleY(1); } }
@keyframes robotWalk { from { transform: translateX(0); } to { transform: translateX(39px); } }
@keyframes graphRun { 0%, 100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-3px) rotate(5deg); } }
@keyframes graphClimb { from { transform: translateY(2px) rotate(-4deg); } to { transform: translateY(-6px) rotate(4deg); } }
@keyframes graphHang { from { transform: rotate(-8deg) translateY(-1px); } to { transform: rotate(8deg) translateY(2px); } }
@keyframes graphSwing { from { transform: rotate(-32deg) translateY(1px); } to { transform: rotate(32deg) translateY(5px); } }
@keyframes graphSlide { from { transform: translateX(-4px) rotate(-12deg); } to { transform: translateX(8px) rotate(14deg); } }
@keyframes graphLeap { 0%, 100% { transform: translateY(0) scaleY(.88); } 18% { transform: translateY(2px) scaleY(.84); } 48%, 65% { transform: translateY(-15px) scaleY(1.04); } 82% { transform: translateY(1px) scaleY(.9); } }
@keyframes graphPointBody { from { transform: translateY(1px) rotate(-3deg); } to { transform: translateY(-4px) rotate(3deg); } }
@keyframes graphDance { 0%, 100% { transform: translateY(0) rotate(-7deg); } 50% { transform: translateY(-5px) rotate(7deg); } }
@keyframes graphWave { from { transform: translateY(0) rotate(-3deg); } to { transform: translateY(-3px) rotate(3deg); } }
@keyframes graphConfront { from { transform: translateX(0) rotate(-4deg); } to { transform: translateX(4px) rotate(4deg); } }
@keyframes graphAttack { from { transform: translateX(0) translateY(0); } to { transform: translateX(8px) translateY(-3px); } }
@keyframes graphKickBody { from { transform: translateX(2px) rotate(-4deg); } to { transform: translateX(10px) rotate(8deg); } }
@keyframes graphVictory { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(-6px) rotate(4deg); } }
@keyframes graphArmRun { from { transform: rotate(-42deg); } to { transform: rotate(48deg); } }
@keyframes graphReach { from { transform: rotate(-45deg); } to { transform: rotate(-105deg); } }
@keyframes graphPoint { from { transform: rotate(-75deg); } to { transform: rotate(-115deg); } }
@keyframes graphClimbLeg { from { transform: rotate(-35deg); } to { transform: rotate(52deg); } }
@keyframes graphKick { from { transform: rotate(-35deg); } to { transform: rotate(42deg); } }
@keyframes graphJumpArms { from { transform: rotate(-35deg); } to { transform: rotate(-145deg); } }
@keyframes graphTuck { from { transform: rotate(-15deg); } to { transform: rotate(65deg); } }
@keyframes graphDanceArm { from { transform: rotate(-125deg); } to { transform: rotate(-42deg); } }
@keyframes graphDanceLeg { from { transform: rotate(-38deg); } to { transform: rotate(38deg); } }
@keyframes graphWaveArm { from { transform: rotate(-145deg); } to { transform: rotate(-75deg); } }
@keyframes graphPunch { from { transform: rotate(-48deg); } to { transform: rotate(-126deg); } }
@keyframes graphFightKick { from { transform: rotate(-8deg); } to { transform: rotate(-102deg); } }
@keyframes graphCelebrate { from { transform: rotate(-110deg); } to { transform: rotate(-160deg); } }
@keyframes graphRivalEnter { from { opacity: 0; translate: 38px -8px; } to { opacity: 1; translate: 0 0; } }
@keyframes graphRivalEscape { 0% { opacity: .88; translate: 5px 15px; rotate: 90deg; } 22% { opacity: 1; translate: 0 4px; rotate: 0deg; } 100% { opacity: 1; translate: 0 0; rotate: 0deg; } }
@keyframes graphRivalPunched { 0%, 100% { translate: 0 0; rotate: 0; } 35% { translate: 8px -3px; rotate: -16deg; } 65% { translate: -3px 1px; rotate: 9deg; } }
@keyframes graphRivalKicked { 0% { translate: 0 0; rotate: 0; } 45% { translate: 17px -12px; rotate: 28deg; } 100% { translate: 13px -4px; rotate: 38deg; } }
@keyframes graphRivalFall { from { opacity: 1; translate: 13px -4px; rotate: 38deg; } to { opacity: .88; translate: 5px 15px; rotate: 90deg; } }
@keyframes impactPop { from { transform: scale(.65) rotate(-12deg); } to { transform: scale(1.2) rotate(12deg); } }
@keyframes webTension { from { transform: scaleY(.82); } to { transform: scaleY(1.08); } }
@keyframes robotStep { from { transform: rotate(-28deg); } to { transform: rotate(28deg); } }
@keyframes robotSwing { from { transform: rotate(-22deg); } to { transform: rotate(22deg); } }
@keyframes robotSignal { from { transform: rotate(-115deg); } to { transform: rotate(-82deg); } }
@keyframes edgeOrbit { to { --edge-angle: 360deg; } }
@keyframes risingPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.75); } }
@keyframes loadingSweep { from { transform: translateX(-42px); opacity: .35; } 50% { opacity: 1; } to { transform: translateX(42px); opacity: .35; } }
@keyframes blink { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .25; transform: scale(.75); } }
@keyframes ring { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }
@keyframes arrowUp { 0%, 100% { transform: translateY(2px); opacity: .4; } 50% { transform: translateY(-3px); opacity: 1; } }
@keyframes arrowDown { 0%, 100% { transform: translateY(-2px); opacity: .4; } 50% { transform: translateY(3px); opacity: 1; } }

@media (max-width: 1200px) {
  .layout { display: grid; grid-template-columns: minmax(240px, .9fr) minmax(320px, 2fr) minmax(240px, .9fr); height: calc(100% - 62px); }
  .sidebar, .main, .market-sidebar { flex: none; width: auto; min-width: 0; }
  .sidebar, .market-sidebar { height: 100%; }
  .main { grid-column: 2; }
}

@media (max-width: 860px) {
  .topbar { height: auto; min-height: 62px; flex-wrap: wrap; padding: 6px 12px; }
  .trend-banner { max-width: none; flex: 1 1 320px; }
  .status { flex: 1 1 230px; justify-content: flex-end; }
  .status { flex-wrap: wrap; justify-content: flex-end; }
  .scan-progress { width: 58px; flex-basis: 58px; }
  .layout { display: flex; flex-direction: column; height: auto; }
  .sidebar { flex: 0 0 auto; width: 100%; min-width: 0; height: auto; border-right: none; }
  .main { flex: 0 0 auto; width: 100%; }
  .market-sidebar { flex: 0 0 auto; width: 100%; min-width: 0; height: auto; border-left: none; }
  .chart-wrap { height: 420px; }
  .indicator-panel { flex-basis: 210px; }
  .obv-chart-wrap { height: 170px; }
}

@media (max-width: 560px) {
  .indicator-heading { flex-wrap: wrap; gap: 6px 12px; }
  #obvStatus { margin-left: 0; }
  .topbar { height: auto; min-height: 52px; flex-wrap: wrap; gap: 6px; padding: 7px 10px; }
  .trend-banner { min-width: 100%; max-width: none; flex: 1 1 100%; order: 2; }
  .status { flex: 1 1 100%; justify-content: flex-start; gap: 6px; font-size: 11px; }
  #scanStatus { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .scan-progress { width: 48px; flex-basis: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  body::after, .rising-ball, .signal-ball, .eye-lid, .robot-guide, .robot-arm, .robot-leg,
  .graph-robot.active, .graph-robot-web, .graph-robot-arm, .graph-robot-leg { animation: none !important; }
}
