@import url("theme.css");

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text);
  overflow: hidden;
  height: 100%;
  height: 100dvh;
  overscroll-behavior: none;
  position: fixed;
  inset: 0;
  width: 100%;
}

.font-mono,
.balance-card__value,
.live-price,
.stake-input,
.quick-stakes button,
.duration-btn,
#payout-preview,
#payout-percent {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ——— Фон ——— */
.platform-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background: #020208;
}
.platform-bg__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.35;
  pointer-events: none;
}
.platform-bg__orb--1 {
  width: 180px;
  height: 180px;
  top: 12%;
  left: -8%;
  background: radial-gradient(circle, rgba(109, 40, 217, 0.5), transparent 70%);
  animation: orbFloat1 22s ease-in-out infinite;
}
.platform-bg__orb--2 {
  width: 140px;
  height: 140px;
  top: 55%;
  right: -5%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.45), transparent 70%);
  animation: orbFloat2 18s ease-in-out infinite;
}
.platform-bg__orb--3 {
  width: 120px;
  height: 120px;
  bottom: 18%;
  left: 30%;
  background: radial-gradient(circle, rgba(76, 29, 149, 0.55), transparent 70%);
  animation: orbFloat3 26s ease-in-out infinite;
}
@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.15); }
}
@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-35px, -25px) scale(1.1); }
}
@keyframes orbFloat3 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(25px, -40px) scale(1.2); }
}
.platform-bg__grid {
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  animation: gridDrift 48s linear infinite;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 20%, transparent 75%);
}
@keyframes gridDrift {
  to { transform: translate(32px, 32px); }
}
#particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.85;
}
.platform-bg__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
  animation: glowPulse 10s ease-in-out infinite alternate;
}
.platform-bg__glow--1 {
  width: 320px;
  height: 320px;
  top: -100px;
  left: 5%;
  background: #6d28d9;
}
.platform-bg__glow--2 {
  width: 260px;
  height: 260px;
  bottom: 80px;
  right: 0;
  background: #a855f7;
  animation-delay: 3s;
}
@keyframes glowPulse {
  from { opacity: 0.28; transform: scale(1); }
  to { opacity: 0.5; transform: scale(1.1); }
}

.app {
  max-width: 500px;
  margin: 0 auto;
  height: 100%;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 6px 10px calc(4px + var(--safe-bottom));
  gap: 6px;
  position: relative;
  z-index: 1;
  overflow: hidden;
  overscroll-behavior: none;
}
.app-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.terminal-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: none;
}
.terminal-module {
  flex-shrink: 0;
}
.terminal-module[data-terminal-module="chart"] {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ——— Topbar ——— */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: var(--gradient-primary);
  box-shadow: var(--neon);
  animation: brandMarkPulse 2.2s ease-in-out infinite;
}
@keyframes brandMarkPulse {
  0%,
  100% {
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.45);
    filter: brightness(1);
  }
  50% {
    box-shadow: 0 0 22px rgba(168, 85, 247, 0.95), 0 0 36px rgba(139, 92, 246, 0.5);
    filter: brightness(1.15);
  }
}
.brand-mark::after {
  content: "C";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
}
.brand-mark { position: relative; }
.brand-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--gradient-premium);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}
.brand-name span {
  -webkit-text-fill-color: #c4b5fd;
  color: #c4b5fd;
}

.balance-card {
  border: none;
  cursor: pointer;
  text-align: right;
  padding: 6px 10px;
  border-radius: 12px;
  background: var(--bg-glass);
  backdrop-filter: var(--blur-glass);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px var(--glass-border-in), 0 0 10px rgba(139, 92, 246, 0.35);
  transition: transform 0.15s, box-shadow 0.2s;
  min-width: 0;
  max-width: 52%;
  flex-shrink: 1;
}
.balance-card:active { transform: scale(0.97); }
.balance-card--loading { pointer-events: none; }
.balance-card__label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.balance-card__row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
.balance-card__value {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(42vw, 200px);
  min-width: 48px;
  display: inline-block;
}
.balance-card--blink-win {
  animation: balanceBlinkWin 0.55s ease 2;
}
.balance-card--blink-loss {
  animation: balanceBlinkLoss 0.55s ease 2;
}
@keyframes balanceBlinkWin {
  0%, 100% {
    box-shadow: inset 0 0 0 1px var(--glass-border-in), 0 0 10px rgba(139, 92, 246, 0.35);
  }
  50% {
    box-shadow:
      0 0 28px rgba(16, 185, 129, 0.75),
      inset 0 0 24px rgba(16, 185, 129, 0.22);
    background: rgba(16, 185, 129, 0.12);
  }
}
@keyframes balanceBlinkLoss {
  0%, 100% {
    box-shadow: inset 0 0 0 1px var(--glass-border-in), 0 0 10px rgba(139, 92, 246, 0.35);
  }
  50% {
    box-shadow:
      0 0 28px rgba(239, 68, 68, 0.7),
      inset 0 0 24px rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.1);
  }
}
.pair-btn--pick {
  animation: pairPick 0.42s ease;
}
.duration-btn--pick {
  animation: durationPick 0.38s ease;
}
@keyframes pairPick {
  0% { transform: scale(1); box-shadow: var(--neon); }
  40% { transform: scale(1.06); box-shadow: 0 0 26px rgba(168, 85, 247, 0.9); }
  100% { transform: scale(1); }
}
@keyframes durationPick {
  0% { transform: scale(1); }
  45% { transform: scale(1.08); box-shadow: 0 0 20px rgba(168, 85, 247, 0.85); }
  100% { transform: scale(1); }
}
.balance-card__badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(139, 92, 246, 0.25);
  color: #e9d5ff;
}

.skeleton-text {
  color: transparent !important;
  background: linear-gradient(
    90deg,
    rgba(139, 92, 246, 0.15) 0%,
    rgba(168, 85, 247, 0.35) 50%,
    rgba(139, 92, 246, 0.15) 100%
  );
  background-size: 200% 100%;
  animation: skeletonPulse 1.2s ease-in-out infinite;
  border-radius: 6px;
  min-width: 72px;
  min-height: 1.1em;
  display: inline-block;
}
@keyframes skeletonPulse {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ——— Пары ——— */
.pairs-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  flex-shrink: 0;
  padding: 2px 0;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}
.pairs-scroll::-webkit-scrollbar { display: none; }
.pair-btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 0.5px solid var(--glass-border);
  background: var(--bg-glass);
  backdrop-filter: var(--blur-glass);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.25s, border-color 0.2s, background 0.25s;
  position: relative;
  overflow: hidden;
}
.pair-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.2), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.pair-btn:active { transform: scale(0.94); }
.pair-btn.active {
  border-color: rgba(168, 85, 247, 0.7);
  background: rgba(109, 40, 217, 0.35);
  color: #fff;
  box-shadow: var(--neon), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.pair-btn__chevron {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.5;
  transition: transform 0.3s, opacity 0.3s;
}
.pair-btn__mini-chart i:nth-child(1) { height: 40%; }
@keyframes miniBar {
  from { transform: scaleY(0.7); }
  to { transform: scaleY(1); }
}

/* ——— График glass ——— */
.chart-card {
  flex: 1 1 0;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg-glass);
  backdrop-filter: var(--blur-glass);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px var(--glass-border-in), 0 8px 32px rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: 8px 10px;
  touch-action: none;
}
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 8px;
  flex-shrink: 0;
}
.pair-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.live-price {
  font-size: 20px;
  font-weight: 700;
  color: #e9d5ff;
  text-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}
.price-change {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--up-dim);
  color: var(--success);
  font-family: var(--font-mono);
}
.price-change.neg {
  background: var(--down-dim);
  color: var(--error);
}
.chart-wrap {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(5, 5, 10, 0.5);
}
#chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.active-trade {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 20;
  max-width: 130px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--bg-glass-strong);
  backdrop-filter: var(--blur-modal);
  border: 0.5px solid var(--glass-border-in);
  box-shadow: var(--neon);
}
.active-trade.hidden { display: none; }
.active-trade__head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.active-trade__dir { font-size: 14px; font-weight: 800; }
.active-trade__dir.up { color: var(--success); }
.active-trade__dir.down { color: var(--error); }
.active-trade__pair { font-size: 10px; font-weight: 700; }
.active-trade__stake { font-size: 9px; color: var(--muted); font-family: var(--font-mono); }
.active-trade__pnl {
  font-size: 12px;
  font-weight: 800;
  margin: 4px 0;
  padding: 4px 6px;
  border-radius: 8px;
  text-align: center;
  font-family: var(--font-mono);
}
.active-trade__pnl.pos { color: #34d399; background: var(--up-dim); }
.active-trade__pnl.neg { color: #f87171; background: var(--down-dim); }
.active-trade__timer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--glass-border);
}
.active-trade__timer .ring {
  width: 22px;
  height: 22px;
  transform: rotate(-90deg);
}
.countdown-text {
  font-size: 14px;
  font-weight: 800;
  color: #c4b5fd;
  font-family: var(--font-mono);
}
.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 3;
}
.ring-progress {
  fill: none;
  stroke: #a855f7;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 264;
  transition: stroke-dashoffset 0.3s linear;
  filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.8));
}

.payout-badge {
  display: flex;
  justify-content: space-between;
  padding-top: 8px;
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}
.payout-badge strong {
  color: #d946ef;
  font-size: 12px;
  font-family: var(--font-mono);
}

/* ——— Trade dock glass ——— */
.trade-dock {
  flex: 0 0 auto;
  position: relative;
  background: var(--bg-glass);
  backdrop-filter: var(--blur-glass);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px var(--glass-border-in);
  border-radius: 14px;
  padding: 6px 8px 8px;
  touch-action: manipulation;
  overflow: visible;
}
.terminal-module[data-terminal-module="dock"] {
  overflow: visible;
}
.dock-row {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}
.dock-field { flex: 1; min-width: 0; }
.dock-field--time { flex: 1.15; }
.dock-label {
  font-size: 8px;
  font-weight: 700;
  margin-bottom: 3px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.duration-row { display: flex; flex-wrap: wrap; gap: 4px; }
.duration-btn {
  padding: 4px 7px;
  border-radius: 10px;
  border: 0.5px solid var(--glass-border);
  background: rgba(11, 11, 21, 0.7);
  backdrop-filter: blur(12px);
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.duration-btn.active {
  background: var(--gradient-primary);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 12px #8b5cf6, inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

.amount-box {
  display: flex;
  gap: 6px;
  align-items: center;
  background: rgba(11, 11, 21, 0.65);
  border: 0.5px solid var(--glass-border);
  border-radius: 14px;
  padding: 4px;
  backdrop-filter: blur(12px);
}
.stake-input,
.amount-box input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  outline: none;
}
.amount-step {
  width: 26px;
  height: 26px;
  border: 0.5px solid var(--glass-border);
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.12);
  color: #e9d5ff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.2s;
}
.amount-step:active { transform: scale(0.92); }

.quick-stakes {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}
.quick-stakes button {
  flex: 1;
  padding: 5px 4px;
  border-radius: 10px;
  background: rgba(11, 11, 21, 0.75);
  backdrop-filter: blur(12px);
  border: 0.5px solid var(--glass-border);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  animation: stakeFadeIn 0.5s ease backwards;
}
.quick-stakes button:nth-child(1) { animation-delay: 0.05s; }
.quick-stakes button:nth-child(2) { animation-delay: 0.1s; }
.quick-stakes button:nth-child(3) { animation-delay: 0.15s; }
.quick-stakes button:nth-child(4) { animation-delay: 0.2s; }
.quick-stakes button.active,
.quick-stakes button:active {
  background: rgba(109, 40, 217, 0.4);
  color: #fff;
  box-shadow: var(--neon), inset 0 2px 5px rgba(0, 0, 0, 0.3);
  border-color: rgba(168, 85, 247, 0.5);
}
@keyframes stakeFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.profit-line {
  text-align: center;
  font-size: 10px;
  margin: 2px 0 5px;
  color: var(--muted);
}
.stake-min-hint {
  font-size: 9px;
  margin-top: 2px;
}
.profit-line strong {
  color: var(--success);
  font-weight: 800;
  background: var(--gradient-premium);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.trade-actions {
  display: flex;
  gap: 8px;
}
.trade-btn-wrap {
  flex: 1;
  position: relative;
}
.trade-btn {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 6px;
  border-radius: 12px;
  border: none;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.2s;
  min-height: 42px;
  position: relative;
  overflow: hidden;
}
.trade-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.25), transparent 55%);
  opacity: 0;
  transition: opacity 0.2s;
}
.trade-btn:active,
.trade-btn--flash {
  transform: scale(0.97);
}
.trade-btn:active::before,
.trade-btn--flash::before { opacity: 1; }
.trade-btn.up {
  background: var(--gradient-up);
  color: #ecfdf5;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35), var(--neon);
}
.trade-btn.down {
  background: var(--gradient-down);
  color: #fff;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3), var(--neon);
}
.trade-btn__arrow { font-size: 18px; line-height: 1; }
.trade-btn__title {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.trade-btn--loading .trade-btn__inner { opacity: 0; }
.trade-btn--loading .trade-btn__loader {
  display: flex;
}
.trade-btn__loader {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.trade-btn__loader span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  animation: dotRun 0.9s ease-in-out infinite;
}
.trade-btn__loader span:nth-child(2) { animation-delay: 0.15s; }
.trade-btn__loader span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dotRun {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.trade-expiry-ring {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.trade-expiry-ring.active { opacity: 1; }
.trade-expiry-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.trade-expiry-ring circle {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}
.trade-expiry-ring .track { stroke: rgba(255, 255, 255, 0.08); }
.trade-expiry-ring .progress {
  stroke: #a855f7;
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.8));
}

body.trade-overlay-dim::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 10, 0.45);
  z-index: 50;
  pointer-events: none;
  animation: fadeDim 0.2s ease;
}
@keyframes fadeDim {
  from { opacity: 0; }
  to { opacity: 1; }
}

.status.hidden { display: none !important; }
.status {
  text-align: center;
  font-size: 11px;
  margin-top: 8px;
  color: var(--muted);
}
.status.ok { color: var(--success); }
.status.err { color: var(--error); }

/* ——— Bottom nav ——— */
.bottom-nav {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  display: flex;
  gap: 10px;
  margin-top: 6px;
  padding: 0 0 calc(2px + var(--safe-bottom));
  background: transparent;
  border: none;
  box-shadow: none;
  z-index: 20;
}
.bottom-nav__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-align: center;
  text-transform: none;
  color: #ede9fe;
}
.bottom-nav__btn,
.bottom-nav__btn--history,
.bottom-nav__btn--menu {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 8px;
  border: none;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(88, 36, 180, 0.82), rgba(36, 12, 70, 0.95));
  color: #ede9fe;
  cursor: pointer;
  box-shadow:
    0 6px 20px rgba(88, 28, 135, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.bottom-nav__btn:active,
.bottom-nav__btn.ui-touch-active {
  transform: scale(0.94);
  filter: brightness(1.1);
}
.bottom-nav__btn.active {
  color: #fff;
  background: linear-gradient(145deg, rgba(124, 58, 237, 0.92), rgba(76, 29, 149, 0.98));
  box-shadow:
    0 0 22px rgba(168, 85, 247, 0.5),
    inset 0 0 0 1px rgba(196, 181, 253, 0.3);
}

/* ——— Modals glass 3.0 ——— */
.trade-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.trade-modal.hidden { display: none; }
.trade-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 10, 0.82);
  backdrop-filter: var(--blur-modal);
}
.trade-modal__box {
  position: relative;
  width: min(100%, 360px);
  padding: 22px;
  border-radius: 22px;
  background: var(--bg-glass-strong);
  backdrop-filter: var(--blur-modal);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px var(--glass-border-in), var(--neon-strong);
}
.trade-modal__title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 16px;
  background: var(--gradient-premium);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}
.trade-modal__list { list-style: none; margin: 0 0 18px; padding: 0; }
.trade-modal__list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--glass-border);
  font-size: 13px;
}
.trade-modal__list strong { font-family: var(--font-mono); }
.trade-modal__list .tc-profit { color: var(--success); }
.trade-modal__list .tc-loss { color: var(--error); }
.trade-modal__actions { display: flex; gap: 10px; }
.trade-modal__btn {
  flex: 1;
  padding: 14px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: transform 0.12s;
}
.trade-modal__btn:active { transform: scale(0.97); }
.trade-modal__btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  color: #c4b5fd;
  border: 0.5px solid var(--glass-border);
}
.trade-modal__btn--primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--neon);
}

.currency-picker__box { max-width: 360px; }
.currency-picker__hint {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.currency-picker__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.currency-picker__btn {
  padding: 14px;
  border-radius: 14px;
  border: 0.5px solid var(--glass-border-in);
  background: rgba(109, 40, 217, 0.2);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: var(--blur-glass);
}
.currency-picker__btn:active { transform: scale(0.97); }

@media (max-height: 640px) {
  #chart { min-height: 160px; }
}
