:root {
  color-scheme: dark;
  --bg: #07090f;
  --ink: #f9fbff;
  --muted: #9ba8b7;
  --line: rgba(255, 255, 255, 0.12);
  --panel: rgba(12, 18, 28, 0.82);
  --panel-solid: #101927;
  --green: #59f58d;
  --red: #ff5470;
  --gold: #ffd15c;
  --blue: #56b7ff;
  --pink: #ff6bd6;
  --violet: #a88cff;
  --cyan: #55f5df;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, rgba(7, 9, 15, 0.12), #07090f 58%),
    radial-gradient(circle at 16% 10%, rgba(255, 107, 214, 0.22), transparent 30rem),
    radial-gradient(circle at 86% 4%, rgba(85, 245, 223, 0.17), transparent 28rem),
    #07090f;
  color: var(--ink);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

body.bull-market {
  animation: bullGlow 2.3s ease-in-out infinite alternate;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

h1,
h2,
p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

.game-shell {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 20px 18px 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo {
  display: grid;
  place-items: center;
  width: 74px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 12px 36px rgba(85, 245, 223, 0.12);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.player-badge {
  display: grid;
  gap: 3px;
  min-width: 108px;
  padding: 8px 10px;
  border: 1px solid rgba(85, 245, 223, 0.2);
  border-radius: 8px;
  background: rgba(85, 245, 223, 0.06);
  text-align: right;
}

.player-badge span,
.site-link span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.player-badge strong {
  max-width: 160px;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-link,
.top-button,
.kolect-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid rgba(85, 245, 223, 0.24);
  border-radius: 8px;
  color: var(--cyan);
  background: rgba(85, 245, 223, 0.08);
  font-size: 12px;
  font-weight: 950;
  text-decoration: none;
}

.site-link img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.mobile-upgrade-toggle,
.mobile-drawer-close {
  display: none;
}

.top-button.danger {
  border-color: rgba(255, 84, 112, 0.26);
  color: #ff9aaa;
  background: rgba(255, 84, 112, 0.08);
}

.language-control {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-align: right;
  text-transform: uppercase;
}

.language-control select {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 900;
}

.eyebrow {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(33px, 8vw, 68px);
  line-height: 0.88;
  letter-spacing: 0;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.36);
}

.money-wrap {
  min-width: 145px;
  padding: 10px 12px;
  border: 1px solid rgba(89, 245, 141, 0.34);
  border-radius: 8px;
  background: linear-gradient(150deg, rgba(89, 245, 141, 0.14), rgba(16, 25, 39, 0.8));
  text-align: right;
  box-shadow: 0 16px 40px rgba(89, 245, 141, 0.12);
}

.money-wrap span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.money-wrap strong {
  display: block;
  color: var(--green);
  font-size: clamp(26px, 8vw, 48px);
  line-height: 1;
  font-weight: 1000;
  font-variant-numeric: tabular-nums;
}

.money-wrap strong.bump {
  animation: moneyPop 0.18s ease;
}

.war-room {
  position: relative;
  min-height: 255px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(18, 32, 50, 0.76), rgba(8, 11, 18, 0.94)),
    #101927;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.asset-cloud {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.token {
  position: absolute;
  display: grid;
  place-items: center;
  width: 58px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.28), transparent 30%),
    linear-gradient(145deg, rgba(255, 209, 92, 0.26), rgba(85, 245, 223, 0.12));
  color: var(--gold);
  font-size: 12px;
  font-weight: 1000;
  box-shadow: 0 10px 34px rgba(255, 209, 92, 0.16);
  animation: floatToken 4.8s ease-in-out infinite alternate;
}

.token-a {
  left: 8%;
  top: 17%;
}

.token-b {
  right: 11%;
  top: 12%;
  animation-delay: 0.6s;
}

.token-c {
  right: 25%;
  bottom: 30%;
  animation-delay: 1.1s;
}

.token-d {
  left: 27%;
  bottom: 24%;
  animation-delay: 1.7s;
}

.scene-art {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.scene-art svg {
  width: 100%;
  height: 100%;
  display: block;
}

.city-back {
  fill: rgba(73, 106, 134, 0.34);
}

.city-front {
  fill: rgba(11, 17, 28, 0.86);
}

.desk {
  fill: #0b111c;
  stroke: rgba(255, 255, 255, 0.12);
}

.monitor {
  fill: rgba(3, 11, 18, 0.78);
  stroke: rgba(85, 245, 223, 0.34);
  stroke-width: 3;
  filter: drop-shadow(0 0 16px rgba(85, 245, 223, 0.22));
}

.chart {
  fill: none;
  stroke: url(#screenGlow);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 7;
  animation: chartPulse 1.6s ease-in-out infinite alternate;
}

.avatar-head {
  fill: #182438;
  stroke: var(--gold);
  stroke-width: 5;
}

.avatar-body {
  fill: #192a3f;
  stroke: rgba(255, 209, 92, 0.5);
  stroke-width: 4;
}

.pulse-ring {
  fill: none;
  stroke: rgba(255, 209, 92, 0.78);
  stroke-width: 6;
  stroke-dasharray: 20 12;
  animation: spin 9s linear infinite;
  transform-origin: 620px 88px;
}

.coin-text {
  fill: var(--gold);
  font-size: 34px;
  font-weight: 1000;
}

.hud-card {
  position: absolute;
  z-index: 2;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.hud-card > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(4, 8, 13, 0.74);
  backdrop-filter: blur(10px);
}

.hud-label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.hud-card strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 10px 0;
}

.risk-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 13, 21, 0.82);
}

.risk-control button,
.tree-tabs button,
.small-button,
.deal-action,
.sell-button,
.find-button {
  border-radius: 8px;
  transition: transform 0.12s ease, filter 0.12s ease, background 0.12s ease;
}

.risk-control button:active,
.tree-tabs button:active,
.small-button:active,
.deal-action:active,
.sell-button:active,
.find-button:active {
  transform: translateY(1px) scale(0.99);
}

.risk-control button {
  min-height: 42px;
  color: var(--muted);
  background: transparent;
  font-weight: 950;
}

.risk-control button.active {
  color: #07100c;
  background: linear-gradient(135deg, var(--green), var(--cyan));
}

.find-button {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 72px;
  color: #07100c;
  background:
    linear-gradient(135deg, #fff36b, #59f58d 48%, #55f5df),
    var(--green);
  font-weight: 1000;
  box-shadow: 0 18px 48px rgba(89, 245, 141, 0.22);
}

.find-button span {
  font-size: 22px;
}

.find-button small {
  font-size: 12px;
  font-weight: 900;
}

.main-grid {
  display: grid;
  gap: 12px;
}

.play-column,
.side-column {
  display: grid;
  gap: 12px;
  align-content: start;
}

.game-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(14px);
}

.airdrop-panel {
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 209, 92, 0.12), transparent 46%),
    var(--panel);
}

.airdrop-body {
  display: grid;
  gap: 11px;
  padding: 12px;
}

.airdrop-button {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 86px;
  border-radius: 8px;
  color: #120a02;
  background:
    linear-gradient(135deg, #ffd15c, #59f58d 52%, #55f5df),
    var(--gold);
  font-weight: 1000;
  box-shadow: 0 18px 42px rgba(255, 209, 92, 0.18);
}

.airdrop-button span {
  font-size: 21px;
}

.airdrop-button small {
  font-size: 12px;
  font-weight: 900;
}

.airdrop-meter {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.airdrop-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--green), var(--cyan));
  transition: width 0.16s ease;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  font-size: 19px;
  line-height: 1;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slot-pill {
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0 9px;
  border: 1px solid rgba(85, 245, 223, 0.24);
  border-radius: 999px;
  background: rgba(85, 245, 223, 0.08);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.small-button {
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.small-button.danger {
  color: #ff9aaa;
}

.deal-grid {
  display: grid;
  align-items: stretch;
  grid-auto-rows: minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
}

.deal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  min-height: 198px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 42%),
    #101927;
}

.deal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.52;
  background:
    radial-gradient(circle at 90% 5%, var(--rarity-color), transparent 8rem),
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.28));
  pointer-events: none;
}

.deal-card::after {
  content: "";
  position: absolute;
  inset: auto 14px 12px 14px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--rarity-color), transparent);
  opacity: 0.72;
}

.deal-card > * {
  position: relative;
}

.deal-card.empty {
  display: grid;
  grid-column: 1 / -1;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.deal-card.reveal {
  animation: dealIn 0.26s ease both;
}

.deal-top,
.position-top,
.upgrade-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pill {
  min-width: 0;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.rarity-pill {
  color: var(--rarity-color);
  background: color-mix(in srgb, var(--rarity-color) 18%, transparent);
}

.deal-card h3 {
  margin: 0 0 7px;
  font-size: 28px;
  line-height: 0.95;
  overflow-wrap: anywhere;
}

.token-head,
.position-token {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin-top: 12px;
}

.position-token {
  margin-top: 0;
}

.token-head > div:last-child,
.position-token > div:last-child {
  min-width: 0;
}

.token-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.token-meta span {
  max-width: 100%;
  padding: 4px 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-emblem {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  flex: 0 0 76px;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--rarity-color) 55%, white 10%);
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.45), transparent 24%),
    linear-gradient(145deg, hsl(var(--avatar-hue) 92% 58% / 0.92), hsl(calc(var(--avatar-hue) + 74) 86% 44% / 0.7)),
    color-mix(in srgb, var(--rarity-color) 26%, #101927);
  color: #06100a;
  box-shadow: 0 16px 42px color-mix(in srgb, var(--rarity-color) 24%, transparent);
  transform: rotate(var(--avatar-tilt));
}

.project-emblem span {
  position: relative;
  z-index: 1;
  color: var(--ink);
  font-size: 20px;
  font-weight: 1000;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}

.project-emblem::after {
  content: "";
  position: absolute;
  inset: 12%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: inherit;
}

.project-emblem.mini {
  width: 42px;
  flex-basis: 42px;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--rarity-color, var(--cyan)) 18%, transparent);
}

.project-emblem.mini span {
  font-size: 12px;
}

.project-emblem.moon,
.project-emblem.vault {
  border-radius: 50%;
}

.project-emblem.hex {
  clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
}

.project-emblem.node {
  border-radius: 8px 24px;
}

.project-emblem.pixel {
  border-radius: 4px;
  box-shadow:
    9px 9px 0 rgba(255, 255, 255, 0.08),
    0 16px 42px color-mix(in srgb, var(--rarity-color) 24%, transparent);
}

.project-emblem.mask {
  border-radius: 44% 44% 18% 18%;
}

.project-emblem.stack {
  border-radius: 8px;
  transform: rotate(var(--avatar-tilt)) skew(-8deg);
}

.token-logo {
  display: block;
  flex: 0 0 76px;
  width: 76px;
  aspect-ratio: 1;
  border-radius: 22px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
}

.token-logo.mini {
  flex-basis: 42px;
  width: 42px;
  border-radius: 12px;
}

.deal-card p {
  flex: 0 1 auto;
  min-height: 45px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.deal-market {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 7px;
  align-items: stretch;
}

.deal-market > div:first-child {
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.deal-market span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.deal-market strong {
  display: block;
  margin-top: 2px;
  color: var(--gold);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.mini-candle {
  height: 46px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    rgba(0, 0, 0, 0.18);
  background-size: 100% 25%, 18px 100%;
}

.mini-candle svg {
  display: block;
  width: 100%;
  height: 100%;
}

.mini-candle .up line,
.mini-candle .up rect {
  stroke: var(--green);
  fill: rgba(89, 245, 141, 0.86);
}

.mini-candle .down line,
.mini-candle .down rect {
  stroke: var(--red);
  fill: rgba(255, 84, 112, 0.86);
}

.mini-candle .price-line {
  stroke: rgba(255, 209, 92, 0.62);
  stroke-width: 0.8;
  stroke-dasharray: 3 3;
}

.mini-candle .volume {
  opacity: 0.26;
}

.signal-row {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-height: 0;
  margin: 12px 0;
  overflow: hidden;
}

.signal {
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.signal span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.signal strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.deal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -2px 0 10px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.deal-foot span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.deal-foot strong {
  color: var(--gold);
  font-size: 13px;
}

.deal-actions {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: auto;
}

.deal-action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 0;
  width: 100%;
  padding: 0 10px;
  font-weight: 1000;
  line-height: 1;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deal-action.buy {
  color: #06100a;
  background: linear-gradient(135deg, var(--green), var(--cyan));
}

.deal-action.hold {
  color: #120a02;
  background: linear-gradient(135deg, var(--gold), #ff8a4c);
}

.portfolio-list,
.upgrade-list {
  display: grid;
  align-content: start;
  align-items: start;
  gap: 9px;
  padding: 12px;
}

.upgrade-list {
  grid-auto-rows: max-content;
}

.portfolio-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
}

.portfolio-list .empty-state {
  grid-column: 1 / -1;
}

.position-card,
.upgrade-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.position-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.position-name {
  font-size: 18px;
  font-weight: 1000;
}

.position-fundamentals {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.position-fundamentals > div {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.position-fundamentals span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.position-fundamentals strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.position-fundamentals strong.is-up {
  color: var(--green);
}

.position-fundamentals strong.is-down {
  color: var(--red);
}

.bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--green));
  transition: width 0.28s ease;
}

.candle-chart {
  height: 104px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 18% 0%, rgba(85, 245, 223, 0.1), transparent 12rem),
    rgba(0, 0, 0, 0.2);
  background-size: 100% 25%, 22px 100%, auto, auto;
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.28);
}

.candle-chart svg {
  width: 100%;
  height: 100%;
}

.candle-chart line {
  stroke-width: 1.35;
}

.candle-chart rect {
  rx: 0.7px;
}

.candle-chart .up line,
.candle-chart .up rect {
  stroke: var(--green);
  fill: rgba(89, 245, 141, 0.86);
  filter: drop-shadow(0 0 3px rgba(89, 245, 141, 0.26));
}

.candle-chart .down line,
.candle-chart .down rect {
  stroke: var(--red);
  fill: rgba(255, 84, 112, 0.86);
  filter: drop-shadow(0 0 3px rgba(255, 84, 112, 0.24));
}

.candle-chart .chart-sheen {
  fill: url(#chartFade);
}

.candle-chart .price-line {
  stroke: rgba(255, 209, 92, 0.68);
  stroke-width: 0.8;
  stroke-dasharray: 3 3;
  vector-effect: non-scaling-stroke;
}

.candle-chart .volume {
  stroke: 0;
  opacity: 0.32;
  filter: none;
}

.candle-chart .up-volume {
  fill: var(--green);
}

.candle-chart .down-volume {
  fill: var(--red);
}

.hold-meter {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.hold-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--gold), var(--red));
  transition: width 0.2s ease;
}

.position-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.position-meta strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.quote-tick {
  animation: quoteTick 0.22s ease-out;
}

.chart-tick svg {
  animation: chartTick 0.22s ease-out;
}

.sell-button {
  min-height: 42px;
  color: #06100a;
  background: linear-gradient(135deg, var(--green), #abff6b);
  font-weight: 1000;
}

.upgrade-card {
  padding: 11px;
}

.upgrade-card strong {
  color: var(--ink);
}

.upgrade-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.upgrade-buy {
  width: 100%;
  min-height: 38px;
  margin-top: 9px;
  border-radius: 8px;
  color: #06100a;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  font-weight: 1000;
}

.tree-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 10px 12px 0;
}

.tree-tabs button {
  min-height: 36px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
  font-size: 12px;
  font-weight: 950;
}

.tree-tabs button.active {
  color: #07100c;
  background: linear-gradient(135deg, var(--green), var(--cyan));
}

.unlock-banner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  margin: 10px 12px 0;
  padding: 10px;
  border: 1px solid rgba(255, 209, 92, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 209, 92, 0.13), rgba(255, 107, 214, 0.08)),
    rgba(255, 255, 255, 0.045);
}

.unlock-banner span,
.unlock-banner em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.unlock-banner strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upgrade-card {
  display: grid;
  gap: 9px;
  position: relative;
  align-content: start;
  align-self: start;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 42%),
    rgba(255, 255, 255, 0.055);
}

.upgrade-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--green);
}

.upgrade-card.unlock::before {
  background: var(--blue);
}

.upgrade-card.jackpot::before {
  background: linear-gradient(var(--gold), var(--pink));
}

.upgrade-card.flash-card {
  animation: upgradeFlash 0.5s ease;
}

.upgrade-top strong {
  font-size: 15px;
}

.upgrade-top {
  align-items: center;
  justify-content: start;
}

.upgrade-top .pill {
  margin-left: auto;
}

.upgrade-top small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.upgrade-icon {
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  width: 46px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.28), transparent 32%),
    linear-gradient(145deg, rgba(85, 245, 223, 0.22), rgba(255, 107, 214, 0.12));
  color: var(--ink);
  font-size: 10px;
  font-weight: 1000;
}

.node-meter {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.node-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--gold));
}

.upgrade-buy.locked {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
}

.empty-state {
  padding: 16px;
  color: var(--muted);
  text-align: center;
}

.toast-layer {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  overflow: hidden;
}

.toast {
  position: fixed;
  left: 50%;
  top: 43%;
  min-width: 112px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(4, 8, 13, 0.82);
  color: var(--ink);
  font-weight: 1000;
  text-align: center;
  backdrop-filter: blur(8px);
  animation: floatUp 1s ease forwards;
}

.toast.good {
  color: var(--green);
}

.toast.bad {
  color: var(--red);
}

.toast.gold {
  color: var(--gold);
}

.flash {
  position: fixed;
  inset: 0;
  z-index: 9;
  background: rgba(255, 209, 92, 0.18);
  opacity: 0;
  pointer-events: none;
}

.flash.on {
  animation: screenFlash 0.36s ease;
}

.ending-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background: rgba(3, 7, 12, 0.72);
  backdrop-filter: blur(10px);
}

.ending-panel {
  width: min(520px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 28px;
  border: 1px solid rgba(255, 209, 92, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 209, 92, 0.16), rgba(85, 245, 223, 0.08)),
    rgba(8, 13, 22, 0.94);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.48);
  text-align: center;
}

.ending-panel h2 {
  margin: 4px 0 10px;
  color: var(--gold);
  font-size: 46px;
}

.ending-panel p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.5;
}

.ending-panel strong {
  display: block;
  margin-top: 18px;
  color: var(--green);
  font-size: 34px;
}

.ending-exit {
  width: 100%;
  min-height: 44px;
  margin-top: 18px;
  color: #06100a;
  background: linear-gradient(135deg, var(--gold), var(--green));
  font-weight: 1000;
}

.ending-share,
.ending-download {
  width: 100%;
  min-height: 42px;
  margin-top: 14px;
  border: 1px solid rgba(85, 245, 223, 0.34);
  color: var(--cyan);
  background: rgba(85, 245, 223, 0.08);
  font-weight: 950;
}

.kolect-link {
  width: 100%;
  margin-top: 12px;
  color: #06100a;
  background: linear-gradient(135deg, var(--cyan), var(--green));
}

.share-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(4, 8, 14, 0.48);
  text-align: left;
}

.ending-panel .share-panel {
  display: none !important;
}

.share-panel label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.share-panel input {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 900;
}

.share-panel input[readonly] {
  color: var(--cyan);
}

.share-panel canvas {
  width: 100%;
  max-height: 360px;
  border: 1px solid rgba(255, 209, 92, 0.22);
  border-radius: 8px;
  background: #07101a;
}

.share-help {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}

.ending-download {
  margin-top: 0;
  color: #06100a;
  background: linear-gradient(135deg, var(--cyan), var(--green));
}

.retired-run .game-shell {
  filter: saturate(0.75) brightness(0.74);
}

.name-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 7, 12, 0.78);
  backdrop-filter: blur(12px);
}

.name-panel {
  width: min(430px, 100%);
  padding: 24px;
  border: 1px solid rgba(85, 245, 223, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(85, 245, 223, 0.14), rgba(255, 209, 92, 0.08)),
    rgba(8, 13, 22, 0.96);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.name-panel img {
  width: 92px;
  height: 92px;
  border-radius: 8px;
  object-fit: cover;
}

.name-panel h2 {
  margin: 8px 0;
  font-size: 30px;
}

.name-panel p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.45;
}

.name-panel input {
  width: 100%;
  min-height: 46px;
  margin-top: 12px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  font-size: 18px;
  font-weight: 900;
  text-align: center;
}

.referral-note {
  display: block;
  min-height: 16px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.leaderboard-overlay {
  position: fixed;
  inset: 0;
  z-index: 28;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background: rgba(3, 7, 12, 0.74);
  backdrop-filter: blur(10px);
}

.leaderboard-panel {
  width: min(620px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 20px;
  border: 1px solid rgba(85, 245, 223, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(85, 245, 223, 0.12), rgba(255, 209, 92, 0.08)),
    rgba(8, 13, 22, 0.96);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.5);
}

.leaderboard-head,
.referral-box,
.leaderboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.leaderboard-head h2 {
  margin: 4px 0 0;
  font-size: 30px;
}

.referral-box {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid rgba(85, 245, 223, 0.18);
  border-radius: 8px;
  background: rgba(85, 245, 223, 0.06);
}

.referral-box span,
.leaderboard-row small,
.leader-score span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.referral-box strong {
  display: block;
  margin-top: 3px;
  color: var(--cyan);
  font-size: 22px;
}

.leaderboard-list {
  display: grid;
  gap: 8px;
}

.leaderboard-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 12px;
}

.leaderboard-tabs button {
  min-width: 0;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
  cursor: pointer;
}

.leaderboard-tabs button.active {
  border-color: rgba(85, 245, 223, 0.48);
  background: rgba(85, 245, 223, 0.13);
  color: var(--cyan);
}

.leaderboard-row {
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.leaderboard-row.current {
  border-color: rgba(89, 245, 141, 0.42);
  background: rgba(89, 245, 141, 0.08);
}

.leader-rank {
  width: 38px;
  color: var(--gold);
  font-weight: 1000;
}

.leaderboard-row > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.leaderboard-row strong {
  display: block;
}

.leader-score {
  min-width: 58px;
  text-align: center;
}

.leader-score strong {
  color: var(--green);
  font-size: 22px;
}

.leaderboard-empty {
  padding: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.name-panel button {
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  border-radius: 8px;
  color: #06100a;
  background: linear-gradient(135deg, var(--gold), var(--green), var(--cyan));
  font-weight: 1000;
}

.name-panel a {
  display: inline-block;
  margin-top: 14px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.shake {
  animation: shake 0.3s ease;
}

@media (min-width: 740px) {
  .command-row {
    grid-template-columns: 340px 1fr;
  }

  .deal-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 739px) {
  .topbar {
    flex-wrap: wrap;
  }

  .top-actions {
    width: 100%;
    justify-content: space-between;
  }

  .language-control {
    text-align: left;
  }

  .portfolio-list {
    grid-template-columns: 1fr;
  }

  .deal-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .deal-grid::-webkit-scrollbar {
    display: none;
  }

  .deal-card {
    flex: 0 0 min(86vw, 420px);
    scroll-snap-align: start;
  }

  .deal-card.empty {
    flex-basis: 100%;
  }
}

@media (min-width: 980px) {
  .main-grid {
    grid-template-columns: minmax(0, 1fr) 390px;
    align-items: start;
  }

  .war-room {
    min-height: 218px;
  }

  .play-column {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar {
    margin-bottom: 8px;
  }

  .token {
    width: 50px;
  }

  .find-button {
    min-height: 62px;
  }

  .find-button span {
    font-size: 20px;
  }
}

@media (min-width: 1220px) {
  .game-shell {
    padding-inline: 22px;
  }

  .main-grid {
    grid-template-columns: minmax(0, 1fr) 420px;
  }

  .command-row {
    grid-template-columns: 380px 1fr;
  }

  .war-room {
    min-height: 238px;
  }

  .deal-card {
    min-height: 236px;
  }

  .candle-chart {
    height: 118px;
  }
}

@media (min-width: 980px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .game-shell {
    height: 100vh;
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: 8px;
    padding: 10px 14px 12px;
  }

  .topbar {
    margin-bottom: 0;
  }

  h1 {
    font-size: 46px;
  }

  .money-wrap {
    padding: 8px 11px;
  }

  .money-wrap strong {
    font-size: 38px;
  }

  .war-room {
    height: 92px;
    min-height: 92px;
  }

  .scene-art {
    opacity: 0.78;
  }

  .token {
    width: 34px;
    font-size: 9px;
  }

  .token-d {
    bottom: 46%;
  }

  .hud-card {
    left: 8px;
    right: 8px;
    bottom: 8px;
    gap: 6px;
  }

  .hud-card > div {
    padding: 7px 9px;
  }

  .hud-label {
    font-size: 9px;
  }

  .hud-card strong {
    font-size: 12px;
  }

  .command-row {
    margin: 0;
    grid-template-columns: 320px 1fr;
  }

  .risk-control {
    padding: 5px;
  }

  .risk-control button {
    min-height: 42px;
  }

  .find-button {
    min-height: 52px;
  }

  .find-button span {
    font-size: 19px;
  }

  .main-grid,
  .play-column,
  .side-column,
  .game-panel {
    min-height: 0;
  }

  .main-grid {
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 10px;
    align-items: stretch;
    overflow: hidden;
  }

  .play-column {
    grid-template-rows: minmax(0, 1fr) minmax(0, 0.84fr);
    gap: 10px;
    align-content: stretch;
    overflow: hidden;
  }

  .side-column {
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
    align-content: stretch;
    overflow: hidden;
  }

  .deal-panel,
  .portfolio-panel,
  .upgrades-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .upgrades-panel {
    grid-template-rows: auto auto auto minmax(0, 1fr);
  }

  .panel-head {
    padding: 9px 11px;
  }

  .panel-head h2 {
    font-size: 17px;
  }

  .small-button {
    min-height: 32px;
    font-size: 12px;
  }

  .slot-pill {
    min-height: 26px;
    font-size: 10px;
  }

  .deal-grid,
  .portfolio-list,
  .upgrade-list {
    padding: 8px;
    gap: 8px;
    overflow: auto;
  }

  .deal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 3px 8px 4px;
  }

  .deal-card {
    display: grid;
    gap: 5px;
    min-height: 0;
    padding: 5px;
  }

  .deal-top {
    gap: 5px;
  }

  .pill {
    padding: 4px 6px;
    font-size: 9px;
  }

  .token-head {
    gap: 8px;
    margin-top: 4px;
  }

  .deal-card h3 {
    font-size: 17px;
    margin-bottom: 2px;
  }

  .token-meta {
    gap: 4px;
  }

  .token-meta span {
    padding: 2px 5px;
    font-size: 8px;
  }

  .project-emblem {
    width: 36px;
    flex-basis: 36px;
  }

  .project-emblem span {
    font-size: 12px;
  }

  .deal-card p {
    display: none;
  }

  .signal-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    margin: 4px 0;
  }

  .signal {
    padding: 3px 5px;
  }

  .signal span {
    font-size: 7px;
  }

  .signal strong {
    font-size: 9px;
  }

  .deal-foot {
    display: none;
  }

  .deal-action {
    min-height: 28px;
  }

  .position-card {
    gap: 5px;
    padding: 8px;
  }

  .position-name {
    font-size: 15px;
  }

  .project-emblem.mini {
    width: 30px;
    flex-basis: 30px;
  }

  .position-fundamentals {
    gap: 5px;
  }

  .position-fundamentals > div {
    padding: 5px 6px;
  }

  .position-fundamentals span {
    font-size: 8px;
  }

  .position-fundamentals strong {
    font-size: 10px;
  }

  .candle-chart {
    height: 54px;
  }

  .position-meta {
    font-size: 10px;
  }

  .position-meta strong {
    font-size: 11px;
  }

  .sell-button {
    min-height: 30px;
  }

  .airdrop-body {
    gap: 8px;
    padding: 9px;
  }

  .airdrop-button {
    min-height: 54px;
  }

  .airdrop-button span {
    font-size: 18px;
  }

  .airdrop-meter {
    height: 7px;
  }

  .tree-tabs {
    padding: 8px 9px 0;
  }

  .tree-tabs button {
    min-height: 32px;
    font-size: 11px;
  }

  .unlock-banner {
    margin: 8px 9px 0;
    padding: 8px;
  }

  .unlock-banner span,
  .unlock-banner em {
    font-size: 9px;
  }

  .upgrade-list {
    overflow: auto;
  }

  .upgrade-card {
    gap: 6px;
    min-height: 118px;
    padding: 8px 9px;
  }

  .upgrade-icon {
    flex-basis: 36px;
    width: 36px;
    font-size: 8px;
  }

  .upgrade-top strong {
    font-size: 14px;
  }

  .upgrade-top small {
    font-size: 9px;
  }

  .upgrade-card p {
    font-size: 12px;
    line-height: 1.25;
  }

  .upgrade-buy {
    min-height: 32px;
    margin-top: 4px;
  }
}

@media (max-width: 520px) {
  html,
  body {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .game-shell {
    height: auto;
    display: block;
    padding: 16px 12px 30px;
  }

  .topbar {
    align-items: flex-start;
  }

  .money-wrap {
    min-width: 126px;
  }

  .hud-card {
    grid-template-columns: 1fr;
  }

  .war-room {
    min-height: 330px;
  }

  .position-meta,
  .signal-row {
    grid-template-columns: 1fr;
  }

  .position-fundamentals {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 980px) {
  .game-shell {
    grid-template-rows: 50px 36px 40px minmax(0, 1fr);
    gap: 6px;
    padding: 8px 14px 10px;
  }

  h1 {
    font-size: 34px;
  }

  .money-wrap strong {
    font-size: 28px;
  }

  .war-room {
    height: 36px;
    min-height: 36px;
    box-shadow: none;
  }

  .asset-cloud,
  .scene-art {
    display: none;
  }

  .hud-card {
    position: static;
    display: grid;
    height: 100%;
    padding: 4px;
  }

  .hud-card > div {
    padding: 3px 7px;
  }

  .command-row {
    grid-template-columns: 310px 1fr;
  }

  .risk-control button,
  .find-button {
    min-height: 40px;
  }

  .find-button span {
    font-size: 18px;
  }

  .find-button small {
    font-size: 11px;
  }

  .main-grid {
    grid-template-columns: minmax(0, 1fr) 390px;
    align-items: stretch;
  }

  .play-column {
    grid-template-rows: minmax(260px, 0.96fr) minmax(245px, 0.9fr);
    align-content: stretch;
  }

  .side-column {
    grid-template-rows: 138px minmax(0, 1fr);
  }

  .deal-grid,
  .portfolio-list,
  .upgrade-list {
    overflow: auto;
  }

  .deal-grid {
    padding: 7px;
    overflow: auto;
    scrollbar-gutter: stable;
  }

  .deal-card {
    min-height: 0;
    padding: 8px;
    gap: 6px;
  }

  .token-logo {
    flex-basis: 44px;
    width: 44px;
    border-radius: 13px;
  }

  .token-logo.mini {
    flex-basis: 32px;
    width: 32px;
    border-radius: 10px;
  }

  .deal-card h3 {
    font-size: 18px;
  }

  .deal-card p {
    display: block;
    min-height: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
  }

  .deal-market {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 5px;
  }

  .deal-market > div:first-child {
    padding: 4px 5px;
  }

  .deal-market span {
    font-size: 7px;
  }

  .deal-market strong {
    font-size: 10px;
  }

  .mini-candle {
    height: 32px;
  }

  .signal-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    margin: 5px 0;
  }

  .deal-card .signal:nth-child(n + 5) {
    display: none;
  }

  .signal {
    padding: 4px 5px;
  }

  .signal strong {
    font-size: 9px;
  }

  .deal-foot {
    margin: 0 0 4px;
    padding: 5px 7px;
  }

  .deal-foot span {
    font-size: 8px;
  }

  .deal-foot strong {
    font-size: 10px;
  }

  .deal-action {
    min-height: 34px;
  }

  .portfolio-list {
    padding: 5px 8px;
    overflow: auto;
  }

  .position-card {
    gap: 4px;
    padding: 6px 8px;
  }

  .candle-chart {
    height: 36px;
  }

  .position-name {
    font-size: 14px;
  }

  .position-fundamentals {
    gap: 4px;
  }

  .position-fundamentals > div {
    padding: 4px 6px;
  }

  .position-fundamentals span {
    font-size: 8px;
  }

  .position-fundamentals strong {
    font-size: 9px;
  }

  .position-meta {
    font-size: 9px;
  }

  .position-meta strong {
    font-size: 10px;
  }

  .hold-meter {
    display: none;
  }

  .sell-button {
    min-height: 26px;
  }

  .airdrop-button {
    min-height: 48px;
  }

  .upgrade-list {
    overflow: auto;
  }
}

@media (min-width: 1360px) and (min-height: 800px) {
  .game-shell {
    grid-template-rows: 58px 44px 50px minmax(0, 1fr);
    gap: 8px;
    padding: 10px 18px 12px;
  }

  h1 {
    font-size: 40px;
  }

  .money-wrap strong {
    font-size: 32px;
  }

  .war-room {
    height: 44px;
    min-height: 44px;
  }

  .hud-card > div {
    padding: 5px 9px;
  }

  .command-row {
    grid-template-columns: 350px 1fr;
  }

  .main-grid {
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 12px;
  }

  .play-column {
    grid-template-rows: minmax(360px, 1.08fr) minmax(245px, 0.76fr);
    gap: 12px;
  }

  .side-column {
    grid-template-rows: 160px minmax(0, 1fr);
    gap: 12px;
  }

  .panel-head {
    padding: 10px 12px;
  }

  .deal-grid,
  .portfolio-list,
  .upgrade-list {
    padding: 9px;
    gap: 9px;
  }

  .portfolio-list {
    padding-block: 4px;
  }

  .deal-card {
    padding: 9px;
    gap: 7px;
  }

  .token-logo {
    flex-basis: 52px;
    width: 52px;
    border-radius: 15px;
  }

  .token-logo.mini {
    flex-basis: 36px;
    width: 36px;
    border-radius: 11px;
  }

  .deal-card h3 {
    font-size: 19px;
  }

  .deal-card p {
    display: -webkit-box;
    min-height: 15px;
    white-space: normal;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    font-size: 12px;
    line-height: 1.25;
  }

  .deal-market {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 7px;
  }

  .deal-market span {
    font-size: 8px;
  }

  .deal-market strong {
    font-size: 12px;
  }

  .mini-candle {
    height: 38px;
  }

  .signal-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin: 6px 0;
  }

  .deal-card .signal:nth-child(n + 5) {
    display: block;
  }

  .signal {
    height: 31px;
    min-height: 0;
    overflow: hidden;
    padding: 5px 6px;
  }

  .signal span,
  .signal strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .signal strong {
    font-size: 9px;
    line-height: 1.05;
  }

  .deal-action {
    min-height: 34px;
  }

  .position-card {
    gap: 4px;
    padding: 7px 9px;
  }

  .position-top {
    gap: 8px;
    min-width: 0;
  }

  .position-token {
    min-width: 0;
  }

  .position-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
  }

  .position-fundamentals {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
  }

  .position-fundamentals > div {
    padding: 4px 5px;
  }

  .position-fundamentals span,
  .position-fundamentals strong,
  .position-meta span,
  .position-meta strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .position-fundamentals span {
    font-size: 8px;
  }

  .position-fundamentals strong {
    font-size: 9px;
  }

  .candle-chart {
    height: 32px;
  }

  .hold-meter {
    display: none;
  }

  .position-meta {
    gap: 4px;
    font-size: 8px;
  }

  .position-meta strong {
    font-size: 9px;
  }

  .sell-button {
    min-height: 27px;
  }

  .airdrop-button {
    min-height: 58px;
  }

  .upgrade-card {
    grid-template-columns: minmax(0, 1fr) 82px;
    grid-template-areas:
      "top top"
      "desc buy"
      "meter buy";
    gap: 5px 8px;
    min-height: 0;
    padding: 7px 8px 7px 12px;
  }

  .upgrade-top {
    grid-area: top;
    min-width: 0;
    gap: 7px;
  }

  .upgrade-icon {
    flex-basis: 32px;
    width: 32px;
    font-size: 7px;
  }

  .upgrade-top strong {
    display: block;
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
  }

  .upgrade-top small {
    font-size: 8px;
  }

  .upgrade-top .pill {
    padding: 4px 6px;
    font-size: 8px;
  }

  .upgrade-card p {
    grid-area: desc;
    margin: 0;
    font-size: 11px;
    line-height: 1.2;
    -webkit-line-clamp: 2;
  }

  .node-meter {
    grid-area: meter;
    align-self: end;
    height: 6px;
  }

  .upgrade-buy {
    grid-area: buy;
    align-self: stretch;
    min-height: 0;
    margin-top: 0;
    padding: 0 6px;
    font-size: 11px;
  }
}

@media (min-width: 1700px) and (min-height: 920px) {
  .game-shell {
    grid-template-rows: 68px 56px 62px minmax(0, 1fr);
    gap: 12px;
    padding: 14px 26px 18px;
  }

  h1 {
    font-size: 50px;
  }

  .money-wrap strong {
    font-size: 40px;
  }

  .war-room {
    height: 56px;
    min-height: 56px;
  }

  .command-row {
    grid-template-columns: 390px 1fr;
  }

  .risk-control button,
  .find-button {
    min-height: 50px;
  }

  .main-grid {
    grid-template-columns: minmax(0, 1fr) 460px;
    gap: 14px;
  }

  .play-column {
    grid-template-rows: minmax(360px, 1fr) minmax(330px, 0.82fr);
    gap: 14px;
  }

  .side-column {
    grid-template-rows: 188px minmax(0, 1fr);
    gap: 14px;
  }

  .deal-grid,
  .portfolio-list,
  .upgrade-list {
    padding: 11px;
    gap: 11px;
  }

  .deal-card {
    padding: 11px;
    gap: 8px;
  }

  .deal-card p {
    min-height: 30px;
    -webkit-line-clamp: 2;
  }

  .mini-candle {
    height: 54px;
  }

  .candle-chart {
    height: 58px;
  }

  .position-card {
    gap: 8px;
    padding: 10px;
  }

  .position-name {
    font-size: 16px;
  }

  .position-fundamentals > div {
    padding: 6px 7px;
  }

  .position-fundamentals strong {
    font-size: 10px;
  }

  .position-meta strong {
    font-size: 11px;
  }
}

@media (min-width: 980px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .game-shell {
    width: min(100%, 1680px);
    height: 100svh;
    display: grid;
    grid-template-rows: 52px 40px 44px minmax(0, 1fr);
    gap: 8px;
    padding: 8px 14px 10px;
  }

  @supports (height: 100dvh) {
    .game-shell {
      height: 100dvh;
    }
  }

  .topbar,
  .war-room,
  .command-row,
  .main-grid,
  .play-column,
  .side-column,
  .game-panel {
    min-height: 0;
  }

  .topbar {
    margin: 0;
  }

  .brand-logo {
    width: 52px;
  }

  h1 {
    font-size: 36px;
    line-height: 0.92;
  }

  .eyebrow {
    font-size: 10px;
  }

  .top-actions {
    gap: 8px;
  }

  .language-control select {
    min-height: 30px;
    max-width: 132px;
  }

  .money-wrap {
    min-width: 138px;
    padding: 7px 10px;
  }

  .money-wrap strong {
    font-size: 30px;
  }

  .war-room {
    height: 40px;
    min-height: 40px;
    box-shadow: none;
  }

  .asset-cloud,
  .scene-art {
    display: none;
  }

  .hud-card {
    position: static;
    height: 100%;
    padding: 4px;
    gap: 6px;
  }

  .hud-card > div {
    padding: 4px 7px;
  }

  .hud-label {
    font-size: 8px;
  }

  .hud-card strong {
    font-size: 12px;
  }

  .command-row {
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 8px;
    margin: 0;
  }

  .risk-control {
    padding: 4px;
  }

  .risk-control button,
  .find-button {
    min-height: 36px;
  }

  .find-button span {
    font-size: 17px;
  }

  .find-button small {
    font-size: 10px;
  }

  .main-grid {
    grid-template-columns: minmax(0, 1fr) clamp(340px, 28vw, 460px);
    gap: 10px;
    align-items: stretch;
    overflow: hidden;
  }

  .play-column {
    grid-template-rows: minmax(310px, 1.12fr) minmax(240px, 0.88fr);
    gap: 10px;
    align-content: stretch;
    overflow: hidden;
  }

  .side-column {
    grid-template-rows: 132px minmax(0, 1fr);
    gap: 10px;
    overflow: hidden;
  }

  .deal-panel,
  .portfolio-panel,
  .upgrades-panel {
    display: grid;
    overflow: hidden;
  }

  .deal-panel,
  .portfolio-panel {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .upgrades-panel {
    grid-template-rows: auto auto auto minmax(0, 1fr);
  }

  .panel-head {
    padding: 8px 10px;
  }

  .panel-head h2 {
    font-size: 16px;
  }

  .small-button {
    min-height: 30px;
    padding: 0 9px;
    font-size: 11px;
  }

  .slot-pill {
    min-height: 24px;
    padding: 0 8px;
    font-size: 9px;
  }

  .deal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr);
    min-height: 0;
    gap: 7px;
    padding: 7px;
    overflow: hidden;
  }

  .deal-card {
    display: flex;
    height: 100%;
    min-height: 0;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
    padding: 7px;
    overflow: hidden;
  }

  .deal-card::after {
    display: none;
  }

  .deal-top {
    gap: 5px;
  }

  .pill {
    padding: 4px 6px;
    font-size: 9px;
  }

  .token-head {
    gap: 7px;
    margin-top: 2px;
  }

  .token-logo {
    flex-basis: 38px;
    width: 38px;
    border-radius: 12px;
  }

  .deal-card h3 {
    margin-bottom: 2px;
    font-size: 16px;
    line-height: 1;
  }

  .token-meta {
    gap: 3px;
  }

  .token-meta span {
    max-width: 96px;
    padding: 2px 4px;
    font-size: 8px;
    white-space: nowrap;
  }

  .deal-card p {
    display: none;
  }

  .deal-market {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 5px;
  }

  .deal-market > div:first-child {
    padding: 4px 5px;
  }

  .deal-market span {
    font-size: 7px;
  }

  .deal-market strong {
    font-size: 10px;
  }

  .mini-candle {
    height: 32px;
  }

  .signal-row {
    flex: 0 1 auto;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    min-height: 0;
    margin: 4px 0;
    overflow: hidden;
  }

  .deal-card .signal:nth-child(n + 5) {
    display: block;
  }

  .signal {
    min-height: 26px;
    padding: 3px 4px;
    overflow: hidden;
  }

  .signal span,
  .signal strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .signal span {
    font-size: 7px;
  }

  .signal strong {
    font-size: 9px;
    line-height: 1.1;
  }

  .deal-foot {
    display: none;
  }

  .deal-actions {
    flex: 0 0 auto;
    margin-top: auto;
  }

  .deal-action {
    min-height: 34px;
    font-size: 12px;
  }

  .portfolio-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    min-height: 0;
    padding: 7px;
    overflow: auto;
    scrollbar-gutter: stable;
  }

  .portfolio-list[data-count="4"],
  .portfolio-list[data-count="5"],
  .portfolio-list[data-count="6"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr);
  }

  .portfolio-list[data-count="4"] .position-card,
  .portfolio-list[data-count="5"] .position-card,
  .portfolio-list[data-count="6"] .position-card {
    gap: 3px;
    padding: 6px;
  }

  .portfolio-list[data-count="4"] .token-logo.mini,
  .portfolio-list[data-count="5"] .token-logo.mini,
  .portfolio-list[data-count="6"] .token-logo.mini {
    flex-basis: 26px;
    width: 26px;
    border-radius: 8px;
  }

  .portfolio-list[data-count="4"] .position-name,
  .portfolio-list[data-count="5"] .position-name,
  .portfolio-list[data-count="6"] .position-name {
    font-size: 12px;
  }

  .portfolio-list[data-count="4"] .position-fundamentals > div,
  .portfolio-list[data-count="5"] .position-fundamentals > div,
  .portfolio-list[data-count="6"] .position-fundamentals > div {
    padding: 3px 4px;
  }

  .portfolio-list[data-count="4"] .candle-chart,
  .portfolio-list[data-count="5"] .candle-chart,
  .portfolio-list[data-count="6"] .candle-chart {
    height: 28px;
  }

  .portfolio-list[data-count="4"] .position-meta,
  .portfolio-list[data-count="5"] .position-meta,
  .portfolio-list[data-count="6"] .position-meta {
    font-size: 7px;
  }

  .portfolio-list[data-count="4"] .position-meta strong,
  .portfolio-list[data-count="5"] .position-meta strong,
  .portfolio-list[data-count="6"] .position-meta strong {
    font-size: 8px;
  }

  .portfolio-list[data-count="4"] .sell-button,
  .portfolio-list[data-count="5"] .sell-button,
  .portfolio-list[data-count="6"] .sell-button {
    min-height: 23px;
  }

  .position-card {
    min-height: 0;
    gap: 4px;
    padding: 7px;
    overflow: hidden;
  }

  .position-top {
    gap: 6px;
    min-width: 0;
  }

  .position-token {
    gap: 7px;
    min-width: 0;
  }

  .token-logo.mini {
    flex-basis: 30px;
    width: 30px;
    border-radius: 9px;
  }

  .position-name {
    overflow: hidden;
    font-size: 13px;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .position-fundamentals {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
  }

  .position-fundamentals > div {
    padding: 4px 5px;
  }

  .position-fundamentals span,
  .position-fundamentals strong,
  .position-meta span,
  .position-meta strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .position-fundamentals span {
    font-size: 7px;
  }

  .position-fundamentals strong {
    font-size: 9px;
  }

  .candle-chart {
    height: 34px;
  }

  .position-meta {
    gap: 4px;
    font-size: 8px;
  }

  .position-meta strong {
    font-size: 9px;
  }

  .hold-meter {
    display: none;
  }

  .sell-button {
    min-height: 26px;
    font-size: 11px;
  }

  .airdrop-body {
    gap: 7px;
    padding: 8px;
  }

  .airdrop-button {
    min-height: 50px;
  }

  .airdrop-button span {
    font-size: 17px;
  }

  .airdrop-button small {
    font-size: 10px;
  }

  .airdrop-meter {
    height: 7px;
  }

  .tree-tabs {
    padding: 7px 8px 0;
  }

  .tree-tabs button {
    min-height: 30px;
    font-size: 10px;
  }

  .unlock-banner {
    margin: 7px 8px 0;
    padding: 7px 8px;
  }

  .unlock-banner span,
  .unlock-banner em {
    font-size: 8px;
  }

  .upgrade-list {
    gap: 7px;
    min-height: 0;
    padding: 7px 8px;
    overflow: auto;
    scrollbar-gutter: stable;
  }

  .upgrade-card {
    min-height: 0;
    gap: 5px;
    padding: 7px 8px;
  }

  .upgrade-icon {
    flex-basis: 32px;
    width: 32px;
    font-size: 7px;
  }

  .upgrade-top {
    gap: 6px;
    min-width: 0;
  }

  .upgrade-top strong {
    font-size: 13px;
  }

  .upgrade-top small {
    font-size: 8px;
  }

  .upgrade-card p {
    font-size: 11px;
    line-height: 1.2;
    -webkit-line-clamp: 2;
  }

  .upgrade-buy {
    min-height: 30px;
    margin-top: 3px;
    font-size: 11px;
  }
}

@media (min-width: 1360px) and (min-height: 800px) {
  .game-shell {
    grid-template-rows: 58px 44px 50px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 18px 12px;
  }

  h1 {
    font-size: 40px;
  }

  .money-wrap strong {
    font-size: 34px;
  }

  .war-room {
    height: 44px;
    min-height: 44px;
  }

  .command-row {
    grid-template-columns: 360px minmax(0, 1fr);
  }

  .risk-control button,
  .find-button {
    min-height: 42px;
  }

  .main-grid {
    grid-template-columns: minmax(0, 1fr) clamp(410px, 28vw, 500px);
    gap: 12px;
  }

  .play-column {
    grid-template-rows: minmax(360px, 1.08fr) minmax(260px, 0.82fr);
    gap: 12px;
  }

  .side-column {
    grid-template-rows: 154px minmax(0, 1fr);
    gap: 12px;
  }

  .deal-grid,
  .portfolio-list,
  .upgrade-list {
    gap: 9px;
    padding: 9px;
  }

  .deal-card {
    gap: 6px;
    padding: 9px;
  }

  .token-logo {
    flex-basis: 46px;
    width: 46px;
  }

  .deal-card h3 {
    font-size: 18px;
  }

  .deal-card p {
    display: -webkit-box;
    min-height: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  .mini-candle {
    height: 40px;
  }

  .signal {
    min-height: 30px;
  }

  .deal-foot {
    display: none;
  }

  .portfolio-list {
    gap: 8px;
    padding: 8px;
  }

  .position-card {
    gap: 6px;
    padding: 9px;
  }

  .token-logo.mini {
    flex-basis: 34px;
    width: 34px;
  }

  .position-name {
    font-size: 15px;
  }

  .position-fundamentals > div {
    padding: 5px 6px;
  }

  .position-fundamentals span {
    font-size: 8px;
  }

  .position-fundamentals strong {
    font-size: 10px;
  }

  .candle-chart {
    height: 46px;
  }

  .position-meta {
    font-size: 9px;
  }

  .position-meta strong {
    font-size: 10px;
  }

  .sell-button {
    min-height: 30px;
  }
}

@media (min-width: 980px) and (min-height: 880px) and (max-width: 1359px) {
  .play-column {
    grid-template-rows: minmax(400px, 1.02fr) minmax(330px, 0.86fr);
  }

  .portfolio-list {
    gap: 8px;
    padding: 8px;
  }

  .position-card {
    gap: 6px;
    padding: 9px;
  }

  .token-logo.mini {
    flex-basis: 34px;
    width: 34px;
  }

  .position-name {
    font-size: 15px;
  }

  .position-fundamentals > div {
    padding: 5px 6px;
  }

  .position-fundamentals span {
    font-size: 8px;
  }

  .position-fundamentals strong {
    font-size: 10px;
  }

  .candle-chart {
    height: 52px;
  }

  .position-meta {
    font-size: 9px;
  }

  .position-meta strong {
    font-size: 10px;
  }

  .sell-button {
    min-height: 30px;
  }
}

@media (min-width: 1700px) and (min-height: 920px) {
  .game-shell {
    grid-template-rows: 66px 54px 58px minmax(0, 1fr);
    gap: 12px;
    padding: 14px 24px 16px;
  }

  h1 {
    font-size: 48px;
  }

  .brand-logo {
    width: 60px;
  }

  .money-wrap strong {
    font-size: 39px;
  }

  .war-room {
    height: 54px;
    min-height: 54px;
  }

  .command-row {
    grid-template-columns: 390px minmax(0, 1fr);
  }

  .risk-control button,
  .find-button {
    min-height: 48px;
  }

  .main-grid {
    grid-template-columns: minmax(0, 1fr) 470px;
    gap: 14px;
  }

  .play-column {
    grid-template-rows: minmax(370px, 0.96fr) minmax(350px, 0.9fr);
    gap: 14px;
  }

  .side-column {
    grid-template-rows: 182px minmax(0, 1fr);
    gap: 14px;
  }

  .deal-card p {
    font-size: 12px;
    -webkit-line-clamp: 2;
  }

  .mini-candle {
    height: 52px;
  }

  .candle-chart {
    height: 74px;
  }

  .portfolio-list {
    gap: 10px;
    padding: 10px;
  }

  .position-card {
    gap: 8px;
    padding: 11px;
  }

  .token-logo.mini {
    flex-basis: 40px;
    width: 40px;
    border-radius: 11px;
  }

  .position-name {
    font-size: 17px;
  }

  .position-fundamentals > div {
    padding: 7px 8px;
  }

  .position-fundamentals span {
    font-size: 9px;
  }

  .position-fundamentals strong {
    font-size: 11px;
  }

  .position-meta {
    font-size: 10px;
  }

  .position-meta strong {
    font-size: 12px;
  }

  .sell-button {
    min-height: 34px;
  }
}

@media (min-width: 980px) and (max-height: 760px) {
  .game-shell {
    grid-template-rows: 42px 34px 38px minmax(0, 1fr);
    gap: 6px;
    padding: 6px 12px 8px;
  }

  h1 {
    font-size: 30px;
  }

  .brand-logo {
    width: 42px;
  }

  .money-wrap strong {
    font-size: 25px;
  }

  .war-room {
    height: 34px;
    min-height: 34px;
  }

  .main-grid {
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 8px;
  }

  .play-column {
    grid-template-rows: minmax(250px, 1fr) minmax(190px, 0.78fr);
    gap: 8px;
  }

  .side-column {
    grid-template-rows: 112px minmax(0, 1fr);
    gap: 8px;
  }

  .deal-grid,
  .portfolio-list,
  .upgrade-list {
    gap: 5px;
    padding: 5px;
  }

  .deal-card {
    gap: 4px;
    padding: 5px;
  }

  .token-logo {
    flex-basis: 32px;
    width: 32px;
  }

  .deal-card h3 {
    font-size: 14px;
  }

  .deal-market {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .mini-candle {
    height: 28px;
  }

  .signal {
    min-height: 25px;
    padding: 2px 4px;
  }

  .deal-action {
    min-height: 30px;
  }

  .deal-foot,
  .deal-card p {
    display: none;
  }

  .unlock-banner {
    margin-top: 5px;
    padding: 5px 7px;
  }

  .upgrade-card {
    gap: 4px;
    padding: 5px 7px;
  }

  .upgrade-icon {
    flex-basis: 28px;
    width: 28px;
    font-size: 7px;
  }

  .upgrade-top {
    gap: 5px;
  }

  .upgrade-top strong {
    font-size: 12px;
  }

  .upgrade-top small {
    margin-top: 0;
    font-size: 7px;
  }

  .upgrade-card p {
    font-size: 10px;
    line-height: 1.15;
    -webkit-line-clamp: 1;
  }

  .node-meter {
    height: 5px;
  }

  .upgrade-buy {
    min-height: 26px;
    margin-top: 1px;
    font-size: 10px;
  }
}

@media (min-width: 980px) {
  .portfolio-list[data-count="4"],
  .portfolio-list[data-count="5"],
  .portfolio-list[data-count="6"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr);
  }

  .portfolio-list[data-count="4"] .position-card,
  .portfolio-list[data-count="5"] .position-card,
  .portfolio-list[data-count="6"] .position-card {
    gap: 3px;
    padding: 6px;
  }

  .portfolio-list[data-count="4"] .position-top,
  .portfolio-list[data-count="5"] .position-top,
  .portfolio-list[data-count="6"] .position-top {
    gap: 5px;
  }

  .portfolio-list[data-count="4"] .token-logo.mini,
  .portfolio-list[data-count="5"] .token-logo.mini,
  .portfolio-list[data-count="6"] .token-logo.mini {
    flex-basis: 26px;
    width: 26px;
    border-radius: 8px;
  }

  .portfolio-list[data-count="4"] .position-name,
  .portfolio-list[data-count="5"] .position-name,
  .portfolio-list[data-count="6"] .position-name {
    font-size: 12px;
  }

  .portfolio-list[data-count="4"] .position-fundamentals,
  .portfolio-list[data-count="5"] .position-fundamentals,
  .portfolio-list[data-count="6"] .position-fundamentals {
    gap: 3px;
  }

  .portfolio-list[data-count="4"] .position-fundamentals > div,
  .portfolio-list[data-count="5"] .position-fundamentals > div,
  .portfolio-list[data-count="6"] .position-fundamentals > div {
    padding: 3px 4px;
  }

  .portfolio-list[data-count="4"] .position-fundamentals span,
  .portfolio-list[data-count="5"] .position-fundamentals span,
  .portfolio-list[data-count="6"] .position-fundamentals span {
    font-size: 7px;
  }

  .portfolio-list[data-count="4"] .position-fundamentals strong,
  .portfolio-list[data-count="5"] .position-fundamentals strong,
  .portfolio-list[data-count="6"] .position-fundamentals strong {
    font-size: 8px;
  }

  .portfolio-list[data-count="4"] .candle-chart,
  .portfolio-list[data-count="5"] .candle-chart,
  .portfolio-list[data-count="6"] .candle-chart {
    height: 28px;
  }

  .portfolio-list[data-count="4"] .position-meta,
  .portfolio-list[data-count="5"] .position-meta,
  .portfolio-list[data-count="6"] .position-meta {
    gap: 3px;
    font-size: 7px;
  }

  .portfolio-list[data-count="4"] .position-meta strong,
  .portfolio-list[data-count="5"] .position-meta strong,
  .portfolio-list[data-count="6"] .position-meta strong {
    font-size: 8px;
  }

  .portfolio-list[data-count="4"] .sell-button,
  .portfolio-list[data-count="5"] .sell-button,
  .portfolio-list[data-count="6"] .sell-button {
    min-height: 23px;
    font-size: 10px;
  }
}

@keyframes dealIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes moneyPop {
  50% {
    transform: scale(1.05);
  }
}

@keyframes chartPulse {
  to {
    filter: drop-shadow(0 0 12px rgba(85, 245, 223, 0.86));
  }
}

@keyframes quoteTick {
  0% {
    color: var(--gold);
    text-shadow: 0 0 10px rgba(255, 209, 92, 0.55);
  }
  100% {
    text-shadow: none;
  }
}

@keyframes chartTick {
  0% {
    filter: brightness(1.26) saturate(1.12);
  }
  100% {
    filter: none;
  }
}

@keyframes floatToken {
  to {
    transform: translateY(-12px) rotate(7deg);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translate(-50%, 20px) scale(0.92);
  }
  14% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -94px) scale(1.04);
  }
}

@keyframes screenFlash {
  30% {
    opacity: 1;
  }
}

@keyframes upgradeFlash {
  50% {
    border-color: rgba(89, 245, 141, 0.72);
    background: rgba(89, 245, 141, 0.12);
  }
}

@keyframes shake {
  20% {
    transform: translateX(-5px);
  }
  40% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
}

@keyframes bullGlow {
  to {
    background-color: #0e160a;
  }
}

@media (max-width: 640px) {
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  body {
    background:
      linear-gradient(180deg, rgba(7, 9, 15, 0.05), #07090f 58%),
      radial-gradient(circle at 15% 0%, rgba(85, 245, 223, 0.18), transparent 16rem),
      radial-gradient(circle at 90% 10%, rgba(255, 209, 92, 0.12), transparent 16rem),
      #07090f;
  }

  body::before {
    background-size: 26px 26px;
  }

  .game-shell {
    width: 100%;
    height: 100svh;
    display: grid;
    grid-template-rows: auto 38px 54px minmax(0, 1fr);
    gap: 6px;
    padding: 7px;
    overflow: hidden;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    margin: 0;
  }

  .brand-block {
    gap: 8px;
  }

  .brand-logo {
    width: 42px;
    box-shadow: 0 8px 20px rgba(85, 245, 223, 0.1);
  }

  .eyebrow {
    font-size: 8px;
  }

  h1 {
    font-size: 25px;
    line-height: 0.9;
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 4px;
    width: auto;
    justify-content: end;
  }

  .player-badge,
  .language-control {
    display: none;
  }

  .site-link,
  .top-button {
    min-height: 28px;
    padding: 0 7px;
    font-size: 10px;
  }

  .site-link span {
    display: none;
  }

  .site-link img {
    width: 18px;
    height: 18px;
  }

  .money-wrap {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
    padding: 5px 8px;
    border-radius: 8px;
  }

  .money-wrap span {
    font-size: 8px;
  }

  .money-wrap strong {
    font-size: 22px;
  }

  .war-room {
    min-height: 0;
    height: 38px;
    border-radius: 8px;
    box-shadow: none;
  }

  .asset-cloud,
  .scene-art {
    display: none;
  }

  .hud-card {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    height: 100%;
    padding: 4px;
    background: transparent;
    box-shadow: none;
  }

  .hud-card > div {
    min-width: 0;
    padding: 4px 6px;
    border-radius: 7px;
  }

  .hud-label {
    font-size: 7px;
  }

  .hud-card strong {
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .command-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1.08fr;
    gap: 6px;
    min-height: 0;
    margin: 0;
  }

  .risk-control {
    gap: 3px;
    padding: 4px;
  }

  .risk-control button {
    min-height: 42px;
    padding: 0 3px;
    font-size: 10px;
  }

  .find-button {
    min-height: 54px;
    gap: 1px;
  }

  .find-button span {
    font-size: 17px;
  }

  .find-button small {
    font-size: 10px;
  }

  .main-grid {
    display: grid;
    grid-template-rows: minmax(0, 1.2fr) minmax(0, 0.82fr);
    gap: 6px;
    min-height: 0;
  }

  .play-column {
    display: grid;
    grid-template-rows: minmax(0, 1fr) minmax(78px, 0.46fr);
    gap: 6px;
    min-height: 0;
  }

  .side-column {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 6px;
    min-height: 0;
  }

  .game-panel {
    min-height: 0;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
  }

  .panel-head {
    min-height: 0;
    padding: 7px 8px;
  }

  .panel-head h2 {
    font-size: 15px;
  }

  .small-button,
  .slot-pill {
    min-height: 26px;
    padding: 0 7px;
    font-size: 9px;
  }

  .deal-grid {
    display: block;
    height: calc(100% - 45px);
    overflow: hidden;
    padding: 0 8px 8px;
  }

  .deal-card {
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 9px;
  }

  .deal-card.empty {
    min-height: 100%;
  }

  .deal-card h3 {
    margin-bottom: 4px;
    font-size: 22px;
  }

  .deal-card p {
    display: none;
  }

  .deal-top {
    gap: 5px;
  }

  .pill {
    padding: 4px 6px;
    font-size: 9px;
  }

  .token-head {
    gap: 8px;
    margin-top: 7px;
  }

  .token-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
  }

  .token-meta span {
    padding: 3px 5px;
    font-size: 8px;
  }

  .deal-market {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 6px;
    margin-top: 7px;
  }

  .deal-market > div:first-child {
    padding: 7px;
  }

  .deal-market span,
  .signal span {
    font-size: 8px;
  }

  .deal-market strong {
    font-size: 14px;
  }

  .mini-candle {
    height: 56px;
  }

  .signal-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    margin: 7px 0;
  }

  .signal-row .signal:nth-child(n + 5) {
    display: none;
  }

  .signal {
    padding: 6px;
  }

  .signal strong {
    font-size: 11px;
  }

  .deal-action {
    min-height: 36px;
    font-size: 13px;
  }

  .portfolio-list,
  .upgrade-list {
    height: calc(100% - 45px);
    min-height: 0;
    padding: 7px;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .portfolio-list::-webkit-scrollbar,
  .upgrade-list::-webkit-scrollbar {
    display: none;
  }

  .portfolio-list {
    grid-template-columns: 1fr;
  }

  .portfolio-list .empty-state {
    padding: 8px;
    font-size: 11px;
    line-height: 1.25;
  }

  .position-card {
    gap: 6px;
    padding: 7px;
  }

  .position-name {
    font-size: 13px;
  }

  .position-chart {
    height: 48px;
  }

  .position-fundamentals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .position-fundamentals > div {
    padding: 5px;
  }

  .position-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    font-size: 9px;
  }

  .sell-button {
    min-height: 30px;
    font-size: 12px;
  }

  .airdrop-panel .panel-head {
    display: none;
  }

  .airdrop-body {
    height: 100%;
    padding: 7px;
  }

  .airdrop-button {
    min-height: 100%;
    padding: 8px;
    font-size: 12px;
  }

  .airdrop-button small {
    font-size: 9px;
  }

  .airdrop-meter {
    height: 4px;
    margin-top: 5px;
  }

  .tree-tabs {
    gap: 3px;
    padding: 0 7px 6px;
  }

  .tree-tabs button {
    min-height: 25px;
    padding: 0 4px;
    font-size: 9px;
  }

  .unlock-banner {
    display: none;
  }

  .upgrade-card {
    padding: 7px;
  }

  .upgrade-top {
    gap: 6px;
  }

  .upgrade-icon {
    width: 30px;
    height: 30px;
    font-size: 9px;
  }

  .upgrade-card h3 {
    font-size: 12px;
  }

  .upgrade-card p {
    margin-top: 4px;
    font-size: 10px;
    line-height: 1.25;
  }

  .upgrade-meta {
    gap: 4px;
    margin-top: 6px;
    font-size: 9px;
  }

  .upgrade-buy {
    min-height: 30px;
    margin-top: 6px;
    font-size: 11px;
  }

  .toast-layer {
    inset: auto 8px 8px;
  }

  .toast {
    min-height: 34px;
    padding: 8px 10px;
    font-size: 12px;
  }

  .name-panel {
    width: min(92vw, 340px);
    padding: 18px;
  }

  .name-panel img {
    width: 70px;
    height: 70px;
  }

  .name-panel h2 {
    font-size: 24px;
  }
}

@media (max-width: 380px), (max-height: 760px) and (max-width: 640px) {
  .game-shell {
    grid-template-rows: auto 34px 48px minmax(0, 1fr);
    gap: 5px;
    padding: 5px;
  }

  .brand-logo {
    width: 36px;
  }

  h1 {
    font-size: 21px;
  }

  .site-link,
  .top-button {
    min-height: 25px;
    padding: 0 6px;
    font-size: 9px;
  }

  .money-wrap {
    padding: 4px 7px;
  }

  .money-wrap strong {
    font-size: 19px;
  }

  .war-room {
    height: 34px;
  }

  .hud-card > div {
    padding: 3px 5px;
  }

  .command-row {
    grid-template-columns: 0.95fr 1.05fr;
  }

  .risk-control button {
    min-height: 36px;
    font-size: 9px;
  }

  .find-button {
    min-height: 48px;
  }

  .find-button span {
    font-size: 15px;
  }

  .panel-head {
    padding: 6px 7px;
  }

  .panel-head h2 {
    font-size: 13px;
  }

  .deal-grid,
  .portfolio-list,
  .upgrade-list {
    height: calc(100% - 39px);
    padding: 6px;
  }

  .deal-card {
    padding: 7px;
  }

  .deal-card h3 {
    font-size: 18px;
  }

  .token-head {
    margin-top: 5px;
  }

  .token-logo {
    width: 34px;
    height: 34px;
  }

  .mini-candle {
    height: 44px;
  }

  .signal-row {
    margin: 5px 0;
  }

  .deal-action {
    min-height: 32px;
  }

  .side-column {
    grid-template-columns: 92px minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .game-shell {
    grid-template-rows: auto 38px 54px minmax(0, 1fr);
  }

  .main-grid {
    grid-template-rows: minmax(0, 1fr) 86px;
  }

  .play-column {
    grid-template-rows: minmax(0, 0.82fr) 236px;
  }

  .deal-card {
    gap: 5px;
    padding: 7px;
  }

  .deal-card h3 {
    font-size: 18px;
  }

  .deal-top {
    gap: 4px;
  }

  .token-head {
    gap: 7px;
    margin-top: 4px;
  }

  .token-logo {
    width: 34px;
    height: 34px;
  }

  .deal-market {
    margin-top: 4px;
  }

  .mini-candle {
    height: 42px;
  }

  .signal-row {
    margin: 4px 0;
  }

  .signal-row .signal:nth-child(n + 3) {
    display: none;
  }

  .deal-action {
    min-height: 30px;
    font-size: 12px;
  }

  .side-column {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
  }

  .airdrop-panel {
    min-height: 0;
  }

  .airdrop-body {
    padding: 6px;
  }

  .airdrop-button {
    min-height: 100%;
    padding: 8px 6px;
    font-size: 13px;
  }

  .mobile-upgrade-toggle {
    display: grid;
    place-items: center;
    min-height: 0;
    border: 1px solid rgba(85, 245, 223, 0.24);
    border-radius: 8px;
    color: #06100a;
    background:
      linear-gradient(135deg, rgba(255, 209, 92, 0.95), rgba(89, 245, 141, 0.95), rgba(85, 245, 223, 0.95));
    box-shadow: 0 10px 24px rgba(85, 245, 223, 0.18);
    text-align: center;
  }

  .mobile-upgrade-toggle span {
    font-size: 18px;
    font-weight: 1000;
  }

  .mobile-upgrade-toggle small {
    color: rgba(6, 16, 10, 0.7);
    font-size: 10px;
    font-weight: 950;
    text-transform: uppercase;
  }

  .upgrades-panel {
    position: fixed;
    inset: auto 8px 8px;
    z-index: 24;
    height: min(72svh, 610px);
    max-height: calc(100svh - 18px);
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    border-color: rgba(85, 245, 223, 0.34);
    background:
      linear-gradient(180deg, rgba(11, 18, 28, 0.98), rgba(6, 10, 16, 0.98)),
      var(--panel-solid);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.68);
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + 16px));
    transition: transform 0.22s ease, opacity 0.22s ease;
  }

  body.mobile-upgrades-open .upgrades-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .mobile-drawer-close {
    display: inline-flex;
  }

  .upgrades-panel .panel-head {
    padding: 9px 10px;
  }

  .upgrades-panel .panel-head h2 {
    font-size: 18px;
  }

  .upgrades-panel .panel-actions {
    margin-left: auto;
  }

  .upgrades-panel .tree-tabs {
    padding: 0 10px 8px;
  }

  .upgrades-panel .unlock-banner {
    display: flex;
    margin: 0 10px 8px;
  }

  .upgrade-list {
    height: auto;
    padding: 0 10px 10px;
    overflow: auto;
  }

  .upgrade-card {
    padding: 9px;
  }

  .portfolio-list {
    height: calc(100% - 43px);
    display: grid;
    grid-auto-rows: minmax(0, 1fr);
    overflow: hidden;
  }

  .portfolio-list .empty-state {
    display: grid;
    place-items: center;
    height: 100%;
  }

  .position-card {
    position: relative;
    height: 100%;
    min-height: 0;
    gap: 5px;
    grid-template-rows: auto auto auto 5px;
    overflow: hidden;
    padding: 7px;
  }

  .position-top {
    gap: 5px;
  }

  .position-token {
    min-width: 0;
  }

  .position-token .token-meta {
    display: none;
  }

  .position-top > .pill {
    display: none;
  }

  .position-fundamentals {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .position-fundamentals > div:nth-child(n + 4) {
    display: none;
  }

  .position-chart,
  .candle-chart {
    display: none;
  }

  .position-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .position-meta > div:nth-child(n + 3) {
    display: none;
  }

  .hold-meter {
    height: 5px;
  }

  .sell-button {
    position: absolute;
    top: 7px;
    right: 7px;
    min-height: 25px;
    min-width: 58px;
    padding: 0 10px;
    font-size: 11px;
  }
}

@media (max-width: 380px), (max-height: 760px) and (max-width: 640px) {
  .main-grid {
    grid-template-rows: minmax(0, 1fr) 74px;
  }

  .play-column {
    grid-template-rows: minmax(0, 0.8fr) 190px;
  }

  .mobile-upgrade-toggle span {
    font-size: 16px;
  }

  .upgrades-panel {
    height: min(78svh, 590px);
  }
}

@media (max-width: 640px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
    position: fixed;
    width: 100%;
  }

  .game-shell {
    height: 100svh;
    min-height: 0;
    grid-template-rows: auto 34px 50px minmax(0, 1fr);
    gap: 5px;
    padding:
      max(6px, env(safe-area-inset-top))
      max(7px, env(safe-area-inset-right))
      max(7px, env(safe-area-inset-bottom))
      max(7px, env(safe-area-inset-left));
  }

  @supports (height: 100dvh) {
    .game-shell {
      height: 100dvh;
    }
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    align-items: stretch;
  }

  .brand-block {
    min-width: 0;
  }

  .brand-block > div {
    min-width: 0;
  }

  h1 {
    max-width: 100%;
    overflow: hidden;
    font-size: 22px;
    line-height: 0.95;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand-logo {
    width: 36px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 30px auto auto auto minmax(0, 1fr);
    align-items: stretch;
    gap: 5px;
    width: 100%;
  }

  .site-link,
  .top-button {
    min-height: 32px;
    padding: 0 7px;
    border-radius: 8px;
    font-size: 9px;
    white-space: nowrap;
  }

  .site-link {
    padding: 0;
  }

  .site-link img {
    width: 18px;
    height: 18px;
  }

  .money-wrap {
    grid-column: auto;
    width: auto;
    min-width: 0;
    padding: 4px 7px;
    text-align: right;
  }

  .money-wrap strong {
    max-width: 100%;
    overflow: hidden;
    font-size: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .war-room {
    height: 34px;
    min-height: 34px;
  }

  .hud-card {
    gap: 3px;
    padding: 3px;
  }

  .hud-card > div {
    padding: 3px 5px;
  }

  .command-row {
    grid-template-columns: minmax(0, 1fr) minmax(104px, 1.02fr);
    gap: 5px;
  }

  .risk-control {
    gap: 3px;
    padding: 3px;
  }

  .risk-control button {
    min-height: 44px;
    padding: 0 2px;
    font-size: 9px;
  }

  .find-button {
    min-height: 50px;
  }

  .find-button span {
    font-size: 15px;
  }

  .main-grid {
    grid-template-rows: minmax(0, 1fr) 76px;
    min-height: 0;
    gap: 5px;
  }

  .play-column {
    grid-template-rows: minmax(0, 1fr) minmax(150px, 31%);
    min-height: 0;
    gap: 5px;
  }

  .side-column {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 5px;
  }

  .panel-head {
    min-height: 36px;
    padding: 6px 7px;
  }

  .panel-head h2 {
    font-size: 13px;
  }

  .deal-grid,
  .portfolio-list {
    height: calc(100% - 36px);
    padding: 6px;
  }

  .deal-card {
    gap: 4px;
    padding: 7px;
  }

  .deal-card h3 {
    font-size: 17px;
  }

  .token-head {
    gap: 6px;
    margin-top: 4px;
  }

  .token-logo {
    width: 32px;
    height: 32px;
  }

  .token-meta {
    gap: 3px;
  }

  .token-meta span {
    max-width: 92px;
    padding: 2px 4px;
    font-size: 7px;
  }

  .deal-market {
    gap: 5px;
    margin-top: 4px;
  }

  .mini-candle {
    height: 38px;
  }

  .signal-row {
    gap: 4px;
    margin: 4px 0;
  }

  .signal {
    padding: 5px;
  }

  .signal strong {
    font-size: 10px;
  }

  .deal-action {
    min-height: 30px;
    padding: 0 6px;
    font-size: clamp(9px, 3.1vw, 12px);
    letter-spacing: 0;
  }

  .portfolio-list {
    grid-auto-rows: 1fr;
    overflow: hidden;
  }

  .position-card {
    padding: 7px;
  }

  .position-name {
    max-width: 150px;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .position-fundamentals,
  .position-meta {
    gap: 4px;
  }

  .position-fundamentals > div,
  .position-meta > div {
    padding: 5px;
  }

  .position-fundamentals span,
  .position-meta span {
    font-size: 7px;
  }

  .position-fundamentals strong,
  .position-meta strong {
    font-size: 9px;
  }

  .sell-button {
    min-height: 24px;
    min-width: 52px;
    padding: 0 8px;
    font-size: 10px;
  }

  .airdrop-button,
  .mobile-upgrade-toggle {
    min-height: 0;
    height: 100%;
  }

  .airdrop-button {
    padding: 6px;
    font-size: 12px;
  }

  .airdrop-button span {
    font-size: 18px;
    line-height: 1;
  }

  .airdrop-button small {
    margin-top: 3px;
    font-size: 10px;
  }

  .mobile-upgrade-toggle span {
    font-size: 18px;
    line-height: 1;
  }

  .mobile-upgrade-toggle small {
    margin-top: 4px;
    font-size: 9px;
  }

  .upgrades-panel {
    inset:
      auto
      max(7px, env(safe-area-inset-right))
      max(7px, env(safe-area-inset-bottom))
      max(7px, env(safe-area-inset-left));
    height: min(76dvh, 590px);
    max-height: calc(100dvh - max(14px, env(safe-area-inset-top)) - max(14px, env(safe-area-inset-bottom)));
  }

  .ending-overlay,
  .name-overlay {
    padding:
      max(10px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
  }

  .ending-panel,
  .name-panel {
    width: min(100%, 360px);
    max-width: calc(100vw - max(20px, env(safe-area-inset-left)) - max(20px, env(safe-area-inset-right)));
    max-height: calc(100dvh - max(20px, env(safe-area-inset-top)) - max(20px, env(safe-area-inset-bottom)));
    overflow: auto;
    padding: 18px;
  }

  .ending-panel h2,
  .name-panel h2 {
    font-size: 25px;
  }

  .ending-panel strong {
    font-size: 24px;
  }

  .name-panel p:not(.eyebrow),
  .ending-panel p:not(.eyebrow) {
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: 13px;
    line-height: 1.35;
  }

  .name-panel input {
    min-width: 0;
    font-size: 16px;
  }

  .ending-share,
  .ending-download,
  .ending-exit,
  .name-panel button {
    min-height: 42px;
  }
}

@media (max-width: 390px) and (max-height: 740px) {
  .game-shell {
    grid-template-rows: auto 31px 44px minmax(0, 1fr);
    gap: 4px;
    padding:
      max(5px, env(safe-area-inset-top))
      max(5px, env(safe-area-inset-right))
      max(5px, env(safe-area-inset-bottom))
      max(5px, env(safe-area-inset-left));
  }

  .brand-logo {
    width: 32px;
  }

  h1 {
    font-size: 19px;
  }

  .top-actions {
    grid-template-columns: 28px auto auto auto minmax(0, 1fr);
    gap: 4px;
  }

  .site-link,
  .top-button {
    min-height: 29px;
    padding: 0 6px;
    font-size: 9px;
  }

  .money-wrap strong {
    font-size: 16px;
  }

  .war-room {
    height: 31px;
    min-height: 31px;
  }

  .hud-card strong {
    font-size: 9px;
  }

  .risk-control button {
    min-height: 38px;
  }

  .find-button {
    min-height: 44px;
  }

  .main-grid {
    grid-template-rows: minmax(0, 1fr) 66px;
  }

  .play-column {
    grid-template-rows: minmax(0, 1fr) 138px;
  }

  .mini-candle {
    height: 32px;
  }

  .deal-action {
    min-height: 28px;
    font-size: clamp(8px, 3vw, 11px);
  }
}

@media (max-width: 430px) {
  .name-overlay,
  .ending-overlay {
    place-items: center;
    padding: 12px;
  }

  .name-panel,
  .ending-panel {
    width: calc(100vw - 24px);
    max-width: 360px;
    max-height: calc(100dvh - 24px);
    margin: 0 auto;
    padding: 16px;
  }

  .name-panel img {
    width: 64px;
    height: 64px;
  }

  .name-panel h2,
  .ending-panel h2 {
    font-size: 23px;
    line-height: 1.05;
  }

  .name-panel p:not(.eyebrow),
  .ending-panel p:not(.eyebrow) {
    max-width: 100%;
    font-size: 13px;
    line-height: 1.35;
    overflow-wrap: break-word;
  }

  .name-panel input,
  .name-panel button,
  .ending-share,
  .ending-exit,
  .kolect-link {
    min-height: 42px;
  }

  .name-panel input {
    margin-top: 14px;
    font-size: 16px;
  }

  .referral-note {
    font-size: 10px;
  }

  .leaderboard-overlay {
    padding: 12px;
  }

  .leaderboard-panel {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    padding: 14px;
  }

  .leaderboard-head h2 {
    font-size: 22px;
  }

  .referral-box {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .referral-box strong {
    font-size: 18px;
  }

  .leaderboard-tabs button {
    min-height: 36px;
    font-size: 10px;
  }

  .leaderboard-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 74px;
    gap: 8px;
  }

  .leader-score {
    min-width: 0;
  }
}

@media (max-width: 430px) and (min-height: 780px) {
  .game-shell {
    grid-template-rows: auto 36px 52px minmax(0, 1fr);
  }

  .main-grid {
    grid-template-rows: minmax(0, 1fr) 80px;
  }

  .play-column {
    grid-template-rows: minmax(0, 1fr) minmax(158px, 30%);
  }

  .mini-candle {
    height: 42px;
  }
}

@media (max-width: 380px) {
  .game-shell {
    grid-template-rows: auto 31px 44px minmax(0, 1fr);
  }

  .brand-block {
    gap: 6px;
  }

  .brand-logo {
    width: 31px;
  }

  h1 {
    font-size: 18px;
  }

  .top-actions {
    grid-template-columns: 27px auto auto auto minmax(0, 1fr);
  }

  .site-link,
  .top-button {
    min-height: 28px;
    padding: 0 5px;
    font-size: 8px;
  }

  .money-wrap {
    padding: 3px 6px;
  }

  .money-wrap strong {
    font-size: 15px;
  }

  .command-row {
    grid-template-columns: minmax(0, 0.94fr) minmax(98px, 1.06fr);
  }

  .risk-control button {
    font-size: 8px;
  }

  .find-button span {
    font-size: 14px;
  }

  .find-button small {
    font-size: 9px;
  }

  .airdrop-button span,
  .mobile-upgrade-toggle span {
    font-size: 16px;
  }

  .deal-card h3 {
    font-size: 16px;
  }

  .position-name {
    max-width: 125px;
  }
}
