:root {
  --bg: #070808;
  --panel: #0b1014;
  --panel-2: #10171c;
  --line: #1c2a32;
  --line-2: #484b51;
  --lime: #d0ff00;
  --lime-dim: #b6e000;
  --gold: #f5c542;
  --gold-2: #ffd978;
  --muted: #8b97a0;
  --text: #eef3f6;
  --danger: #ff6b4a;
  --ok: #3ee0a0;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans SC", "JetBrains Mono", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(245, 197, 66, 0.08), transparent 55%),
    var(--bg);
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line-2);
  background: #070808;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--lime);
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
  flex: 0 0 auto;
}

.tabs {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #14180a;
  box-shadow: 0 0 0 1px rgba(208, 255, 0, 0.25);
}

.tabs {
  display: flex;
  gap: 18px;
}

.tab {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.12em;
  font-family: "JetBrains Mono", monospace;
}

.tab.active {
  color: var(--text);
  border-bottom: 2px solid var(--text);
  padding-bottom: 6px;
}

.top-actions,
.ammo,
.control-bar,
.panel-head,
.wallet-meta {
  display: flex;
  align-items: center;
}

.top-actions {
  gap: 8px;
}

.ghost,
.back,
.full-btn,
.ammo button {
  background: #14181b;
  color: var(--text);
  border: 1px solid #2a3338;
  border-radius: 10px;
}

.ghost,
.full-btn {
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.ghost:hover,
.ammo button:hover,
.full-btn:hover,
.back:hover {
  border-color: #4b5560;
}

.subhead {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px 8px;
  position: relative;
}

.subhead h1 {
  margin: 0;
  font-size: clamp(15px, 2.4vw, 28px);
  letter-spacing: 0.08em;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.cursor {
  color: var(--lime);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.back {
  width: 36px;
  height: 36px;
  position: absolute;
  left: 18px;
  top: 12px;
  z-index: 2;
}

.creator-row {
  margin: 0 16px 10px;
  padding: 8px 14px;
  border-radius: 8px;
  background: #101416;
  color: var(--muted);
  font-size: 13px;
}

.stage {
  position: relative;
  margin: 0 16px;
  height: min(68vh, 720px);
  min-height: 420px;
  border-radius: 18px;
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--shadow);
  border: 1px solid #1a2428;
  user-select: none;
}

.stage.is-full {
  position: fixed;
  inset: 0;
  z-index: 40;
  margin: 0;
  height: 100vh;
  min-height: 100vh;
  border-radius: 0;
}

#mine {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.stage-copy {
  position: absolute;
  top: 16px;
  left: 18px;
  z-index: 2;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
}

.stage-copy h2 {
  margin: 0;
  font-size: 22px;
}

.stage-copy p {
  margin: 6px 0 10px;
  color: #d5e0e6;
  font-size: 13px;
  max-width: 420px;
}

.risk {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(62, 224, 160, 0.12);
  color: var(--ok);
  font-size: 12px;
  border: 1px solid rgba(62, 224, 160, 0.28);
}

.pool-card,
.mag-chip {
  position: absolute;
  z-index: 2;
  background: rgba(8, 14, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border-radius: 14px;
}

.pool-card {
  top: 92px;
  left: 18px;
  padding: 10px 14px 12px;
  min-width: 168px;
}

.pool-card span,
.mag-chip {
  color: var(--muted);
  font-size: 12px;
}

.pool-card strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  letter-spacing: 0.02em;
}

.pool-card em,
.stats b i,
#scenePool {
  font-style: normal;
  font-family: "JetBrains Mono", monospace;
  color: var(--gold-2);
}

.mag-chip {
  top: 16px;
  right: 86px;
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 6px;
}

.full-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
}

.drop-hint {
  position: absolute;
  left: 50%;
  bottom: 78px;
  transform: translateX(-50%);
  z-index: 2;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(8, 14, 18, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #d7e0e6;
  font-size: 12px;
  letter-spacing: 0.04em;
  pointer-events: none;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.ghost.is-muted {
  color: var(--muted);
}

.control-bar {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 3;
  gap: 14px;
  padding: 8px 8px 8px 8px;
  background: rgba(10, 16, 20, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  max-width: calc(100% - 24px);
  flex-wrap: wrap;
  justify-content: center;
}

.ammo {
  gap: 4px;
}

.ammo button {
  min-width: 36px;
  height: 36px;
  border-radius: 10px;
}

.ammo button.active {
  background: #20262b;
  color: var(--lime);
  border-color: #4a5a22;
}

.cost {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.cta {
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--lime);
  color: #111;
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.cta:hover {
  background: var(--lime-dim);
}

.cta:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.board {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(280px, 1fr) minmax(280px, 360px);
  gap: 14px;
  padding: 16px;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stats article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.stats article {
  padding: 14px 16px 16px;
}

.stats span,
.panel h3 {
  color: var(--muted);
  font-size: 13px;
}

.stats b {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.panel {
  padding: 16px;
  min-height: 240px;
}

.panel h3 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 16px;
}

.panel-head {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.panel-head h3 {
  margin: 0;
}

.wallet-meta {
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  flex-wrap: wrap;
}

code {
  font-family: "JetBrains Mono", monospace;
  color: #c9d4dc;
}

.empty {
  color: var(--muted);
  padding: 18px 0 8px;
}

.mag-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}

.shot {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.shot .ore {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
}

.shot .meta small {
  color: var(--muted);
}

.shot .pay {
  font-family: "JetBrains Mono", monospace;
  color: var(--gold);
}

.shot button {
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 0;
  background: var(--lime);
  color: #111;
  font-weight: 700;
}

.shot.miss .pay {
  color: var(--muted);
}

.claim-all {
  margin-top: 12px;
  width: 100%;
}

.catalog {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.catalog th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.catalog td {
  padding: 10px 0;
  border-bottom: 1px solid #151d22;
}

.ore-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 10px currentColor;
}

.rules {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  margin: 12px 0 0;
}

.foot {
  padding: 4px 18px 20px;
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 50;
  background: #111;
  color: var(--text);
  border: 1px solid #333;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

@media (max-width: 1080px) {
  .board {
    grid-template-columns: 1fr;
  }

  .back {
    position: static;
  }

  .subhead {
    justify-content: flex-start;
  }

  .cost {
    display: none;
  }

  .mag-chip {
    right: 16px;
    top: 58px;
  }
}
