:root {
  --bg: #090c13;
  --ink: #eef1f6;
  --mute: #8b93a5;
  --rule: rgba(255, 255, 255, 0.1);
  --loss: #ff7433;
  --gain: #4ea8ff;
}

[hidden] {
  display: none !important;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

#app {
  position: relative;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 45%, #111724 0%, var(--bg) 72%);
}

#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

.head {
  position: absolute;
  left: 24px;
  top: 18px;
  right: 380px;
  pointer-events: none;
}

.kicker {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}

h1 {
  margin: 6px 0 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.sub {
  margin: 6px 0 0;
  max-width: 560px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--mute);
}

.readout {
  position: absolute;
  right: 24px;
  top: 18px;
  width: 340px;
  text-align: right;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.when {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: end;
  gap: 18px;
  margin-top: 8px;
}

.stats > div {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.lab {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
}

.val {
  font-size: 20px;
  font-weight: 700;
  margin-top: 2px;
  white-space: nowrap;
}

.val.loss { color: var(--loss); }
.val.gain { color: var(--gain); }

.controls {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.group {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--rule);
  border-radius: 999px;
}

button {
  font: inherit;
  color: inherit;
}

.play {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--ink);
  color: var(--bg);
  font-size: 15px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.chip {
  border: 0;
  background: transparent;
  color: var(--mute);
  font-size: 12px;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.chip:hover { color: var(--ink); }

.chip.on {
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
}

.chip.toggle {
  border: 1px solid var(--rule);
  padding: 8px 12px;
}

.chip.toggle:not(.on) { text-decoration: line-through; }

button:focus-visible {
  outline: 2px solid var(--gain);
  outline-offset: 2px;
}

.legend {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--mute);
  white-space: nowrap;
}

.legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-left: 8px;
}

.legend i.loss { background: var(--loss); }
.legend i.gain { background: var(--gain); }

.note {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 72px;
  font-size: 12px;
  color: var(--ink);
  background: rgba(255, 116, 51, 0.16);
  border: 1px solid rgba(255, 116, 51, 0.45);
  padding: 6px 12px;
  border-radius: 8px;
  max-width: calc(100% - 48px);
  text-align: center;
}

.cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(9, 12, 19, 0.55);
}

.big {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 0;
  background: var(--ink);
  color: var(--bg);
  font-size: 34px;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 10px rgba(78, 168, 255, 0.18);
}

.big span { margin-left: 6px; }

.coverText {
  margin-top: 10px;
  font-size: 18px;
  font-weight: 600;
}

.coverSub {
  font-size: 13px;
  color: var(--mute);
}

.foot {
  position: absolute;
  right: 24px;
  bottom: 62px;
  font-size: 10px;
  color: rgba(139, 147, 165, 0.6);
  pointer-events: none;
}

.error {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 45%;
  text-align: center;
  color: var(--loss);
  font-size: 14px;
}

@media (max-width: 760px) {
  .head { right: 16px; left: 16px; top: 14px; }
  h1 { font-size: 21px; }
  .sub { font-size: 12.5px; }
  .readout {
    left: 16px;
    right: 16px;
    width: auto;
    top: var(--readout-top, 150px);
    text-align: left;
  }
  .stats { justify-content: start; gap: 14px; grid-template-columns: repeat(4, auto); }
  .stats > div { align-items: flex-start; }
  .val { font-size: 16px; }
  .when { font-size: 13px; }
  .controls { left: 12px; right: 12px; gap: 6px; }
  .legend { margin-left: 0; width: 100%; }
  .legend i:first-child { margin-left: 0; }
  .foot { display: none; }
  .note { bottom: 120px; }
}
