:root {
  color-scheme: dark;
  --bg: #080a0d;
  --panel: #12161b;
  --ink: #f3f0e8;
  --muted: #8f9aa3;
  --line: #26313a;
  --cyan: #43f4ff;
  --red: #ff4c5e;
  --gold: #f6c945;
  --green: #72e08a;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(115deg, rgba(67, 244, 255, 0.12), transparent 32%),
    radial-gradient(circle at 78% 20%, rgba(246, 201, 69, 0.12), transparent 24%),
    linear-gradient(180deg, #0d1114 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: "Trebuchet MS", "Gill Sans", Verdana, sans-serif;
}

button {
  font: inherit;
}

.shell {
  display: grid;
  width: min(1180px, calc(100vw - 32px));
  height: min(720px, calc(100vh - 32px));
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
}

.stage {
  position: relative;
  overflow: hidden;
  min-width: 0;
  border: 1px solid rgba(243, 240, 232, 0.18);
  border-radius: 8px;
  background: #090d10;
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.46);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.curtain {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 32px;
  text-align: center;
  background:
    linear-gradient(90deg, rgba(8, 10, 13, 0.96), rgba(8, 10, 13, 0.72)),
    repeating-linear-gradient(0deg, rgba(67, 244, 255, 0.08) 0 1px, transparent 1px 16px);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.curtain.hidden {
  visibility: hidden;
  opacity: 0;
}

.kicker {
  margin: 0 0 12px;
  color: var(--cyan);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  max-width: 620px;
  margin: 0 0 24px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 7vw, 5.8rem);
  font-weight: 700;
  line-height: 0.95;
}

#startButton {
  min-width: 168px;
  min-height: 48px;
  border: 1px solid rgba(67, 244, 255, 0.64);
  border-radius: 4px;
  background: var(--cyan);
  color: #061012;
  cursor: pointer;
  font-weight: 800;
  text-transform: uppercase;
  box-shadow: 0 0 26px rgba(67, 244, 255, 0.28);
}

#startButton:hover {
  filter: brightness(1.08);
}

.panel {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(243, 240, 232, 0.16);
  border-radius: 8px;
  background: rgba(18, 22, 27, 0.86);
}

.label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.value {
  margin: 0;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 4.4rem;
  line-height: 0.9;
}

.small-value {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
}

.meter {
  height: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #07090b;
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--cyan));
  transition: width 120ms ease;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.controls {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: #c6ced5;
  font-size: 0.95rem;
  line-height: 1.45;
}

.controls p {
  margin: 0 0 12px;
}

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

  .shell {
    height: auto;
    min-height: calc(100vh - 24px);
    grid-template-columns: 1fr;
    grid-template-rows: minmax(420px, 68vh) auto;
    width: calc(100vw - 24px);
  }

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

  .controls {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .shell {
    grid-template-rows: minmax(360px, 62vh) auto;
  }

  .panel,
  .stats {
    grid-template-columns: 1fr;
  }

  .value {
    font-size: 3.2rem;
  }
}
