/* TripleX Indicator — minimalista: superfícies escuras, linhas finas, violeta só onde há ação. Regras em DESIGN.md. */

:root {
  --bg: #09090d;
  --surface: #101016;
  --surface-2: #15151d;
  --raise: #1b1b25;
  --hair: rgba(255, 255, 255, 0.07);
  --hair-2: rgba(255, 255, 255, 0.12);
  --text: #ededf3;
  --text-2: #a3a3b6;
  --text-3: #7d7d93;
  --accent: #16b45a;
  --accent-hover: #22d477;
  --accent-2: #39ff88;
  --accent-soft: rgba(25, 194, 104, 0.12);
  --buy: #3ddc97;
  --buy-ink: #04261a;
  --buy-soft: rgba(61, 220, 151, 0.11);
  --sell: #ff5f7e;
  --sell-ink: #33060f;
  --sell-soft: rgba(255, 95, 126, 0.11);
  --amber: #f6c26b;
  --amber-soft: rgba(246, 194, 107, 0.11);
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--text);
  font: 400 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: clip; caret-color: var(--accent-2);
}
::selection { background: rgba(25, 194, 104, 0.45); color: #fff; }
* { scrollbar-width: thin; scrollbar-color: #2c2c3a transparent; }
::-webkit-scrollbar { width: 10px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2c2c3a; border-radius: 8px; border: 2px solid var(--bg); }
a { color: var(--accent-2); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: #cbbaff; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 8px; }
h1, h2, p { margin: 0; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.ic { width: 16px; height: 16px; flex: none; }

/* ---------- topo ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1400px; height: 64px; margin: 0 auto; padding: 0 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand-mark { width: 26px; height: 26px; }
.brand-word { font-weight: 600; font-size: 17px; letter-spacing: -0.025em; }
.brand-word b { font-weight: 600; color: var(--accent-2); }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; cursor: pointer; text-decoration: none; font-weight: 500;
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease);
}
.btn:active { transform: scale(0.985); }
.btn-quiet {
  height: 36px; padding: 0 14px; font-size: 14px;
  background: rgba(255, 255, 255, 0.04); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--hair);
}
.btn-quiet:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.icon-btn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--text-3); cursor: pointer;
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.kbd {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 5px; background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px var(--hair);
  font: 500 11px/1 var(--mono); color: var(--text-3);
}
.kbd-on-accent { background: rgba(255, 255, 255, 0.16); box-shadow: none; color: rgba(255, 255, 255, 0.85); }

/* ---------- grelha ---------- */
.stage {
  display: grid; grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "market" "panel" "history";
  gap: 16px; max-width: 1400px; margin: 0 auto; padding: 4px 16px 24px;
}
.market { grid-area: market; display: grid; gap: 14px; min-width: 0; }
.panel { grid-area: panel; }
.history { grid-area: history; }

/* ---------- par e preço ---------- */
.market-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.pair-trigger {
  display: inline-flex; align-items: baseline; gap: 10px;
  margin: -6px -10px; padding: 6px 10px; border: 0; border-radius: 12px; background: transparent; cursor: pointer;
  transition: background-color 0.2s;
}
.pair-trigger:hover { background: rgba(255, 255, 255, 0.04); }
.pair-trigger .ic { align-self: center; color: var(--text-3); transition: transform 0.25s var(--ease); }
.pair-trigger:hover .ic { transform: translateY(2px); color: var(--text-2); }
.pair-trigger .kbd { align-self: center; margin-left: 2px; }
.pair-sym { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.pair-name { font-size: 15px; color: var(--text-3); }
.quote { text-align: right; margin-left: auto; }
.price { font: 500 30px/1 var(--mono); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; transition: color 0.6s; white-space: nowrap; }
.price.is-up { color: var(--buy); transition: none; }
.price.is-down { color: var(--sell); transition: none; }
.price .d { display: inline-block; height: 1em; overflow: hidden; vertical-align: top; }
.price .d > span { display: flex; flex-direction: column; transition: transform 0.55s var(--ease); }
.price .d i { display: block; height: 1em; font-style: normal; }
.change { margin-top: 6px; font: 500 13px/1 var(--mono); color: var(--text-3); font-variant-numeric: tabular-nums; }
.change[data-trend="up"] { color: var(--buy); }
.change[data-trend="down"] { color: var(--sell); }

/* ---------- gráfico ---------- */
.chart-wrap {
  position: relative; height: 300px; min-width: 0;
  background: var(--surface); border-radius: 18px; box-shadow: inset 0 0 0 1px var(--hair); overflow: hidden;
}
.chart { position: absolute; inset: 40px 6px 4px 6px; }
.feed { position: absolute; top: 14px; left: 16px; display: inline-flex; align-items: center; gap: 8px; font: 500 12px/1 var(--mono); color: var(--text-3); }
.feed i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.feed[data-live="1"] i { background: var(--buy); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.35; } }
.scan {
  position: absolute; top: 0; bottom: 0; left: 0; width: 26%; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(25, 194, 104, 0.08) 75%, rgba(57, 255, 136, 0.55) 99.4%, transparent 100%);
}
.scan.is-on { opacity: 1; animation: sweep 1.15s var(--ease) infinite; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(385%); } }

/* ---------- painel ---------- */
.panel {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start;
  padding: 20px; background: var(--surface); border-radius: 20px; box-shadow: inset 0 0 0 1px var(--hair);
  min-width: 0;
}
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-label { font-size: 14px; color: var(--text-2); }

.segmented {
  --i: 0;
  position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 3px; border-radius: 11px; background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--hair);
}
.segmented-thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 3);
  border-radius: 8px; background: var(--accent);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 6px 14px -8px rgba(25, 194, 104, 0.9);
  transform: translateX(calc(100% * var(--i))); transition: transform 0.42s var(--ease);
}
.segmented button {
  position: relative; z-index: 1; min-width: 54px; height: 32px; padding: 0 12px;
  border: 0; background: transparent; color: var(--text-2); cursor: pointer;
  font: 500 13px/1 var(--mono); transition: color 0.2s;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-checked="true"] { color: #fff; }

.analyze {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 56px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--accent); color: #fff; font-size: 16px; font-weight: 600; letter-spacing: -0.01em;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset, 0 14px 30px -18px rgba(25, 194, 104, 1);
  transition: background-color 0.2s, transform 0.2s var(--ease);
}
.analyze:hover { background: var(--accent-hover); }
.analyze:active { transform: scale(0.99); }
.analyze-label, .analyze .kbd { position: relative; }
.analyze-fill { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.16); transform: scaleX(0); transform-origin: left; }
.analyze.is-busy { cursor: progress; }
.analyze.is-busy .analyze-fill { animation: fill 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
@keyframes fill { to { transform: scaleX(1); } }

/* direção */
.signal { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.direction { min-height: 96px; display: grid; align-content: center; gap: 8px; }
.direction-idle { color: var(--text-2); font-size: 15px; max-width: 40ch; }
.panel[data-state="error"] .direction-idle { color: #ff9cb0; }
.direction-main { display: flex; align-items: center; gap: 10px; }
.direction-word { font-size: 60px; font-weight: 600; line-height: 0.95; letter-spacing: -0.045em; }
.direction-ic { width: 46px; height: 46px; }
.panel[data-dir="buy"] .direction-main { color: var(--buy); }
.panel[data-dir="sell"] .direction-main { color: var(--sell); }
.direction-main.is-in .direction-word { animation: rise 0.6s var(--ease) both; }
.direction-main.is-in .direction-ic { animation: rise 0.6s var(--ease) 0.06s both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); filter: blur(8px); clip-path: inset(0 0 100% 0); }
  to { opacity: 1; transform: none; filter: blur(0); clip-path: inset(0 0 -20% 0); }
}
.strength { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }
.strength b { color: var(--text); font-weight: 500; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 14px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); }
.panel[data-dir="buy"] .pips i.on { background: var(--buy); }
.panel[data-dir="sell"] .pips i.on { background: var(--sell); }
.strength.is-weak { color: var(--amber); }

/* três leituras */
.readings { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.reading-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.reading-label { font-size: 14px; font-weight: 500; }
.reading-value { font-size: 13px; color: var(--text-3); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reading:not([data-vote="none"]) .reading-value { color: var(--text-2); }
.reading-detail { margin-top: 6px; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: rise-soft 0.4s var(--ease) both; }
.meter { position: relative; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.meter::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, 0.18); }
.meter-fill {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 50%; border-radius: 3px; background: var(--text-3);
  transform-origin: left center; transform: scaleX(0);
  transition: transform 0.7s var(--ease), background-color 0.3s;
}
.reading[data-vote="up"] .meter-fill { background: var(--buy); }
.reading[data-vote="down"] .meter-fill { background: var(--sell); }
.reading[data-vote="flat"] .meter-fill { background: var(--amber); }
.panel[data-state="scan"] .meter { background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0%, rgba(57, 255, 136, 0.35) 50%, rgba(255, 255, 255, 0.05) 100%) 0 0 / 200% 100%; animation: shimmer 1s linear infinite; }
.panel[data-state="scan"] .reading:nth-child(2) .meter { animation-delay: -0.33s; }
.panel[data-state="scan"] .reading:nth-child(3) .meter { animation-delay: -0.66s; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* horário e contagem */
.timing { display: grid; gap: 16px; padding-top: 18px; border-top: 1px solid var(--hair); }
.times { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; margin: 0; }
.times dt { font-size: 12px; color: var(--text-3); }
.times dd { margin: 3px 0 0; font: 500 15px/1.2 var(--mono); font-variant-numeric: tabular-nums; }
.countdown-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.countdown-label { font-size: 14px; color: var(--text-2); }
.countdown-digits { font: 500 34px/1 var(--mono); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.countdown-track { height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.countdown-bar { display: block; height: 100%; width: 100%; border-radius: 2px; background: var(--accent-2); transform-origin: left center; transform: scaleX(0); transition: transform 0.25s linear; }
.countdown[data-phase="soon"] .countdown-digits { color: var(--amber); }
.countdown[data-phase="soon"] .countdown-bar { background: var(--amber); }
.panel[data-dir="buy"] .countdown[data-phase="live"] .countdown-bar { background: var(--buy); }
.panel[data-dir="sell"] .countdown[data-phase="live"] .countdown-bar { background: var(--sell); }
.countdown[data-phase="check"] .countdown-digits { color: var(--text-3); }

/* resultado */
.outcome { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; animation: rise-soft 0.5s var(--ease) both; }
@keyframes rise-soft { from { opacity: 0; transform: translateY(8px); } }
.outcome > .ic { width: 32px; height: 32px; padding: 7px; border-radius: 50%; }
.outcome-text { flex: 1; min-width: 0; }
.outcome-text b { display: block; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.outcome-text span { font: 400 12px/1.4 var(--mono); color: var(--text-2); }
.outcome--win { background: var(--buy-soft); }
.outcome--win > .ic { background: var(--buy); color: var(--buy-ink); }
.outcome--win b { color: var(--buy); }
.outcome--loss { background: var(--sell-soft); }
.outcome--loss > .ic { background: var(--sell); color: var(--sell-ink); }
.outcome--loss b { color: var(--sell); }
.outcome--draw { background: var(--amber-soft); }
.outcome--draw > .ic { background: var(--amber); color: #2b1d02; }
.outcome--draw b { color: var(--amber); }
.outcome .btn-quiet { height: 34px; flex: none; }

.notes { font-size: 13px; color: var(--amber); line-height: 1.5; }

.btn-trade { height: 52px; width: 100%; border-radius: 14px; font-size: 15px; font-weight: 600; }
.panel[data-dir="buy"] .btn-trade { background: var(--buy); color: var(--buy-ink); }
.panel[data-dir="buy"] .btn-trade:hover { background: #5ae6a8; color: var(--buy-ink); }
.panel[data-dir="sell"] .btn-trade { background: var(--sell); color: var(--sell-ink); }
.panel[data-dir="sell"] .btn-trade:hover { background: #ff7a93; color: var(--sell-ink); }

.invite {
  position: relative; padding: 14px 44px 14px 16px; border-radius: 14px;
  background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(25, 194, 104, 0.28);
  animation: rise-soft 0.5s var(--ease) both;
}
.invite p { font-size: 14px; color: var(--text-2); }
.invite b { color: var(--text); font-weight: 500; }
.invite-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 14px; font-weight: 500; text-decoration: none; }
.invite-close { position: absolute; top: 8px; right: 8px; }

.shortcuts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); }
.shortcuts .kbd { margin-left: 6px; }
.shortcuts .kbd:first-child, .shortcuts .kbd + .kbd { margin-left: 0; }

/* ---------- histórico ---------- */
.history { min-width: 0; padding: 4px 4px 0; }
.history-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.history h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.today { font: 400 13px/1 var(--mono); color: var(--text-2); }
.history-list { list-style: none; margin: 0; padding: 0; }
.history-empty { padding: 14px 0; font-size: 14px; color: var(--text-3); border-top: 1px solid var(--hair); }
.hrow {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto auto; align-items: center; gap: 14px;
  padding: 11px 0; border-top: 1px solid var(--hair); font-size: 14px;
}
.hrow.is-new { animation: rise-soft 0.5s var(--ease) both; }
.h-time { font: 400 13px/1 var(--mono); color: var(--text-3); }
.h-pair { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-pair i { font-style: normal; font: 400 12px var(--mono); color: var(--text-3); margin-left: 6px; }
.h-dir { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.h-dir .ic { width: 14px; height: 14px; }
.h-dir--buy { color: var(--buy); }
.h-dir--sell { color: var(--sell); }
.h-res { justify-self: end; min-width: 74px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; text-align: center; white-space: nowrap; }
.h-res--win { background: var(--buy-soft); color: var(--buy); }
.h-res--loss { background: var(--sell-soft); color: var(--sell); }
.h-res--draw { background: var(--amber-soft); color: var(--amber); }
.h-res--pending { background: var(--accent-soft); color: var(--accent-2); }

/* ---------- rodapé ---------- */
.foot { max-width: 1400px; margin: 0 auto; padding: 8px 24px 32px; display: grid; gap: 6px; font-size: 12px; line-height: 1.6; color: var(--text-3); }
.foot p { max-width: 110ch; }

/* ---------- paleta de criptos ---------- */
.palette {
  width: min(540px, calc(100vw - 32px)); max-height: min(560px, 76vh); margin: 12vh auto auto; padding: 0;
  border: 0; border-radius: 18px; background: #121219; color: var(--text);
  box-shadow: inset 0 0 0 1px var(--hair-2), 0 40px 90px -30px rgba(0, 0, 0, 0.9);
  overflow: hidden; flex-direction: column;
}
.palette[open] { display: flex; animation: pop 0.24s var(--ease); }
.palette::backdrop { background: rgba(4, 4, 8, 0.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }
.palette-search { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--hair); color: var(--text-3); }
.palette-search .ic { width: 18px; height: 18px; }
.palette-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: 400 16px var(--sans); outline: none; }
.palette-search input::placeholder { color: var(--text-3); }
.palette-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.p-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto 68px; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
}
.p-item[aria-selected="true"] { background: rgba(255, 255, 255, 0.06); }
.p-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.p-sym { font-weight: 600; letter-spacing: -0.01em; }
.p-name { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-current { width: 14px; height: 14px; color: var(--accent-2); }
.p-price { font: 400 13px/1 var(--mono); color: var(--text-2); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.p-change { font: 500 12px/1 var(--mono); text-align: right; color: var(--text-3); font-variant-numeric: tabular-nums; }
.p-change[data-trend="up"] { color: var(--buy); }
.p-change[data-trend="down"] { color: var(--sell); }
.p-empty { padding: 18px 12px; font-size: 14px; color: var(--text-3); }

/* ---------- admin ---------- */
.admin { max-width: 1200px; margin: 0 auto; padding: 8px 24px 48px; }
.admin h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; }
.admin-login { max-width: 340px; margin: 48px auto; display: grid; gap: 14px; }
.admin-login input {
  height: 46px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--hair-2); color: var(--text); font: 400 15px var(--sans);
}
.admin-login input:focus { outline: none; box-shadow: inset 0 0 0 1px var(--accent-2), 0 0 0 3px rgba(25, 194, 104, 0.25); }
.admin-login .btn { height: 46px; background: var(--accent); color: #fff; font-weight: 600; }
.admin-error { font-size: 14px; color: #ff9cb0; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 20px; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin: 0 0 28px; border-top: 1px solid var(--hair); }
.admin-stats div { padding: 16px 16px 16px 0; border-bottom: 1px solid var(--hair); }
.admin-stats dt { font-size: 13px; color: var(--text-3); }
.admin-stats dd { margin: 6px 0 0; font: 500 28px/1 var(--mono); letter-spacing: -0.03em; }
.admin h2 { font-size: 15px; font-weight: 600; margin: 24px 0 8px; }
.admin-note { font-size: 13px; color: var(--text-2); max-width: 90ch; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
.admin-table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--text-3); padding: 10px 16px 10px 0; border-bottom: 1px solid var(--hair-2); }
.admin-table td { padding: 10px 16px 10px 0; border-bottom: 1px solid var(--hair); font-variant-numeric: tabular-nums; }

/* ---------- responsivo ---------- */
@media (hover: none) { .hide-touch { display: none !important; } }
@media (max-width: 520px) {
  .hide-sm { display: none; }
  .top { padding: 0 16px; height: 58px; }
  .pair-sym { font-size: 24px; }
  .price { font-size: 24px; }
  .direction-word { font-size: 52px; }
  .panel { padding: 18px 16px; border-radius: 18px; }
  .chart-wrap { height: 260px; border-radius: 16px; }
  .hrow { grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 10px; }
  .palette { margin: auto 0 0; width: 100%; max-width: none; max-height: 82vh; border-radius: 20px 20px 0 0; }
  .palette[open] { animation: sheet 0.32s var(--ease); }
  .foot { padding: 8px 16px 28px; }
}
@keyframes sheet { from { transform: translateY(100%); } }
@media (min-width: 1040px) {
  .stage {
    grid-template-columns: minmax(0, 1fr) 400px;
    grid-template-areas: "market panel" "history panel";
    grid-template-rows: auto 1fr;
    gap: 20px 24px; padding: 8px 24px 28px;
  }
  .chart-wrap { height: clamp(380px, calc(100vh - 250px), 640px); }
  .panel { align-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ===== ícones de cripto ===== */
.pair-ic { width: 30px; height: 30px; border-radius: 50%; flex: none; align-self: center; margin-right: 10px; object-fit: cover; }
.pair-ic[src=""], .pair-ic:not([src]) { display: none; }
.p-ic { width: 28px; height: 28px; border-radius: 50%; flex: none; object-fit: cover; background: rgba(255,255,255,.04); }
.coin-mono { display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-2); font: 600 12px/1 var(--mono); border-radius: 50%; }
.pair-ic.coin-mono { font-size: 13px; }

/* ===== barra de ferramentas do gráfico ===== */
.chart-tools { position: absolute; top: 9px; right: 11px; z-index: 4; display: flex; align-items: center; gap: 8px; }
.farol { display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px; border-radius: 999px;
  background: rgba(255,255,255,0.04); box-shadow: inset 0 0 0 1px var(--hair); font: 500 11.5px/1 var(--mono); color: var(--text-2); white-space: nowrap; }
.farol-dots { display: inline-flex; gap: 4px; }
.farol-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.14); transition: background .3s, box-shadow .3s; }
.farol[data-level="vermelho"] .farol-dots i:nth-child(1) { background: #ff5f7e; box-shadow: 0 0 9px rgba(255,95,126,.75); animation: farolPulse 1.1s ease-in-out infinite; }
.farol[data-level="amarelo"] .farol-dots i:nth-child(2) { background: #f5c94b; box-shadow: 0 0 9px rgba(245,201,75,.75); animation: farolPulse 1.3s ease-in-out infinite; }
.farol[data-level="verde"] .farol-dots i:nth-child(3) { background: #3ddc97; box-shadow: 0 0 9px rgba(61,220,151,.75); animation: farolPulse 1.6s ease-in-out infinite; }
.farol[data-level="vermelho"] .farol-txt { color: #ff93a7; }
.farol[data-level="amarelo"] .farol-txt { color: #f3d487; }
.farol[data-level="verde"] .farol-txt { color: #7bf0c0; }
@keyframes farolPulse { 50% { opacity: .4; } }

.auto-btn { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,0.04); box-shadow: inset 0 0 0 1px var(--hair); color: var(--text-2); font: 500 12px/1 var(--sans); transition: background .2s, color .2s, box-shadow .2s; }
.auto-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-1); }
.auto-btn svg { width: 15px; height: 15px; flex: none; }
.auto-btn[aria-pressed="true"] { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(25,194,104,.42); }
.auto-btn[aria-pressed="true"] svg { animation: autoWiggle 1.3s ease-in-out infinite; }
@keyframes autoWiggle { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }

@media (max-width: 560px) {
  .chart-tools { top: 8px; right: 9px; gap: 6px; }
  .farol { padding: 5px 9px; gap: 6px; }
  .farol-txt { display: none; }
  .auto-btn { padding: 6px 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .farol-dots i, .auto-btn[aria-pressed="true"] svg { animation: none !important; }
}

/* ===== trial: aviso de dias + botão de compra ===== */
.trial-bar { display: flex; justify-content: center; padding: 4px 16px 2px; }
.trial-info { display: inline-flex; align-items: center; gap: 9px; text-align: center;
  font: 500 13.5px/1.35 var(--sans); color: var(--text-2);
  background: var(--accent-soft); border: 1px solid rgba(25,194,104,0.32); padding: 9px 18px; border-radius: 999px; }
.trial-info b { color: var(--accent-2); font-weight: 700; }
.trial-info svg { width: 16px; height: 16px; flex: none; color: var(--accent-2); }
.buy-month { display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; max-width: 420px; margin: 10px auto 22px; box-sizing: border-box; padding: 17px 20px; border-radius: 15px;
  background: linear-gradient(180deg, #22d477, #0f9a4e); color: #fff; text-decoration: none;
  font: 700 16px/1 var(--sans); letter-spacing: .01em; box-shadow: 0 14px 34px rgba(15,154,78,0.42);
  transition: transform .15s, filter .2s; }
.buy-month:hover { filter: brightness(1.07); transform: translateY(-2px); color: #fff; }
.buy-month svg { width: 19px; height: 19px; flex: none; }
@media (max-width: 560px) {
  .trial-info { font-size: 12.5px; padding: 8px 14px; }
  .buy-month { font-size: 15px; padding: 15px 18px; }
}

/* ===== card de trial (contador grande + botão) ===== */
.trial-card { max-width: 480px; margin: 12px auto 4px; padding: 20px 22px 22px; border-radius: 22px; text-align: center; position: relative; overflow: hidden;
  background: radial-gradient(130% 120% at 50% -25%, rgba(25,194,104,0.24), rgba(22,20,32,0.55));
  border: 1px solid rgba(25,194,104,0.42); box-shadow: 0 20px 55px rgba(15,154,78,0.26), inset 0 1px 0 rgba(255,255,255,0.05); }
.trial-badge { display: inline-flex; align-items: center; gap: 7px; font: 600 11.5px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase;
  color: #9df0bd; background: rgba(25,194,104,0.18); border: 1px solid rgba(25,194,104,0.34); padding: 7px 14px; border-radius: 999px; }
.trial-badge svg { width: 14px; height: 14px; }
.trial-head { margin: 15px 0 13px; font: 500 15px/1.3 var(--sans); color: var(--text-2); }
.trial-count { display: flex; align-items: flex-start; justify-content: center; gap: 8px; }
.tc-unit { display: flex; flex-direction: column; align-items: center; min-width: 60px; padding: 11px 6px; border-radius: 14px;
  background: rgba(255,255,255,0.045); box-shadow: inset 0 0 0 1px var(--hair); }
.tc-num { font: 700 31px/1 var(--mono); color: #fff; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tc-sec { color: var(--accent-2); }
.tc-lab { margin-top: 7px; font: 600 10px/1 var(--sans); text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); }
.tc-sep { font: 700 26px/1.5 var(--mono); color: var(--accent-2); opacity: .55; align-self: center; }
.trial-card .buy-month { margin: 18px auto 0; max-width: none; }
@media (max-width: 560px) {
  .trial-card { padding: 16px 13px 18px; border-radius: 18px; }
  .trial-head { font-size: 14px; margin: 13px 0 11px; }
  .trial-count { gap: 5px; }
  .tc-unit { min-width: 50px; padding: 9px 3px; }
  .tc-num { font-size: 26px; }
  .tc-sep { font-size: 20px; }
  .tc-lab { font-size: 9px; letter-spacing: .06em; }
}

/* ── Seletor de país (bandeira) no topo, igual ao /links ─────────────── */
.top-right { display: flex; align-items: center; gap: 12px; }
.topo-flag { position: relative; }
.flag-btn {
  display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 11px;
  border-radius: 11px; border: 1px solid var(--hair-2); background: rgba(255, 255, 255, 0.04);
  color: var(--text); font: inherit; font-size: 14px; cursor: pointer;
  transition: border-color .18s, background .18s;
}
.flag-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.flag-btn .emoji { font-size: 20px; line-height: 1; }
.flag-btn .chev { width: 14px; height: 14px; color: var(--text-2); transition: transform .18s; }
.flag-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.flag-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; width: 248px; max-height: 64vh;
  overflow-y: auto; padding: 8px; border-radius: 14px; background: #12161a;
  border: 1px solid var(--hair-2); box-shadow: 0 24px 60px rgba(0, 0, 0, .8);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s, visibility .18s, transform .18s;
}
.flag-menu.aberto { opacity: 1; visibility: visible; transform: none; }
.flag-menu-tit { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-3); padding: 6px 10px 8px; }
.flag-op {
  width: 100%; display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 9px;
  border: 0; background: none; color: var(--text); font: inherit; font-size: 14.5px; text-align: left; cursor: pointer;
}
.flag-op:hover { background: var(--accent-soft); }
.flag-op.ativo { background: rgba(25, 194, 104, .18); color: var(--accent-2); font-weight: 600; }
.flag-op .emoji { font-size: 20px; line-height: 1; flex: 0 0 auto; }
@media (max-width: 480px) { .flag-btn .chev { display: none; } .flag-btn { padding: 0 9px; } }

/* ── Martingala (hasta 2 reentradas tras una pérdida) ───────────────── */
.mg-card { display: none; flex-direction: column; gap: 12px; margin-top: 4px; padding: 16px;
  border-radius: 16px; border: 1px solid rgba(251, 191, 36, .34); background: rgba(251, 191, 36, .08); }
.mg-card:not([hidden]) { display: flex; animation: pop .24s var(--ease); }
.mg-card[data-state="win"]  { border-color: rgba(25, 194, 104, .42); background: var(--accent-soft); }
.mg-card[data-state="fail"] { border-color: rgba(239, 68, 68, .42); background: rgba(239, 68, 68, .09); }
.mg-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: #fbbf24; }
.mg-card[data-state="win"]  .mg-badge { color: var(--accent-2); }
.mg-card[data-state="fail"] .mg-badge { color: #fca5a5; }
.mg-msg { margin: 0; font-size: 15.5px; line-height: 1.5; color: var(--text); }
.mg-msg b { color: #fbbf24; font-weight: 700; }
.mg-card[data-state="win"] .mg-msg b { color: var(--accent-2); }
.mg-timer { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; border-radius: 12px; background: rgba(0, 0, 0, .26); }
.mg-timer-lab { font-size: 13px; color: var(--text-2); }
.mg-timer-val { font: 600 18px/1 var(--mono); color: var(--text); font-variant-numeric: tabular-nums; }
.mg-card[data-state="win"] .mg-timer, .mg-card[data-state="fail"] .mg-timer { display: none; }
.mg-card[data-state="win"] .mg-trade, .mg-card[data-state="fail"] .mg-trade { display: none; }
.mg-again { align-self: flex-start; }
/* chip "MG" en el historial cuando se recuperó con martingala */
.h-mg { display: inline-block; margin-left: 7px; padding: 1px 6px; border-radius: 6px; font-size: 10.5px;
  font-weight: 700; letter-spacing: .03em; background: rgba(25, 194, 104, .18); color: var(--accent-2); vertical-align: middle; }
