/* ==========================================================================
   WWW — components and pages
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
img { display: block; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent); color: #fff; }

.ic { flex: none; display: inline-block; vertical-align: middle; }
.mono { font-family: var(--mono); font-feature-settings: "zero"; }
.faint { color: var(--faint); }
.sub { color: var(--muted); }
.hint { color: var(--faint); font-size: 13px; }
.about { color: var(--ink-2); max-width: 64ch; }
.accent { color: var(--accent-text); }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; }
.wrap { flex-wrap: wrap; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; }
.center { text-align: center; }
.mt-6 { margin-top: 6px; } .mt-10 { margin-top: 10px; } .mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }

.flag { border-radius: 4px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); flex: none; }
[data-theme="dark"] .flag { box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }

/* ---------------------------------------------------------------- shell */

.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
html[data-side="rail"] .shell { grid-template-columns: var(--side-rail) 1fr; }
.main { min-width: 0; }

.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 14px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
}
.logo { display: flex; align-items: center; gap: 12px; padding: 4px 6px 16px; color: var(--ink); text-decoration: none !important; }
.logo-mark { display: flex; }
.logo-svg { display: block; }
.logo-text { display: flex; flex-direction: column; min-width: 0; }
.logo-word { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -0.03em; line-height: 1; }
.logo-tag { color: var(--muted); font-size: 12px; margin-top: 3px; white-space: nowrap; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: flex; align-items: center; gap: 14px;
  height: 46px; padding: 0 14px; border-radius: var(--pill);
  color: var(--ink-2); font-weight: 550; text-decoration: none !important;
  transition: background .15s, color .15s;
}
.side-link:hover { background: var(--panel-2); color: var(--ink); }
.side-link.on { background: var(--accent-soft); color: var(--accent-text); }
.side-cta { padding: 12px 0 6px; }

.side-label { display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.side-value { display: block; font-weight: 600; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.side-draw-in {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border-radius: var(--r); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--ink); text-decoration: none !important;
}
.side-draw-in .flag { border-radius: 5px; }
.side-timer { font-size: 13px; font-weight: 600; color: var(--accent-text); }

.side-card { margin-top: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-2); }
.side-card-row { display: flex; align-items: center; gap: 6px; padding: 10px 10px 10px 14px; }
.side-card-row + .side-card-row { border-top: 1px solid var(--line); }
.side-bottom { display: flex; align-items: center; justify-content: space-between; padding: 10px 6px 0; }

.toggle { display: inline-flex; padding: 3px; gap: 2px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--pill); }
.toggle button { width: 34px; height: 28px; border: 0; border-radius: var(--pill); background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.toggle button.on { background: var(--panel-3); color: var(--ink); }

.icon-btn {
  width: 34px; height: 34px; flex: none; display: inline-grid; place-items: center;
  border: 0; border-radius: var(--pill); background: transparent; color: var(--ink-2); cursor: pointer;
  transition: background .15s;
}
.icon-btn:hover:not(:disabled) { background: var(--panel-3); color: var(--ink); text-decoration: none; }
.icon-btn:disabled { opacity: .4; cursor: default; }
.icon-btn.sm { width: 28px; height: 28px; }

.side-collapse {
  position: fixed; z-index: 30; top: 26px; left: calc(var(--side-w) - 13px);
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); cursor: pointer;
}
.side-collapse:hover { color: var(--ink); }
html[data-side="rail"] .side-collapse { left: calc(var(--side-rail) - 13px); transform: rotate(180deg); }
html[data-side="rail"] .logo-text,
html[data-side="rail"] .side-link span,
html[data-side="rail"] .side-cta .btn span,
html[data-side="rail"] .side-draw,
html[data-side="rail"] .side-bottom .side-label { opacity: 0; max-width: 0; max-height: 0; overflow: hidden; margin-top: 0; padding: 0; border-width: 0; pointer-events: none; }
html[data-side="rail"] .sidebar { padding: 18px 10px; align-items: center; }
html[data-side="rail"] .side-link { width: 52px; justify-content: center; padding: 0; }
html[data-side="rail"] .side-cta .btn { width: 52px; padding: 0; }
html[data-side="rail"] .side-bottom { flex-direction: column; margin-top: auto; }
html[data-side="rail"] .toggle { flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  height: var(--top-h); padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-logo { display: none; }
.search {
  flex: 1; min-width: 0; max-width: 520px; height: 44px; display: flex; align-items: center; gap: 10px;
  padding: 0 14px; border-radius: var(--pill); background: var(--panel); border: 1px solid var(--line); color: var(--muted);
}
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font: inherit; }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { font: 12px var(--mono); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--faint); }
.search-results {
  position: absolute; top: calc(var(--top-h) - 6px); left: 28px; width: min(520px, calc(100% - 56px));
  max-height: 60vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r); padding: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .28);
}
.wallet-btn {
  margin-left: auto; flex: none; height: 44px; padding: 0 18px; display: inline-flex; align-items: center; gap: 10px;
  border: 0; border-radius: var(--pill); background: var(--accent); color: var(--on-accent); font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.wallet-btn:hover { background: var(--accent-hover); }
.wallet-btn.on { background: var(--panel); color: var(--ink); border: 1px solid var(--line-2); }

.content { padding: 28px; max-width: 1280px; margin: 0 auto; }

/* ---------------------------------------------------------------- basics */

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.ph-title { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15px; }
.ph-title .ic { color: var(--accent-text); }
.ph-right { margin-left: auto; }
.panel-body { padding: 20px; }
.panel-body.flush { padding: 6px; }

.page-head { display: flex; align-items: flex-start; gap: 16px; }
.ph-ic { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--accent-soft); color: var(--accent-text); }
.ph-body { flex: 1; min-width: 0; }
.title { font-size: 32px; }
.ph-actions { flex: none; }
.h2 { font-size: 22px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; width: fit-content;
  padding: 6px 12px; border-radius: var(--pill); background: var(--accent-soft); color: var(--accent-text);
  font-size: 13px; font-weight: 600; text-decoration: none !important;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px;
  border-radius: var(--pill); background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2); font-size: 13px; font-weight: 550;
}
.chip-blue { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid transparent; border-radius: var(--pill); font-weight: 650; cursor: pointer;
  text-decoration: none !important; white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
}
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-md { height: 42px; padding: 0 20px; font-size: 14px; }
.btn-lg { height: 54px; padding: 0 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:active:not(:disabled) { background: var(--accent-press); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--panel-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite;
}
.btn-ghost.is-busy::after { border-color: var(--line-2); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }

.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 44px 20px; text-align: center; color: var(--muted); }
.empty .ic { color: var(--faint); }
.empty h3 { font-size: 22px; color: var(--ink); }
.empty p { max-width: 48ch; }

.skel-rows { display: flex; flex-direction: column; gap: 14px; }
.skel-row { display: flex; align-items: center; gap: 14px; }
.skel { background: var(--panel-2); border-radius: 8px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

.notice { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--r); font-size: 14px; }
.notice-err { background: var(--down-soft); color: var(--down); }

.toasts { position: fixed; z-index: 100; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { padding: 12px 18px; border-radius: var(--r); background: var(--ink); color: var(--bg); font-weight: 550; font-size: 14px; max-width: min(520px, 90vw); box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.toast-err { background: var(--down); color: #fff; }

/* ---------------------------------------------------------------- lists */

.trow {
  display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: var(--r);
  color: var(--ink); text-decoration: none !important;
}
.trow:hover { background: var(--panel-2); }
.trow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.trow-name { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow-sub { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.trow-right { display: flex; flex-direction: column; align-items: flex-end; }
.trow-mcap { font-family: var(--mono); font-weight: 600; }
.rank { width: 28px; text-align: center; font-family: var(--mono); font-weight: 600; color: var(--faint); }
.coin-row:nth-child(1) .rank, .coin-row:nth-child(2) .rank, .coin-row:nth-child(3) .rank { color: var(--accent-text); }
.coin-img { border-radius: 12px; object-fit: cover; flex: none; background: var(--panel-2); }
.coin-img-flag { display: grid; place-items: center; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.coin-card {
  display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: var(--r-lg);
  background: var(--panel); border: 1px solid var(--line); color: var(--ink); text-decoration: none !important;
  transition: border-color .15s, transform .15s var(--ease);
}
.coin-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.coin-card .coin-img { width: 100% !important; height: auto !important; aspect-ratio: 1; margin-bottom: 6px; }
.coin-card-country { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.coin-card-name { font-family: var(--display); font-weight: 800; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coin-card-foot { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.coin-card-foot b { color: var(--ink); font-family: var(--mono); }

.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.stat-label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.stat-label .ic { color: var(--accent-text); }
.stat-value { font-family: var(--display); font-weight: 800; font-size: 28px; letter-spacing: -0.02em; }
.stat-sub { color: var(--faint); font-size: 13px; }

.steps { display: flex; flex-direction: column; gap: 18px; }
.step { display: flex; gap: 16px; }
.step-n { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; }
.step-title { font-weight: 700; font-size: 16px; }
.step-text { color: var(--muted); margin-top: 2px; max-width: 70ch; }

.facts { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.facts li { position: relative; padding-left: 20px; color: var(--ink-2); font-size: 14px; }
.facts li::before { content: ""; position: absolute; left: 4px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv-k { color: var(--muted); }
.kv-v { display: inline-flex; align-items: center; gap: 6px; text-align: right; }

/* ---------------------------------------------------------------- forms */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.flabel { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, .textarea {
  width: 100%; padding: 0 14px; height: 46px; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink); font: inherit; outline: 0;
  transition: border-color .15s;
}
.textarea { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus { border-color: var(--accent); }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.seg-group { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-btn { height: 36px; padding: 0 14px; border-radius: var(--pill); border: 1px solid var(--line-2); background: none; font-weight: 600; font-size: 13px; cursor: pointer; }
.seg-btn:hover { background: var(--panel-2); }
.seg-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.devbuy-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.devbuy-custom { position: relative; width: 140px; }
.devbuy-custom .input { height: 36px; padding-right: 44px; }
.devbuy-unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--faint); }
.devbuy-cost { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); font-size: 14px; }
.devbuy-cost.is-warn { background: var(--down-soft); }
.devbuy-warn { color: var(--down); font-weight: 600; }

/* ---------------------------------------------------------------- home */

.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 24px; align-items: center;
  padding: 36px 36px 36px 44px; overflow: hidden;
}
.hero-copy { display: flex; flex-direction: column; gap: 20px; min-height: 380px; justify-content: center; }
.hero-title { font-size: clamp(38px, 4.4vw, 62px); letter-spacing: -0.035em; line-height: .98; }
.hero-sub { color: var(--muted); font-size: 17px; max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-stats { display: flex; gap: 28px; padding-top: 8px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font-family: var(--display); font-size: 26px; font-weight: 800; line-height: 1.1; }
.hero-stats span { color: var(--muted); font-size: 13px; }

.hero-globe { position: relative; }
.globe-host { width: 100%; max-width: 560px; margin: 0 auto; aspect-ratio: 1; }
.globe-canvas { display: block; cursor: grab; touch-action: none; }
.globe-hint { text-align: center; color: var(--faint); font-size: 12px; margin-top: 6px; }
.globe-tip {
  position: absolute; z-index: 5; pointer-events: none;
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px;
  background: var(--ink); color: var(--bg); font-size: 13px; white-space: nowrap;
}
.tip-owned, .tip-free { font-family: var(--mono); font-size: 12px; padding: 1px 8px; border-radius: var(--pill); }
.tip-owned { background: var(--accent); color: #fff; }
.tip-free { background: color-mix(in srgb, var(--bg) 20%, transparent); }

.reveal { display: flex; flex-direction: column; gap: 18px; animation: rise .45s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.reveal-flag .flag { width: 120px; height: 90px; border-radius: 12px; }
.reveal-body { display: flex; flex-direction: column; gap: 8px; }
.reveal-name { font-size: clamp(40px, 4.6vw, 64px); letter-spacing: -0.035em; }
.reveal-timer { display: inline-flex; align-items: center; gap: 8px; width: fit-content; padding: 8px 14px; border-radius: var(--pill); background: var(--panel-2); border: 1px solid var(--line); font-size: 14px; }
.reveal-timer b { color: var(--accent-text); }
.reveal-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------------------------------------------------------------- launch */

.launch-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); gap: 14px; align-items: start; }
.launch-side { position: sticky; top: calc(var(--top-h) + 20px); }
.country-bar { display: flex; align-items: center; gap: 16px; padding: 16px 20px; }
.country-bar .flag { width: 64px; height: 48px; border-radius: 8px; }
.country-bar-name { display: block; font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1.1; }
.timer-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--pill); background: var(--accent-soft); color: var(--accent-text); }
.coin-preview { overflow: hidden; }
.coin-preview-art svg { display: block; width: 100%; height: auto; }
.coin-preview-body { padding: 14px 18px 16px; }
.coin-preview-name { font-family: var(--display); font-weight: 800; font-size: 20px; }
.launch-status { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--r); background: var(--panel-2); font-size: 14px; }
.launch-status.is-err { background: var(--down-soft); color: var(--ink); }
.launch-status.is-ok { background: var(--up-soft); }

/* ---------------------------------------------------------------- countries */

.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.wall-tile {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  padding: 10px; border-radius: 12px; border: 1px solid var(--line); color: var(--ink); text-decoration: none !important;
  background: var(--panel-2);
}
.wall-tile .flag { grid-row: span 2; opacity: .45; filter: grayscale(.7); transition: opacity .15s, filter .15s; }
.wall-tile:hover { border-color: var(--line-2); }
.wall-tile:hover .flag { opacity: 1; filter: none; }
.wall-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wall-free { font-size: 11px; color: var(--faint); }
.wall-tick { font-size: 11px; color: var(--accent-text); }
.wall-tile.is-owned { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.wall-tile.is-owned .flag { opacity: 1; filter: none; }

/* ---------------------------------------------------------------- country & coin */

.country-hero, .coin-hero { display: grid; grid-template-columns: 340px 1fr; gap: 32px; padding: 24px; align-items: center; }
.country-art, .coin-hero-art { border-radius: var(--r-lg); overflow: hidden; background: var(--panel-2); }
.country-art svg, .country-art img, .coin-hero-art .coin-img { display: block; width: 100% !important; height: auto !important; aspect-ratio: 1; border-radius: 0; }
.country-body, .coin-hero-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.country-name, .coin-name { font-size: clamp(34px, 4vw, 52px); letter-spacing: -0.03em; }
.owned-card { padding: 18px; border-radius: var(--r); background: var(--panel-2); border: 1px solid var(--line); }
.owned-name { font-family: var(--display); font-weight: 800; font-size: 22px; }
.ca-pill { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 4px 0 14px; border-radius: var(--pill); background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; padding: 28px; }
  .hero-copy { min-height: 0; }
  .globe-host { max-width: 460px; }
  .launch-grid { grid-template-columns: 1fr; }
  .launch-side { position: static; }
}

@media (max-width: 860px) {
  .shell, html[data-side="rail"] .shell { grid-template-columns: 1fr; }
  .sidebar, .side-collapse { display: none; }
  .topbar { padding: 0 16px; gap: 10px; }
  .topbar-logo { display: flex; }
  .search kbd { display: none; }
  .search-results { left: 16px; width: calc(100% - 32px); }
  .wallet-btn span { display: none; }
  .wallet-btn { padding: 0 14px; }
  .content { padding: 16px; padding-bottom: 88px; }
  .statgrid { grid-template-columns: 1fr; }
  .form-2 { grid-template-columns: 1fr; }
  .country-hero, .coin-hero { grid-template-columns: 1fr; padding: 16px; gap: 18px; }
  .hero { padding: 20px; }
  .hero-stats { gap: 20px; }
  .title { font-size: 26px; }
  .page-head { flex-wrap: wrap; }
}

/* the phone's bottom navigation, built from the sidebar links */
.mobile-nav {
  display: none; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); gap: 4px;
  background: var(--panel); border-top: 1px solid var(--line);
}
.mobile-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 12px; color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none !important; }
.mobile-nav a.on { color: var(--accent-text); background: var(--accent-soft); }

@media (max-width: 860px) {
  .mobile-nav { display: flex; }
  .toasts { bottom: 84px; }
}

@media (max-width: 1080px) {
  .hero-globe { order: -1; }
}

@media (max-width: 520px) {
  .hero-title { font-size: 38px; }
  .hero-sub { font-size: 15px; }
  .hero-actions .btn { flex: 1; }
  .reveal-actions .btn { flex: 1; }
  .globe-host { max-width: 340px; }
}

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

/* a coin with no pinned image yet: its flag, centred */
.coin-hero-art .coin-img-flag, .coin-card .coin-img-flag { display: grid !important; place-items: center; }
.coin-hero-art .coin-img-flag .flag, .coin-card .coin-img-flag .flag { width: 62%; height: auto; border-radius: 10px; }

/* launch day: the $WORLD contract address on the home page */
.ca-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: fit-content; max-width: 100%; padding: 6px 6px 6px 16px; border-radius: var(--pill); background: var(--panel-2); border: 1px solid var(--line); }
.ca-bar-label { font-size: 12px; font-weight: 700; color: var(--accent-text); }
.ca-bar-addr { font-size: 13px; margin-right: 4px; }

/* ==========================================================================
   WWW skin: every screen is a browser window (see tokens.css).
   Later rules win, so this block re-styles the components above.
   ========================================================================== */

body {
  font-family: var(--font);
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.6px, transparent 1.9px);
  background-size: 22px 22px;
  background-attachment: fixed;
}
h1, h2, h3, .logo-word, .title, .h2, .hero-title, .reveal-name, .country-name, .coin-name, .stat-value,
.hero-stats b, .coin-card-name, .owned-name, .country-bar-name, .coin-preview-name, .empty h3 {
  font-family: var(--display); font-weight: 400; letter-spacing: 0; line-height: 1.15; text-transform: uppercase;
}
.logo-word { font-size: 22px; }
.logo-img { image-rendering: auto; border-radius: 8px; }
.title { font-size: 26px; }
.h2 { font-size: 18px; }
.hero-title { font-size: clamp(24px, 2.6vw, 38px); line-height: 1.2; }
.hero-title .accent { color: var(--accent); }
.reveal-name { font-size: clamp(28px, 3.4vw, 46px); }
.country-name, .coin-name { font-size: clamp(24px, 3vw, 38px); }
.stat-value { font-size: 22px; }
.hero-stats b { font-size: 22px; }
.coin-card-name { font-size: 13px; }
.owned-name { font-size: 15px; }
.country-bar-name { font-size: 20px; }
.coin-preview-name { font-size: 15px; }
.empty h3 { font-size: 18px; }
.ph-title { font-family: var(--display); font-weight: 400; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
::selection { background: var(--sun); color: var(--ink); }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

/* ---- windows: white panels with a navy frame, hard shadow and a blue title bar ---- */
.panel {
  background: var(--panel); border: 2px solid var(--frame); border-radius: var(--r-lg);
  box-shadow: 0 5px 0 var(--shadow); overflow: hidden;
}
.panel-head, .hero-head {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 16px 9px 16px;
  background: var(--titlebar); color: #fff; border-bottom: 2px solid var(--frame);
}
.panel-head::before, .hero-head::before {
  content: ""; flex: none; width: 11px; height: 11px; border-radius: 50%; margin-right: 38px;
  background: #ff6b5e; box-shadow: 18px 0 0 #ffd23f, 36px 0 0 #3ddc84, 0 0 0 1.5px rgba(12, 26, 85, .35), 18px 0 0 1.5px rgba(12, 26, 85, .35), 36px 0 0 1.5px rgba(12, 26, 85, .35);
}
.panel-head .ph-title, .panel-head .ph-title .ic, .hero-head .ph-title { color: #fff; }
.panel-head .ph-right { color: #fff; }
.panel-head .ph-right .btn { box-shadow: none; }
.hero-addr {
  margin-left: 6px; flex: 1; min-width: 0; max-width: 520px; display: flex; align-items: center; gap: 8px;
  height: 26px; padding: 0 12px; border-radius: 8px; background: #e9f2fc; color: #0c1a55;
  font: 500 12px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hero-addr b { font: 400 11px var(--display); color: var(--accent); letter-spacing: .06em; }

.hero { padding: 0; gap: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); grid-template-rows: auto 1fr; align-items: stretch; }
.hero-head { grid-column: 1 / -1; }
.hero-copy { padding: 34px 20px 34px 44px; }
.hero-globe { padding: 20px 36px 20px 8px; align-self: center; }
.hero-sub { color: var(--ink-2); }
.hero-stats { border-top: 2px dashed var(--line-2); padding-top: 16px; }
.hero-stats span { color: var(--muted); }

/* ---- sidebar and topbar: the bookmarks bar and the browser toolbar ---- */
.sidebar { background: var(--panel-2); border-right: 2px solid var(--frame); }
.logo { padding-bottom: 14px; }
.logo-tag { font: 500 11px var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.side-link { border-radius: var(--r); font-weight: 600; border: 2px solid transparent; }
.side-link:hover { background: var(--panel); border-color: var(--line-2); }
.side-link.on { background: var(--accent); color: #fff; border-color: var(--frame); box-shadow: 0 3px 0 var(--shadow); }
.side-label { font-family: var(--mono); font-size: 10.5px; }
.side-draw-in { border-radius: var(--r); border: 2px solid var(--frame); background: var(--sun); color: var(--ink); box-shadow: 0 3px 0 var(--shadow); }
.side-draw-in .side-label, .side-draw-in .side-value, .side-draw-in .side-timer { color: var(--ink); }
.side-card { border: 2px solid var(--frame); border-radius: var(--r); background: var(--panel); box-shadow: 0 3px 0 var(--shadow); }
.side-card-row + .side-card-row { border-top: 2px dashed var(--line-2); }
.toggle { border: 2px solid var(--frame); border-radius: var(--r); background: var(--panel); }
.toggle button { border-radius: 6px; }
.toggle button.on { background: var(--accent); color: #fff; }
.side-collapse { border: 2px solid var(--frame); background: var(--panel); color: var(--ink); }
.icon-btn { border-radius: var(--r-sm); color: var(--ink-2); }
.icon-btn:hover:not(:disabled) { background: var(--panel-3); }

.topbar {
  background: var(--titlebar); border-bottom: 2px solid var(--frame); backdrop-filter: none; box-shadow: 0 3px 0 var(--shadow);
}
.topbar-logo { align-items: center; }
.search {
  height: 40px; border-radius: 10px; border: 2px solid var(--frame); background: #e9f2fc; color: var(--faint); padding: 0 12px 0 10px;
}
.search::before { content: "www"; font: 400 11px var(--display); color: var(--accent); letter-spacing: .06em; padding-right: 10px; margin-right: 2px; border-right: 2px solid var(--line); }
.search input { color: #0c1a55; }
.search:focus-within { border-color: var(--sun); box-shadow: 0 0 0 3px var(--sun); }
.search kbd { border: 2px solid var(--line); border-radius: 6px; color: var(--faint); }
.search-results { border: 2px solid var(--frame); border-radius: var(--r-lg); background: var(--panel); box-shadow: 0 5px 0 var(--shadow); }
.wallet-btn {
  height: 40px; border-radius: 10px; border: 2px solid var(--frame); background: var(--sun); color: #0c1a55; box-shadow: 0 3px 0 var(--shadow); font-weight: 700;
}
.wallet-btn:hover { background: #ffe066; }
.wallet-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--shadow); }
.wallet-btn.on { background: #e9f2fc; color: #0c1a55; border: 2px solid var(--frame); }

/* ---- buttons, chips, forms ---- */
.btn { border-radius: 10px; border: 2px solid var(--frame); box-shadow: 0 3px 0 var(--shadow); font-weight: 700; transition: transform .08s, box-shadow .08s, background .15s; }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--shadow); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:active:not(:disabled) { background: var(--accent-press); }
.btn-ghost { background: var(--panel); border-color: var(--frame); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--panel-3); }
.btn-lg { height: 52px; }
.btn.is-busy::after { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
.btn-ghost.is-busy::after { border-color: var(--line-2); border-top-color: var(--ink); }
.eyebrow { border-radius: 8px; background: var(--sun); color: #0c1a55; border: 2px solid var(--frame); font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.chip { border-radius: 8px; border: 2px solid var(--line-2); background: var(--panel); color: var(--ink-2); }
.chip-blue { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.input, .textarea { border: 2px solid var(--line-2); border-radius: 8px; background: #e9f2fc; color: #0c1a55; }
[data-theme="dark"] .input, [data-theme="dark"] .textarea { background: var(--panel-2); color: var(--ink); }
.input:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.flabel { font-family: var(--mono); font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.seg-btn { border: 2px solid var(--line-2); border-radius: 8px; background: var(--panel); }
.seg-btn:hover { background: var(--panel-3); }
.seg-btn.on { background: var(--accent); border-color: var(--frame); color: #fff; }
.devbuy-cost { border: 2px dashed var(--line-2); background: var(--panel-2); border-radius: 8px; }

/* ---- cards, tiles, lists ---- */
.coin-card, .stat, .owned-card {
  border: 2px solid var(--frame); border-radius: var(--r-lg); background: var(--panel); box-shadow: 0 4px 0 var(--shadow);
}
.coin-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.coin-img { border-radius: 8px; }
.wall-tile { border: 2px solid var(--line-2); border-radius: 8px; background: var(--panel); }
.wall-tile:hover { border-color: var(--frame); }
.wall-tile.is-owned { background: var(--sun); border-color: var(--frame); }
.wall-tile.is-owned .wall-name, .wall-tile.is-owned .wall-tick { color: #0c1a55; }
.trow { border-radius: 8px; }
.trow:hover { background: var(--panel-3); }
.step-n { border-radius: 8px; background: var(--accent); border: 2px solid var(--frame); box-shadow: 0 3px 0 var(--shadow); font-family: var(--display); font-weight: 400; }
.facts li::before { border-radius: 0; background: var(--accent); width: 7px; height: 7px; top: 8px; }
.kv { border-bottom: 2px dashed var(--line); }
.ph-ic { border-radius: 10px; background: var(--sun); color: #0c1a55; border: 2px solid var(--frame); box-shadow: 0 3px 0 var(--shadow); }
.ca-bar { border: 2px solid var(--frame); border-radius: 10px; background: var(--panel); box-shadow: 0 3px 0 var(--shadow); }
.ca-bar-label { font-family: var(--display); font-size: 11px; }
.ca-pill { border: 2px solid var(--line-2); border-radius: 8px; background: var(--panel); }
.reveal-timer { border: 2px solid var(--frame); border-radius: 8px; background: var(--panel); }
.timer-chip { border-radius: 8px; border: 2px solid var(--frame); background: var(--sun); color: #0c1a55; }
.country-art, .coin-hero-art { border: 2px solid var(--frame); border-radius: var(--r-lg); background: var(--panel-2); }
.country-art svg, .country-art img, .coin-hero-art .coin-img { border-radius: 0; }
.launch-status { border: 2px dashed var(--line-2); border-radius: 8px; }
.launch-status.is-err { border-color: var(--down); }
.notice { border-radius: 8px; border: 2px solid var(--down); }
.flag { border-radius: 4px; box-shadow: 0 0 0 1.5px var(--frame); }
.toast { border: 2px solid var(--frame); border-radius: 10px; background: #0c1a55; color: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .35); }
.toast-err { background: var(--down); }
.globe-tip { border-radius: 8px; border: 2px solid var(--frame); background: #0c1a55; color: #fff; }
.tip-owned { background: var(--sun); color: #0c1a55; border-radius: 6px; }
.globe-hint { font-family: var(--mono); text-transform: uppercase; letter-spacing: .05em; font-size: 11px; }
.mobile-nav { background: var(--panel); border-top: 2px solid var(--frame); }
.mobile-nav a { border-radius: 8px; font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; }
.mobile-nav a.on { background: var(--accent); color: #fff; }

@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; grid-template-rows: auto auto auto; }
  .hero-copy { padding: 26px 24px 20px; }
  .hero-globe { padding: 8px 24px 24px; }
}
@media (max-width: 860px) {
  .hero-copy { padding: 22px 18px 16px; }
  .hero-addr { display: none; }
  .search::before { display: none; }
  .title { font-size: 20px; }
}
@media (max-width: 520px) {
  .hero-title { font-size: 26px; }
}

/* ==========================================================================
   Sidebar motion: it slides open and shut, labels fade, links hop on hover,
   and everything steps in on load. (reduced-motion turns all of it off)
   ========================================================================== */
.shell { transition: grid-template-columns .32s var(--ease); }
.sidebar { transition: padding .32s var(--ease); overflow-x: hidden; }
.logo-text, .side-link span, .side-cta .btn span, .side-bottom .side-label { max-width: 220px; white-space: nowrap; transition: opacity .18s ease, max-width .32s var(--ease); }
.side-card { max-height: 220px; transition: opacity .18s ease, max-height .32s var(--ease), margin .32s var(--ease); }
.side-draw { max-height: 96px; transition: opacity .18s ease, max-height .32s var(--ease); }
.side-link, .side-cta .btn { width: 100%; transition: width .32s var(--ease), padding .32s var(--ease), background .15s, border-color .15s, color .15s, transform .12s var(--ease), box-shadow .12s; }
html[data-side="rail"] .side-link, html[data-side="rail"] .side-cta .btn { width: 52px; }
.side-collapse { transition: left .32s var(--ease), transform .32s var(--ease), background .15s, color .15s; }
.side-collapse:hover { background: var(--sun); color: #0c1a55; }
.side-link:hover { transform: translateX(4px); }
.side-link:active { transform: translateX(4px) translateY(2px); }
.side-link.on { transform: none; }
.side-link .ic { transition: transform .2s var(--ease); }
.side-link:hover .ic { transform: scale(1.18) rotate(-6deg); }
.logo:hover .logo-img { animation: logo-hop .5s var(--ease); }
@keyframes logo-hop { 0% { transform: translateY(0); } 35% { transform: translateY(-7px) rotate(-4deg); } 65% { transform: translateY(0) rotate(2deg); } 100% { transform: none; } }
@keyframes side-in { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
.sidebar .logo, .sidebar .side-nav .side-link, .sidebar .side-cta, .sidebar .side-card, .sidebar .side-bottom { animation: side-in .45s var(--ease) both; }
.sidebar .side-nav .side-link:nth-child(1) { animation-delay: .05s; } .sidebar .side-nav .side-link:nth-child(2) { animation-delay: .1s; }
.sidebar .side-nav .side-link:nth-child(3) { animation-delay: .15s; } .sidebar .side-nav .side-link:nth-child(4) { animation-delay: .2s; }
.sidebar .side-cta { animation-delay: .27s; } .sidebar .side-card { animation-delay: .34s; } .sidebar .side-bottom { animation-delay: .4s; }
.side-link.on { animation: side-in .45s var(--ease) both, tab-pop .3s var(--ease) .1s; }
@keyframes tab-pop { 50% { box-shadow: 0 5px 0 var(--shadow); } }
.side-draw-in { animation: side-in .4s var(--ease) both; }

/* ---- collapsed sidebar (the 76px rail): icons dead-centre, the X and pump.fun buttons stay ---- */
html[data-side="rail"] .sidebar { padding: 18px 0; align-items: center; }
html[data-side="rail"] .logo { padding: 4px 0 16px; gap: 0; justify-content: center; width: 100%; }
html[data-side="rail"] .side-nav { align-items: center; width: 100%; }
html[data-side="rail"] .side-link, html[data-side="rail"] .side-cta .btn { gap: 0; width: 52px; padding: 0; justify-content: center; margin: 0 auto; }
html[data-side="rail"] .side-link span, html[data-side="rail"] .side-cta .btn span { margin: 0; padding: 0; }
html[data-side="rail"] .side-cta { width: 100%; display: flex; justify-content: center; }
html[data-side="rail"] .side-link:hover { transform: none; }
html[data-side="rail"] .side-card {
  margin-top: auto; width: 52px; max-width: 52px; border-width: 2px; padding: 4px 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
html[data-side="rail"] .side-card-row { flex-direction: column; align-items: center; padding: 2px 0; gap: 2px; width: 100%; }
html[data-side="rail"] .side-card-row + .side-card-row { border-top: 2px dashed var(--line-2); padding-top: 6px; margin-top: 2px; }
html[data-side="rail"] .side-card-row .grow { display: none; }
html[data-side="rail"] .side-card .icon-btn { width: 36px; height: 36px; }
html[data-side="rail"] .side-bottom { width: 100%; padding: 10px 0 0; justify-content: center; }
html[data-side="rail"] .toggle { padding: 3px; }
html[data-side="rail"] .side-draw-in { padding: 8px; justify-content: center; }
