:root {
  --bg: #0b0c10;
  --card: #12131a;
  --text: #f5f7fb;
  --muted: #aeb3c2;
  --accent: #ff6b3d;
  --tag: #1e2533;
  --border: #1b1d25;
  --btn: #1a2234;
  --btn-ghost: transparent;
  --fs-sm: clamp(12px, 2.4vw, 14px);
  --fs-base: clamp(14px, 2.6vw, 16px);
  --fs-lg: clamp(18px, 3.2vw, 20px);
  --fs-xl: clamp(22px, 4vw, 28px);
  --pad-sm: 10px;
  --pad-md: 14px;
  --pad-lg: 16px;
  --r-sm: 10px;
  --r-md: 12px;
  --r-lg: 16px;
  --thumb-h: clamp(160px, 32vw, 200px);
  --hero-h: clamp(38vh, 50vw, 48vh);
  --header-h: 52px;
  --ticker-speed: 32s;
  --live-ticker-speed: 32s; /* Medium-fast scrolling */
}

/* Base */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: var(--fs-base);
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input { font: inherit; }
a, button { -webkit-tap-highlight-color: transparent; }

/* Header / Nav */
.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: flex-start; align-items: center; gap: 10px;
  padding: var(--pad-sm) var(--pad-lg);
  background: rgba(18, 19, 26, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand .fire { font-size: 20px; }
.brand .title { font-weight: 700; letter-spacing: 0.3px; font-size: var(--fs-lg); }
.main-nav {
  display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.main-nav a {
  padding: 6px 10px; border-radius: var(--r-sm);
  background: var(--btn); border: 1px solid var(--border);
  font-size: var(--fs-sm); white-space: nowrap;
}

/* Layout */
.container { max-width: 920px; margin: 20px auto; padding: 0 var(--pad-lg); }
.toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.search {
  display: flex; gap: 8px; width: 100%; max-width: 560px;
}
.search input {
  flex: 1; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--border);
  background: #0f1118; color: #f5f7fb; min-height: 44px;
}
.search button, .btn {
  padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--border);
  background: var(--accent); color: #111; font-weight: 600; cursor: pointer; min-height: 44px;
}
.btn.ghost { background: var(--btn-ghost); color: var(--text); }

/* Cards */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; margin: 16px 0; display: grid;
  grid-template-columns: 180px 1fr; gap: 0;
}
.card .thumb {
  display: flex; justify-content: center; align-items: center;
  background: #000; width: 100%; height: var(--thumb-h); overflow: hidden;
}
.card .thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.card-body { padding: var(--pad-md); }
.card-title { margin: 0 0 8px 0; font-size: var(--fs-lg); line-height: 1.2; }
.meta {
  display: flex; flex-wrap: wrap; gap: 10px;
  color: var(--muted); font-size: var(--fs-sm); margin-bottom: 8px;
}
.desc { margin: 8px 0 12px; color: #d8dcee; font-size: var(--fs-base); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions .btn { padding: 10px 12px; }

/* Detail Page */
.detail { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.hero img { width: 100%; height: var(--hero-h); object-fit: cover; }
.detail-body { padding: var(--pad-md); }
.detail-title { margin: 10px 0 8px; font-size: var(--fs-xl); }
.meta.big { font-size: var(--fs-sm); margin-bottom: 10px; }
.lead { font-size: var(--fs-base); color: #e8ebf5; margin: 10px 0 8px; }

/* Pager */
.pager {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 18px 0;
}
.pager a, .pager span {
  padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--btn); color: var(--text); font-size: var(--fs-sm);
  min-height: 40px; display: inline-flex; align-items: center; justify-content: center;
}
.pager .current { background: var(--accent); color: #111; font-weight: 700; }
.results-info { color: var(--muted); text-align: center; font-size: var(--fs-sm); margin: 8px 0 12px; }

/* Footer */
.site-footer {
  margin-top: 30px; padding: 20px var(--pad-lg);
  border-top: 1px solid var(--border); background: #0f1118;
  color: #f5f7fbcc; text-align: center; font-size: var(--fs-sm);
}

/* Ticker */
.ticker-wrap {
  position: sticky; top: var(--header-h); z-index: 9;
  background: #0f1118; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.ticker {
  display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; min-height: 40px;
}
.ticker-label {
  margin: 8px 0 8px 12px;
  background: linear-gradient(135deg, #ff6b3d 0%, #ff915f 100%);
  color: #111; font-weight: 900; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 6px 12px; border-radius: 999px; font-size: 12px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.35), 0 4px 18px rgba(255,107,61,0.25);
}
.ticker-viewport { position: relative; overflow: hidden; white-space: nowrap; padding: 8px 0; }
.ticker-track { display: inline-block; will-change: transform; animation: ticker-scroll var(--ticker-speed) linear infinite; }
.ticker-track a {
  display: inline-block; color: var(--text); opacity: 0.92;
  padding: 0 18px; border-left: 1px solid var(--border); transition: opacity .15s ease, transform .15s ease;
}
.ticker-track a:first-child { border-left: 0; }
.ticker-viewport:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker-scroll { from{transform:translateX(0);} to{transform:translateX(-50%);} }
@media (prefers-reduced-motion: reduce){ .ticker-track{ animation:none; } }

/* Live Ticker */
.live-ticker-wrap {
  position: static; background: #111318; border: none;
  min-height: 28px; padding: 0 16px; display: flex; align-items: center;
}
.live-ticker {
  height: auto; overflow: hidden; white-space: nowrap;
  display: flex; align-items: center; width: 100%; max-width: 100%;
}
.live-ticker-track { display: flex; width: 100%; animation: live-ticker-scroll var(--live-ticker-speed) linear infinite; }
.live-price-item {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 500; color: #aeb3c2; text-transform: uppercase;
  padding: 5px 0; padding-right: 15px; border-right: 1px solid #333; margin-right: 15px;
}
.live-price-item:last-of-type { border-right: none; }
.live-price-item .symbol { color: #f5f7fb; font-weight: 600; font-size: 14px; }
.live-price-item .price { color: #aeb3c2; font-size: 13px; }
.live-price-item .percent-change { font-weight: 600; font-size: 13px; white-space: nowrap; }
.live-price-item .positive { color: #4CAF50; }
.live-price-item .negative { color: #F44336; }
@keyframes live-ticker-scroll { 
    from {transform: translateX(0);} 
    to {transform: translateX(-100%);} 
}