:root {
  --bg: #06080e;
  --panel: rgba(13, 17, 26, 0.82);
  --panel-2: rgba(19, 24, 37, 0.9);
  --line: rgba(255, 255, 255, 0.08);
  --line-bright: rgba(255, 255, 255, 0.16);
  --ink: #f3f6fc;
  --mute: #8892a8;
  --green: #18e279;
  --green-glow: rgba(24, 226, 121, 0.25);
  --gold: #f7c948;
  --gold-glow: rgba(247, 201, 72, 0.25);
  --cyan: #38bdf8;
  --cyan-glow: rgba(56, 189, 248, 0.25);
  --purple: #a855f7;
  --red: #f87171;
  --mono: 'IBM Plex Mono', monospace;
  --cond: 'Barlow Condensed', sans-serif;
  --sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, #06080e 0%, #090d16 50%, #06080e 100%);
  background-size: 24px 24px, 100% 100%;
  color: var(--ink);
  font-family: var(--sans);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

.bg-glow {
  position: fixed;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  filter: blur(130px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.22;
}
.bg-glow-1 { top: -180px; left: -120px; background: radial-gradient(circle, #18e279, transparent 70%); }
.bg-glow-2 { bottom: -180px; right: -120px; background: radial-gradient(circle, #f7c948, transparent 70%); }

/* ---------- TOPBAR ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: rgba(8, 11, 18, 0.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  gap: 14px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(24,226,121,0.16), rgba(247,201,72,0.14));
  border: 1px solid rgba(24,226,121,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-hen { width: 26px; height: 28px; image-rendering: pixelated; }
.pulse-ring {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulseDot 1.6s infinite;
}
@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.65; }
}

.brand-row { display: flex; align-items: center; gap: 8px; }
.brand b {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
}
.brand b span { color: var(--green); }
.net-badge {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(24, 226, 121, 0.12);
  color: var(--green);
  border: 1px solid rgba(24, 226, 121, 0.3);
}
.sub-tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  display: block;
}

.topbar-center {
  display: flex;
  align-items: center;
  gap: 10px;
}
.utc-clock-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  font-family: var(--mono);
}
.clock-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}
.utc-clock-box small { font-size: 10px; color: var(--mute); letter-spacing: 0.06em; }
.utc-clock-box b { font-size: 13px; color: var(--ink); font-weight: 600; }

.sync-box {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.24);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cyan);
  cursor: pointer;
  user-select: none;
  transition: 0.2s;
}
.sync-box:hover { background: rgba(56, 189, 248, 0.16); }
.sync-spin.spinning { display: inline-block; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wallet-chip, .lang-sel, .status-pill, .ov-btn {
  font-family: var(--mono);
  font-size: 11.5px;
  background: rgba(19, 24, 37, 0.85);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 6px 11px;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: 0.2s;
}
.wallet-chip b { color: var(--gold); }
.wallet-chip:hover, .ov-btn:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}
.w-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--mute); }
.status-pill.ok i { background: var(--green); box-shadow: 0 0 8px var(--green); }
.status-pill.err i { background: var(--red); }
.status-pill em { font-style: normal; }
.ov-btn {
  background: linear-gradient(135deg, rgba(56,189,248,0.15), rgba(168,85,247,0.15));
  border-color: rgba(56,189,248,0.35);
  color: #e0f2fe;
}

/* ---------- MAIN CONSOLE ---------- */
.console {
  position: relative;
  z-index: 1;
  max-width: 1560px;
  margin: 0 auto;
  padding: 20px 24px 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---------- HERO TELEMETRY STRIP ---------- */
.hero-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.kpi-card {
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}
.kpi-card:hover { transform: translateY(-2px); border-color: var(--line-bright); }
.kpi-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}
.kpi-card.highlight-green::before { background: linear-gradient(90deg, var(--green), transparent); }
.kpi-card.highlight-gold::before { background: linear-gradient(90deg, var(--gold), transparent); }
.kpi-card.highlight-cyan::before { background: linear-gradient(90deg, var(--cyan), transparent); }
.kpi-card.highlight-purple::before { background: linear-gradient(90deg, var(--purple), transparent); }

.kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.kpi-lbl {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mute);
}
.live-tag, .kpi-chip {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  border: 1px solid var(--line);
}
.live-tag {
  background: rgba(24, 226, 121, 0.14);
  color: var(--green);
  border-color: rgba(24, 226, 121, 0.3);
}
.kpi-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.kpi-main b {
  font-family: var(--cond);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  color: #fff;
}
.kpi-unit {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
}
.cd-pill {
  display: flex;
  align-items: baseline;
  gap: 6px;
  background: rgba(24, 226, 121, 0.1);
  border: 1px solid rgba(24, 226, 121, 0.25);
  padding: 4px 9px;
  border-radius: 8px;
}
.cd-pill small { font-family: var(--mono); font-size: 9.5px; color: var(--mute); }
.cd-pill span { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--green); }

.round-bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 8px;
}
.round-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #18e279, #38bdf8);
  border-radius: 99px;
  transition: width 0.4s ease;
}
.round-bar.gold i {
  background: linear-gradient(90deg, #f7c948, #f59e0b);
}
.kpi-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
}

/* ---------- PANELS ---------- */
.panel {
  background: var(--panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-title { display: flex; align-items: center; gap: 11px; }
.sq-icon { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.sq-icon.green { background: var(--green); box-shadow: 0 0 10px var(--green); }
.sq-icon.gold { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.sq-icon.cyan { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }

.panel-title h2 {
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
}
.panel-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  display: block;
  margin-top: 2px;
}
.panel-right { display: flex; align-items: center; gap: 8px; }

/* ---------- TABS ---------- */
.tabs {
  display: inline-flex;
  background: rgba(8, 11, 18, 0.85);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.tabs button {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  background: transparent;
  border: 0;
  padding: 5px 12px;
  cursor: pointer;
  border-radius: 6px;
  text-transform: uppercase;
  transition: 0.18s;
}
.tabs button:hover { color: var(--ink); }
.tabs button.active {
  background: linear-gradient(135deg, #38bdf8, #60a5fa);
  color: #050811;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.35);
}

/* ---------- 1. GREEN MOSAIC SETTLEMENT STRIP ---------- */
.mosaic-strip {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scrollbar-width: thin;
  scrollbar-color: #263044 transparent;
}
.mosaic-strip::-webkit-scrollbar { height: 6px; }
.mosaic-strip::-webkit-scrollbar-thumb { background: #263044; border-radius: 4px; }

.mosaic-card {
  flex: 0 0 340px;
  display: block;
  text-decoration: none;
  background: rgba(9, 13, 20, 0.92);
  border: 1px solid rgba(24, 226, 121, 0.25);
  border-radius: 12px;
  padding: 10px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.mosaic-card:hover {
  transform: translateY(-3px);
  border-color: var(--green);
  box-shadow: 0 8px 24px rgba(24, 226, 121, 0.18);
}
.mosaic-card svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ---------- 2. SQK MINT + SQK SUPPLY ROW ---------- */
.mint-supply-row {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 18px;
}

.mint-windows {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.mw-col {
  cursor: pointer;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  transition: 0.2s;
}
.mw-col:hover {
  border-color: var(--line-bright);
  background: rgba(255, 255, 255, 0.045);
}
.mw-col.active {
  background: linear-gradient(180deg, rgba(247, 201, 72, 0.12), rgba(247, 201, 72, 0.03));
  border-color: rgba(247, 201, 72, 0.45);
}
.mw-label {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--mute);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.mw-col.active .mw-label { color: var(--gold); }
.mw-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(247, 201, 72, 0.15);
  color: var(--gold);
}
.mw-delta { font-size: 10.5px; font-weight: 600; }
.mw-delta.up { color: var(--green); }
.mw-delta.down { color: var(--red); }

.mw-val {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 27px;
  line-height: 1.1;
  color: var(--ink);
  white-space: nowrap;
}
.mw-col.active .mw-val { color: var(--gold); }
.mw-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--mute);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* HEN + EGGS STAGE */
.hen-stage {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding-top: 12px;
  overflow-x: auto;
}
.hen-col {
  flex: 0 0 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hen-avatar-wrap {
  width: 88px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  filter: drop-shadow(0 6px 14px rgba(247, 201, 72, 0.18));
}
.hen-img {
  width: 82px;
  height: 90px;
  image-rendering: pixelated;
}
.hen-axis-lbl, .hen-axis-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  width: 100%;
  padding-top: 7px;
}
.hen-axis-lbl { border-top: 1px solid var(--line); }

.eggs-track {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(66px, 1fr));
  gap: 8px;
  align-items: end;
}
.egg-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 6px 4px;
  border-radius: 10px;
  transition: background 0.2s;
}
.egg-slot:hover { background: rgba(255, 255, 255, 0.035); }
.egg-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  min-height: 62px;
}
.egg-box img {
  width: 100%;
  height: 100%;
  display: block;
}
.egg-mark {
  position: absolute;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--mute);
  background: rgba(9, 12, 20, 0.85);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.egg-mark.filled {
  color: var(--gold);
  font-weight: 600;
  border-color: rgba(247, 201, 72, 0.4);
}
.egg-round {
  width: 100%;
  border-top: 1px solid var(--line);
  padding-top: 7px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink);
}
.egg-slot:first-child .egg-round { color: var(--gold); font-weight: 600; }
.egg-time {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--mute);
  margin-top: 4px;
}

/* ---------- 3. SQK SUPPLY PANEL ---------- */
.sqk-supply-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.supply-body {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 14px;
  align-items: center;
  flex: 1;
}
.supply-figures {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sup-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
}
.sup-card.gold-box {
  background: linear-gradient(135deg, rgba(247, 201, 72, 0.12), rgba(247, 201, 72, 0.02));
  border-color: rgba(247, 201, 72, 0.35);
}
.sup-lbl {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.sup-val-gold {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 30px;
  color: var(--gold);
  line-height: 1.1;
  white-space: nowrap;
}
.sup-bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}
.sup-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--green));
  border-radius: 99px;
}
.sup-val-total {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.sup-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.sup-mini {
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
}
.sup-mini small {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--mute);
  margin-bottom: 3px;
}
.sup-mini b {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
}

.supply-egg-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}
#supplyEggCanvas {
  width: 230px;
  height: 300px;
  display: block;
}
.supply-pct-line {
  position: absolute;
  left: -12px;
  right: 52%;
  border-bottom: 1.5px solid var(--gold);
  padding-bottom: 3px;
  pointer-events: none;
}
.supply-pct-line span {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gold);
  background: rgba(9, 13, 22, 0.9);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ---------- 4. BOTTOM ROW (WHEEL DISTANCE + LIVE EVENTS) ---------- */
.bottom-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 18px;
}
.facts-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.fact-pill {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 8px;
}
.fact-pill b { color: var(--ink); }

canvas#chart { width: 100%; display: block; }
.tip {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--gold);
  min-height: 18px;
  margin-top: 6px;
}

.heat-wrap { margin-top: 10px; }
.hrow {
  display: grid;
  grid-template-columns: 46px repeat(48, 1fr);
  gap: 2px;
  align-items: center;
  margin: 3px 0;
}
.hrow span { font-family: var(--mono); font-size: 10px; color: var(--mute); }
.hrow i {
  height: 11px;
  border-radius: 2px;
  background: rgba(24, 226, 121, var(--a, 0.08));
}
.hrow i.z { background: rgba(255, 255, 255, 0.04); }

.feed {
  list-style: none;
  max-height: 310px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-right: 4px;
}
.feed li {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12.5px;
  transition: border-color 0.2s;
}
.feed li:hover { border-color: var(--line-bright); }
.feed li b { display: block; font-weight: 600; }
.feed li small { font-family: var(--mono); font-size: 11px; color: var(--mute); }
.feed a { color: var(--ink); text-decoration: none; }
.feed a:hover { color: var(--green); }

.contracts-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.contracts-bar a {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--mute);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  padding: 4px 8px;
  border-radius: 6px;
  text-decoration: none;
  transition: 0.18s;
}
.contracts-bar a:hover { color: var(--gold); border-color: var(--gold); }

footer {
  position: relative;
  z-index: 1;
  max-width: 1560px;
  margin: 0 auto;
  padding: 18px 24px 32px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--mute);
}
footer a { color: var(--gold); text-decoration: none; }

/* OVERLAY MODE */
body.overlay { background: transparent !important; }
body.overlay .topbar, body.overlay .console, body.overlay footer, body.overlay .bg-glow { display: none; }
#overlay { position: fixed; left: 20px; right: 20px; bottom: 20px; display: flex; justify-content: space-between; align-items: flex-end; pointer-events: none; }
.ov-bar { display: flex; gap: 20px; align-items: center; background: rgba(9, 12, 18, 0.9); backdrop-filter: blur(12px); border: 1px solid rgba(24, 226, 121, 0.45); padding: 12px 20px; border-radius: 12px; }
.ov-bar small { display: block; font-family: var(--mono); font-size: 10px; color: var(--mute); }
.ov-bar b { font-family: var(--mono); font-size: 18px; color: var(--gold); }
.ov-feed { list-style: none; display: flex; flex-direction: column; gap: 6px; width: 320px; }
.ov-feed li { background: rgba(9, 12, 18, 0.88); border-left: 3px solid var(--green); padding: 7px 11px; border-radius: 6px; font-size: 12px; display: flex; gap: 8px; align-items: center; }

@media (max-width: 1180px) {
  .hero-strip { grid-template-columns: repeat(2, 1fr); }
  .mint-supply-row, .bottom-row { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .hero-strip, .mint-windows, .supply-body { grid-template-columns: 1fr; }
}
