:root {
  --bg: #05080a;
  --teal: #2ff3c8;
  --teal-soft: #57e0c4;
  --pink: #ff2f7e;
  --pink-soft: #ff6aa4;
  --gold: #f3c04a;
  --green: #35f08c;
  --red: #ff3d5f;
  --text: #dcefec;
  --muted: #6a827f;
  --line: #17282a;
  --panel: rgba(8, 14, 15, 0.72);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #020405; }
body {
  font-family: "Rajdhani", system-ui, sans-serif;
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
.lbl { color: var(--muted); }

/* ---------- frame ---------- */
.frame {
  position: relative;
  /* fit within BOTH viewport width and height (minus 40px body padding),
     preserving aspect ratio so it never overflows at 100% zoom */
  width: var(--frame-w, 1560px);
  height: var(--frame-h, 819px);
  flex: none;
  transform: scale(var(--fit, 1));
  transform-origin: center center;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #14201f;
  background:
    radial-gradient(140% 120% at 50% -20%, #10201f 0%, #08100f 45%, #04080a 100%);
  box-shadow: 0 0 0 1px #000, 0 40px 120px rgba(0,0,0,.85), inset 0 0 120px rgba(0,0,0,.6);
  display: flex; flex-direction: column;
}
.frame::before { /* neon rim wash */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background:
    radial-gradient(60% 40% at 95% 0%, rgba(47,243,200,.12), transparent 60%);
  mix-blend-mode: screen;
}
.scanline { position: absolute; inset: 0; z-index: 6; pointer-events: none; opacity: .35;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.025) 0 1px, transparent 1px 3px); }

/* ---------- bars (top/bottom) ---------- */
.topbar, .footbar {
  position: relative; z-index: 7;
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 20px; background: rgba(4,8,9,.85);
  backdrop-filter: blur(4px);
}
.topbar { border-bottom: 1px solid var(--line); }
.footbar { border-top: 1px solid var(--line); font-size: 12px; letter-spacing: .16em; color: var(--muted); font-weight: 500; }
.foot-cell { display: inline-flex; align-items: center; gap: 9px; }
.foot-cell.mid { flex-direction: column; gap: 4px; }
.foot-cell.mid .wallet-row { display: inline-flex; align-items: center; gap: 9px; }
.foot-cell .birdeye-link { font-size: 11px; letter-spacing: .16em; color: var(--muted); }
.foot-cell .birdeye-link:hover { color: var(--teal-soft); }
.foot-cell em { color: var(--teal); font-style: normal; }
.foot-social { gap: 8px; }
.sicon { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); transition: color .15s, border-color .15s, box-shadow .15s; }
.sicon svg { width: 15px; height: 15px; fill: currentColor; }
.sicon svg[fill="none"] { fill: none; }
.sicon.x:hover, .sicon.tg:hover { color: var(--teal); border-color: var(--teal); box-shadow: 0 0 10px rgba(47,243,200,.35); }
.sicon.pf:hover { color: var(--green); border-color: var(--green); box-shadow: 0 0 10px rgba(53,240,140,.35); }
.sicon.be:hover { color: var(--gold); border-color: var(--gold); box-shadow: 0 0 10px rgba(243,192,74,.35); }
.sicon.be .be-mask { width: 16px; height: 17px; background-color: currentColor;
  -webkit-mask: url(/birdeye-mark.png?v=20260912T0009) center/contain no-repeat;
          mask: url(/birdeye-mark.png?v=20260912T0009) center/contain no-repeat; }
.wallet-link { color: var(--teal); text-decoration: none; letter-spacing: .08em; transition: color .15s, text-shadow .15s; }
.wallet-link:hover { color: var(--teal-soft); text-shadow: 0 0 10px rgba(47,243,200,.55); text-decoration: underline; }

.brand { display: flex; align-items: center; gap: 14px; }
.bar-sep { width: 1px; height: 18px; background: #2a3a3a; }
.glyphs { display: inline-flex; gap: 9px; align-items: center; }
.g-circle { width: 13px; height: 13px; border: 2px solid var(--pink); border-radius: 50%; box-shadow: 0 0 7px rgba(255,47,126,.55); }
.g-triangle { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 13px solid var(--teal); filter: drop-shadow(0 0 5px rgba(47,243,200,.5)); }
.g-square { width: 12px; height: 12px; border: 2px solid var(--teal); box-shadow: 0 0 7px rgba(47,243,200,.45); }
.g-triangle.sm { border-left-width: 5px; border-right-width: 5px; border-bottom-width: 9px; }
.g-square.sm { width: 9px; height: 9px; }
.title { font-weight: 700; letter-spacing: .22em; font-size: 20px; color: #eafffb; }
.title em { color: var(--pink); font-style: normal; text-shadow: 0 0 14px rgba(255,47,126,.6); }

.session { display: flex; align-items: center; gap: 12px; font-size: 14px; letter-spacing: .12em; font-weight: 600; }
.session .lbl { font-size: 12px; letter-spacing: .18em; }
.clock { font-family: "Share Tech Mono", monospace; color: var(--teal); font-size: 17px; text-shadow: 0 0 12px rgba(47,243,200,.5); }
.dots { display: inline-flex; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #223; }
.dot.pink { background: var(--pink); box-shadow: 0 0 8px var(--pink); }
.dot.teal { background: var(--teal); box-shadow: 0 0 8px var(--teal); }
.dot.live { animation: pulse 1.7s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
.menu { color: var(--muted); font-size: 18px; }

/* ---------- grid ---------- */
/* Desktop + landscape: right rail is split into OPEN POSITIONS (top) over
   CLOSED TRADES (bottom); wallet + arena span both rows. Portrait overrides
   this to a flex stack further down. */
.grid { flex: 1; display: grid; grid-template-columns: 190px 1fr 360px; grid-template-rows: auto minmax(0, 1fr); min-height: 0; position: relative; z-index: 7; }
.panel { min-height: 0; position: relative; }
.wallet { grid-column: 1; grid-row: 1 / -1; border-right: 1px solid var(--line); background: linear-gradient(180deg, rgba(10,17,18,.9), rgba(5,9,10,.95)); padding: 16px; display: flex; flex-direction: column; }
.arena { grid-column: 2; grid-row: 1 / -1; }
.results { grid-column: 3; grid-row: 2; border-left: 1px solid var(--line); background: linear-gradient(180deg, rgba(10,17,18,.9), rgba(5,9,10,.95)); padding: 16px; display: flex; flex-direction: column; }
/* open-positions panel: top of the right rail on desktop/landscape (portrait re-slots it via body.m-port below) */
.openpos { grid-column: 3; grid-row: 1; display: flex; flex-direction: column;
  border-left: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10,17,18,.9), rgba(5,9,10,.95)); padding: 14px 16px 12px; }
.openpos .open-wrap { flex: 0 1 auto; max-height: 216px; }

/* ---------- wallet: glass case + piggy ---------- */
.case { display: flex; justify-content: center; margin: 2px 0 8px; }
.piggy-img { width: 150px; height: auto; display: block;
  filter: drop-shadow(0 8px 22px rgba(0,0,0,.55)); }

.equity { color: var(--pink); letter-spacing: .01em; line-height: 1.0;
  text-align: center; text-shadow: 0 0 22px rgba(255,47,126,.45);
  display: flex; align-items: baseline; justify-content: center; gap: 6px; white-space: nowrap; }
.equity .eq-num { font-size: 34px; font-weight: 700; }
.equity .eq-unit { font-size: 14px; font-weight: 600; letter-spacing: .14em; opacity: .85; }
.equity.up { color: var(--green); text-shadow: 0 0 22px rgba(53,240,140,.45); }
.equity.down { color: var(--pink); text-shadow: 0 0 22px rgba(255,47,126,.45); }
.peak-delta { color: var(--pink-soft); opacity: .8; font-size: 13px; font-weight: 600; letter-spacing: .12em; margin-top: 3px; text-align: center; }
.peak-delta.up { color: var(--green); }
.peak-delta.down { color: var(--pink); }
.total-trades { color: #b9ccc8; opacity: .7; font-size: 11px; font-weight: 600; letter-spacing: .14em; margin-top: 6px; text-align: center; }
.total-trades .tt-num { color: #fff; font-weight: 800; }

/* coin jar */
.jar { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; }
.jar-glass { width: 54px; height: 66px; border-radius: 8px 8px 10px 10px; position: relative; overflow: hidden;
  background: linear-gradient(180deg, rgba(150,230,215,.08), rgba(40,70,68,.04));
  border: 1px solid rgba(90,180,165,.22); box-shadow: inset 0 0 12px rgba(120,230,210,.10); }
.jar-coins { position: absolute; left: 0; right: 0; bottom: 0; height: 62%;
  background:
    radial-gradient(circle at 30% 30%, #ffe08a 0 3px, transparent 4px) 0 0/12px 10px,
    radial-gradient(circle at 70% 60%, #e8b23e 0 3px, transparent 4px) 0 0/12px 10px,
    linear-gradient(180deg, #f3c04a, #a9781f);
  box-shadow: 0 0 16px rgba(243,192,74,.35); }
.jar-meta { display: flex; flex-direction: column; gap: 3px; }
.jar-meta .lbl { font-size: 11px; letter-spacing: .14em; }
.jar-meta .val { color: var(--gold); font-size: 18px; font-weight: 700; text-shadow: 0 0 12px rgba(243,192,74,.35); }

/* trade ticker */
.feed-h { color: var(--teal); text-shadow: 0 0 12px rgba(47,243,200,.4); margin-top: 22px; margin-bottom: 2px; }
.ticker { list-style: none; flex: 1; overflow: hidden; margin-top: 0; font-family: "Share Tech Mono", monospace; font-size: 11px; }
.ticker li { display: grid; grid-template-columns: 52px auto 1fr; gap: 6px; padding: 4px 4px; color: #b9ccc8; border-bottom: 1px solid rgba(255,255,255,.035); align-items: center; }
.ticker li > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticker .act { display: inline-flex; align-items: center; gap: 4px; }
.ticker .tx-link { display: inline-flex; align-items: center; }
.ticker .tx-link img { width: 8.4px; height: 8.4px; opacity: .55; transition: opacity .12s; }
.ticker a.tx-link:hover img { opacity: 1; }
.sym .pf-link { display: inline-flex; align-items: center; vertical-align: middle; margin-right: 4px; }
.sym .pf-link img { width: 9px; height: 9px; opacity: .55; transition: opacity .12s; }
.sym a.pf-link:hover img { opacity: 1; }
.ticker .act { font-weight: 700; letter-spacing: .06em; }
.ticker .buy, .ticker .sell { color: var(--muted); }
.ticker .num { color: #b9ccc8; text-align: right; }

.wallet-foot { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; }
.wf-label { font-size: 26px; font-weight: 700; letter-spacing: .12em; color: #f0d488; text-shadow: 0 0 16px rgba(243,192,74,.3); }
.wf-chip { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(243,192,74,.4); display: flex; align-items: center; justify-content: center; font-size: 16px; box-shadow: 0 0 12px rgba(243,192,74,.2); }

/* ---------- arena ---------- */
.arena { padding: 0; overflow: hidden; display: flex; flex-direction: column; background: #070b0c; }
.arena-scene { position: absolute; inset: 0;
  background: #060606 url("/assets/arena-plate.png") center 46% / cover no-repeat;
}
.arena-scene::before { /* subtle vignette so overlaid data stays legible */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 40%, rgba(3,5,6,.35) 78%, rgba(3,5,6,.72) 100%),
    linear-gradient(180deg, rgba(3,5,6,.35) 0%, transparent 24%);
}

/* fake CSS floor retired — the plate provides the real arena */
.arena-floor { display: none; }

.arena-head { position: relative; z-index: 3; flex: 0 0 auto; display: flex; justify-content: center; padding: 12px 14px 4px; }
.pnl-cal { width: 100%; max-width: 620px; background: rgba(4,8,9,.55); backdrop-filter: blur(3px); border: 1px solid rgba(120,150,145,.30); border-radius: 12px; padding: 8px 12px; box-shadow: 0 4px 18px rgba(0,0,0,.45); }
.cal-title { font-size: 10px; font-weight: 700; letter-spacing: .14em; color: #cfe0dc; text-align: center; margin-bottom: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-dow { font-size: 8px; color: #7e938f; text-align: center; font-weight: 700; letter-spacing: .04em; padding-bottom: 2px; }
.cal-cell { min-height: 46px; border-radius: 5px; padding: 3px 1px; display: flex; flex-direction: column; align-items: center; gap: 1px; background: rgba(255,255,255,.035); }
.cal-cell.empty { background: transparent; }
.cal-cell .cal-d { font-size: 8px; color: #8ba39e; line-height: 1; }
.cal-pnl { font-size: 8.5px; font-weight: 700; line-height: 1.05; }
.cal-roi { font-size: 7.5px; opacity: .85; line-height: 1; }
.cal-cell.up { background: rgba(47,243,200,.10); }
.cal-cell.up .cal-pnl, .cal-cell.up .cal-roi { color: var(--green); }
.cal-cell.down { background: rgba(255,47,126,.10); }
.cal-cell.down .cal-pnl, .cal-cell.down .cal-roi { color: var(--pink); }
.cal-cell.warn { background: rgba(255,165,60,.12); }
.cal-cell.warn .cal-pnl, .cal-cell.warn .cal-roi { color: #ffa53c; }
.cal-cell.today { outline: 1px solid rgba(243,192,74,.75); }

/* desktop: let the calendar fill the wide middle frame instead of a small pill */
@media (min-width: 1000px) {
  .arena-head { padding: 14px 16px 6px; }
  .pnl-cal { max-width: none; padding: 12px 18px; }
  .cal-title { font-size: 15px; margin-bottom: 9px; }
  .cal-grid { gap: 5px; }
  .cal-cell { min-height: 81px; padding: 6px 2px; border-radius: 7px; gap: 2px; }
  .cal-dow { font-size: 12px; }
  .cal-cell .cal-d { font-size: 12px; }
  .cal-pnl { font-size: 15px; }
  .cal-roi { font-size: 12px; }
  /* taller calendar above eats vertical space; shrink the winrate/best/worst/PF
     row (mosaic middle row) proportionally so equity + streak keep their size */
  .mos { grid-template-rows: 1.69fr .52fr .59fr; }
}

/* ---------- performance mosaic (center panel) ---------- */
.mosaic { flex: 1; min-height: 0; padding: 8px 14px 14px; display: flex; flex-direction: column; overflow: auto; container-type: inline-size; container-name: mos; }
.mos { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: 1.69fr .78fr .63fr; gap: 12px; min-height: 0; }
.mosaic .eqcard { grid-column: 1 / -1; }
.mosaic .streakcard { grid-column: span 3; }
/* winrate (donut card) spans 2 of the 4 desktop cols so BEST | WINRATE | PF fills
   the row after WORST was removed */
.mosaic .card.row { grid-column: span 2; }
.mosaic .card.row .wr-txt { min-width: 0; }
.mosaic .card { background: rgba(8,14,15,.72); border: 1px solid rgba(120,200,190,.14); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; min-height: 0; }
.mosaic .card .lab { color: #5b7a76; font-size: 11px; letter-spacing: 2px; font-family: "Share Tech Mono", monospace; }
.mosaic .card .num { font-size: 2.0rem; font-weight: 700; margin-top: 6px; font-family: "Rajdhani", sans-serif; line-height: 1; }
.mosaic .num.g { color: #3ff0b0; } .mosaic .num.r { color: #ff5c8a; } .mosaic .num.c { color: #3fe0d8; }
.mosaic .card .foot { color: #5b7a76; font-size: 11px; margin-top: 6px; font-family: "Share Tech Mono", monospace; }
.mosaic .span2 { grid-column: span 2; }
.mosaic .span3 { grid-column: span 3; }
.mosaic .card.row { flex-direction: row; align-items: center; }
.mosaic .donut { width: 92px; height: 92px; border-radius: 50%; background: conic-gradient(#3ff0b0 0 0%, #16211f 0 100%); display: flex; align-items: center; justify-content: center; margin-right: 16px; flex: 0 0 auto; }
.mosaic .donut i { width: 66px; height: 66px; border-radius: 50%; background: #0a1211; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 19px; font-weight: 700; color: #3fe0d8; font-family: "Rajdhani", sans-serif; }
.mosaic .eqcard .lab { margin-bottom: 4px; }
.mosaic .eqcard { padding-bottom: 8px; }
.mosaic .eq-plot { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.mosaic .spark { touch-action: pan-y; cursor: crosshair; }
/* hover readout: snaps to the nearest day (app.js setupEqHover) */
.eq-hline, .eq-hdot, .eq-tip { position: absolute; pointer-events: none; display: none; z-index: 4; }
.eq-hovering .eq-hline, .eq-hovering .eq-hdot, .eq-hovering .eq-tip { display: block; }
.eq-hline { width: 0; border-left: 1px dashed rgba(207,224,220,.55); }
.eq-hdot { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: #3ff0b0; box-shadow: 0 0 0 2px rgba(8,14,15,.9); }
.eq-tip { background: rgba(10,16,17,.94); border: 1px solid rgba(120,150,145,.40); border-radius: 7px; padding: 6px 8px; font: 10px/1.35 "Share Tech Mono", monospace; color: #cfe0dc; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.eq-tip .t-date { color: #fff; font-weight: 700; margin-bottom: 3px; }
.eq-tip .up { color: var(--green); } .eq-tip .down { color: var(--pink); } .eq-tip .warn { color: #ffa53c; } .eq-tip .mut { color: #7e938f; }
.mosaic .eq-top { flex: 1; min-height: 0; display: flex; align-items: stretch; gap: 6px; }
.mosaic .eq-yaxis { width: 26px; flex: 0 0 26px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; padding: 2px 0; }
.mosaic .eq-yaxis span { color: #5b7a76; font-size: 9px; font-family: "Share Tech Mono", monospace; line-height: 1; white-space: nowrap; }
.mosaic .spark { flex: 1; width: 100%; min-height: 0; }
.mosaic .eq-xaxis { position: relative; height: 9px; margin-top: 3px; margin-left: 32px; }
.mosaic .eq-xaxis span { position: absolute; top: 0; transform: translateX(-50%); color: #5b7a76; font-size: 8px; font-family: "Share Tech Mono", monospace; line-height: 1; white-space: nowrap; }
.mosaic .eq-xaxis span.first { transform: none; }
.mosaic .eq-xaxis span.last { transform: translateX(-100%); }
.mosaic .streak { display: flex; gap: 5px; margin-top: 10px; flex-wrap: wrap; }
.mosaic .sq { width: 16px; height: 16px; border-radius: 4px; background: #16211f; }
.mosaic .sq.w { background: #3ff0b0; } .mosaic .sq.l { background: #ff5c8a; } .mosaic .sq.o { background: #ffa53c; }

/* narrow (landscape-phone ~280px cell): reflow to 2 cols, shrink */
@container mos (max-width: 560px) {
  .mosaic { padding: 8px 9px; }
  .mos { grid-template-columns: 1fr 1fr; grid-template-rows: none; grid-auto-rows: minmax(0, auto); gap: 7px; }
  .mosaic .card { padding: 8px 9px; border-radius: 9px; }
  .mosaic .card .lab { font-size: 9px; letter-spacing: 1px; }
  .mosaic .card .num { font-size: 1.15rem; margin-top: 3px; }
  .mosaic .card .foot { font-size: 9px; margin-top: 3px; }
  .mosaic .eqcard, .mosaic .streakcard { grid-column: span 2; }
  /* on the 2-col mobile reflow winrate drops to 1 col beside BEST; stack the
     donut over the text so the label/pct/foot get the full column width instead
     of wrapping in the ~50px gap left of a side-by-side donut */
  .mosaic .card.row { grid-column: span 1; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
  .mosaic .card.row .donut { margin-right: 0; }
  .mosaic .card.row .wr-txt { min-width: 0; width: 100%; }
  .mosaic .donut { width: 58px; height: 58px; margin-right: 11px; }
  .mosaic .donut i { width: 42px; height: 42px; font-size: 13px; }
  .mosaic #wr-num { font-size: 1.05rem !important; }
  .mosaic .eq-top { flex: 0 0 90px; height: 90px; }
  .mosaic .spark { height: 90px; align-self: stretch; }
  .mosaic .streak { gap: 3px; margin-top: 6px; }
  .mosaic .sq { width: 11px; height: 11px; border-radius: 3px; }
}

/* opponents (villains): one per player, each pinned directly ABOVE its own pod
   (further up the plate = further back) in a BACK layer (z-index 1, behind
   .players @ z-index 2). The container mirrors the players' slot grid; each item
   shares its player's SLOT_X left so it sits right above him. Mirrored to face
   down toward the hero, scaled + hue-shifted to read as a distinct rival. Each
   villain's clip is the OPPOSITE of the player it faces (see app.js). */
.villains { position: absolute; left: 0; right: 0; top: 34%; z-index: 1; pointer-events: none; }
.villain { position: absolute; top: 0; transform: translateX(-50%) scale(1.2);
  transform-origin: bottom center;
  display: flex; flex-direction: column; align-items: center;
  transition: left .4s cubic-bezier(.4,0,.2,1);
  filter: hue-rotate(150deg) brightness(.86) saturate(.95) drop-shadow(0 6px 14px rgba(0,0,0,.6)); }
.villain .char-wrap { height: 92px; margin-top: 0; }
.villain .char-img { height: 92px; transform: scaleX(-1); }

/* no-coins plate: players stand in a row on the sand, on the emblem midline */
.players { position: absolute; left: 0; right: 0; top: 50%; z-index: 2; display: flex; align-items: flex-end; justify-content: center; gap: 20px; flex-wrap: wrap; padding: 0 16px; }
.players .empty { color: #b9ccc8; font-size: 13px; letter-spacing: .16em; margin: 0 auto; padding: 7px 16px; border-radius: 20px; background: rgba(4,8,9,.55); backdrop-filter: blur(3px); text-shadow: 0 1px 6px rgba(0,0,0,.8); }
.player { position: absolute; top: 0; transform: translateX(-50%) scale(1.2); transform-origin: bottom center; display: flex; flex-direction: column; align-items: center; gap: 0; transition: left .4s cubic-bezier(.4,0,.2,1); }
/* HUD (cashtag + %/bar/mark) is pulled OUT of flow and pinned just above the
   player, growing UPWARD. This decouples the player's position from the HUD, so
   text filling in, a win/lose flip, or the fade-out on a fall can never reflow
   and shove the player. char-wrap reserves the equivalent space so the player
   still stands at the same baseline. */
.p-hud { position: absolute; left: 50%; bottom: 134px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px; }
.p-tag { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.p-tag .row { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; font-family: "Share Tech Mono", monospace; }
.p-bar { width: 42px; height: 5px; border-radius: 3px; background: #2a3a3a; }
.player.win .p-bar { background: var(--green); box-shadow: 0 0 9px var(--green); }
.player.lose .p-bar { background: var(--pink); box-shadow: 0 0 9px var(--pink); }
.player.win .p-pct { color: var(--green); }
.player.lose .p-pct { color: var(--pink); }
.p-age { color: var(--muted); }
.p-price { color: var(--muted); font-size: 11px; }
/* triangle reserves a constant 8px height in every state (transparent when
   unknown) so a win/lose/state flip can't grow the tag and shove the pod down */
.p-mark { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 8px solid transparent; }
.player.win .p-mark { border-bottom-color: var(--green); }
.player.lose .p-mark { border-bottom: 0; border-top: 8px solid var(--pink); }
.char-wrap { position: relative; display: flex; flex-direction: column; align-items: center;
  height: 132px; margin-top: 70px; justify-content: flex-end; }
.char-img { height: 132px; width: auto; display: block; position: relative; z-index: 2;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.55)); }
.player.win .char-img { filter: drop-shadow(0 3px 6px rgba(0,0,0,.55)) drop-shadow(0 0 10px rgba(47,243,200,.6)); }
.player.lose .char-img { filter: drop-shadow(0 3px 6px rgba(0,0,0,.55)) drop-shadow(0 0 10px rgba(255,47,126,.6)); }
.char-sym { z-index: 3;
  font-family: "Share Tech Mono", monospace; font-size: 11px; font-weight: 700; color: #fff;
  text-shadow: 0 0 5px rgba(0,0,0,.9); letter-spacing: .02em;
  white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
/* chamfer-cylinder pedestal, tucked under the player's feet (~19px of empty
   render sits below the shoes, so the disc is lifted to meet them). Small and
   neutral-dark at rest; on a loss-sell (.fall) it flushes magenta and tips
   forward while the player tumbles off. */
.char-wrap { perspective: 300px; }
.pod-base { position: absolute; bottom: 6px; left: 50%; z-index: 1;
  width: 52px; height: 34px; transform: translateX(-50%);
  transform-origin: 50% 0%;
  background: url("assets/base_pill.png") center bottom / contain no-repeat;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,.4)); }
/* loss-sell fall is a rendered clip (fall.webm, ~2.4s) that shows the base
   rotating and the player tumbling off — so we hide the CSS pedestal and let
   the video drive the motion, only fading the cashtag/% tag out over it. */
/* base holds through the 0.2s pause, then disappears the instant the drop starts */
.player.fall .pod-base { animation: baseHide .1s linear .2s forwards; }
@keyframes baseHide { to { opacity: 0; } }
/* after a 0.2s hold, the player drops (linear) and fades in lockstep — the fade
   starts as the drop starts and completes exactly when the drop stops */
.player.fall .char-img {
  animation:
    fallDrop .45s linear .2s forwards,
    fallFade .45s linear .2s forwards;
}
@keyframes fallDrop { from { transform: translateY(0); } to { transform: translateY(60px); } }
@keyframes fallFade { to { opacity: 0; } }
.player.fall .p-hud { animation: podFade .4s ease-out .6s forwards; }
@keyframes podFade { to { opacity: 0; } }
.who { font-size: 9px; letter-spacing: .04em; color: var(--muted); margin-top: 2px; }

/* ---------- results: closed trades ---------- */
.res-h { font-size: 15px; letter-spacing: .16em; font-weight: 700; margin-bottom: 10px; }
.closed-h, .open-h { color: var(--teal); text-shadow: 0 0 12px rgba(47,243,200,.4); }
.res-count { color: var(--muted); font-size: 11px; letter-spacing: .1em; font-weight: 600; }
.closed-wrap { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; margin: 0 -4px; }
.closed-wrap::-webkit-scrollbar { width: 5px; }
.closed-wrap::-webkit-scrollbar-thumb { background: #1c2e2c; border-radius: 3px; }
.closed-table { width: 100%; border-collapse: collapse; font-family: "Share Tech Mono", monospace; font-size: 11px; }
.closed-table th { position: sticky; top: 0; z-index: 1; background: rgba(6,11,12,.96); color: var(--muted);
  font-weight: 600; letter-spacing: .04em; text-align: left; padding: 4px 5px; border-bottom: 1px solid var(--line); }
.closed-table th.r, .closed-table td.r { text-align: right; }
.closed-table td { padding: 4px 5px; border-bottom: 1px solid rgba(255,255,255,.035); color: #b9ccc8; white-space: nowrap; }
.closed-table .sym { color: #eafffb; font-weight: 700; }
.closed-table .mono { font-variant-numeric: tabular-nums; }
.closed-table .up { color: var(--green); }
.closed-table .down { color: var(--pink); }
.closed-table .muted { color: var(--muted); }
.closed-table .reason { color: #7e938f; max-width: 52px; overflow: hidden; text-overflow: ellipsis; }
.closed-table .empty-td { color: var(--muted); text-align: center; padding: 14px 0; }

.hit-row { margin-top: auto; padding-top: 14px; color: var(--gold); font-size: 15px; font-weight: 700; letter-spacing: .14em; display: flex; align-items: center; gap: 8px; }
.reticle { color: var(--gold); font-size: 16px; text-shadow: 0 0 10px rgba(243,192,74,.5); }

/* ======================= MOBILE ======================= */
/* Driven by JS (fitFrame): body.m-land on landscape phones, body.m-port on
   portrait phones. Desktop/tablet keep the centered scaled board unchanged. */

/* Landscape phone: JS narrows the arena column + fills width; board scrolls
   vertically from the top-left. */
body.m-land { align-items: flex-start; justify-content: flex-start;
  padding: 0; overflow-x: hidden; overflow-y: auto; }
body.m-land .frame { transform-origin: top left; border-radius: 0; }

/* Portrait phone: drop the arena, stack the two data panels at native readable
   size; the page scrolls normally. */
body.m-port { display: block; padding: 0; height: auto;
  overflow-x: hidden; overflow-y: auto; }
body.m-port .frame { width: 100vw; height: auto; transform: none;
  border-radius: 0; border-left: none; border-right: none; }
body.m-port .grid { display: flex; flex-direction: column; min-height: 0; padding-top: 14px; }
body.m-port .arena { display: none; }
/* portrait stack: hero (piggy/equity) on top -> CLOSED TRADES -> FEED.
   FEED lives inside .wallet, so drop the wallet box (display:contents) and let its
   children reorder against the results panel via flex order. */
body.m-port .wallet { display: contents; }
body.m-port .wallet > * { padding-left: 16px; padding-right: 16px; }
/* portrait order: hero (0) -> OPEN POSITIONS (1) -> CLOSED TRADES (2) -> FEED (3) */
body.m-port .openpos {
  display: flex; flex-direction: column; order: 1; width: 100%;
  border-left: none; border-bottom: none;
  border-top: 1px solid var(--line); padding: 18px 16px; margin-top: 8px; }
body.m-port .openpos .open-wrap { max-height: none; }
body.m-port .results {
  order: 2; width: 100%; border-left: none; border-right: none;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 18px 16px; }
body.m-port .feed-h, body.m-port .ticker { order: 3; }
body.m-port .feed-h { margin-top: 20px; }
body.m-port .ticker { flex: none; overflow: visible; font-size: 14px; }
body.m-port .closed-wrap { overflow: visible; }
body.m-port .closed-table { font-size: 15px; }
body.m-port .closed-table th { font-size: 10px; }
body.m-port .closed-table .reason { max-width: none; }
/* 2026-10-07: 6 columns at 15px ran past a 390px phone (PnL% / Closed cut off).
   Tighter cells, wrapping headers ("Entry / sol"), long tickers ellipsised, and a
   sideways-scroll fallback for very narrow phones. */
body.m-port .closed-table th, body.m-port .closed-table td { padding: 4px 3px; }
body.m-port .closed-table th { white-space: normal; letter-spacing: .02em; vertical-align: bottom; }
body.m-port .closed-table .sym { max-width: 10ch; overflow: hidden; text-overflow: ellipsis; }
body.m-port .closed-wrap { overflow-x: auto; }
body.m-port .piggy-img { width: 190px; }
body.m-port .equity .eq-num { font-size: 42px; }
body.m-port .topbar, body.m-port .footbar { flex-wrap: wrap; gap: 6px 14px; }
/* standalone (home-screen) fullscreen: push header below the iOS status bar */
body.m-port .topbar { padding-top: calc(10px + env(safe-area-inset-top)); }
/* keep UTC + SESSION clocks on one line in portrait: shrink text/gaps + no-wrap */
body.m-port .session { flex-wrap: nowrap; gap: 7px; font-size: 11px; letter-spacing: .06em; white-space: nowrap; }
body.m-port .session .lbl { font-size: 9px; letter-spacing: .1em; }
body.m-port .session .clock { font-size: 11px; }
body.m-port .foot-cell.mid .wallet-link { font-size: 11px; word-break: break-all; }
/* portrait footer: stack the cells, push the social icons to the very bottom */
body.m-port .footbar { flex-direction: column; align-items: center; gap: 14px; }
body.m-port .foot-social { order: 3; }
