:root {
  color-scheme: dark;
  --bg: #08090d;
  --ink: #f6f8ff;
  --muted: #94a0b8;
  --panel: rgba(14, 18, 28, 0.82);
  --line: rgba(255, 255, 255, 0.12);
  --pink: #ff3d9a;
  --cyan: #ffe082;
  --green: #7cff8b;
  --amber: #ffd166;
  --red: #ff5c5c;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 61, 154, 0.18), transparent 26rem),
    radial-gradient(circle at 88% 18%, rgba(55, 217, 255, 0.14), transparent 22rem),
    linear-gradient(180deg, #090b12 0%, #0c0f17 48%, #07080c 100%);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
  overflow-x: hidden;
}

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

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

#grid-canvas {
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  height: 42vh;
  z-index: 0;
  opacity: 0.58;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 22px;
  min-height: 78px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(8, 9, 13, 0.74);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid var(--ink);
  background: linear-gradient(135deg, var(--pink), var(--cyan));
  color: #05060a;
  font: 800 18px Space Mono, monospace;
  box-shadow: 4px 4px 0 #000;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.nav a,
.wallet-button,
.language-toggle,
.icon-button,
.primary-action,
.secondary-action {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.nav a {
  padding: 9px 12px;
  color: var(--muted);
  font-size: 13px;
}

.nav a:hover { color: var(--ink); border-color: rgba(255,255,255,.32); }

.wallet-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 118px;
  min-height: 42px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.language-toggle {
  min-width: 46px;
  min-height: 42px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 18px var(--red);
}

.wallet-button.connected .status-dot {
  background: var(--green);
  box-shadow: 0 0 18px var(--green);
}

main {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 480px);
  align-items: center;
  gap: clamp(28px, 6vw, 78px);
  min-height: calc(100vh - 78px);
  padding: 46px 0 60px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--green);
  font: 700 13px Space Mono, monospace;
  text-transform: uppercase;
}

h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(44px, 7.3vw, 92px);
  line-height: 0.92;
  letter-spacing: 0;
}

.lede {
  max-width: 620px;
  margin: 24px 0 0;
  color: #c8d0e2;
  font-size: clamp(16px, 1.8vw, 20px);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  font-weight: 800;
}

.primary-action {
  color: #08090d;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  border-color: transparent;
}

.secondary-action {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
}

.primary-action[href="#"],
.secondary-action[href="#"] {
  pointer-events: none;
  filter: grayscale(.8);
  opacity: .6;
}

.machine {
  position: relative;
  padding: 18px;
  background: linear-gradient(180deg, #2b3144, #121724);
  border: 2px solid rgba(255,255,255,.2);
  border-radius: 8px;
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.22);
}

.machine::before,
.machine::after {
  content: "";
  position: absolute;
  top: 34px;
  width: 18px;
  height: 120px;
  background: linear-gradient(180deg, var(--pink), transparent);
  filter: blur(10px);
}

.machine::before { left: -10px; }
.machine::after { right: -10px; background: linear-gradient(180deg, var(--cyan), transparent); }

.machine-screen {
  min-height: 430px;
  padding: 22px;
  background: #05070c;
  border: 1px solid rgba(124,255,139,.36);
  border-radius: 6px;
  box-shadow: inset 0 0 40px rgba(55,217,255,.12);
}

.screen-top,
.jackpot,
.buyer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font: 700 13px Space Mono, monospace;
  text-transform: uppercase;
}

.screen-top strong,
.jackpot strong,
.buyer strong {
  color: var(--ink);
  text-align: right;
  text-transform: none;
}

.timer {
  margin: 54px 0 46px;
  color: var(--green);
  font: 700 clamp(42px, 7vw, 72px) Space Mono, monospace;
  text-align: center;
  text-shadow: 0 0 22px rgba(124,255,139,.5);
}

.jackpot {
  margin-bottom: 18px;
  padding: 18px 0;
  border-top: 1px dashed rgba(255,255,255,.18);
  border-bottom: 1px dashed rgba(255,255,255,.18);
}

.machine-feet {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 14px 18px 0;
}

.machine-feet span {
  height: 8px;
  background: rgba(255,255,255,.16);
  border-radius: 999px;
}

.quick-stats,
.section-grid,
.manual {
  display: grid;
  gap: 14px;
}

.quick-stats {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 14px;
}

.quick-stats article,
.panel,
.manual-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.quick-stats article {
  min-height: 112px;
  padding: 18px;
}

.quick-stats span,
.wallet-data span,
.totals span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.quick-stats strong,
.wallet-data strong,
.totals strong {
  display: block;
  margin-top: 8px;
  font: 700 24px Space Mono, monospace;
}

.section-grid {
  grid-template-columns: 1fr 1fr;
  margin-top: 14px;
}

.panel {
  padding: 20px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  font-weight: 800;
}

.panel-title small {
  color: var(--muted);
  font-weight: 600;
}

.icon-button {
  width: 34px;
  height: 34px;
  color: var(--ink);
  background: rgba(255,255,255,.08);
  cursor: pointer;
}

.empty-state,
.activity-empty {
  color: var(--muted);
  line-height: 1.55;
}

.hidden { display: none !important; }

.wallet-data,
.totals {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.wallet-data > div,
.totals > div {
  min-height: 92px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  background: rgba(255,255,255,.04);
}

.claim {
  grid-column: 1 / -1;
  border: 0;
  cursor: pointer;
}

.activity-panel {
  margin-top: 14px;
}

.activity-list {
  display: grid;
  gap: 10px;
}

.activity-item {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  background: rgba(255,255,255,.04);
}

.activity-item strong {
  color: var(--green);
}

.activity-item span,
.activity-item a {
  color: var(--muted);
  font-size: 13px;
}

.manual {
  grid-template-columns: repeat(4, 1fr);
  margin: 14px 0 42px;
}

.manual-card {
  overflow: hidden;
}

.manual-card button {
  width: 100%;
  padding: 18px;
  color: var(--ink);
  text-align: left;
  font-weight: 800;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.manual-card p {
  margin: 0;
  padding: 0 18px 18px;
  color: var(--muted);
  line-height: 1.5;
}

footer {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  padding: 28px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

footer a { color: var(--ink); }

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr auto auto;
  }

  .nav { display: none; }

  .hero,
  .section-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 38px;
  }

  .quick-stats,
  .manual {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  main { width: min(100% - 22px, 1180px); }

  .topbar {
    min-height: 68px;
    padding: 10px 12px;
    gap: 10px;
  }

  .brand small { display: none; }
  .wallet-button { min-width: 96px; }

  h1 { font-size: 42px; }
  .quick-stats,
  .manual,
  .wallet-data,
  .totals {
    grid-template-columns: 1fr;
  }

  .machine-screen {
    min-height: 360px;
    padding: 16px;
  }

  .timer {
    margin: 42px 0 34px;
    font-size: 42px;
  }

  .activity-item {
    grid-template-columns: 1fr;
  }
}

/* BSC terminal skin */
:root {
  --bg: #0d0900;
  --ink: #fff8d6;
  --muted: #d8b84e;
  --panel: rgba(16, 11, 0, 0.94);
  --line: #f0b90b;
  --line-dim: rgba(240, 185, 11, 0.42);
  --primary: #f0b90b;
  --primary-bright: #ffd84d;
  --cyan: #ffe082;
  --green: #f0b90b;
  --red: #ff4d7d;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.5);
}

body {
  background:
    radial-gradient(circle at 12% 8%, rgba(240, 185, 11, 0.32), transparent 26rem),
    radial-gradient(circle at 88% 12%, rgba(255, 216, 77, 0.18), transparent 22rem),
    linear-gradient(180deg, #050300 0%, #0d0900 52%, #000000 100%);
  color: var(--primary-bright);
  font-family: "JetBrains Mono", "Microsoft YaHei", "Noto Sans SC", monospace;
}

.noise {
  opacity: 1;
  background: linear-gradient(to bottom, rgba(240, 185, 11, 0) 50%, rgba(240, 185, 11, 0.055) 50%);
  background-size: 100% 4px;
  z-index: 50;
}

.terminal-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  box-shadow: inset 0 0 160px rgba(240, 185, 11, 0.2);
}

#grid-canvas {
  opacity: .34;
}

.topbar {
  min-height: 64px;
  background: rgba(0, 0, 0, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--primary);
  color: #050300;
  box-shadow: 0 0 18px rgba(240, 185, 11, 0.65);
  font-family: "JetBrains Mono", monospace;
}

.brand strong {
  color: var(--ink);
  font-size: 18px;
  text-transform: uppercase;
  text-shadow: 0 0 9px rgba(255, 216, 77, 0.8);
}

.brand small,
.nav a,
.quick-stats span,
.wallet-data span,
.totals span,
.empty-state,
.activity-empty,
.manual-card p,
footer {
  color: rgba(255, 248, 214, 0.7);
}

.nav a {
  padding: 0;
  border: 0;
  border-radius: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.nav a:hover {
  color: var(--ink);
  text-shadow: 0 0 8px var(--primary-bright);
}

.wallet-button,
.language-toggle,
.primary-action,
.secondary-action,
.icon-button {
  border-color: var(--line);
  border-radius: 0;
  background: #000;
  color: var(--ink);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.wallet-button:hover,
.language-toggle:hover,
.secondary-action:hover,
.icon-button:hover {
  background: var(--primary);
  color: #050300;
}

.primary-action {
  background: var(--primary);
  color: #050300;
  box-shadow: 0 0 22px rgba(240, 185, 11, 0.45);
}

.primary-action:hover {
  background: var(--ink);
  color: var(--primary);
}

.status-dot {
  border-radius: 0;
}

main {
  width: min(1280px, calc(100% - 32px));
  padding: 32px 0;
}

.hero {
  min-height: auto;
  grid-template-columns: minmax(0, 7fr) minmax(360px, 5fr);
  margin-bottom: 32px;
}

.eyebrow {
  display: none;
}

.sys-lines {
  display: grid;
  gap: 6px;
  margin-bottom: 24px;
  color: rgba(255, 248, 214, 0.68);
  font-size: 12px;
  font-weight: 700;
}

h1 {
  color: var(--ink);
  font-size: clamp(32px, 5vw, 64px);
  line-height: 1.05;
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(240, 185, 11, 0.75);
}

.lede {
  color: rgba(255, 248, 214, 0.78);
  font-size: 16px;
  font-family: "JetBrains Mono", monospace;
}

.terminal-box,
.quick-stats article,
.panel,
.manual-card,
.machine {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 28px;
  margin: -1px -1px 0;
  padding: 4px 9px;
  background: var(--primary);
  color: #050300;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
}

.machine {
  padding: 0;
}

.machine::before,
.machine::after {
  content: none;
}

.machine-screen {
  min-height: 420px;
  padding: clamp(20px, 3vw, 32px);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.screen-top,
.jackpot,
.buyer {
  color: rgba(255, 248, 214, 0.66);
}

.screen-top strong,
.jackpot strong,
.buyer strong,
.quick-stats strong,
.wallet-data strong,
.totals strong {
  color: var(--ink);
  text-shadow: 0 0 9px rgba(240, 185, 11, 0.65);
}

.timer {
  color: var(--ink);
  font-size: clamp(44px, 5vw, 66px);
  text-shadow: 0 0 14px var(--primary), 0 0 28px rgba(255, 216, 77, 0.45);
}

.jackpot {
  border-color: var(--line-dim);
}

.machine-feet span,
.bars i {
  background: var(--line);
  border-radius: 0;
}

.quick-stats article {
  min-height: 0;
  padding: 0;
}

.quick-stats article > span,
.quick-stats article > strong {
  padding-left: 22px;
  padding-right: 22px;
}

.quick-stats article > span {
  padding-top: 22px;
}

.quick-stats article > strong {
  padding-bottom: 22px;
}

.panel-title {
  margin: -21px -21px 24px;
  min-height: 28px;
  padding: 4px 9px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  text-transform: uppercase;
}

.panel-title small {
  color: #fff;
}

.panel {
  padding: 20px;
}

.empty-state,
.activity-empty {
  border: 1px dashed var(--line-dim);
  border-radius: 0;
  background: transparent;
  text-transform: uppercase;
}

.wallet-data > div,
.totals > div,
.activity-item {
  border: 1px solid var(--line-dim);
  border-radius: 0;
  background: rgba(240, 185, 11, 0.055);
}

.manual-card {
  overflow: hidden;
}

.manual-card button {
  color: var(--ink);
  font-weight: 800;
  text-transform: uppercase;
}

footer {
  background: #000;
  border-top-color: var(--line);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

footer a {
  color: var(--ink);
}
