:root {
  --bg: #120c0a;
  --bg-2: #1a1210;
  --surface: #1c1412;
  --surface-2: #261a16;
  --line: #3a2a22;
  --line-2: #5a4334;
  --text: #f3ead8;
  --muted: #b7a48a;
  --faint: #8a7360;
  --gold: #d4af6a;
  --gold-2: #f0d9a0;
  --gold-dim: rgba(212, 175, 106, 0.14);
  --mint: #d4af6a;
  --mint-dim: rgba(212, 175, 106, 0.14);
  --amber: #e0b35a;
  --amber-dim: rgba(224, 179, 90, 0.14);
  --blue: #c4b08a;
  --rose: #c97b6a;
  --violet: #b89b7a;
  --ok: #c5b07a;
  --warn: #e0b35a;
  --bad: #c97b6a;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --radius: 4px;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Source Serif 4", "Noto Serif", "Noto Sans", Georgia, serif;
  --display: "Cormorant Garamond", "Source Serif 4", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 17px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(212, 175, 106, 0.09), transparent 55%),
    radial-gradient(700px 420px at 100% 0%, rgba(90, 30, 24, 0.35), transparent 50%),
    radial-gradient(circle at 50% 120%, rgba(212, 175, 106, 0.04), transparent 40%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-2); text-decoration: underline; text-underline-offset: 3px; }
button, input { font-family: inherit; }
img { max-width: 100%; display: block; }

.app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(18, 12, 10, 0.82);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.45;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: 1.28rem;
}
.brand:hover { text-decoration: none; color: var(--gold-2); }
.brand img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(212, 175, 106, 0.35);
}
.brand span b { color: var(--gold); font-weight: 600; }
.nav {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 0;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--display);
}
.nav a:hover, .nav a.active {
  color: var(--gold);
  background: transparent;
  text-decoration: none;
}
.nav a.active { box-shadow: inset 0 -1px 0 var(--gold); }

.wrap { width: min(1140px, calc(100% - 36px)); margin: 0 auto; }
.main { flex: 1; padding: 36px 0 88px; }

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
  padding: 28px 0 18px;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
  font-family: var(--display);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
}
body.latin .kicker { letter-spacing: 0.22em; text-transform: uppercase; }

.lang-wrap { position: relative; }
.lang-btn {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--line-2);
  border-radius: 0;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-family: var(--display);
}
.lang-btn:hover { border-color: var(--gold); background: var(--gold-dim); }
.lang-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(320px, 86vw);
  max-height: 70vh;
  overflow: hidden;
  background: #1a1210;
  border: 1px solid var(--gold);
  border-radius: 0;
  box-shadow: var(--shadow);
  z-index: 30;
}
.lang-menu.on { display: flex; flex-direction: column; }
.lang-menu input {
  margin: 10px 10px 6px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 9px 11px;
  font-size: 0.9rem;
}
.lang-list { overflow: auto; padding: 4px 6px 8px; }
.lang-opt {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
}
.lang-opt:hover, .lang-opt.active { background: var(--surface-2); color: var(--gold); }
.lang-opt small { color: var(--faint); }

html[dir="rtl"] .lang-menu { right: auto; left: 0; }
html[dir="rtl"] .lang-opt { text-align: right; }
html[dir="rtl"] .nav { justify-content: flex-start; }
html[dir="rtl"] th, html[dir="rtl"] td { text-align: right; }
html[dir="rtl"] .toast { right: auto; left: 16px; }

.pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(212, 175, 106, 0.55);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 10px rgba(212, 175, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(212, 175, 106, 0); }
}
h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.4rem, 5.4vw, 4.1rem);
  line-height: 1.08;
  letter-spacing: 0.01em;
  margin: 14px 0 16px;
  color: #f7efe0;
}
.lede { color: var(--muted); font-size: 1.12rem; max-width: 48ch; font-weight: 400; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

.btn {
  border: 0;
  cursor: pointer;
  border-radius: 0;
  padding: 13px 20px;
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: var(--display);
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(180deg, #e8c98a, #c49a4a);
  color: #2a1a0c;
  box-shadow: 0 8px 24px rgba(196, 154, 74, 0.22);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost {
  background: transparent;
  color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--gold); }
.btn-amber { background: linear-gradient(180deg, #e8c98a, #c49a4a); color: #2a1a0c; }
.btn-wide { width: 100%; }

.live-chip {
  background: linear-gradient(180deg, #231814, #17100e);
  border: 1px solid var(--line-2);
  border-radius: 0;
  padding: 26px 24px;
  box-shadow: var(--shadow);
  position: relative;
}
.live-chip::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(212, 175, 106, 0.18);
  pointer-events: none;
}
.live-chip .label {
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-family: var(--display);
}
.live-chip .ip {
  font-family: var(--display);
  font-size: 1.7rem;
  margin: 10px 0 12px;
  word-break: break-all;
  color: var(--gold-2);
  letter-spacing: 0.02em;
}
.meta-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  font-size: 0.74rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 4px 10px;
  letter-spacing: 0.04em;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 42px;
}
.tool-card {
  background: linear-gradient(180deg, #201612, #16100e);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 26px 22px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}
.tool-card::after {
  content: "";
  position: absolute;
  left: 22px; right: 22px; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.5;
}
.tool-card:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
  text-decoration: none;
  box-shadow: var(--shadow);
}
.tool-card .icon {
  width: 46px; height: 46px;
  border-radius: 50%;
  display: grid; place-items: center;
  margin-bottom: 16px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  font-family: var(--display);
  color: var(--gold);
  border: 1px solid rgba(212, 175, 106, 0.35);
}
.tool-card h3 {
  margin: 0 0 8px;
  letter-spacing: 0.04em;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.35rem;
}
.tool-card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.i-mint, .i-amber, .i-blue { background: transparent; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
}
.section-head h2 {
  margin: 0;
  letter-spacing: 0.02em;
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  font-family: var(--display);
  font-weight: 500;
}
.section-head p { margin: 8px 0 0; color: var(--muted); }

.panel {
  background: linear-gradient(180deg, #1e1512, #16100e);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 24px;
}
.panel + .panel { margin-top: 16px; }
.panel h3 {
  margin: 0 0 14px;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
  font-family: var(--display);
}

.grid-2 { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stack { display: grid; gap: 14px; }

.stat {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 14px 14px 12px;
}
.stat .k {
  color: var(--faint);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-family: var(--display);
}
.stat .v {
  font-family: var(--display);
  font-size: 1.12rem;
  margin-top: 6px;
  word-break: break-word;
}
.stat .v.big {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: 0.02em;
  color: var(--gold-2);
  font-weight: 500;
}
.stat .s { color: var(--muted); font-size: 0.8rem; margin-top: 4px; }

.hero-ip {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.copy {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--line-2);
  border-radius: 0;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--display);
}
.copy:hover { border-color: var(--gold); }

.field-row { display: flex; gap: 10px; }
.field-row input {
  flex: 1;
  background: #120c0a;
  color: var(--text);
  border: 1px solid var(--line-2);
  border-radius: 0;
  padding: 13px 14px;
  font-size: 1rem;
  outline: none;
}
.field-row input:focus { border-color: var(--gold); }

.gauge-wrap {
  display: grid;
  place-items: center;
  padding: 10px 0 4px;
}
.gauge {
  width: min(340px, 100%);
  aspect-ratio: 2 / 1.05;
  position: relative;
}
.gauge svg { width: 100%; height: 100%; }
.gauge-read {
  position: absolute;
  inset: auto 0 8px;
  text-align: center;
}
.gauge-read .num {
  font-size: 2.5rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  font-family: var(--display);
  color: var(--gold-2);
}
.gauge-read .unit { color: var(--muted); font-family: var(--display); letter-spacing: 0.12em; }

.bar {
  height: 2px;
  background: #2a1c16;
  border-radius: 0;
  overflow: hidden;
  margin-top: 14px;
}
.bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #8a6230, var(--gold-2));
  border-radius: inherit;
  transition: width 0.2s linear;
}
.phase { color: var(--muted); font-size: 0.88rem; margin-top: 10px; }

.table-wrap { overflow: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}
th, td {
  text-align: left;
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  color: var(--gold);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--display);
}
td.mono, .mono { font-family: var(--mono); font-size: 0.84rem; }
.good { color: var(--gold-2); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }

.note {
  background: rgba(212, 175, 106, 0.06);
  border: 1px solid rgba(212, 175, 106, 0.22);
  color: #e8d7b4;
  border-radius: 0;
  padding: 14px 16px;
  font-size: 0.92rem;
}
.warnbox {
  background: rgba(201, 123, 106, 0.08);
  border: 1px solid rgba(201, 123, 106, 0.28);
  color: #f0c8b8;
  border-radius: 0;
  padding: 14px 16px;
  font-size: 0.92rem;
}
.okbox {
  background: var(--gold-dim);
  border: 1px solid rgba(212, 175, 106, 0.28);
  color: #ead9b4;
  border-radius: 0;
  padding: 14px 16px;
  font-size: 0.92rem;
}

.ad {
  border: 1px dashed var(--line-2);
  background: repeating-linear-gradient(
    -45deg,
    rgba(212,175,106,0.02),
    rgba(212,175,106,0.02) 8px,
    rgba(212,175,106,0.05) 8px,
    rgba(212,175,106,0.05) 16px
  );
  border-radius: 0;
  min-height: 90px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--faint);
  padding: 14px;
  margin: 18px 0;
}
.ad b { color: var(--muted); display: block; font-size: 0.85rem; }
.ad span { font-size: 0.75rem; }
.ad.leader { min-height: 98px; }
.ad.box { min-height: 250px; }
.ad.sticky-foot {
  position: sticky;
  bottom: 10px;
  z-index: 15;
  margin-top: 22px;
}

.split { display: grid; grid-template-columns: 1fr 320px; gap: 16px; }
.side .ad.box { margin-top: 0; }

.timeline { display: grid; gap: 8px; }
.tl {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold);
  margin-top: 8px;
  box-shadow: 0 0 0 4px var(--gold-dim);
}
.dot.wait { background: var(--faint); box-shadow: none; }
.dot.err { background: var(--rose); box-shadow: 0 0 0 4px rgba(201,123,106,0.15); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 0.74rem;
  padding: 3px 9px;
  border-radius: 0;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}
.tag.on { color: var(--gold); border-color: rgba(212,175,106,0.4); }
.tag.off { color: var(--rose); border-color: rgba(201,123,106,0.28); }

.view { display: none; }
.view.on { display: block; animation: in 0.35s ease; }
@keyframes in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.footer {
  border-top: 1px solid var(--line);
  padding: 36px 0 44px;
  color: var(--muted);
  font-size: 0.9rem;
  position: relative;
}
.footer::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.4;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 24px;
}
.footer h4 {
  margin: 0 0 10px;
  color: var(--gold);
  font-family: var(--display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 500;
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--gold); }

.local-banner {
  background: rgba(212, 175, 106, 0.08);
  border: 1px solid rgba(212, 175, 106, 0.28);
  color: #ead9b4;
  border-radius: 0;
  padding: 14px 16px;
  margin: 0 0 22px;
  font-size: 0.92rem;
}
.local-banner b { color: var(--gold); }

.consent {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  background: #1a1210;
  border: 1px solid var(--gold);
  border-radius: 0;
  padding: 18px 18px;
  display: none;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  box-shadow: var(--shadow);
  width: min(820px, calc(100% - 32px));
  margin: 0 auto;
}
.consent.on { display: grid; }
.consent.legal-gate { width: min(640px, calc(100% - 32px)); }
.consent p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.toast {
  position: fixed;
  top: 82px;
  right: 16px;
  background: #1a1210;
  border: 1px solid var(--gold);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 0;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 50;
  font-family: var(--display);
  letter-spacing: 0.08em;
}
.toast.on { opacity: 1; transform: none; }

.skeleton {
  background: linear-gradient(90deg, #1a1210 25%, #2a1c16 50%, #1a1210 75%);
  background-size: 200% 100%;
  animation: sk 1.2s infinite;
  border-radius: 0;
  height: 14px;
}
@keyframes sk { to { background-position: -200% 0; } }

.hidden { display: none !important; }
.tiny { font-size: 0.84rem; color: var(--faint); }
pre.code {
  background: #100b09;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 12px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #e6d7b8;
}

.earn-table td:nth-child(n+2) { font-family: var(--mono); white-space: nowrap; }

@media (max-width: 920px) {
  .hero, .grid-2, .split, .footer-grid { grid-template-columns: 1fr; }
  .tool-grid, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .nav { display: none; }
  .mobile-nav { display: flex; }
  .consent { grid-template-columns: 1fr; }
  h1 { font-size: clamp(2rem, 9vw, 2.8rem); }
}
@media (min-width: 921px) {
  .mobile-nav { display: none; }
}
.mobile-nav {
  gap: 8px;
  padding: 12px 16px 0;
}
.mobile-nav a {
  flex: 1;
  text-align: center;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 0;
  padding: 8px 6px;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  font-family: var(--display);
}
.mobile-nav a.active { color: var(--gold); border-color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
