/* Bailout — base + four looks. The look is html[data-theme]; "app" is the
   default: a straight, polished crypto product with no costume. */
:root {
  --bg: #0b0d12; --bg2: #10131a; --card: #141822; --card2: #1a1f2b; --line: #222837; --line2: #2b3245;
  --text: #e9edf5; --muted: #8e97aa; --dim: #5d6679;
  --accent: #6ef2a1; --accent-ink: #062b16; --red: #ff5c7a; --red-soft: rgba(255, 92, 122, 0.14); --green-soft: rgba(110, 242, 161, 0.12);
  --gold: #ffd166; --blue: #6ea8ff;
  --radius: 14px; --radius-sm: 9px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display: var(--font);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --hero-grad: radial-gradient(1200px 500px at 20% -10%, rgba(110, 242, 161, 0.14), transparent 60%), radial-gradient(900px 400px at 90% 0%, rgba(255, 92, 122, 0.12), transparent 60%);
}

/* Government bailout: hazard tape, stencil type, black and warning yellow. */
html[data-theme="hazard"] {
  --bg: #0a0a0a; --bg2: #111; --card: #141414; --card2: #1b1b1b; --line: #2a2a2a; --line2: #3a3a3a;
  --text: #f4f1e6; --muted: #a39f8f; --dim: #6b675c;
  --accent: #ffd400; --accent-ink: #1a1600; --red: #ff3b3b; --red-soft: rgba(255, 59, 59, 0.16); --green-soft: rgba(255, 212, 0, 0.12);
  --gold: #ffd400; --blue: #8fb3ff;
  --radius: 4px; --radius-sm: 3px;
  --display: "Anton", Impact, "Arial Narrow Bold", sans-serif;
  --hero-grad: repeating-linear-gradient(135deg, rgba(255, 212, 0, 0.07) 0 28px, transparent 28px 56px);
}
html[data-theme="hazard"] h1, html[data-theme="hazard"] h2, html[data-theme="hazard"] .tile .v, html[data-theme="hazard"] .brand { font-family: var(--display); letter-spacing: 0.02em; text-transform: uppercase; font-weight: 400; }
html[data-theme="hazard"] .hero h1 { font-size: clamp(54px, 9vw, 112px); line-height: 0.92; }
html[data-theme="hazard"] .btn.primary { border-radius: 2px; }
html[data-theme="hazard"] .tape { display: block; height: 14px; background: repeating-linear-gradient(135deg, #ffd400 0 22px, #0a0a0a 22px 44px); }

/* Relief fund: paper white, red cross, serif, calm. */
html[data-theme="relief"] {
  --bg: #f7f4ee; --bg2: #fbfaf6; --card: #ffffff; --card2: #f1ede4; --line: #e4ded1; --line2: #d4ccbb;
  --text: #1b1a17; --muted: #6d675c; --dim: #a39d91;
  --accent: #d62828; --accent-ink: #fff; --red: #c81e1e; --red-soft: rgba(214, 40, 40, 0.1); --green-soft: rgba(20, 120, 70, 0.1);
  --gold: #b7791f; --blue: #2f5fbf;
  --radius: 10px; --radius-sm: 6px;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --shadow: 0 10px 30px rgba(60, 40, 10, 0.08);
  --hero-grad: radial-gradient(800px 300px at 50% -20%, rgba(214, 40, 40, 0.08), transparent 70%);
}
html[data-theme="relief"] h1, html[data-theme="relief"] h2, html[data-theme="relief"] .brand { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; }
html[data-theme="relief"] .hero h1 { font-size: clamp(40px, 6.5vw, 84px); font-style: italic; font-weight: 500; }
html[data-theme="relief"] .good { color: #14784a; }

/* Terminal: amber on black, monospace everything. */
html[data-theme="terminal"] {
  --bg: #050505; --bg2: #0a0a0a; --card: #0d0d0d; --card2: #131313; --line: #242424; --line2: #333;
  --text: #ffb000; --muted: #a87400; --dim: #5e4200;
  --accent: #ffb000; --accent-ink: #000; --red: #ff4d4d; --red-soft: rgba(255, 77, 77, 0.14); --green-soft: rgba(255, 176, 0, 0.1);
  --gold: #ffd166; --blue: #ffb000;
  --radius: 0; --radius-sm: 0;
  --font: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; --display: var(--font);
  --shadow: none;
  --hero-grad: linear-gradient(rgba(255, 176, 0, 0.04) 1px, transparent 1px);
}
html[data-theme="terminal"] body { background-size: 100% 3px; }
html[data-theme="terminal"] .hero h1 { font-size: clamp(34px, 5.5vw, 68px); text-transform: uppercase; letter-spacing: 0.04em; }
html[data-theme="terminal"] .card, html[data-theme="terminal"] .tile { box-shadow: inset 0 0 0 1px var(--line); }

* { box-sizing: border-box; }
html { color-scheme: dark; }
html[data-theme="relief"] { color-scheme: light; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-color: var(--dim); }
button, input, textarea, select { font: inherit; color: inherit; }
img { display: block; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.bad { color: var(--red); }
.good { color: var(--accent); }
.gold { color: var(--gold); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.nav { display: flex; align-items: center; gap: 22px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -0.01em; }
.brand .mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 900; font-size: 15px; }
.nav .links { display: flex; gap: 18px; color: var(--muted); font-weight: 500; }
.nav .links a.on { color: var(--text); }
.nav .spacer { flex: 1; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line2); background: var(--card); color: var(--text); padding: 9px 14px; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { background: var(--red); color: #fff; border-color: transparent; }
.btn.lg { padding: 13px 20px; font-size: 16px; border-radius: calc(var(--radius-sm) + 2px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--card2); color: var(--muted); border: 1px solid var(--line); }
.pill.red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.pill.green { background: var(--green-soft); color: var(--accent); border-color: transparent; }
.pill.gold { color: var(--gold); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: 0.35; } }

.hero { padding: 54px 0 34px; background: var(--hero-grad); }
.hero h1 { font-size: clamp(38px, 6vw, 76px); line-height: 1.02; margin: 0 0 18px; letter-spacing: -0.03em; font-weight: 800; max-width: 15ch; }
.hero h1 em { color: var(--red); font-style: normal; }
.hero p.lede { font-size: 18px; color: var(--muted); max-width: 62ch; margin: 0 0 26px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero .mascot { display: none; }
html[data-theme="goblin"] .hero .mascot { display: block; }
.lang-toggle { display: none; }
html[data-theme="goblin"] .lang-toggle { display: inline; }
.brand .mark img { display: none; }
.brand .wordmark-nav { height: 40px; width: auto; display: block; }
.hero .wordmark { display: none; }
html[data-theme="goblin"] .hero .wordmark { display: block; }
html[data-theme="goblin"] .brand .mark img { display: block; }
html[data-theme="goblin"] .brand .mark::before { content: none; }
.brand .mark::before { content: "B"; }
.tryit { display: flex; gap: 8px; align-items: center; }
.tryit input { width: min(420px, 70vw); }
input[type="text"], input[type="number"], input[type="url"], textarea, select { background: var(--bg2); border: 1px solid var(--line2); color: var(--text); border-radius: var(--radius-sm); padding: 10px 12px; outline: none; }
input:focus, textarea:focus { border-color: var(--muted); }
textarea { width: 100%; min-height: 90px; resize: vertical; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 10px 0 28px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.tile .k { color: var(--muted); font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }
.tile .v { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile .s { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.tile.hot { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); background: linear-gradient(180deg, var(--red-soft), var(--card)); }

.section { margin: 30px 0; }
.section h2 { font-size: 20px; margin: 0 0 12px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.section h2 .pill { font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.coin-card { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: start; }
.coin-card:hover { border-color: var(--line2); text-decoration: none; }
.coin-card img, .avatar { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--card2); }
.coin-card .name { font-weight: 700; display: flex; gap: 8px; align-items: baseline; }
.coin-card .name .sym { color: var(--muted); font-weight: 600; }
.coin-card .row { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-top: 6px; }
.coin-card .row b { color: var(--text); font-weight: 600; }

.ticker { display: flex; gap: 10px; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker .track { display: flex; gap: 10px; animation: scroll 40s linear infinite; }
.ticker .item { white-space: nowrap; background: var(--card); border: 1px solid var(--line); padding: 8px 12px; border-radius: 999px; font-size: 13px; color: var(--muted); }
.ticker .item b { color: var(--accent); }
@keyframes scroll { to { transform: translateX(-50%); } }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
td.r, th.r { text-align: right; }
tr.me td { background: var(--green-soft); }
tr.top1 td:first-child { color: var(--gold); font-weight: 800; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.addr { font-family: var(--mono); font-size: 13px; }
.bar { height: 6px; background: var(--card2); border-radius: 3px; overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--red); }

.coin-head { display: grid; grid-template-columns: 84px 1fr auto; gap: 18px; align-items: center; margin: 22px 0; }
.coin-head img { width: 84px; height: 84px; border-radius: 18px; object-fit: cover; background: var(--card2); }
.coin-head h1 { margin: 0; font-size: 30px; letter-spacing: -0.02em; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.coin-head h1 .sym { color: var(--muted); font-weight: 600; font-size: 20px; }
.coin-head .meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13px; margin-top: 6px; }
.coin-head .meta a:hover { color: var(--text); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
/* grid and flex children default to min-width:auto, which lets a wide table or input push the whole page sideways on a phone */
.two > *, .hero .wrap > *, .grid > *, .stats > * { min-width: 0; }
.tryit { flex-wrap: wrap; }
.tryit input { flex: 1 1 240px; min-width: 0; }
.grid .wide { grid-column: 1 / -1; display: flex; align-items: center; gap: 22px; text-align: left; padding: 18px 22px; }
.grid .wide img { width: 110px; flex: 0 0 auto; }
td.empty { text-align: center; }
td.empty img { display: block; margin: 0 auto 8px; width: 110px; }
@media (max-width: 640px) {
  .nav { flex-wrap: wrap; height: auto; padding: 10px 0; row-gap: 8px; }
  .nav .links { order: 3; width: 100%; display: flex; gap: 14px; white-space: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .nav .spacer { display: none; }
  .nav .btn { margin-left: auto; font-size: 14px; padding: 7px 10px; }
  .brand .wordmark-nav { height: 36px; }
  .hero .mascot { width: 200px; }
}
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } .coin-head { grid-template-columns: 64px 1fr; } .coin-head .actions { grid-column: 1 / -1; } }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tabs button { background: none; border: 0; padding: 10px 14px; color: var(--muted); font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.banner { padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--line2); background: var(--card2); color: var(--muted); margin: 14px 0; }
.banner.red { border-color: color-mix(in srgb, var(--red) 50%, var(--line)); background: var(--red-soft); color: var(--text); }
.banner.green { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--green-soft); color: var(--text); }
.rule { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; font-size: 14px; }
.kv .k { color: var(--muted); }
.countdown { font-family: var(--mono); font-size: 26px; font-weight: 700; letter-spacing: 0.02em; }

.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; max-width: 760px; }
.form > *, .form label > * { min-width: 0; }
.form .row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.form label { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.form label input, .form label textarea { font-weight: 400; color: var(--text); }
.drop { border: 1.5px dashed var(--line2); border-radius: var(--radius); padding: 18px; display: flex; gap: 16px; align-items: center; cursor: pointer; background: var(--bg2); }
.drop:hover { border-color: var(--muted); }
.drop img { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; background: var(--card2); }
.range { display: grid; grid-template-columns: 1fr 110px; gap: 12px; align-items: center; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.steps { display: grid; gap: 8px; }
.step { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.step .n { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line2); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.step.on { color: var(--text); }
.step.on .n { border-color: var(--accent); color: var(--accent); }
.step.done .n { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.step.fail .n { background: var(--red); color: #fff; border-color: transparent; }

.how h3 { margin: 22px 0 6px; font-size: 17px; }
.how p, .how li { color: var(--muted); max-width: 72ch; }
.how code { font-family: var(--mono); background: var(--card2); padding: 1px 6px; border-radius: 4px; font-size: 13px; color: var(--text); }
.footer { color: var(--dim); font-size: 13px; padding: 40px 0 30px; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.footer .spacer { flex: 1; }
.theme-pick { display: inline-flex; gap: 6px; }
.theme-pick button { background: var(--card); border: 1px solid var(--line); color: var(--muted); padding: 4px 9px; border-radius: 999px; font-size: 12px; cursor: pointer; }
.theme-pick button.on { color: var(--text); border-color: var(--muted); }
.empty { color: var(--muted); padding: 26px; text-align: center; }
.skeleton { background: linear-gradient(90deg, var(--card) 25%, var(--card2) 50%, var(--card) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-sm); min-height: 18px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--card2); border: 1px solid var(--line2); padding: 10px 16px; border-radius: 999px; box-shadow: var(--shadow); z-index: 10; }
.rankbadge { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--card2); font-weight: 800; font-size: 12px; }
tr.top1 .rankbadge { background: var(--gold); color: #1a1200; }
tr.top2 .rankbadge { background: #c7ced9; color: #111; }
tr.top3 .rankbadge { background: #b07a4a; color: #fff; }
