:root {
  color-scheme: dark;
  --bg: #070a12;
  --card: rgba(255, 255, 255, 0.06);
  --card2: rgba(255, 255, 255, 0.08);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.70);
  --line: rgba(255, 255, 255, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1000px 700px at 25% 10%, rgba(66, 92, 255, 0.20), transparent 60%),
    radial-gradient(900px 620px at 70% 20%, rgba(255, 92, 160, 0.16), transparent 60%),
    linear-gradient(180deg, #070a12 0%, #05060c 100%);
  color: var(--text);
  overflow: hidden;
}

.topbar {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbarInner {
  display: grid;
  grid-template-columns: 240px 1fr auto;
  gap: 14px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.brandTitle {
  font-weight: 1000;
  letter-spacing: 0.6px;
  font-size: 22px;
  line-height: 1;
}

.brandSub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 750;
}

.hud {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hudItem {
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  min-width: 96px;
}

.hudItem .label {
  font-size: 12px;
  color: var(--muted);
}

.hudItem .value {
  font-size: 18px;
  font-weight: 1000;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 850;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn.primary {
  background: rgba(66, 92, 255, 0.24);
  border-color: rgba(66, 92, 255, 0.40);
}

.layout {
  display: grid;
  grid-template-columns: 250px 1fr 300px;
  gap: 16px;
  padding: 16px;
  max-width: 1200px;
  margin: 0 auto;
  height: calc(100vh - 92px - 74px);
}

.left,
.right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 100%;
  overflow: auto;
}

.panel {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 16px;
  padding: 12px;
}

.panel.muted {
  background: rgba(255, 255, 255, 0.04);
}

.panelTitle {
  font-weight: 1000;
  margin-bottom: 8px;
}

.panelFoot {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.stage {
  position: relative;
  height: 100%;
  display: flex;
}

.canvasWrap {
  position: relative;
  width: 100%;
  height: 100%;
}

#c {
  width: 100%;
  height: auto;
  aspect-ratio: 720 / 920;
  max-height: 100%;
  max-width: 100%;
  display: block;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.hidden {
  display: none;
}

.overlayCard {
  width: min(420px, 92%);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  padding: 18px;
  text-align: center;
}

.overlayTitle {
  font-size: 34px;
  font-weight: 1000;
  letter-spacing: 0.4px;
}

.overlayText {
  margin-top: 8px;
  color: var(--muted);
}

.bottombar {
  border-top: 1px solid var(--line);
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
}

.bottombarInner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.hint {
  color: rgba(255, 255, 255, 0.70);
  font-size: 12px;
  font-weight: 700;
}

.boosterGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.levelList {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.levelBtn {
  padding: 9px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.18);
  color: rgba(255, 255, 255, 0.92);
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.levelBtn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.levelBtn.active {
  background: rgba(66, 92, 255, 0.22);
  border-color: rgba(66, 92, 255, 0.42);
}

.levelTag {
  font-size: 11px;
  font-weight: 1000;
  padding: 3px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.78);
}

.booster {
  width: 100%;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  cursor: pointer;
  color: rgba(255, 255, 255, 0.9);
}

.booster:hover {
  background: rgba(255, 255, 255, 0.06);
}

.boosterIcon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 18px;
}

.boosterName {
  font-weight: 1000;
  font-size: 14px;
}

.boosterDesc {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  font-weight: 750;
}

.coachText {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.82);
  font-weight: 680;
  line-height: 1.5;
  font-size: 13px;
  min-height: 64px;
}

.bins {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.bin {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.18);
  padding: 10px;
}

.binHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.binName {
  font-weight: 1000;
}

.binCap {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 850;
  font-size: 12px;
}

.binSlots {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.slot {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  position: relative;
  --slotColor: rgba(255, 255, 255, 0.28);
}

.slot::before {
  content: '';
  position: absolute;
  inset: 18% 18% 34% 18%;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.30), rgba(0, 0, 0, 0.18) 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(0, 0, 0, 0.20));
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 8px 10px rgba(0, 0, 0, 0.35);
}

.slot::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 56%;
  width: 32%;
  height: 32%;
  transform: translate(-50%, -50%);
  background:
    linear-gradient(90deg, transparent 44%, rgba(255, 255, 255, 0.80) 44%, rgba(255, 255, 255, 0.80) 56%, transparent 56%),
    linear-gradient(0deg, transparent 44%, rgba(255, 255, 255, 0.80) 44%, rgba(255, 255, 255, 0.80) 56%, transparent 56%);
  opacity: 0.22;
}

.slot.filled {
  background: rgba(0, 0, 0, 0.22);
  border-color: rgba(255, 255, 255, 0.16);
  --slotColor: rgba(255, 255, 255, 0.92);
}

.slot.filled::before {
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.35), rgba(0, 0, 0, 0.18) 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--slotColor) 86%, white 14%), color-mix(in srgb, var(--slotColor) 70%, black 30%));
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 14px rgba(0, 0, 0, 0.42);
}

.slot.filled::after {
  opacity: 0.38;
}

.stats {
  display: grid;
  gap: 6px;
}

.statRow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.statRow:last-child {
  border-bottom: 0;
}

.statLabel {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 850;
}

.statValue {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 1000;
}

@media (max-width: 1020px) {
  body {
    overflow: auto;
  }

  .layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .topbarInner {
    grid-template-columns: 1fr;
  }

  #c {
    max-width: 820px;
  }
}
