:root {
  color-scheme: dark;
  --bg: #101215;
  --panel: #181d22;
  --panel-2: #20272e;
  --line: #35424d;
  --text: #f4f7f8;
  --muted: #aebac2;
  --green: #72d08d;
  --gold: #f4c95d;
  --red: #ff6f61;
  --blue: #79b8ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, rgba(121, 184, 255, .16), transparent 32rem),
    linear-gradient(135deg, #121416 0%, #182127 55%, #111418 100%);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  align-items: center;
}

.game-panel {
  display: grid;
  gap: 12px;
}

.topbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.topbar > div {
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(24, 29, 34, .92);
  border-radius: 8px;
  padding: 10px 12px;
}

.label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

canvas {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #20282b;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .28);
  touch-action: manipulation;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
}

button {
  border: 1px solid #4a5d69;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  min-height: 58px;
  padding: 9px 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button span,
button small {
  display: block;
}

button small {
  margin-top: 3px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
}

button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

button:not(:disabled):hover {
  border-color: var(--blue);
}

.ghost {
  min-width: 92px;
  color: var(--muted);
  background: rgba(24, 29, 34, .72);
}

@media (max-width: 700px) {
  .shell {
    padding: 10px;
    align-items: start;
  }

  .topbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  strong {
    font-size: 19px;
  }

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

  .ghost {
    width: 100%;
  }
}
