:root {
  --bg: #070b12;
  --panel: #0e1522;
  --panel-2: #121b2c;
  --line: rgba(94, 234, 212, 0.16);
  --cyan: #5eead4;
  --emerald: #34d399;
  --amber: #fbbf24;
  --rose: #fb7185;
  --ink: #e8eef8;
  --muted: #8b9bb3;
  --display: "Space Grotesk", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--display);
  background:
    radial-gradient(ellipse 70% 50% at 15% -10%, rgba(52, 211, 153, 0.12), transparent),
    radial-gradient(ellipse 50% 40% at 90% 0%, rgba(94, 234, 212, 0.08), transparent),
    var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--cyan); text-underline-offset: 3px; }
a:hover { color: var(--emerald); }

.wrap { width: min(1140px, 92%); margin-inline: auto; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 0;
  flex-wrap: wrap;
}
.brand {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}
.brand small {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--emerald);
  margin-bottom: 0.15rem;
  font-weight: 600;
}
.nav { display: flex; flex-wrap: wrap; gap: 0.85rem 1.1rem; list-style: none; }
.nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
}
.nav a:hover { color: var(--ink); }

.badge-game {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
}
.badge-game::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.hero {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  min-height: min(72vh, 580px);
  background: var(--panel);
  margin-bottom: 1.25rem;
}
.hero img {
  width: 100%;
  height: min(72vh, 580px);
  object-fit: cover;
  opacity: 0.55;
  animation: drift 20s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: scale(1.02); }
  to { transform: scale(1.08) translateY(-1%); }
}
.hero-copy {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(1.4rem, 4vw, 2.8rem);
  background: linear-gradient(transparent 15%, rgba(7, 11, 18, 0.92) 68%);
}
.hero-copy h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  max-width: 14ch;
  margin: 0.7rem 0 0.75rem;
}
.hero-copy p {
  max-width: 46ch;
  color: var(--muted);
  margin-bottom: 1.2rem;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  transition: transform 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, var(--emerald), var(--cyan));
  color: #04110d;
}
.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(255,255,255,0.03);
}

.warn {
  border: 1px solid rgba(251, 191, 36, 0.28);
  background: rgba(251, 191, 36, 0.07);
  color: #fde68a;
  padding: 0.95rem 1.1rem;
  border-radius: 14px;
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
}

.game-shell {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1rem;
  margin-bottom: 2rem;
}
@media (max-width: 900px) {
  .game-shell { grid-template-columns: 1fr; }
}

.game-panel, .side-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
.game-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.game-head h2 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.78rem;
}
.stat {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  color: var(--muted);
}
.stat b { color: var(--ink); font-weight: 600; }
.stat.up b { color: var(--emerald); }
.stat.down b { color: var(--rose); }

#market {
  width: 100%;
  height: 420px;
  display: block;
  background: #080e18;
  cursor: crosshair;
  touch-action: none;
}

.controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
  padding: 0.9rem;
  border-top: 1px solid var(--line);
}
@media (max-width: 700px) {
  .controls { grid-template-columns: 1fr 1fr; }
}
.controls .btn { width: 100%; }
.btn-buy { background: rgba(52, 211, 153, 0.15); color: var(--emerald); border-color: rgba(52, 211, 153, 0.35); }
.btn-sell { background: rgba(251, 113, 133, 0.12); color: var(--rose); border-color: rgba(251, 113, 133, 0.35); }
.btn-bot { background: rgba(94, 234, 212, 0.1); color: var(--cyan); border-color: rgba(94, 234, 212, 0.3); }
.btn-reset { background: transparent; color: var(--muted); border-color: var(--line); }

.side-panel { padding: 1rem; }
.side-panel h3 {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.side-panel p, .side-panel li {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.55rem;
}
.side-panel ul { margin-left: 1.1rem; margin-bottom: 1rem; }
.log {
  font-family: var(--mono);
  font-size: 0.72rem;
  max-height: 220px;
  overflow: auto;
  display: grid;
  gap: 0.35rem;
}
.log div {
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
}
.log .buy { color: var(--emerald); }
.log .sell { color: var(--rose); }
.log .sys { color: var(--cyan); }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  margin: 1.5rem 0 2rem;
}
@media (max-width: 800px) { .grid-3 { grid-template-columns: 1fr; } }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.15rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s;
}
.card:hover { border-color: rgba(94, 234, 212, 0.45); transform: translateY(-3px); }
.card h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.card p { color: var(--muted); font-size: 0.9rem; }

.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.25rem;
  align-items: center;
  margin: 2rem 0;
}
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }
.split img { border-radius: 16px; border: 1px solid var(--line); }
.split h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); letter-spacing: -0.03em; margin-bottom: 0.7rem; }
.split p { color: var(--muted); margin-bottom: 0.7rem; }

.page { width: min(760px, 92%); margin: 1.5rem auto 3rem; }
.page h1 { font-size: 2rem; letter-spacing: -0.03em; margin-bottom: 1rem; }
.page h2 { font-size: 1.25rem; margin: 1.4rem 0 0.55rem; color: var(--cyan); }
.page p, .page li { color: var(--muted); margin-bottom: 0.7rem; }
.page ul { margin-left: 1.2rem; }

.form { display: grid; gap: 0.7rem; max-width: 480px; }
.form label { font-size: 0.88rem; font-weight: 600; }
.form input, .form textarea {
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
}

.footer {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.footer a { color: var(--cyan); text-decoration: none; }
.foot-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 720px) { .foot-grid { grid-template-columns: 1fr; } }
.footer h4 { color: var(--ink); margin-bottom: 0.5rem; }

.rise { opacity: 0; transform: translateY(14px); transition: 0.65s ease; }
.rise.on { opacity: 1; transform: none; }
