/* ============================================================
   app.css - Cartoon terminal theme
   Thick ink outlines, hard offset shadows, saturated colours,
   chunky buttons that physically press down.
   ============================================================ */

:root {
  /* ink is the outline colour everything is drawn with */
  --ink:       #05060d;
  --ink-soft:  #171a2e;

  --bg:        #0b0e1c;
  --bg-2:      #101430;
  --panel:     #161b38;
  --panel-2:   #1d2449;
  --row:       #1a2044;
  --row-hover: #242c5c;

  --text:      #f3f5ff;
  --muted:     #a6b0d8;
  --dim:       #6f7bab;

  --up:        #34e392;
  --up-deep:   #10a866;
  --down:      #ff4f6f;
  --down-deep: #c81f43;
  --purple:    #a06bff;
  --cyan:      #35d9f5;
  --yellow:    #ffd23f;
  --pink:      #ff6bd6;
  --orange:    #ff9f43;

  --accent:    var(--purple);
  --accent-2:  var(--cyan);
  --gold:      var(--yellow);

  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  --display: "Segoe UI Black", "Arial Black", Impact, var(--sans);

  --bd: 2.5px solid var(--ink);
  --pop: 3px 3px 0 var(--ink);
  --pop-lg: 5px 5px 0 var(--ink);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  overflow: hidden;
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.045) 1.4px, transparent 1.4px) 0 0 / 16px 16px,
    radial-gradient(ellipse at 20% -10%, #2a1c5e 0%, transparent 55%),
    radial-gradient(ellipse at 90% 110%, #10404a 0%, transparent 50%),
    var(--bg);
}

button, input, select { font-family: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
input {
  background: var(--bg-2); border: 2px solid var(--ink); border-radius: 8px;
  color: var(--text); font-weight: 700;
}
input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(53,217,245,.3); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--panel-2); border: 2px solid var(--ink); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple); }

.mono { font-family: var(--mono); }
.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.hidden { display: none !important; }
.spacer { flex: 1; }

.eth-ico { vertical-align: -1px; margin-right: 3px; flex: 0 0 auto; }
.eth-n { font-family: var(--mono); font-weight: 700; }
.eth-u { display: inline-flex; align-items: center; }
.eth-u .eth-ico { margin-right: 0; }

#app { display: grid; grid-template-rows: 62px 38px 1fr 26px; height: 100vh; }

/* ---------------- Topbar ---------------- */
.topbar {
  display: flex; align-items: center; gap: 9px; padding: 0 12px;
  border-bottom: 3px solid var(--ink);
  background: linear-gradient(180deg, #221a4e, #141232);
  box-shadow: 0 3px 0 rgba(0,0,0,.35);
  z-index: 5;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
}
.topbar::-webkit-scrollbar { display: none; }
.topbar > * { flex: 0 0 auto; }
.topbar .spacer { flex: 1 1 auto; min-width: 4px; }

/* every chip is the same height and never wraps, so the row stays level */
.wallet-chip, .lvl-chip, .me-chip, .buy-preset {
  height: 48px; justify-content: center; white-space: nowrap;
}
.topbar .divider-v { height: 30px; }

.brand { transform: rotate(-2deg); }
.brand .logo {
  font-family: var(--display); font-size: 21px; letter-spacing: 1px; line-height: 1;
  color: var(--yellow);
  -webkit-text-stroke: 2.5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 3px 3px 0 var(--ink);
}
.brand .sub {
  font-size: 7.5px; color: var(--pink); letter-spacing: 1.4px; margin-top: 3px;
  font-weight: 800;
}

.view-switch { display: flex; gap: 5px; }
.view-switch button {
  font-family: var(--display); font-size: 10.5px; letter-spacing: .6px;
  padding: 7px 13px; border-radius: 9px; color: var(--text);
  background: var(--panel-2); border: var(--bd); box-shadow: var(--pop);
  transition: transform .08s, box-shadow .08s;
}
.view-switch button:hover { transform: translate(-1px,-1px); box-shadow: var(--pop-lg); }
.view-switch button:active { transform: translate(3px,3px); box-shadow: 0 0 0 var(--ink); }
.view-switch button.active { background: var(--purple); color: #150a2e; }

.wallet-chip { cursor: default; }
#chip-balance { cursor: pointer; }
#chip-balance:hover { border-color: var(--cyan); }
.wallet-chip {
  display: flex; flex-direction: column; gap: 0;
  padding: 0 11px; border: var(--bd); box-shadow: var(--pop);
  border-radius: 10px; background: var(--panel); min-width: 96px;
}
.wallet-chip .k { font-size: 7.5px; letter-spacing: 1px; color: var(--dim); font-weight: 800; }
.wallet-chip .v { font-size: 15px; font-weight: 900; font-family: var(--mono); }
.wallet-chip .u { font-size: 8.5px; color: var(--dim); font-family: var(--mono); font-weight: 700; }
.wallet-chip.pnl { background: var(--bg-2); }

.buy-preset { display: flex; flex-direction: column; gap: 4px; }
.buy-preset .k { font-size: 7.5px; letter-spacing: 1px; color: var(--yellow); font-weight: 800; }
.buy-preset .row { display: flex; gap: 4px; }
.speed-group, .view-switch { align-items: center; }
.buy-preset button, .speed-group button {
  font-family: var(--mono); font-size: 10.5px; font-weight: 800;
  padding: 5px 9px; border-radius: 8px;
  background: var(--panel-2); border: var(--bd); box-shadow: 2px 2px 0 var(--ink);
  color: var(--muted); transition: transform .08s, box-shadow .08s;
}
.buy-preset button:hover, .speed-group button:hover { color: var(--text); transform: translate(-1px,-1px); box-shadow: var(--pop); }
.buy-preset button:active, .speed-group button:active { transform: translate(2px,2px); box-shadow: none; }
.buy-preset button.active { background: var(--up); border-color: var(--ink); color: #04240f; }

.speed-group { display: flex; gap: 4px; }
.speed-group button.active { background: var(--cyan); color: #04222a; }

.tool-btn {
  width: 34px; height: 34px; border-radius: 10px;
  border: var(--bd); box-shadow: var(--pop);
  background: var(--panel-2); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 900;
  transition: transform .08s, box-shadow .08s;
}
.tool-btn:hover { transform: translate(-1px,-1px); box-shadow: var(--pop-lg); background: var(--purple); }
.tool-btn.off { opacity: .55; }
.tool-btn:active { transform: translate(3px,3px); box-shadow: none; }

/* ---------------- Ribbon ---------------- */
.ribbon {
  display: flex; align-items: center; gap: 7px;
  padding: 0 10px; overflow-x: auto; overflow-y: hidden;
  border-bottom: 3px solid var(--ink);
  background: repeating-linear-gradient(-45deg, #1a1440 0 14px, #171238 14px 28px);
  scrollbar-width: none;
}
.ribbon::-webkit-scrollbar { display: none; }
.rib {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  padding: 4px 9px; border-radius: 9px;
  border: 2px solid var(--ink); background: var(--panel);
  cursor: pointer; font-size: 11px; white-space: nowrap; font-weight: 700;
  transition: transform .1s;
}
.rib:hover { transform: translateY(-2px) rotate(-1.5deg); background: var(--panel-2); }
.rib .e { font-size: 14px; }
.rib .s { font-family: var(--mono); font-weight: 900; }
.rib .m { font-family: var(--mono); font-size: 10.5px; font-weight: 800; }

/* ---------------- Main ---------------- */
.main { position: relative; min-height: 0; display: flex; }
.columns {
  flex: 1; display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; padding: 10px; min-height: 0;
}
.col {
  background: var(--panel); border: 3px solid var(--ink); border-radius: 16px;
  box-shadow: 5px 5px 0 rgba(0,0,0,.5);
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
.col-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 11px; border-bottom: 3px solid var(--ink);
  font-family: var(--display); font-size: 11px; letter-spacing: .8px; color: var(--text);
  background: var(--panel-2);
}
.col:nth-child(1) .col-head { background: linear-gradient(180deg, #4a2f9e, #341f78); }
.col:nth-child(2) .col-head { background: linear-gradient(180deg, #9e6a1a, #7a4f12); }
.col:nth-child(3) .col-head { background: linear-gradient(180deg, #147a52, #0d5c3d); }
.col-head .dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--ink); }
.col-head .n {
  font-family: var(--mono); font-size: 10px; font-weight: 900; color: var(--ink);
  background: var(--text); border-radius: 20px; padding: 1px 7px; border: 2px solid var(--ink);
}
.col-head .sorts { margin-left: auto; display: flex; gap: 3px; }
.col-head .sorts button {
  font-size: 8.5px; letter-spacing: .4px; padding: 3px 6px; border-radius: 6px;
  color: rgba(255,255,255,.65); border: 2px solid transparent; font-weight: 800;
}
.col-head .sorts button:hover { color: #fff; }
.col-head .sorts button.active { color: var(--ink); background: var(--yellow); border-color: var(--ink); }
.col-list { flex: 1; overflow-y: auto; padding: 8px; }

/* ---------------- Token card ---------------- */
.tok {
  display: grid; grid-template-columns: 46px 1fr auto;
  gap: 10px; padding: 9px; margin-bottom: 9px;
  background: var(--row); border: 2.5px solid var(--ink);
  border-radius: 14px; cursor: pointer; position: relative;
  box-shadow: var(--pop);
  transition: transform .1s, box-shadow .1s, background .1s;
  animation: popIn .22s cubic-bezier(.3,1.6,.5,1);
}
@keyframes popIn { from { transform: scale(.9); opacity: 0; } }
.tok:hover {
  background: var(--row-hover); transform: translate(-2px,-2px) rotate(-.4deg);
  box-shadow: 6px 6px 0 var(--ink);
}
.tok:active { transform: translate(2px,2px); box-shadow: 0 0 0 var(--ink); }
.tok.sel { background: #2c2260; border-color: var(--purple); box-shadow: 4px 4px 0 var(--purple); }
.tok.held { border-color: var(--yellow); box-shadow: 4px 4px 0 var(--yellow); }
.tok.dead { opacity: .55; filter: saturate(.4); }
.tok.rugged { background: #3d1526; border-color: var(--down); box-shadow: 4px 4px 0 var(--down-deep); animation: wiggle .5s; }
@keyframes wiggle {
  0%,100% { transform: rotate(0); } 25% { transform: rotate(-2.5deg); } 75% { transform: rotate(2.5deg); }
}

.avatar {
  width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 25px; position: relative; overflow: hidden;
  border: 2.5px solid var(--ink); box-shadow: 2px 2px 0 var(--ink);
}
.avatar::after {
  content: ''; position: absolute; top: -10%; left: -20%; width: 70%; height: 55%;
  background: rgba(255,255,255,.28); border-radius: 50%; transform: rotate(-20deg);
}
.avatar.lg { width: 52px; height: 52px; border-radius: 16px; font-size: 28px; }

.tok-mid { min-width: 0; }
.tok-top { display: flex; align-items: center; gap: 6px; }
.tok-sym { font-family: var(--display); font-size: 14px; letter-spacing: .3px; }
.tok-name {
  font-size: 10.5px; color: var(--dim); white-space: nowrap; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; max-width: 120px;
}
.tok-sub { display: flex; align-items: center; gap: 7px; margin-top: 4px; font-size: 10px; color: var(--dim); font-family: var(--mono); font-weight: 700; }
.tok-sub .age { color: var(--up); }
.tok-sub .age.old { color: var(--dim); }
.soc { display: inline-flex; gap: 3px; }
.soc i {
  width: 15px; height: 15px; border-radius: 5px; background: var(--panel-2);
  border: 1.5px solid var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 8px; font-style: normal; font-weight: 900; color: var(--muted);
}

.badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.bdg {
  display: inline-flex; align-items: center; gap: 3px;
  font-family: var(--mono); font-size: 9px; font-weight: 800;
  padding: 2.5px 6px; border-radius: 20px;
  background: var(--panel-2); color: var(--muted); border: 1.5px solid var(--ink);
}
.bdg.good { background: var(--up-deep); color: #d6ffe9; }
.bdg.warn { background: #a77410; color: #fff2cf; }
.bdg.bad  { background: var(--down-deep); color: #ffd9e1; }

.tok-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.tok-mc { font-family: var(--mono); font-size: 13px; font-weight: 900; }
.tok-v { font-family: var(--mono); font-size: 9.5px; color: var(--dim); font-weight: 700; }
.spark { width: 64px; height: 22px; display: block; }
.buy-btn {
  font-family: var(--display); font-size: 11px;
  padding: 6px 11px; border-radius: 10px; margin-top: 2px;
  background: var(--up); border: 2.5px solid var(--ink); color: #04240f;
  box-shadow: 2.5px 2.5px 0 var(--ink);
  transition: transform .07s, box-shadow .07s;
}
.buy-btn:hover { transform: translate(-1px,-1px); box-shadow: var(--pop); }
.buy-btn:active { transform: translate(2.5px,2.5px); box-shadow: none; }

.curve-bar {
  height: 8px; background: var(--bg); border-radius: 20px; margin-top: 8px;
  overflow: hidden; border: 2px solid var(--ink);
}
.curve-bar i {
  display: block; height: 100%;
  background: repeating-linear-gradient(45deg, var(--cyan) 0 6px, var(--up) 6px 12px);
  transition: width .25s;
}

.risk-tag {
  margin-left: auto; flex: 0 0 auto;
  font-family: var(--display); font-size: 8.5px; letter-spacing: .4px;
  padding: 3px 7px; border-radius: 20px; border: 2px solid var(--ink); color: var(--ink);
}
.risk-low  { background: var(--up); }
.risk-mid  { background: var(--cyan); }
.risk-high { background: var(--yellow); }
.risk-max  { background: var(--down); color: #fff; animation: throb 1s infinite; }
@keyframes throb { 50% { transform: scale(1.09); } }

/* ---------------- Panes ---------------- */
.pane {
  flex: 1; margin: 10px; background: var(--panel);
  border: 3px solid var(--ink); border-radius: 16px; box-shadow: 5px 5px 0 rgba(0,0,0,.5);
  display: flex; flex-direction: column; min-height: 0; overflow-y: auto;
}
.pane-head {
  display: flex; align-items: center; gap: 10px; padding: 11px 13px;
  border-bottom: 3px solid var(--ink); background: var(--panel-2);
  font-family: var(--display); font-size: 12px; letter-spacing: 1px;
}
.pane-sub {
  padding: 12px 13px 7px; font-family: var(--display); font-size: 10px;
  letter-spacing: 1px; color: var(--yellow);
}

.stats-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; padding: 10px; }
.stats-strip .s {
  background: var(--bg-2); padding: 9px 11px;
  border: 2.5px solid var(--ink); border-radius: 12px; box-shadow: var(--pop);
}
.stats-strip .s .k { font-size: 8px; letter-spacing: 1px; color: var(--dim); font-weight: 800; }
.stats-strip .s .v { font-family: var(--mono); font-size: 16px; font-weight: 900; margin-top: 3px; }

table.grid, table.tape { width: 100%; border-collapse: collapse; font-size: 11.5px; }
table.grid th, table.tape th {
  position: sticky; top: 0; z-index: 1; background: var(--panel-2);
  text-align: left; font-family: var(--display); font-size: 8.5px; letter-spacing: 1px;
  color: var(--muted); padding: 8px 12px; border-bottom: 3px solid var(--ink);
}
table.grid td, table.tape td {
  padding: 8px 12px; border-bottom: 2px solid var(--ink-soft);
  font-family: var(--mono); font-weight: 700;
}
table.grid tr:hover td, table.tape tr:hover td { background: var(--row-hover); }
table.grid td.sym, table.tape td.sym { font-weight: 900; }

.mini-btn {
  font-family: var(--mono); font-size: 9.5px; font-weight: 900;
  padding: 5px 9px; border-radius: 8px;
  background: var(--panel-2); border: 2px solid var(--ink); color: var(--muted);
  box-shadow: 2px 2px 0 var(--ink); transition: transform .07s, box-shadow .07s;
}
.mini-btn:hover { color: var(--text); transform: translate(-1px,-1px); box-shadow: var(--pop); }
.mini-btn:active { transform: translate(2px,2px); box-shadow: none; }
.mini-btn.danger { background: var(--down); color: #fff; }
.mini-btn.good { background: var(--up); color: #04240f; }

.empty { padding: 30px; text-align: center; color: var(--dim); font-size: 12px; font-weight: 700; }

.feed-item {
  display: flex; gap: 10px; align-items: center; padding: 9px 13px;
  border-bottom: 2px solid var(--ink-soft); font-size: 11.5px; cursor: pointer; font-weight: 600;
}
.feed-item:hover { background: var(--row-hover); }
.feed-item .ts { font-family: var(--mono); font-size: 9.5px; color: var(--dim); min-width: 58px; font-weight: 700; }
.feed-item .kind {
  font-family: var(--display); font-size: 8.5px; letter-spacing: .5px;
  padding: 3px 7px; border-radius: 20px; min-width: 70px; text-align: center;
  border: 2px solid var(--ink); color: var(--ink);
}
.k-launch  { background: var(--purple); }
.k-migrate { background: var(--cyan); }
.k-rug     { background: var(--down); color: #fff; }
.k-moon    { background: var(--up); }
.k-devsold { background: var(--yellow); }
.k-send    { background: var(--pink); }
.feed-item .sym { font-family: var(--mono); font-weight: 900; min-width: 74px; }

/* ---------------- Token page ---------------- */
.token-page {
  flex: 1; display: grid; grid-template-columns: 1fr 336px;
  gap: 10px; padding: 10px; min-height: 0;
}
.tp-main {
  background: var(--panel); border: 3px solid var(--ink); border-radius: 16px;
  box-shadow: 5px 5px 0 rgba(0,0,0,.5);
  display: grid; grid-template-rows: auto auto minmax(150px, 1fr) auto auto 40%;
  min-height: 0; overflow: hidden;
}
.tp-side {
  background: var(--panel); border: 3px solid var(--ink); border-radius: 16px;
  box-shadow: 5px 5px 0 rgba(0,0,0,.5);
  display: flex; flex-direction: column; min-height: 0; overflow-y: auto;
}

.tp-head {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  border-bottom: 3px solid var(--ink); background: var(--panel-2);
}
.tp-id { min-width: 0; }
.tp-sym-row { display: flex; align-items: center; gap: 8px; }
.tp-sym {
  font-family: var(--display); font-size: 21px; letter-spacing: .5px;
  -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill;
}
.tp-name { font-size: 11.5px; color: var(--dim); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.tp-sub { font-size: 10px; color: var(--dim); margin-top: 3px; font-weight: 700; }
.tp-mc {
  padding: 5px 11px; border: 2.5px solid var(--ink); border-radius: 12px;
  background: var(--bg-2); box-shadow: var(--pop);
}
.tp-mc .v { font-family: var(--mono); font-size: 20px; font-weight: 900; }
.tp-mc .k { font-size: 7.5px; letter-spacing: 1px; color: var(--dim); font-weight: 800; }
.tp-metrics { display: flex; gap: 15px; flex-wrap: wrap; margin-left: 4px; }
.tp-metrics .m .k { font-size: 7.5px; letter-spacing: 1px; color: var(--dim); font-weight: 800; }
.tp-metrics .m .v { font-family: var(--mono); font-size: 11.5px; font-weight: 800; margin-top: 3px; }
.amm-badge {
  margin-left: auto; font-family: var(--display); font-size: 9px; letter-spacing: .6px;
  padding: 7px 11px; border-radius: 10px;
  background: var(--purple); color: var(--ink);
  border: 2.5px solid var(--ink); box-shadow: var(--pop);
}

.tp-toolbar {
  display: flex; align-items: center; gap: 5px; padding: 7px 10px;
  border-bottom: 3px solid var(--ink); background: var(--bg-2);
}
.divider-v { width: 3px; height: 17px; background: var(--ink); border-radius: 2px; margin: 0 4px; }
.tf-group { display: flex; gap: 4px; }
.tf-group button, .cbtn {
  font-family: var(--mono); font-size: 10px; font-weight: 800;
  padding: 5px 9px; border-radius: 8px; color: var(--muted);
  border: 2px solid var(--ink); background: var(--panel);
  box-shadow: 2px 2px 0 var(--ink); transition: transform .07s, box-shadow .07s;
}
.tf-group button:hover, .cbtn:hover { color: var(--text); transform: translate(-1px,-1px); box-shadow: var(--pop); }
.tf-group button:active, .cbtn:active { transform: translate(2px,2px); box-shadow: none; }
.tf-group button.active { background: var(--cyan); color: var(--ink); }
.cbtn.on { background: var(--yellow); color: var(--ink); }
.tp-curve-inline { font-family: var(--mono); font-size: 9.5px; color: var(--muted); margin-right: 8px; font-weight: 800; }

.chart-wrap { position: relative; min-height: 0; background: var(--bg); }
#chart { width: 100%; height: 100%; display: block; cursor: crosshair; }
#chart.grabbing { cursor: grabbing; }
.chart-flash {
  position: absolute; inset: 0; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 58px; letter-spacing: 2px;
  opacity: 0; transform: scale(.5) rotate(-8deg);
  -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill;
}
.chart-flash.show { animation: bam .6s cubic-bezier(.2,1.7,.4,1); }
@keyframes bam {
  0% { opacity: 0; transform: scale(.4) rotate(-14deg); }
  35% { opacity: 1; transform: scale(1.15) rotate(-5deg); }
  70% { opacity: 1; transform: scale(1) rotate(-6deg); }
  100% { opacity: 0; transform: scale(1.05) rotate(-6deg); }
}

.tp-tabs { display: flex; gap: 5px; padding: 7px 9px 0; border-top: 3px solid var(--ink); background: var(--panel-2); }
.tp-tabs button {
  font-family: var(--display); font-size: 10px; letter-spacing: .6px;
  padding: 7px 11px; border-radius: 10px 10px 0 0; color: var(--muted);
  border: 2.5px solid var(--ink); border-bottom: none; background: var(--panel);
}
.tp-tabs button:hover { color: var(--text); }
.tp-tabs button.active { background: var(--yellow); color: var(--ink); }
.tp-tabs .count {
  font-family: var(--mono); font-size: 9px; margin-left: 4px;
  background: var(--ink); color: var(--yellow); border-radius: 20px; padding: 1px 5px;
}
.tp-tabs button.active .count { background: var(--ink); color: var(--yellow); }

.tp-filters {
  display: flex; align-items: center; gap: 13px; flex-wrap: wrap;
  padding: 8px 12px; border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink);
  font-family: var(--mono); font-size: 9.5px; color: var(--dim); font-weight: 800;
  background: var(--bg-2);
}
.tp-filters b { font-weight: 900; }
.tp-body { overflow-y: auto; min-height: 0; }

.tape td { padding: 6px 12px; font-size: 10.5px; }
.tape tr.you td { background: rgba(255,210,63,.16); }
.side-pill {
  display: inline-block; min-width: 40px; text-align: center;
  font-family: var(--display); font-size: 9px; padding: 3px 7px; border-radius: 20px;
  border: 2px solid var(--ink); color: var(--ink);
}
.side-pill.buy { background: var(--up); }
.side-pill.sell { background: var(--down); color: #fff; }
.wtag {
  font-family: var(--display); font-size: 7.5px; padding: 2px 5px; border-radius: 20px;
  margin-left: 5px; border: 1.5px solid var(--ink); color: var(--ink);
}
.w-dev { background: var(--down); color: #fff; }
.w-sniper { background: var(--yellow); }
.w-insider { background: var(--pink); }
.w-kol { background: var(--cyan); }
.w-you { background: var(--yellow); }

.hbar { height: 9px; background: var(--bg); border: 2px solid var(--ink); border-radius: 20px; overflow: hidden; min-width: 70px; }
.hbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--purple)); }

/* right panel */
.perf-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 9px; }
.perf-strip .p {
  background: var(--bg-2); padding: 6px 3px; text-align: center;
  border: 2.5px solid var(--ink); border-radius: 10px;
}
.perf-strip .p .k { font-size: 7.5px; color: var(--dim); letter-spacing: .8px; font-weight: 800; }
.perf-strip .p .v { font-family: var(--mono); font-size: 12px; font-weight: 900; margin-top: 2px; }

.trade-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 9px 9px; }
.trade-tabs button {
  padding: 10px; border-radius: 11px; font-family: var(--display); font-size: 13px; letter-spacing: .6px;
  background: var(--panel-2); border: 2.5px solid var(--ink); color: var(--muted);
  box-shadow: var(--pop); transition: transform .07s, box-shadow .07s;
}
.trade-tabs button:hover { transform: translate(-1px,-1px); box-shadow: var(--pop-lg); }
.trade-tabs button:active { transform: translate(3px,3px); box-shadow: none; }
.trade-tabs button:first-child.active { background: var(--up); color: var(--ink); }
.trade-tabs button:last-child.active { background: var(--down); color: #fff; }

.side-pad { padding: 0 9px 9px; }
.amount-row {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg-2); border: 2.5px solid var(--ink); border-radius: 11px; padding: 0 10px;
  box-shadow: inset 0 2px 0 rgba(0,0,0,.35);
}
.amount-row .eth-mark { display: inline-flex; }
.amount-row input {
  flex: 1; padding: 10px 0; font-family: var(--mono); font-size: 17px; font-weight: 900;
  border: none; background: none; box-shadow: none;
}
.amount-row input:focus { box-shadow: none; }
.amount-row .unit { font-family: var(--mono); font-size: 10px; color: var(--dim); font-weight: 800; }

.quick-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin: 8px 0 10px; }
.quick-row.three { grid-template-columns: repeat(3, 1fr); }
.quick-row button {
  padding: 7px 2px; border-radius: 9px; font-family: var(--mono); font-size: 10px; font-weight: 900;
  background: var(--panel-2); border: 2px solid var(--ink); color: var(--muted);
  box-shadow: 2px 2px 0 var(--ink); transition: transform .07s, box-shadow .07s;
}
.quick-row button:hover { color: var(--ink); background: var(--cyan); transform: translate(-1px,-1px); box-shadow: var(--pop); }
.quick-row button:active { transform: translate(2px,2px); box-shadow: none; }
.preset-edit { color: var(--yellow) !important; }
.preset-edit:hover { background: var(--yellow) !important; color: var(--ink) !important; }
.buy-preset .preset-edit { padding: 5px 8px; }
.preset-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.preset-grid input { text-align: center; padding: 8px 4px; }

.submit-btn {
  width: 100%; padding: 14px; border-radius: 13px;
  font-family: var(--display); font-size: 17px; letter-spacing: 1px;
  border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
  transition: transform .07s, box-shadow .07s;
}
.submit-btn.buy { background: var(--up); color: var(--ink); }
.submit-btn.sell { background: var(--down); color: #fff; }
.submit-btn:hover:not(:disabled) { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--ink); }
.submit-btn:active:not(:disabled) { transform: translate(4px,4px); box-shadow: none; }
.submit-btn:disabled { opacity: .4; cursor: not-allowed; }

.auto-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 7px; align-items: end; margin-top: 12px; }
.auto-row .f label { display: block; font-size: 8px; letter-spacing: 1px; color: var(--yellow); margin-bottom: 4px; font-weight: 800; }
.auto-row input { width: 100%; padding: 7px 9px; font-family: var(--mono); font-size: 12px; }

.exec-row { display: flex; align-items: center; gap: 9px; margin-top: 11px; font-size: 9px; color: var(--dim); font-family: var(--mono); font-weight: 800; }
.exec-row b { color: var(--text); }

.bag-strip {
  margin-top: 11px; border: 2.5px solid var(--ink); border-radius: 12px;
  background: var(--bg-2); padding: 9px 11px; box-shadow: var(--pop);
}
.bag-strip .r { display: flex; justify-content: space-between; font-size: 10.5px; padding: 3px 0; font-weight: 700; }
.bag-strip .r .k { color: var(--dim); }
.bag-strip .r .v { font-family: var(--mono); font-weight: 800; }

.audit-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink);
  font-family: var(--display); font-size: 10px; letter-spacing: 1px; color: var(--text);
  background: var(--panel-2);
}
.audit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 9px; }
.audit-grid .a { background: var(--bg-2); padding: 8px 9px; border: 2.5px solid var(--ink); border-radius: 10px; }
.audit-grid .a .k { font-size: 7.5px; letter-spacing: .9px; color: var(--dim); font-weight: 800; }
.audit-grid .a .v { font-family: var(--mono); font-size: 13px; font-weight: 900; margin-top: 3px; }

.audit-flags { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 12px 12px; }
.flag {
  font-family: var(--display); font-size: 8.5px; padding: 4px 8px; border-radius: 20px;
  border: 2px solid var(--ink); color: var(--ink);
}
.flag.ok { background: var(--up); }
.flag.no { background: var(--down); color: #fff; }

.addr-list { padding: 0 0 12px; }
.addr-list .r { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; font-size: 10px; font-weight: 700; }
.addr-list .r .k { color: var(--dim); letter-spacing: .6px; }
.addr-list .r .v { font-family: var(--mono); color: var(--muted); font-weight: 800; }

/* ---------------- Statusbar ---------------- */
.statusbar {
  display: flex; align-items: center; gap: 14px; padding: 0 12px;
  border-top: 3px solid var(--ink); background: var(--bg-2);
  font-family: var(--mono); font-size: 9.5px; color: var(--dim); font-weight: 800;
}
.statusbar .sep { width: 3px; height: 12px; background: var(--ink); border-radius: 2px; }

/* ---------------- Toast ---------------- */
#toasts { position: fixed; right: 16px; bottom: 40px; z-index: 60; display: flex; flex-direction: column; gap: 9px; align-items: flex-end; }
.toast {
  background: var(--panel-2); border: 3px solid var(--ink);
  border-radius: 13px; padding: 10px 14px; font-size: 12px; min-width: 200px; max-width: 330px;
  box-shadow: 5px 5px 0 var(--ink);
  animation: toastIn .25s cubic-bezier(.3,1.7,.5,1);
}
@keyframes toastIn { from { transform: translateX(40px) rotate(4deg); opacity: 0; } }
.toast.ok { background: var(--up-deep); }
.toast.err { background: var(--down-deep); }
.toast.warn { background: #9c6d0d; }
.toast .t { font-family: var(--display); font-size: 12.5px; margin-bottom: 3px; }
.toast .d { color: rgba(255,255,255,.82); font-family: var(--mono); font-size: 10.5px; font-weight: 700; }

/* ---------------- Modal ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(5,6,13,.78); display: flex;
  align-items: center; justify-content: center; z-index: 80; backdrop-filter: blur(3px);
}
.modal {
  background: var(--panel); border: 4px solid var(--ink); border-radius: 20px;
  width: min(580px, 92vw); max-height: 84vh; overflow: auto;
  box-shadow: 9px 9px 0 var(--ink);
  animation: popIn .25s cubic-bezier(.3,1.6,.5,1);
}
.modal h3 {
  margin: 0; padding: 15px 18px; border-bottom: 3px solid var(--ink);
  font-family: var(--display); font-size: 15px; letter-spacing: .5px;
  background: var(--purple); color: var(--ink);
}
.modal .body { padding: 18px; font-size: 12.5px; line-height: 1.7; color: var(--muted); font-weight: 600; }
.modal .body h5 { color: var(--yellow); margin: 16px 0 7px; font-family: var(--display); font-size: 11px; letter-spacing: 1px; }
.modal .body ul { margin: 0; padding-left: 20px; }
.modal .body b { color: var(--text); }
.modal .body kbd {
  font-family: var(--mono); font-size: 10px; background: var(--bg-2);
  border: 2px solid var(--ink); box-shadow: 0 2px 0 var(--ink);
  border-radius: 6px; padding: 2px 6px; color: var(--text); font-weight: 800;
}
.modal .body label { display: block; font-family: var(--display); font-size: 9.5px; letter-spacing: 1px; color: var(--yellow); margin: 14px 0 6px; }
.modal .body input { width: 100%; padding: 9px; font-family: var(--mono); font-size: 13px; }
.modal .foot { padding: 14px 18px; border-top: 3px solid var(--ink); display: flex; gap: 10px; justify-content: flex-end; }
.modal .foot button {
  padding: 9px 18px; border-radius: 11px; font-family: var(--display); font-size: 12px;
  background: var(--panel-2); border: 2.5px solid var(--ink); color: var(--muted);
  box-shadow: var(--pop); transition: transform .07s, box-shadow .07s;
}
.modal .foot button:hover { transform: translate(-1px,-1px); box-shadow: var(--pop-lg); color: var(--text); }
.modal .foot button:active { transform: translate(3px,3px); box-shadow: none; }
.modal .foot button.primary { background: var(--cyan); color: var(--ink); }
.modal .foot button.danger { background: var(--down); color: #fff; }

/* ---------------- Login ---------------- */
.login-screen {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.05) 1.4px, transparent 1.4px) 0 0 / 16px 16px,
    radial-gradient(ellipse at 25% 0%, #3a2178 0%, transparent 55%),
    radial-gradient(ellipse at 80% 100%, #0f5057 0%, transparent 55%),
    var(--bg);
  overflow-y: auto;
}
.login-card {
  position: relative;
  width: min(430px, 94vw);
  background: var(--panel); border: 4px solid var(--ink); border-radius: 22px;
  box-shadow: 10px 10px 0 var(--ink); padding: 24px;
  animation: popIn .3s cubic-bezier(.3,1.6,.5,1);
}
.login-logo {
  font-family: var(--display); font-size: 40px; letter-spacing: 1px; text-align: center;
  color: var(--yellow); -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill;
  text-shadow: 5px 5px 0 var(--ink); transform: rotate(-2deg); line-height: 1;
}
.login-tag {
  text-align: center; font-size: 9.5px; letter-spacing: 1.2px; color: var(--pink);
  font-weight: 800; margin: 14px 0 18px;
}
.login-card label {
  display: block; font-family: var(--display); font-size: 9.5px; letter-spacing: 1.2px;
  color: var(--cyan); margin: 16px 0 7px;
}
.handle-row {
  display: flex; align-items: center; gap: 6px; padding: 0 12px;
  background: var(--bg-2); border: 3px solid var(--ink); border-radius: 12px;
}
.handle-row .at { font-family: var(--display); font-size: 19px; color: var(--dim); }
.handle-row input {
  flex: 1; border: none; background: none; padding: 12px 0;
  font-family: var(--mono); font-size: 19px; font-weight: 900;
}
.handle-row input:focus { box-shadow: none; }
.login-err { color: var(--down); font-size: 11px; font-weight: 800; min-height: 15px; margin-top: 6px; }

.face-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.face-grid button {
  aspect-ratio: 1; font-size: 19px; border-radius: 11px;
  background: var(--bg-2); border: 2.5px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  transition: transform .08s;
}
.face-grid button:hover { transform: scale(1.12) rotate(-6deg); }
.face-grid button.active { background: var(--yellow); box-shadow: 0 0 0 3px var(--yellow); }

.login-card .submit-btn { margin-top: 20px; }
.login-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 30px; height: 30px; border-radius: 9px; cursor: pointer;
  border: 2.5px solid var(--ink); background: var(--panel-2); color: var(--fg);
  font-weight: 900; font-size: 13px; line-height: 1; box-shadow: 2px 2px 0 var(--ink);
}
.login-close:hover { background: var(--pink); transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--ink); }
.login-close:active { transform: translate(2px,2px); box-shadow: none; }
.login-reason {
  text-align: center; font-size: 11px; font-weight: 800; color: var(--ink);
  background: var(--yellow); border: 2.5px solid var(--ink); border-radius: 9px;
  padding: 7px 10px; margin: -6px 0 14px;
}
.me-chip.guest { background: var(--yellow); color: var(--ink); }
.me-chip.guest .name { letter-spacing: 1px; }
.login-note { text-align: center; font-size: 9.5px; color: var(--dim); margin-top: 12px; font-weight: 700; }
.login-or { text-align: center; font-size: 9px; color: var(--dim); letter-spacing: 1.5px; margin: 16px 0 0; font-weight: 800; }

.profile-list { display: flex; flex-direction: column; gap: 7px; }
.profile-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  background: var(--bg-2); border: 2.5px solid var(--ink); border-radius: 12px;
  cursor: pointer; box-shadow: var(--pop); transition: transform .08s, box-shadow .08s;
}
.profile-row:hover { transform: translate(-2px,-2px); box-shadow: var(--pop-lg); background: var(--row-hover); }
.profile-row .face { font-size: 22px; }
.profile-row .nm { font-family: var(--mono); font-weight: 900; font-size: 13px; }
.profile-row .sub { font-size: 9.5px; color: var(--dim); font-weight: 700; }
.profile-row .eq { margin-left: auto; text-align: right; font-family: var(--mono); font-weight: 900; }
.profile-row .del {
  font-size: 12px; color: var(--dim); padding: 3px 6px; border-radius: 6px;
}
.profile-row .del:hover { color: var(--down); background: rgba(255,79,111,.15); }

/* profile chip in the topbar */
.me-chip {
  display: flex; align-items: center; gap: 8px; padding: 0 11px;
  background: var(--panel-2); border: var(--bd); border-radius: 10px;
  box-shadow: var(--pop); cursor: pointer; transition: transform .08s, box-shadow .08s;
}
.me-chip:hover { transform: translate(-1px,-1px); box-shadow: var(--pop-lg); background: var(--purple); }
.me-chip:active { transform: translate(3px,3px); box-shadow: none; }
.me-chip .face { font-size: 19px; line-height: 1; }
.me-chip .name {
  font-family: var(--mono); font-size: 11.5px; font-weight: 900;
  white-space: nowrap;   /* an address must never break across two lines */
}

.handle-row .gen-btn {
  font-size: 17px; padding: 6px 9px; border-radius: 9px;
  border: 2.5px solid var(--ink); background: var(--yellow);
  box-shadow: 2px 2px 0 var(--ink); margin: 6px 0 6px 6px;
  transition: transform .08s, box-shadow .08s;
}
.handle-row .gen-btn:hover { transform: translate(-1px,-1px) rotate(-8deg); box-shadow: var(--pop); }
.handle-row .gen-btn:active { transform: translate(2px,2px); box-shadow: none; }
.handle-row input { font-size: 13px; letter-spacing: .3px; }

.safety-note {
  margin-top: 10px; padding: 10px 12px;
  background: rgba(255,79,111,.12); border: 2.5px solid var(--down);
  border-radius: 12px; font-size: 10.5px; line-height: 1.55; color: #ffc9d3; font-weight: 600;
}
.safety-note b { color: var(--down); font-family: var(--display); letter-spacing: .5px; }

/* ---------------- Leaderboard ---------------- */
.reset-in {
  font-family: var(--mono); font-size: 10px; font-weight: 900; color: var(--ink);
  background: var(--yellow); border: 2px solid var(--ink); border-radius: 20px; padding: 3px 9px;
}
.prize-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; padding: 11px; }
.prize {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px;
  border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--pop);
}
.prize.p1 { background: linear-gradient(135deg, #ffd23f, #d99b0d); }
.prize.p2 { background: linear-gradient(135deg, #d6dced, #9aa3bd); }
.prize.p3 { background: linear-gradient(135deg, #e39a5c, #b06a2c); }
.prize .medal { font-size: 26px; }
.prize .lbl { font-family: var(--display); font-size: 11px; color: var(--ink); }
.prize .amt { font-family: var(--mono); font-size: 15px; font-weight: 900; color: var(--ink); }

.lb-row {
  display: grid; grid-template-columns: 46px 46px 1fr auto;
  gap: 11px; align-items: center;
  padding: 9px 13px; border-bottom: 2px solid var(--ink-soft);
}
.lb-row:hover { background: var(--row-hover); }
.lb-row.you {
  background: rgba(255,210,63,.14);
  border-left: 5px solid var(--yellow); border-bottom-color: var(--yellow);
}
.lb-row.top3 .lb-rank { background: var(--yellow); color: var(--ink); }
.lb-rank {
  font-family: var(--display); font-size: 14px; text-align: center;
  padding: 5px 0; border-radius: 10px; border: 2.5px solid var(--ink);
  background: var(--panel-2); color: var(--muted);
}
.lb-face {
  font-size: 22px; width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel-2); border: 2.5px solid var(--ink); box-shadow: 2px 2px 0 var(--ink);
}
.lb-who .h { font-family: var(--display); font-size: 13px; }
.lb-who .a { font-family: var(--mono); font-size: 10px; color: var(--dim); font-weight: 700; margin-top: 2px; }
.lb-pnl { text-align: right; font-family: var(--mono); font-size: 15px; font-weight: 900; }
.lb-tag {
  font-family: var(--display); font-size: 7.5px; padding: 2px 6px; border-radius: 20px;
  border: 2px solid var(--ink); background: var(--cyan); color: var(--ink); margin-left: 6px;
}
.lb-tag.you { background: var(--yellow); }

.lb-hist {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 13px; border-bottom: 2px solid var(--ink-soft); font-size: 11px; font-weight: 700;
}
.lb-hist .d { font-family: var(--mono); font-size: 10px; color: var(--dim); min-width: 84px; }
.lb-hist .w { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 10.5px; }

/* ---------------- Timeline ---------------- */
.post {
  display: grid; grid-template-columns: 44px 1fr; gap: 11px;
  padding: 12px 14px; border-bottom: 2px solid var(--ink-soft);
  animation: popIn .2s cubic-bezier(.3,1.6,.5,1);
}
.post:hover { background: var(--row-hover); }
.post.celeb { background: linear-gradient(90deg, rgba(255,210,63,.14), transparent 60%); }
.post.fud { background: linear-gradient(90deg, rgba(255,79,111,.09), transparent 60%); }
.post-face {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: var(--panel-2); border: 2.5px solid var(--ink); box-shadow: 2px 2px 0 var(--ink);
}
.post-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.post-name { font-family: var(--display); font-size: 12.5px; }
.post-ver { color: var(--cyan); font-size: 11px; }
.post-handle, .post-time { font-size: 10.5px; color: var(--dim); font-weight: 700; font-family: var(--mono); }
.post-fol { font-size: 9px; color: var(--dim); font-weight: 800; margin-left: auto; font-family: var(--mono); }
.post-text { font-size: 13px; margin-top: 4px; line-height: 1.5; font-weight: 600; }
.cashtag {
  font-family: var(--mono); font-weight: 900; color: var(--ink);
  background: var(--cyan); border: 2px solid var(--ink); border-radius: 7px;
  padding: 0 5px; cursor: pointer; display: inline-block;
}
.cashtag:hover { background: var(--yellow); }
.post-stats { display: flex; gap: 16px; margin-top: 8px; font-size: 10px; color: var(--dim); font-weight: 800; font-family: var(--mono); }
.post-tag {
  font-family: var(--display); font-size: 8px; padding: 2px 6px; border-radius: 20px;
  border: 2px solid var(--ink); color: var(--ink); margin-left: 4px;
}
.pt-shill { background: var(--up); }
.pt-fud { background: var(--down); color: #fff; }
.pt-news { background: var(--cyan); }
.pt-cope { background: var(--purple); }
.pt-celeb { background: var(--yellow); }

/* ---------------- Celebrity popup ---------------- */
.celeb-pop {
  position: fixed; top: 74px; left: 50%; transform: translateX(-50%);
  z-index: 150; width: min(480px, 92vw);
  animation: dropIn .45s cubic-bezier(.2,1.6,.4,1);
}
@keyframes dropIn {
  from { transform: translateX(-50%) translateY(-140%) rotate(-6deg); }
  60% { transform: translateX(-50%) translateY(8px) rotate(1.5deg); }
  to { transform: translateX(-50%) translateY(0) rotate(0); }
}
.celeb-card {
  background: var(--panel); border: 4px solid var(--ink); border-radius: 20px;
  box-shadow: 8px 8px 0 var(--ink); padding: 15px; position: relative;
}
.celeb-flag {
  position: absolute; top: -14px; left: 18px;
  font-family: var(--display); font-size: 11px; letter-spacing: 1.2px;
  background: var(--down); color: #fff; border: 3px solid var(--ink);
  border-radius: 20px; padding: 3px 12px; transform: rotate(-3deg);
  animation: throb 1s infinite;
}
.celeb-top { display: flex; align-items: center; gap: 11px; }
.celeb-face {
  width: 50px; height: 50px; border-radius: 50%; font-size: 26px;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel-2); border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
}
.celeb-who { min-width: 0; }
.celeb-name { font-family: var(--display); font-size: 15px; }
.celeb-name .ver { color: var(--cyan); font-size: 12px; margin-left: 4px; }
.celeb-handle { font-family: var(--mono); font-size: 11px; color: var(--dim); font-weight: 700; }
.celeb-x {
  margin-left: auto; width: 28px; height: 28px; border-radius: 8px;
  border: 2px solid var(--ink); background: var(--panel-2); color: var(--muted); font-weight: 900;
}
.celeb-x:hover { background: var(--down); color: #fff; }
.celeb-text { font-size: 17px; font-weight: 800; margin: 13px 0; line-height: 1.45; }
.celeb-foot { display: flex; align-items: center; gap: 10px; }
.celeb-note { font-size: 10.5px; color: var(--yellow); font-weight: 800; }
.celeb-foot .mini-btn { margin-left: auto; font-size: 11px; padding: 8px 13px; }

/* ---------------- Level ---------------- */
.lvl-chip {
  display: flex; flex-direction: column; gap: 3px;
  padding: 0 12px; border: var(--bd); border-radius: 10px;
  background: linear-gradient(180deg, #4a3590, #2a1d5c);
  box-shadow: var(--pop); min-width: 182px; cursor: pointer;
  transition: transform .08s, box-shadow .08s;
}
.lvl-chip:hover { transform: translate(-1px,-1px); box-shadow: var(--pop-lg); }
.lvl-chip:active { transform: translate(3px,3px); box-shadow: none; }
.lvl-top { display: flex; align-items: center; gap: 6px; }
.lvl-top .k { font-size: 7.5px; letter-spacing: 1px; color: #b9a8f2; font-weight: 800; }
.lvl-top .lv {
  font-family: var(--display); font-size: 17px; line-height: 1; color: var(--yellow);
  -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill;
}
.lvl-top .rank {
  font-family: var(--display); font-size: 8.5px; letter-spacing: .6px; color: var(--ink);
  background: var(--cyan); border: 2px solid var(--ink); border-radius: 20px;
  padding: 2px 7px; white-space: nowrap;
}
.lvl-bar {
  height: 7px; background: var(--bg); border: 2px solid var(--ink);
  border-radius: 20px; overflow: hidden;
}
.lvl-bar i {
  display: block; height: 100%; width: 0;
  background: repeating-linear-gradient(45deg, var(--yellow) 0 5px, var(--orange) 5px 10px);
  transition: width .3s;
}
.lvl-xp { font-family: var(--mono); font-size: 9px; color: #cbd3f0; font-weight: 800; }

/* level detail modal */
.rank-ladder { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.rank-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 11px;
  border: 2.5px solid var(--ink); border-radius: 10px; background: var(--bg-2);
  font-family: var(--display); font-size: 11px; color: var(--dim);
}
.rank-row .lv { font-family: var(--mono); font-size: 11px; min-width: 46px; }
.rank-row .rw { margin-left: auto; font-family: var(--mono); font-size: 11px; }
.rank-row.done { background: var(--panel-2); color: var(--muted); }
.rank-row.now { background: var(--cyan); color: var(--ink); box-shadow: var(--pop); }
.rank-row.locked { opacity: .5; }

.lvl-pop {
  position: fixed; top: 96px; left: 50%; transform: translateX(-50%);
  z-index: 160; pointer-events: none;
  animation: lvlIn .55s cubic-bezier(.2,1.7,.4,1);
}
@keyframes lvlIn {
  from { transform: translateX(-50%) scale(.3) rotate(-12deg); opacity: 0; }
  55%  { transform: translateX(-50%) scale(1.12) rotate(3deg); opacity: 1; }
  to   { transform: translateX(-50%) scale(1) rotate(0); opacity: 1; }
}
.lvl-card {
  background: linear-gradient(160deg, #ffd23f, #ff9f43);
  border: 4px solid var(--ink); border-radius: 22px;
  box-shadow: 9px 9px 0 var(--ink);
  padding: 20px 46px 22px; text-align: center; position: relative;
}
.lvl-burst {
  position: absolute; top: -16px; left: 50%; transform: translateX(-50%) rotate(-3deg);
  font-family: var(--display); font-size: 13px; letter-spacing: 1.6px;
  background: var(--pink); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 20px; padding: 4px 16px; white-space: nowrap;
}
.lvl-big {
  font-family: var(--display); font-size: 68px; line-height: 1; color: #fff;
  -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill;
  text-shadow: 5px 5px 0 rgba(0,0,0,.25); margin-top: 8px;
}
.lvl-title { font-family: var(--display); font-size: 17px; letter-spacing: 1.4px; color: var(--ink); margin-top: 4px; }
.lvl-reward {
  font-family: var(--display); font-size: 22px; color: #0a3d24; margin-top: 10px;
  background: var(--up); border: 3px solid var(--ink); border-radius: 14px;
  padding: 5px 18px; display: inline-block;
}
.lvl-sub { font-size: 10.5px; font-weight: 800; color: #5a3c05; margin-top: 9px; }

/* ---------------- Wallet manager ---------------- */
.wal-list { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; }
.wal-row {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px;
  background: var(--bg-2); border: 2.5px solid var(--ink); border-radius: 12px;
  box-shadow: var(--pop); cursor: pointer; transition: transform .08s, box-shadow .08s;
}
.wal-row:hover { transform: translate(-2px,-2px); box-shadow: var(--pop-lg); background: var(--row-hover); }
.wal-row.active { background: var(--panel-2); border-color: var(--yellow); box-shadow: 3px 3px 0 var(--yellow); }
.wal-row .face { font-size: 22px; }
.wal-row .nm { font-family: var(--display); font-size: 13px; }
.wal-row .sub { font-size: 10px; color: var(--dim); font-weight: 700; font-family: var(--mono); }
.wal-row .eq { margin-left: auto; text-align: right; font-family: var(--mono); font-weight: 900; }

.wal-new, .wal-move { display: flex; gap: 7px; align-items: center; margin-top: 8px; }
.wal-new input { flex: 1; padding: 8px 10px; }
.wal-new input:last-of-type { flex: 0 0 60px; text-align: center; }
.wal-move select {
  flex: 1; padding: 8px; background: var(--bg-2); color: var(--text);
  border: 2px solid var(--ink); border-radius: 8px; font-weight: 700; font-size: 11px;
}
.wal-move input { flex: 0 0 86px; padding: 8px; text-align: center; }
.wal-move span { font-family: var(--display); color: var(--muted); }

/* ---------------- P&L card ---------------- */
.pnl-modal { width: min(520px, 94vw); }
.pnl-body { padding: 16px; }
.pnl-canvas {
  width: 100%; display: block; border-radius: 14px;
  border: 3px solid var(--ink); box-shadow: var(--pop-lg);
}
.pnl-themes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 14px; }
.pnl-theme {
  padding: 9px 4px; border-radius: 10px; font-family: var(--display); font-size: 11px;
  background: var(--panel-2); border: 2.5px solid var(--ink); color: var(--muted);
  box-shadow: 2px 2px 0 var(--ink); transition: transform .07s, box-shadow .07s;
}
.pnl-theme:hover { transform: translate(-1px,-1px); box-shadow: var(--pop); color: var(--text); }
.pnl-theme:active { transform: translate(2px,2px); box-shadow: none; }
.pnl-theme.active { background: var(--yellow); color: var(--ink); }

.pnl-toggles {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px;
  font-size: 11.5px; font-weight: 800; color: var(--muted);
}
.pnl-toggles label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.pnl-toggles input[type=checkbox] {
  width: 17px; height: 17px; accent-color: var(--up);
  border: 2px solid var(--ink); border-radius: 5px; cursor: pointer;
}
.pnl-toggles .mini-btn { margin-left: auto; }

.pnl-btn {
  width: 100%; margin-top: 10px; padding: 9px; border-radius: 10px;
  font-family: var(--display); font-size: 11px; letter-spacing: .5px;
  background: var(--purple); color: var(--ink);
  border: 2.5px solid var(--ink); box-shadow: var(--pop);
  transition: transform .07s, box-shadow .07s;
}
.pnl-btn:hover { transform: translate(-1px,-1px); box-shadow: var(--pop-lg); }
.pnl-btn:active { transform: translate(3px,3px); box-shadow: none; }

/* ---------------- Topbar compaction ----------------
   The bar carries a lot. Rather than let it overflow or wrap, shed
   decoration first, then the least load-bearing chips. */
@media (max-width: 1750px) {
  .topbar { gap: 7px; }
  .brand .sub { display: none; }
  .brand .logo { font-size: 18px; }
  .view-switch { gap: 4px; }
  .view-switch button { padding: 7px 9px; font-size: 9.5px; }
  .buy-preset button, .speed-group button { padding: 5px 7px; font-size: 10px; }
  .speed-group { gap: 3px; }
  .lvl-chip { min-width: 148px; }
  .wallet-chip { min-width: 82px; padding: 0 9px; }
  .tool-btn { width: 31px; height: 31px; font-size: 14px; }
}

@media (max-width: 1520px) {
  .topbar .divider-v { display: none; }
  .brand { display: none; }
  .wallet-chip, .lvl-chip, .me-chip, .buy-preset { height: 46px; }
  .buy-preset .k { display: none; }
  .lvl-top .k { display: none; }
}

@media (max-width: 1440px) {
  /* the address is on the profile screen anyway — the face still identifies you */
  .me-chip .name { display: none; }
  .me-chip { padding: 0 8px; }
}

@media (max-width: 1320px) {
  /* holding is derivable from the other two — next to go */
  #chip-holding { display: none; }
  .lvl-top .rank { display: none; }
  .lvl-chip { min-width: 104px; }
}

@media (max-width: 1100px) {
  .view-switch button { padding: 7px 7px; font-size: 8.5px; }
  .buy-preset { display: none; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1400px) {
  .token-page { grid-template-columns: 1fr 296px; }
  .tp-metrics { gap: 10px; }
}
@media (max-width: 1150px) {
  .columns { grid-template-columns: repeat(2, 1fr); }
  .col:nth-child(3) { display: none; }
  .tp-metrics .m:nth-child(n+4) { display: none; }
}
@media (max-width: 900px) {
  .columns { grid-template-columns: 1fr; }
  .col:nth-child(2), .col:nth-child(3) { display: none; }
  .token-page { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .tp-metrics { display: none; }
}

/* ---- Privy sign-in ---- */
.login-or-row { display: flex; justify-content: space-between; margin-top: 8px; }
.link-btn {
  background: none; border: 0; padding: 2px 0; cursor: pointer;
  font-size: 10.5px; font-weight: 800; color: var(--dim); text-decoration: underline;
}
.link-btn:hover { color: var(--fg); }

#privy-code { font-family: var(--mono); letter-spacing: 6px; text-align: center; font-size: 18px; }

.submit-btn:disabled { opacity: .55; cursor: default; transform: none; box-shadow: var(--pop); }

.login-offline { margin-top: 12px; }
.login-offline summary {
  cursor: pointer; font-size: 10.5px; font-weight: 800; color: var(--dim);
  list-style: none; padding: 4px 0;
}
.login-offline summary::-webkit-details-marker { display: none; }
.login-offline summary::before { content: '▸ '; }
.login-offline[open] summary::before { content: '▾ '; }
.login-offline summary:hover { color: var(--fg); }
.login-offline p { font-size: 10.5px; color: var(--dim); margin: 6px 0 8px; line-height: 1.5; }

/* ---- live chat ---- */
.online-pill {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 10px;
  padding: 3px 9px; border: 2.5px solid var(--ink); border-radius: 20px;
  background: var(--up); color: var(--ink); font-size: 10px; font-weight: 900;
}
.online-pill i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ink);
  animation: pulse-dot 1.8s ease-in-out infinite;
}
.online-pill.off { background: var(--panel-2); color: var(--dim); }
.online-pill.off i { animation: none; opacity: .4; }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.online-chip.stale .v { color: var(--dim); }

.chat-log {
  flex: 1; min-height: 0; overflow-y: auto; padding: 10px;
  display: flex; flex-direction: column; gap: 7px;
}
.chat-row { display: flex; gap: 8px; align-items: flex-start; }
.chat-face {
  flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center;
  background: var(--panel-2); border: 2.5px solid var(--ink); border-radius: 9px; font-size: 14px;
}
.chat-body { min-width: 0; flex: 1; }
.chat-who { font-family: var(--mono); font-size: 10px; font-weight: 900; color: var(--cyan); }
.chat-time { font-size: 9px; color: var(--dim); margin-left: 6px; font-weight: 800; }
.chat-text {
  font-size: 12px; line-height: 1.45; font-weight: 600; margin-top: 1px;
  overflow-wrap: anywhere; white-space: pre-wrap;
}
.chat-row.you .chat-who { color: var(--yellow); }
.chat-row.you .chat-face { background: var(--yellow); }

.chat-compose { display: flex; gap: 8px; padding: 10px; border-top: var(--bd); }
.chat-compose input {
  flex: 1; min-width: 0; padding: 10px 12px; font-size: 12px; font-weight: 700;
  background: var(--bg-2); border: 2.5px solid var(--ink); border-radius: 11px; color: var(--fg);
}
.chat-compose input:disabled { opacity: .5; }
.chat-compose .submit-btn { width: auto; padding: 10px 18px; margin: 0; }
.chat-note { padding: 0 10px 10px; font-size: 9.5px; color: var(--dim); font-weight: 700; }

#view-social { display: flex; flex-direction: column; }
.chat-err { padding: 0 10px 4px; font-size: 10.5px; font-weight: 800; color: var(--down); min-height: 14px; }

/* ---- username step ---- */
.name-hint { font-size: 10.5px; font-weight: 800; color: var(--dim); margin: 6px 0 10px; min-height: 14px; }
.name-hint.good { color: var(--up); }
.name-hint.bad  { color: var(--down); }
#privy-name { font-family: var(--mono); letter-spacing: 1px; }
.claim-box {
  margin-top: 12px; padding: 10px 12px; font-size: 11px; line-height: 1.55; font-weight: 700;
  background: var(--bg-2); border: 2.5px solid var(--ink); border-radius: 11px;
}

/* ---- payout address ---- */
.payout-box { margin: 10px; padding: 12px 14px; background: var(--panel-2);
  border: var(--bd); border-radius: 14px; box-shadow: var(--pop); }
.payout-box label { display: block; font-size: 9px; letter-spacing: 1px; font-weight: 900;
  color: var(--dim); margin-bottom: 7px; }
.payout-row { display: flex; gap: 8px; }
.payout-row input { flex: 1; min-width: 0; padding: 9px 11px; font-family: var(--mono);
  font-size: 11.5px; font-weight: 700; background: var(--bg-2);
  border: 2.5px solid var(--ink); border-radius: 11px; color: var(--fg); }
.payout-row .mini-btn { flex: 0 0 auto; padding: 9px 16px; }
.payout-msg { font-size: 10.5px; font-weight: 800; margin-top: 6px; min-height: 14px; color: var(--dim); }
.payout-msg.good { color: var(--up); }
.payout-msg.bad  { color: var(--down); }
.payout-note { font-size: 10px; line-height: 1.55; color: var(--dim); font-weight: 700; margin-top: 8px; }
.claim-box.warn { border-color: var(--down); }
.claim-box .mono { font-family: var(--mono); font-size: 11px; }

/* ---- header socials ---- */
.x-btn { display: grid; place-items: center; color: var(--fg); text-decoration: none; }
.x-btn:hover { background: var(--fg); color: var(--ink); }

/* one line under the board head: shared or local, and the round rule */
.lb-note {
  font-size: 9.5px; font-weight: 800; letter-spacing: .8px; color: var(--dim);
  margin: 0 0 10px;
}

/* the competition rules, right above the prizes they govern */
.lb-rules {
  margin: 0 10px 10px; padding: 10px 12px;
  font-size: 10.5px; line-height: 1.55; font-weight: 700; color: var(--dim);
  background: var(--panel-2); border: var(--bd); border-radius: 10px;
}
.lb-rules b { color: var(--fg); }
