:root {
  color-scheme: dark;
  --bg: #08090d;
  --panel: rgba(18, 21, 31, 0.72);
  --panel-strong: rgba(24, 28, 41, 0.88);
  --text: #f7efd8;
  --muted: #b9ad93;
  --gold: #f4c95d;
  --gold-2: #c98922;
  --amber: #ffdf8a;
  --line: rgba(244, 201, 93, 0.2);
  --danger: #ff6b6b;
  --ok: #65f0b4;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f1e4;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 252, 244, 0.94);
  --text: #241b11;
  --muted: #6f6045;
  --line: rgba(127, 88, 20, 0.2);
  --shadow: 0 18px 50px rgba(90, 64, 20, 0.18);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(244, 201, 93, 0.16), transparent 30rem),
    radial-gradient(circle at 84% 8%, rgba(67, 166, 255, 0.1), transparent 28rem),
    linear-gradient(135deg, var(--bg), #10131a 52%, #050608);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

a { color: inherit; text-decoration: none; }

.site-shell { position: relative; min-height: 100vh; padding: 18px; }

.topbar {
  position: sticky;
  top: 10px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto 42px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 9, 13, 0.66);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

[data-theme="light"] .topbar { background: rgba(255, 255, 255, 0.72); }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: 0; }

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--amber), var(--gold-2));
  color: #191005;
  box-shadow: 0 0 26px rgba(244, 201, 93, 0.42);
}

.nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

.nav a {
  padding: 9px 11px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.92rem;
}

.nav a:hover, .nav a.active {
  color: var(--text);
  background: rgba(244, 201, 93, 0.12);
}

.container { max-width: 1180px; margin: 0 auto; }

.hero {
  min-height: calc(100vh - 124px);
  display: grid;
  align-items: center;
  padding: 26px 0 74px;
}

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr); gap: 34px; align-items: center; }

.eyebrow, .warning {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--amber);
  font-weight: 800;
  font-size: 0.82rem;
  text-transform: uppercase;
}

h1 {
  margin: 16px 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.2rem, 9vw, 7.6rem);
  line-height: 0.84;
  letter-spacing: 0;
  text-shadow: 0 0 34px rgba(244, 201, 93, 0.24);
}

h2 { margin: 0 0 16px; font-size: clamp(1.55rem, 3vw, 2.2rem); letter-spacing: 0; }
h3 { margin: 0 0 10px; font-size: 1.05rem; }
p { color: var(--muted); line-height: 1.7; }

.subtitle { font-size: clamp(1.08rem, 2vw, 1.35rem); max-width: 720px; margin-bottom: 24px; color: #ead9b8; }
[data-theme="light"] .subtitle { color: #594a31; }

.button, button, .file-button {
  border: 0;
  border-radius: 7px;
  padding: 13px 16px;
  min-height: 46px;
  cursor: pointer;
  background: linear-gradient(145deg, var(--amber), var(--gold-2));
  color: #1b1104;
  font-weight: 900;
  box-shadow: 0 0 34px rgba(244, 201, 93, 0.24);
}

.button.secondary, button.secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

.panel, .stat, .table-wrap, .settings-row, .faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.panel { padding: 22px; }

.relic {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.coin-core {
  width: min(70%, 360px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff0aa, #e9b43f 42%, #744510 74%);
  color: #261300;
  font-size: clamp(5rem, 16vw, 10rem);
  font-weight: 950;
  box-shadow: inset 0 0 38px rgba(255,255,255,0.36), 0 0 70px rgba(244,201,93,0.5);
}

.page-title { padding: 16px 0 26px; }
.page-title h1 { font-size: clamp(2.6rem, 7vw, 5.4rem); }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

label { display: grid; gap: 8px; color: var(--muted); font-weight: 700; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 48px;
  padding: 12px 13px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font: inherit;
}

select option { color: #17120a; }

.progress {
  height: 14px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.progress-bar { width: 0%; height: 100%; background: linear-gradient(90deg, var(--gold-2), var(--amber)); transition: width 450ms ease; }
.result { text-align: center; padding: 24px; }
.result-amount { font-size: clamp(2rem, 8vw, 4.8rem); font-weight: 950; color: var(--amber); text-shadow: 0 0 26px rgba(244,201,93,0.4); }
.notice { border-left: 4px solid var(--gold); padding: 10px 12px; background: rgba(244,201,93,0.1); color: var(--text); }

.stat { padding: 18px; }
.stat span { color: var(--muted); font-weight: 700; }
.stat strong { display: block; margin-top: 8px; font-size: 2rem; color: var(--amber); }

.chart { width: 100%; height: 260px; }
.controls { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.controls > * { flex: 1 1 180px; }

table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { text-align: left; padding: 14px; border-bottom: 1px solid var(--line); }
th { color: var(--amber); font-size: 0.84rem; text-transform: uppercase; }
.table-wrap { overflow-x: auto; }

.badge { display: inline-flex; padding: 6px 9px; border-radius: 999px; background: rgba(101,240,180,0.12); color: var(--ok); font-weight: 800; }
.danger { color: var(--danger); }

.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px; }
.switch { display: flex; align-items: center; gap: 10px; }
.switch input { width: 22px; min-height: 22px; }

.footer { max-width: 1180px; margin: 46px auto 0; padding: 22px 0; color: var(--muted); border-top: 1px solid var(--line); }
.footer strong { color: var(--amber); }
.hidden { display: none !important; }
.mt { margin-top: 18px; }
