/* TrendRuntime — shared visual system. Runtime-GUI feel: terminal-grade
   numbers, gold/silver brand accents on a near-black base, light mode swaps
   the ground without losing the gold. */

@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #f0efe9;
  --border: #e3e0d6;
  --text: #17171a;
  --dim: #6b6b74;
  --gold: #b8860a;
  --gold-bright: #f5b800;
  --silver: #7b7c85;
  --win: #4c46c4;
  --loss: #d9640f;
  --shadow: 0 20px 60px -24px rgba(20, 20, 15, 0.25);
  --radius: 14px;
  --max-w: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0a0a0c;
    --surface: #141417;
    --surface-2: #1b1b1f;
    --border: #29292f;
    --text: #eceaf0;
    --dim: #8d8d97;
    --gold: #f5b800;
    --gold-bright: #ffd257;
    --silver: #c7c9d1;
    --win: #6b74f5;
    --loss: #ff8a2e;
    --shadow: 0 24px 70px -20px rgba(0, 0, 0, 0.6);
  }
}

:root[data-theme='dark'] {
  --bg: #0a0a0c;
  --surface: #141417;
  --surface-2: #1b1b1f;
  --border: #29292f;
  --text: #eceaf0;
  --dim: #8d8d97;
  --gold: #f5b800;
  --gold-bright: #ffd257;
  --silver: #c7c9d1;
  --win: #6b74f5;
  --loss: #ff8a2e;
  --shadow: 0 24px 70px -20px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html { color-scheme: light dark; }
html[data-theme='dark'] { color-scheme: dark; }
html[data-theme='light'] { color-scheme: light; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: 'Chakra Petch', 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
}

.mono, .num {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

a { color: inherit; }

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.brand img { width: 34px; height: 34px; display: block; border-radius: 8px; }
.brand span {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
}
.brand .gold { color: var(--gold); }
.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.92rem;
  font-weight: 500;
}
.nav a { text-decoration: none; color: var(--dim); transition: color 0.15s ease; }
.nav a:hover, .nav a.active { color: var(--text); }
.nav .btn-tg { color: var(--bg); }

.theme-toggle {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--dim);
  border-radius: 999px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--gold); border-color: var(--gold); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
:root[data-theme='dark'] .theme-toggle .moon { display: none; }
:root[data-theme='dark'] .theme-toggle .sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle .moon { display: none; }
  :root:not([data-theme='light']) .theme-toggle .sun { display: block; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: #17130a;
  box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--gold) 70%, transparent);
}
.btn-primary:hover { box-shadow: 0 14px 38px -12px color-mix(in srgb, var(--gold) 80%, transparent); }
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--gold); }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; border-radius: 8px; }
.btn-danger { color: var(--loss); background: color-mix(in srgb, var(--loss) 12%, var(--surface)); border-color: color-mix(in srgb, var(--loss) 35%, var(--border)); }

/* ---- Hero ---- */
.hero {
  position: relative;
  padding: 76px 0 56px;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 480px;
  background: radial-gradient(ellipse at 30% 20%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 60%);
  pointer-events: none;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  background: color-mix(in srgb, var(--gold) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
  padding: 6px 14px;
  border-radius: 999px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--win); box-shadow: 0 0 0 3px color-mix(in srgb, var(--win) 25%, transparent); }
.hero h1 {
  font-size: clamp(2.2rem, 4.4vw, 3.6rem);
  line-height: 1.05;
  margin: 20px 0 16px;
  position: relative;
}
.hero p.lead {
  color: var(--dim);
  font-size: 1.12rem;
  max-width: 620px;
  margin: 0 0 30px;
}
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.hero-note { color: var(--dim); font-size: 0.85rem; margin-top: 14px; }

/* ---- Stats bar ---- */
.stats-bar {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 44px;
  box-shadow: var(--shadow);
}
.stat-tile {
  background: var(--surface);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-tile .label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--dim);
}
.stat-tile .value {
  font-size: 1.7rem;
  font-weight: 600;
}
.stat-tile .value.win { color: var(--win); }
.stat-tile .value.loss { color: var(--loss); }
@media (max-width: 780px) {
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Sections ---- */
.section { padding: 64px 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}
.section-head h2 { font-size: 1.7rem; }
.section-head p { color: var(--dim); margin: 6px 0 0; }
.section-head .btn { flex-shrink: 0; }

/* ---- Result cards ---- */
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.result-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.result-card .shot {
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  overflow: hidden;
  position: relative;
}
.result-card .shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
}
.badge-win { color: #fff; background: var(--win); }
.badge-loss { color: #fff; background: var(--loss); }
.badge-open { color: var(--text); background: var(--surface-2); border: 1px solid var(--border); }
.result-card .shot .badge { position: absolute; top: 10px; left: 10px; }
.result-card .body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.result-card .row1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.result-card .symbol { font-family: 'Chakra Petch', sans-serif; font-weight: 700; font-size: 1.05rem; }
.result-card .side { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.side-long { color: var(--win); }
.side-short { color: var(--loss); }
.result-card .roi { font-size: 1.15rem; font-weight: 600; }
.result-card .desc { color: var(--dim); font-size: 0.86rem; flex: 1; }
.result-card .meta { display: flex; align-items: center; justify-content: space-between; font-size: 0.78rem; color: var(--dim); border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }

/* ---- Table (results list page) ---- */
.results-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.results-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 720px; }
table.results-table th, table.results-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.results-table th { color: var(--dim); font-weight: 600; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; }
table.results-table tr:last-child td { border-bottom: none; }
table.results-table td.roi { font-weight: 600; }
table.results-table a.tv-link { color: var(--gold); text-decoration: none; font-weight: 600; }
table.results-table a.tv-link:hover { text-decoration: underline; }
table.results-table img.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; display: block; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 28px; flex-wrap: wrap; }
.pagination a, .pagination span {
  display: inline-flex;
  min-width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0 10px;
}
.pagination a:hover { border-color: var(--gold); color: var(--gold); }
.pagination .current { background: var(--gold); border-color: var(--gold); color: #17130a; }
.pagination .disabled { opacity: 0.35; pointer-events: none; }

/* ---- Telegram CTA banner ---- */
.cta-banner {
  border-radius: 20px;
  padding: 48px 40px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 16%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--border));
  text-align: center;
  box-shadow: var(--shadow);
}
.cta-banner h2 { font-size: 1.9rem; margin-bottom: 10px; }
.cta-banner p { color: var(--dim); max-width: 520px; margin: 0 auto 26px; }
.cta-buttons { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.bot-note { margin-top: 18px; font-size: 0.82rem; color: var(--dim); }
.bot-note .soon { display: inline-block; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; margin-left: 6px; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 50px; color: var(--dim); font-size: 0.85rem; }
.site-footer .wrap { display: flex; flex-direction: column; gap: 16px; }
.site-footer .disclaimer { line-height: 1.6; max-width: 820px; }
.site-footer .foot-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.site-footer a { color: var(--dim); text-decoration: none; }
.site-footer a:hover { color: var(--gold); }

/* ---- Admin panel ---- */
.admin-shell { min-height: 100vh; display: flex; flex-direction: column; }
.admin-main { flex: 1; padding: 32px 0 60px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 980px) { .admin-grid { grid-template-columns: 1fr 1fr; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.card h3 { font-size: 1.05rem; margin-bottom: 4px; }
.card .hint { color: var(--dim); font-size: 0.82rem; margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 0.78rem; font-weight: 600; color: var(--dim); text-transform: uppercase; letter-spacing: 0.04em; }
.field input, .field select, .field textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
}
.field textarea { resize: vertical; min-height: 90px; font-family: 'IBM Plex Mono', monospace; font-size: 0.82rem; }
.field-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 360px; }
.err-msg { color: var(--loss); font-size: 0.85rem; min-height: 1.2em; }
.admin-list { display: flex; flex-direction: column; gap: 10px; max-height: 640px; overflow-y: auto; }
.admin-row { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
.admin-row img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.admin-row .meta1 { flex: 1; min-width: 0; }
.admin-row .meta1 .top { font-weight: 600; font-size: 0.9rem; display: flex; gap: 8px; align-items: center; }
.admin-row .meta1 .sub { color: var(--dim); font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-row .actions { display: flex; gap: 6px; flex-shrink: 0; }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 18px; box-shadow: var(--shadow); font-size: 0.88rem; z-index: 100; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
