/* ============================================================
   Chrome Trading Bot — стили
   Палитра из скриншотов: тёмно-синий фон, акценты бирюза/фиолет/жёлтый
   ============================================================ */

:root {
  --bg-0: #07091a;
  --bg-1: #0d1127;
  --bg-2: #151a35;
  --bg-card: #161c3a;
  --bg-elev: #1b2144;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);

  --text: #e8ecff;
  --text-muted: #7f87b3;

  --accent-cyan: #3fe3d2;
  --accent-purple: #b46bff;
  --accent-pink: #ff5ec8;
  --accent-yellow: #ffcf3a;
  --accent-green: #18d97d;
  --accent-red: #ff4656;
  --accent-orange: #ff8a3d;

  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 20px;

  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-glow-cyan: 0 0 20px rgba(63, 227, 210, 0.28);
  --shadow-glow-green: 0 0 30px rgba(24, 217, 125, 0.45);
  --shadow-glow-red: 0 0 30px rgba(255, 70, 86, 0.45);

  --max-w: 440px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
html { -webkit-tap-highlight-color: transparent; }
body {
  background: radial-gradient(1200px 500px at 50% -10%, #191f46 0%, var(--bg-0) 60%) fixed, var(--bg-0);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.35;
  overflow: hidden;
  position: relative;
}

/* тонкая сетка-фон как на скриншотах + медленный дрейф */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  z-index: 0;
  animation: ctb-grid-drift 90s linear infinite;
  will-change: background-position;
}
@keyframes ctb-grid-drift {
  to { background-position: 28px 28px, 28px 28px; }
}

/* Японские свечи на фоне приложения. SVG — один период из 25 свечей по 32px
   шириной (всего 800×240), фитили + тела с бычьим/медвежьим окрасом.
   repeat-x + сдвиг ровно на 800px за цикл = бесшовное зацикливание. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='800' height='240' viewBox='0 0 800 240' preserveAspectRatio='none'><g opacity='0.55' stroke-width='2'><line x1='16' y1='130' x2='16' y2='170' stroke='%2318d97d'/><rect x='6' y='140' width='20' height='20' fill='%2318d97d'/><line x1='48' y1='115' x2='48' y2='145' stroke='%2318d97d'/><rect x='38' y='125' width='20' height='15' fill='%2318d97d'/><line x1='80' y1='120' x2='80' y2='150' stroke='%23ff4656'/><rect x='70' y='125' width='20' height='15' fill='%23ff4656'/><line x1='112' y1='100' x2='112' y2='145' stroke='%2318d97d'/><rect x='102' y='110' width='20' height='30' fill='%2318d97d'/><line x1='144' y1='100' x2='144' y2='130' stroke='%23ff4656'/><rect x='134' y='110' width='20' height='10' fill='%23ff4656'/><line x1='176' y1='90' x2='176' y2='125' stroke='%2318d97d'/><rect x='166' y='100' width='20' height='20' fill='%2318d97d'/><line x1='208' y1='80' x2='208' y2='110' stroke='%2318d97d'/><rect x='198' y='90' width='20' height='10' fill='%2318d97d'/><line x1='240' y1='85' x2='240' y2='120' stroke='%23ff4656'/><rect x='230' y='90' width='20' height='20' fill='%23ff4656'/><line x1='272' y1='75' x2='272' y2='115' stroke='%2318d97d'/><rect x='262' y='85' width='20' height='25' fill='%2318d97d'/><line x1='304' y1='75' x2='304' y2='105' stroke='%23ff4656'/><rect x='294' y='85' width='20' height='10' fill='%23ff4656'/><line x1='336' y1='70' x2='336' y2='100' stroke='%2318d97d'/><rect x='326' y='80' width='20' height='15' fill='%2318d97d'/><line x1='368' y1='75' x2='368' y2='110' stroke='%23ff4656'/><rect x='358' y='80' width='20' height='20' fill='%23ff4656'/><line x1='400' y1='75' x2='400' y2='105' stroke='%2318d97d'/><rect x='390' y='85' width='20' height='15' fill='%2318d97d'/><line x1='432' y1='80' x2='432' y2='120' stroke='%23ff4656'/><rect x='422' y='85' width='20' height='25' fill='%23ff4656'/><line x1='464' y1='105' x2='464' y2='140' stroke='%23ff4656'/><rect x='454' y='110' width='20' height='20' fill='%23ff4656'/><line x1='496' y1='110' x2='496' y2='140' stroke='%2318d97d'/><rect x='486' y='115' width='20' height='15' fill='%2318d97d'/><line x1='528' y1='110' x2='528' y2='150' stroke='%23ff4656'/><rect x='518' y='115' width='20' height='25' fill='%23ff4656'/><line x1='560' y1='115' x2='560' y2='145' stroke='%2318d97d'/><rect x='550' y='125' width='20' height='15' fill='%2318d97d'/><line x1='592' y1='120' x2='592' y2='160' stroke='%23ff4656'/><rect x='582' y='125' width='20' height='20' fill='%23ff4656'/><line x1='624' y1='125' x2='624' y2='155' stroke='%2318d97d'/><rect x='614' y='130' width='20' height='15' fill='%2318d97d'/><line x1='656' y1='125' x2='656' y2='160' stroke='%23ff4656'/><rect x='646' y='130' width='20' height='20' fill='%23ff4656'/><line x1='688' y1='135' x2='688' y2='160' stroke='%2318d97d'/><rect x='678' y='140' width='20' height='10' fill='%2318d97d'/><line x1='720' y1='135' x2='720' y2='170' stroke='%23ff4656'/><rect x='710' y='140' width='20' height='20' fill='%23ff4656'/><line x1='752' y1='145' x2='752' y2='170' stroke='%2318d97d'/><rect x='742' y='150' width='20' height='10' fill='%2318d97d'/><line x1='784' y1='145' x2='784' y2='170' stroke='%23ff4656'/><rect x='774' y='150' width='20' height='10' fill='%23ff4656'/></g></svg>");
  background-repeat: repeat-x;
  background-size: 800px 60%;
  background-position: 0 60%;
  animation: ctb-chart-scroll 40s linear infinite;
  will-change: background-position;
}
@keyframes ctb-chart-scroll {
  from { background-position:    0px 60%; }
  to   { background-position: -800px 60%; }
}

.app {
  position: relative;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(14px + var(--safe-top)) 16px 0 16px;
  z-index: 1;
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.header__brand {
  font-family: "Russo One", "Arial Black", sans-serif;
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 0.5px;
  display: flex;
  gap: 6px;
  text-transform: uppercase;
  line-height: 1;
}
.brand__chrome { color: var(--accent-green); }
.brand__trading { color: var(--text); }
.brand__bot { color: var(--accent-green); }

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-direction: column;
}

.vip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd23a, #ffb013);
  color: #111;
  font-weight: 800;
  font-size: 12px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  box-shadow: 0 6px 16px rgba(255, 176, 19, 0.35);
  transition: transform 0.12s ease;
}
.vip-btn:active { transform: scale(0.96); }

.lang-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  border-radius: 8px;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
}
.lang-btn__flag { width: 24px; height: 16px; object-fit: cover; border-radius: 2px; }

/* ============================================================
   SEARCH
   ============================================================ */
.search { margin-bottom: 10px; }
.search__input {
  width: 100%;
  padding: 12px 14px 12px 38px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-elev) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237f87b3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") no-repeat 12px 50%;
  background-size: 16px 16px;
  color: var(--text);
  font: inherit;
  outline: none;
}
.search__input:focus {
  border-color: rgba(63, 227, 210, 0.4);
  box-shadow: 0 0 0 3px rgba(63, 227, 210, 0.1);
}

/* ============================================================
   TICKER
   ============================================================ */
.ticker {
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(63, 227, 210, 0.06), rgba(180, 107, 255, 0.06));
  position: relative;
}
.ticker::before,
.ticker::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 30px;
  pointer-events: none;
  z-index: 2;
}
.ticker::before { left: 0; background: linear-gradient(90deg, var(--bg-0), transparent); }
.ticker::after  { right: 0; background: linear-gradient(270deg, var(--bg-0), transparent); }

.ticker__track {
  display: flex;
  gap: 16px;
  padding: 10px 14px;
  white-space: nowrap;
  animation: ticker-scroll 40s linear infinite;
  width: max-content;
}
.ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
}
.ticker__item .flags { display: inline-flex; gap: 0; }
.ticker__item .flags img { width: 16px; height: 12px; border-radius: 2px; object-fit: cover; }
.ticker__item .flags img + img { margin-left: -4px; }
.ticker__item .nm { color: var(--text); }
.ticker__item .pr { color: var(--accent-cyan); }
.ticker__item .py { color: var(--accent-green); }

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================================
   CATEGORIES
   ============================================================ */
.scroll-area {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.scroll-area::-webkit-scrollbar { width: 4px; }
.scroll-area::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }

.categories { display: flex; flex-direction: column; gap: 10px; }

.category {
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: rgba(11, 14, 32, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.category__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  background: linear-gradient(90deg, rgba(180, 107, 255, 0.18), rgba(180, 107, 255, 0.02));
  border-left: 3px solid var(--accent-purple);
}
.category--favorites  .category__head { background: linear-gradient(90deg, rgba(255, 207, 58, 0.18), rgba(255, 207, 58, 0.02)); border-left-color: var(--accent-yellow); }
.category--currencies .category__head { background: linear-gradient(90deg, rgba(63, 227, 210, 0.18), rgba(63, 227, 210, 0.02)); border-left-color: var(--accent-cyan); }
.category--crypto     .category__head { background: linear-gradient(90deg, rgba(255, 138, 61, 0.18), rgba(255, 138, 61, 0.02)); border-left-color: var(--accent-orange); }
.category--commodities .category__head { background: linear-gradient(90deg, rgba(255, 94, 200, 0.18), rgba(255, 94, 200, 0.02)); border-left-color: var(--accent-pink); }
.category--stocks     .category__head { background: linear-gradient(90deg, rgba(24, 217, 125, 0.18), rgba(24, 217, 125, 0.02)); border-left-color: var(--accent-green); }
.category--indices    .category__head { background: linear-gradient(90deg, rgba(180, 107, 255, 0.18), rgba(180, 107, 255, 0.02)); border-left-color: var(--accent-purple); }

.category__icon {
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.category__title {
  font-weight: 800;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.6px;
  flex: 1;
}
.category__arrow {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}
.category--open .category__arrow { transform: rotate(180deg); }

.category__body { display: none; padding: 10px 12px 12px; }
.category--open .category__body { display: block; }

.subgroup-toggle {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  margin-bottom: 10px;
}
.subgroup-toggle__arrow { color: var(--text-muted); font-size: 10px; }

.asset-list { display: flex; flex-direction: column; gap: 8px; }
.asset {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.08s ease;
}
.asset:active { transform: scale(0.985); }
.asset:hover { border-color: var(--border-strong); }

.asset__flags { width: 66px; display: flex; gap: 4px; flex-shrink: 0; }
.asset__flags img {
  width: 30px; height: 22px; border-radius: 3px; object-fit: cover;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.asset__icon {
  width: 66px;
  height: 22px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.asset__icon img { width: 30px; height: 22px; border-radius: 3px; object-fit: cover; }
.asset__icon .crypto-bubble,
.asset__icon .stock-bubble {
  width: 34px; height: 22px; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 10px; color: #0b0f24;
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-yellow));
  letter-spacing: 0;
}
.asset__icon .stock-bubble {
  background: linear-gradient(135deg, var(--accent-green), #07a85a);
  color: #fff;
}
.asset__icon .commodity-emoji { font-size: 18px; line-height: 22px; }

.asset__main { flex: 1; min-width: 0; }
.asset__name {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asset__cat {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 2px;
}
.asset__right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.asset__price { font-size: 13px; color: var(--accent-cyan); font-weight: 700; }
.asset__payout { font-size: 11px; color: var(--accent-green); font-weight: 700; }
.asset__payout--na { color: var(--text-muted); }
.asset__change { font-size: 10px; color: var(--text-muted); }

/* Неактивный актив: серый, неинтерактивный, не реагирует на hover/active */
.asset--inactive {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.6);
}
.asset--inactive:hover { border-color: var(--border); }
.asset--inactive:active { transform: none; }
.asset--inactive .asset__name { color: var(--text-muted); }

.asset__star {
  margin-left: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color 0.15s ease, transform 0.15s ease;
}
.asset__star:hover { color: var(--accent-yellow); }
.asset__star.on { color: var(--accent-yellow); }
.asset__star:active { transform: scale(0.85); }

.empty {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Высота должна быть БОЛЬШЕ суммарной высоты scan-bar (padding-top 36 +
   кнопка ~50 + padding-bottom 78 + safe-bottom ≈ 164–200px) плюс высота
   маскота (~80px), чтобы последний пункт списка (категория «Индексы»)
   не уезжал под кнопку даже когда последняя категория раскрыта. */
.bottom-spacer { height: calc(260px + var(--safe-bottom)); }

/* ============================================================
   SCAN BUTTON (pinned)
   ============================================================ */
.scan-bar {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  padding: 36px 16px calc(78px + var(--safe-bottom));
  z-index: 30;
  display: flex;
  justify-content: center;
  pointer-events: none;
  /* Тёмная подложка снизу: чтобы свечи на фоне не лезли под кнопку. */
  background: linear-gradient(
    to top,
    rgba(7, 9, 26, 0.98) 0%,
    rgba(7, 9, 26, 0.92) 55%,
    rgba(7, 9, 26, 0.0)  100%
  );
}
.scan-btn {
  pointer-events: auto;
  width: 100%;
  max-width: calc(var(--max-w) - 32px);
  padding: 16px;
  font: inherit;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #06101d;
  background: linear-gradient(135deg, var(--accent-cyan), #19b6a6);
  border: 1.5px solid rgba(63, 227, 210, 0.85);
  border-radius: 12px;
  cursor: pointer;
  box-shadow:
    0 0 0 4px rgba(63, 227, 210, 0.10),
    0 10px 26px rgba(63, 227, 210, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.1s ease, filter 0.15s ease, box-shadow 0.15s ease;
}
.scan-btn:hover  { filter: brightness(1.08); }
.scan-btn:active { transform: scale(0.98); }

/* ============================================================
   MASCOT (робот)
   ============================================================ */
.mascot {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(8px + var(--safe-bottom));
  z-index: 40;
  pointer-events: none;
  width: 64px; height: 58px;
}
.mascot__robot {
  width: 100%; height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.mascot__eyes {
  width: 40px; height: 18px;
  background: #11152a;
  border: 2px solid rgba(24, 217, 125, 0.8);
  border-radius: 10px 10px 4px 4px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 6px;
  box-shadow: inset 0 0 6px rgba(24, 217, 125, 0.35);
}
.mascot__eyes span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: blink 3.5s infinite;
}
@keyframes blink {
  0%, 96%, 100% { transform: scaleY(1); }
  98% { transform: scaleY(0.1); }
}
.mascot__screen {
  margin-top: 2px;
  width: 48px;
  padding: 3px 6px;
  border: 2px solid rgba(24, 217, 125, 0.7);
  border-radius: 6px;
  background: #0b0e1e;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 8px rgba(24, 217, 125, 0.3);
}
.mascot__time {
  font-family: "Courier New", monospace;
  color: var(--accent-green);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  text-shadow: 0 0 4px var(--accent-green);
}

/* ============================================================
   OVERLAY + MODAL
   ============================================================ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 16, 0.6);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  animation: overlay-in 0.18s ease-out;
}
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 380px;
  background: #0f1430;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 22px 22px 20px;
  position: relative;
  box-shadow: var(--shadow-soft);
  animation: modal-in 0.22s cubic-bezier(0.2, 1, 0.35, 1);
}
@keyframes modal-in { from { transform: translateY(18px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal__close {
  position: absolute;
  top: 10px; right: 12px;
  width: 28px; height: 28px;
  border: none;
  background: transparent;
  color: var(--accent-red);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
}
.modal__close:hover { background: rgba(255, 70, 86, 0.12); }

.modal__title {
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 4px 0 18px;
}

/* ===== MODE MODAL ===== */
.mode-grid {
  display: grid;
  gap: 12px;
}
.mode-card {
  border: 1px solid var(--border-strong);
  background: linear-gradient(135deg, rgba(63, 227, 210, 0.08), rgba(180, 107, 255, 0.08));
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text);
  transition: transform 0.1s ease, border-color 0.15s ease;
}
.mode-card:hover { border-color: var(--accent-cyan); }
.mode-card:active { transform: scale(0.98); }
.mode-card__icon { font-size: 26px; }
.mode-card__title { font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; font-size: 14px; }
.mode-card__hint { font-size: 11px; color: var(--text-muted); }

.mode-card--meta { background: linear-gradient(135deg, rgba(255, 207, 58, 0.1), rgba(255, 138, 61, 0.1)); }
.mode-card--meta:hover { border-color: var(--accent-orange); }

/* ===== EXPIRATION MODAL ===== */
.modal--expiration { padding: 22px 22px 18px; }

.exp-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.exp-mode-btn {
  padding: 12px 10px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.15s ease, background 0.15s ease;
}
.exp-mode-btn:hover { border-color: var(--accent-cyan); }
.exp-mode-btn:active { transform: scale(0.97); }
.exp-mode-btn.is-active {
  border-color: var(--accent-green);
  background: linear-gradient(135deg, rgba(24, 217, 125, 0.18), rgba(24, 217, 125, 0.05));
  box-shadow: 0 0 0 3px rgba(24, 217, 125, 0.12);
  color: var(--accent-green);
}

.exp-times {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.exp-time-btn {
  padding: 12px 4px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.15s ease, background 0.15s ease;
}
.exp-time-btn:hover { border-color: var(--accent-cyan); }
.exp-time-btn:active { transform: scale(0.94); }
.exp-time-btn.is-active {
  border-color: var(--accent-green);
  background: linear-gradient(135deg, rgba(24, 217, 125, 0.22), rgba(24, 217, 125, 0.06));
  color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(24, 217, 125, 0.12);
}
.exp-time-btn--otc {
  border-color: rgba(180, 107, 255, 0.45);
  color: var(--accent-purple);
}
.exp-time-btn--otc.is-active {
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.exp-auto-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(24, 217, 125, 0.3);
  background: rgba(24, 217, 125, 0.05);
}

/* ===== Indicator dropdown (only visible for "classic" mode) ===== */
.exp-indicator {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.exp-indicator__label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.exp-indicator__select-wrap {
  position: relative;
}
.exp-indicator__select {
  width: 100%;
  padding: 12px 36px 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.3px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.exp-indicator__select:hover { border-color: var(--accent-cyan); }
.exp-indicator__select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(63, 227, 210, 0.15);
}
.exp-indicator__arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--text-muted);
  pointer-events: none;
}
/* Стили выпадающего списка опций — поддерживается только в Chromium-браузерах,
   но даёт консистентный тёмный вид на десктопе. На мобильных нативный picker. */
.exp-indicator__select option {
  background: #0f1430;
  color: var(--text);
}

.exp-analyze {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  font: inherit;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 13px;
  color: #06101d;
  background: linear-gradient(135deg, var(--accent-cyan), #19b6a6);
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(63, 227, 210, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.1s ease, filter 0.15s ease, opacity 0.15s ease;
}
.exp-analyze:hover { filter: brightness(1.08); }
.exp-analyze:active { transform: scale(0.98); }
.exp-analyze:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.4);
  box-shadow: none;
}

/* ===== SCAN MODAL ===== */
.modal--scan {
  padding: 18px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(11, 16, 40, 0.9), rgba(11, 16, 40, 0.95)),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300' viewBox='0 0 300 300'><g opacity='0.45'><rect x='10' y='180' width='10' height='50' fill='%2318d97d'/><rect x='25' y='160' width='10' height='80' fill='%2318d97d'/><rect x='40' y='190' width='10' height='40' fill='%23ff4656'/><rect x='55' y='140' width='10' height='100' fill='%2318d97d'/><rect x='70' y='170' width='10' height='70' fill='%2318d97d'/><rect x='85' y='200' width='10' height='30' fill='%23ff4656'/><rect x='100' y='130' width='10' height='110' fill='%2318d97d'/><rect x='115' y='150' width='10' height='90' fill='%2318d97d'/><rect x='130' y='175' width='10' height='65' fill='%23ff4656'/><rect x='145' y='120' width='10' height='120' fill='%2318d97d'/><rect x='160' y='145' width='10' height='95' fill='%2318d97d'/><rect x='175' y='180' width='10' height='60' fill='%23ff4656'/><rect x='190' y='160' width='10' height='80' fill='%2318d97d'/><rect x='205' y='135' width='10' height='105' fill='%2318d97d'/><rect x='220' y='170' width='10' height='70' fill='%23ff4656'/><rect x='235' y='150' width='10' height='90' fill='%2318d97d'/><rect x='250' y='190' width='10' height='50' fill='%23ff4656'/><rect x='265' y='165' width='10' height='75' fill='%2318d97d'/><rect x='280' y='145' width='10' height='95' fill='%2318d97d'/></g></svg>") center/cover no-repeat;
}

.scan-chart {
  /* картинка уже в фоне модалки */
  display: none;
}

.scan-asset {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.scan-asset__flags {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}
.scan-asset__flags img {
  width: 46px; height: 30px; border-radius: 5px;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}
.scan-asset__name {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 1px;
  color: #fff;
}
.scan-asset__meta { display: flex; gap: 10px; align-items: center; }
.scan-asset__price { color: var(--accent-yellow); font-weight: 700; font-size: 15px; }
.scan-asset__payout { color: var(--accent-purple); font-weight: 700; font-size: 14px; }

.scan-radar {
  margin: 22px auto 14px;
  width: 92px; height: 92px;
  border-radius: 50%;
  border: 1.5px solid rgba(63, 227, 210, 0.35);
  display: grid; place-items: center;
  position: relative;
  background: radial-gradient(circle at 50% 50%, rgba(63, 227, 210, 0.1), transparent 60%);
}
.scan-radar::before,
.scan-radar::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(63, 227, 210, 0.25);
  animation: radar-pulse 2.2s infinite;
}
.scan-radar::after { animation-delay: 1.1s; }
@keyframes radar-pulse {
  0%   { transform: scale(0.5); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}
.scan-radar__dish {
  width: 44px; height: 44px;
  background:
    radial-gradient(circle at 40% 35%, #e9eef8 0%, #8893b0 55%, #3f4568 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  transform: rotate(-22deg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  position: relative;
  animation: radar-rotate 3s linear infinite;
}
.scan-radar__dish::after {
  content: "";
  position: absolute;
  left: 45%; top: 60%;
  width: 3px; height: 18px;
  background: linear-gradient(180deg, #e9eef8, #6a7190);
  transform: rotate(15deg);
}
@keyframes radar-rotate {
  0%, 100% { transform: rotate(-28deg); }
  50% { transform: rotate(10deg); }
}

.scan-status {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-size: 13px;
  color: #d6dbf5;
  margin-top: 6px;
}

.scan-expiration {
  margin: 16px auto 0;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 12px 22px;
  border-radius: 12px;
  border: 1px solid rgba(24, 217, 125, 0.4);
  background: rgba(24, 217, 125, 0.08);
  box-shadow: var(--shadow-glow-green);
}
.scan-expiration__label {
  color: var(--accent-green);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 11px;
}
.scan-expiration__value {
  color: #fff;
  font-weight: 900;
  font-size: 22px;
}

/* ===== SIGNAL MODAL ===== */
.modal--signal {
  padding: 16px 16px 18px;
  text-align: center;
}

.sig-asset { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 12px; }
.sig-asset__flags { display: flex; gap: 8px; }
.sig-asset__flags img {
  width: 40px; height: 26px; border-radius: 4px; object-fit: cover;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}
.sig-asset__name { font-weight: 800; font-size: 18px; letter-spacing: 1px; }
.sig-asset__meta { display: flex; gap: 10px; font-size: 13px; }
.sig-asset__price { color: var(--accent-yellow); font-weight: 700; }
.sig-asset__payout { color: var(--accent-purple); font-weight: 700; }

.sig-card {
  width: 100%;
  padding: 22px 14px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}
.sig-card--buy {
  background: linear-gradient(135deg, #1ee386, #089654);
  box-shadow: var(--shadow-glow-green);
  animation: ctb-glow-green 2.4s ease-in-out infinite;
}
.sig-card--sell {
  background: linear-gradient(135deg, #ff4a58, #b41724);
  box-shadow: var(--shadow-glow-red);
  animation: ctb-glow-red 2.4s ease-in-out infinite;
}
@keyframes ctb-glow-green {
  0%, 100% { box-shadow: 0 0 24px rgba(24, 217, 125, 0.45); }
  50%      { box-shadow: 0 0 56px rgba(24, 217, 125, 0.85); }
}
@keyframes ctb-glow-red {
  0%, 100% { box-shadow: 0 0 24px rgba(255, 70, 86, 0.45); }
  50%      { box-shadow: 0 0 56px rgba(255, 70, 86, 0.85); }
}

/* Слой 1: плывущие свечи в фоне карточки */
.sig-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='120' viewBox='0 0 300 120'><g opacity='0.18'><rect x='10' y='60' width='10' height='40' fill='%23fff'/><rect x='25' y='40' width='10' height='60' fill='%23fff'/><rect x='40' y='70' width='10' height='30' fill='%23fff'/><rect x='55' y='30' width='10' height='75' fill='%23fff'/><rect x='70' y='50' width='10' height='55' fill='%23fff'/><rect x='85' y='65' width='10' height='35' fill='%23fff'/><rect x='100' y='25' width='10' height='80' fill='%23fff'/><rect x='115' y='45' width='10' height='60' fill='%23fff'/><rect x='130' y='60' width='10' height='45' fill='%23fff'/><rect x='145' y='20' width='10' height='85' fill='%23fff'/><rect x='160' y='55' width='10' height='50' fill='%23fff'/><rect x='175' y='70' width='10' height='35' fill='%23fff'/><rect x='190' y='40' width='10' height='65' fill='%23fff'/><rect x='205' y='30' width='10' height='75' fill='%23fff'/><rect x='220' y='60' width='10' height='45' fill='%23fff'/><rect x='235' y='25' width='10' height='80' fill='%23fff'/><rect x='250' y='50' width='10' height='55' fill='%23fff'/><rect x='265' y='65' width='10' height='40' fill='%23fff'/><rect x='280' y='35' width='10' height='70' fill='%23fff'/></g></svg>");
  background-repeat: repeat-x;
  background-size: 300px 100%;
  background-position: 0 50%;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.55;
  animation: ctb-candles-drift 14s linear infinite;
  will-change: background-position;
  z-index: 1;
}
@keyframes ctb-candles-drift {
  from { background-position: 0 50%; }
  to   { background-position: -300px 50%; }
}

/* Слой 2: бегущие диагональные полосы + скользящий блик.
   Для покупки полосы идут вверх-вправо, для продажи — вниз-вправо. */
.sig-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;
}
.sig-card--buy::after {
  background:
    linear-gradient(115deg,
      transparent 0%,
      rgba(255, 255, 255, 0.0) 35%,
      rgba(255, 255, 255, 0.40) 50%,
      rgba(255, 255, 255, 0.0) 65%,
      transparent 100%),
    repeating-linear-gradient(45deg,
      transparent 0,
      transparent 26px,
      rgba(255, 255, 255, 0.10) 26px,
      rgba(255, 255, 255, 0.10) 30px);
  background-size: 220% 100%, 56px 56px;
  background-repeat: no-repeat, repeat;
  background-position: -110% 0, 0 0;
  animation: ctb-buy-bg 3s linear infinite;
  will-change: background-position;
}
.sig-card--sell::after {
  background:
    linear-gradient(115deg,
      transparent 0%,
      rgba(255, 255, 255, 0.0) 35%,
      rgba(255, 255, 255, 0.40) 50%,
      rgba(255, 255, 255, 0.0) 65%,
      transparent 100%),
    repeating-linear-gradient(-45deg,
      transparent 0,
      transparent 26px,
      rgba(255, 255, 255, 0.10) 26px,
      rgba(255, 255, 255, 0.10) 30px);
  background-size: 220% 100%, 56px 56px;
  background-repeat: no-repeat, repeat;
  background-position: -110% 0, 0 0;
  animation: ctb-sell-bg 3s linear infinite;
  will-change: background-position;
}
/* Один источник правды на background-position: блик пролетает за первые 35%
   и паркуется за правым краем; полосы непрерывно ползут на одну плитку (56px)
   за полный цикл, поэтому момент перезапуска визуально незаметен. */
@keyframes ctb-buy-bg {
  0%   { background-position: -110% 0,    0px    0px; }
  35%  { background-position:  110% 0,  19.6px -19.6px; }
  100% { background-position:  110% 0,   56px  -56px; }
}
@keyframes ctb-sell-bg {
  0%   { background-position: -110% 0,    0px   0px; }
  35%  { background-position:  110% 0,  19.6px 19.6px; }
  100% { background-position:  110% 0,   56px  56px; }
}
.sig-card__arrow {
  position: relative;
  font-size: 56px;
  line-height: 1;
  color: #fff;
  font-weight: 900;
  z-index: 2;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.sig-card__label {
  position: relative;
  font-size: 26px;
  letter-spacing: 3px;
  font-weight: 900;
  color: #fff;
  z-index: 2;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.sig-subtitle {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.sig-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 14px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.sig-table td {
  padding: 10px 14px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
}
.sig-table tr:last-child td { border-bottom: none; }
.sig-table td.r { text-align: right; color: var(--text); }

.sig-timer {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.sig-timer__bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.sig-timer__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green));
  border-radius: 999px;
  transition: width 1s linear;
  width: 100%;
}
.sig-timer__value {
  font-family: "Courier New", monospace;
  font-size: 22px;
  font-weight: 900;
  color: var(--accent-cyan);
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(63, 227, 210, 0.35);
}
.sig-timer--expired .sig-timer__fill {
  background: linear-gradient(90deg, var(--accent-red), #7a0e19);
}
.sig-timer--expired .sig-timer__value { color: var(--accent-red); }

.sig-actions { display: flex; gap: 10px; }
.sig-btn {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  transition: transform 0.1s ease, background 0.15s ease;
}
.sig-btn:active { transform: scale(0.97); }
.sig-btn--ghost { background: transparent; color: var(--text); }
.sig-btn--ghost:hover { background: rgba(255, 255, 255, 0.04); }
.sig-btn--primary {
  background: linear-gradient(135deg, var(--accent-cyan), #12a697);
  color: #06101d;
  border: none;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(140px + var(--safe-bottom));
  background: rgba(11, 16, 40, 0.95);
  border: 1px solid var(--border-strong);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--text);
  z-index: 200;
  box-shadow: var(--shadow-soft);
  animation: toast-in 0.2s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ============================================================
   LOCKED OVERLAY (доступ только через Telegram WebApp + депозит)
   ============================================================ */
.overlay.locked {
  /* Поверх всего, не закрывается кликом по фону. */
  z-index: 1000;
  background: rgba(4, 6, 16, 0.92);
  backdrop-filter: blur(10px);
}
.modal--locked {
  text-align: center;
  padding: 32px 24px 28px;
  max-width: 360px;
}
.locked__icon {
  font-size: 56px;
  margin-bottom: 14px;
  filter: drop-shadow(0 4px 16px rgba(255, 207, 58, 0.45));
}
.locked__title {
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 12px;
  color: var(--accent-yellow);
}
.locked__text {
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 22px;
  opacity: 0.92;
}
.locked__btn {
  display: inline-block;
  padding: 14px 22px;
  border-radius: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-size: 13px;
  color: #06101d;
  background: linear-gradient(135deg, var(--accent-cyan), #19b6a6);
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(63, 227, 210, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: filter 0.15s ease, transform 0.1s ease;
}
.locked__btn:hover  { filter: brightness(1.08); }
.locked__btn:active { transform: scale(0.98); }

/* ============================================================
   UTILS
   ============================================================ */
[hidden] { display: none !important; }

/* Уважаем системную настройку «уменьшить анимацию» */
@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after,
  .sig-card,
  .sig-card--buy,
  .sig-card--sell,
  .sig-card::before,
  .sig-card::after {
    animation: none !important;
  }
}
