:root {
  --bg: #0b0f19;
  --panel: rgba(255, 255, 255, 0.06);
  --panel2: rgba(255, 255, 255, 0.08);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.72);
  --muted2: rgba(255, 255, 255, 0.58);
  --border: rgba(255, 255, 255, 0.12);
  --accent: #6ee7ff;
  --accent2: #a78bfa;
  --danger: #ff4d6d;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica,
    Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(
      1200px 600px at 10% 10%,
      rgba(110, 231, 255, 0.18),
      transparent 55%
    ),
    radial-gradient(
      900px 500px at 90% 20%,
      rgba(167, 139, 250, 0.14),
      transparent 50%
    ),
    radial-gradient(
      900px 600px at 50% 90%,
      rgba(255, 77, 109, 0.12),
      transparent 60%
    ),
    var(--bg);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.headerCenter {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 4px 10px 0;
}

.brand {
  font-family: ui-rounded, "Segoe Print", "Segoe Script", "Bradley Hand", "Comic Sans MS", ui-sans-serif;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.8px;
  background: linear-gradient(90deg, rgba(255, 209, 102, 0.95), rgba(124, 92, 255, 0.95));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 10px 26px rgba(0,0,0,0.35);
}

h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0.3px;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.stats {
  display: flex;
  gap: 10px;
}

.stat {
  min-width: 100px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.label {
  font-size: 12px;
  color: var(--muted2);
  margin-bottom: 4px;
}

.value {
  font-size: 20px;
  font-weight: 700;
}

.game {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 16px;
  align-items: start;
}

canvas {
  width: 100%;
  height: auto;
  border-radius: 16px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.03)
  );
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  image-rendering: pixelated;
}

.panel {
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.status {
  padding: 12px;
  border-radius: 12px;
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 12px;
}

.buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

button {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 80ms ease, background 120ms ease;
}

button:hover {
  background: rgba(255, 255, 255, 0.10);
}

button:active {
  transform: translateY(1px);
}

button.primary {
  border-color: rgba(110, 231, 255, 0.35);
  background: linear-gradient(
    135deg,
    rgba(110, 231, 255, 0.18),
    rgba(167, 139, 250, 0.14)
  );
}

.helpTitle {
  font-size: 12px;
  color: var(--muted2);
  margin-bottom: 8px;
}

.helpText {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.footer {
  margin-top: 14px;
  color: var(--muted2);
  font-size: 12px;
}

@media (max-width: 900px) {
  .game {
    grid-template-columns: 1fr;
  }

  .stats {
    width: 100%;
    justify-content: flex-start;
  }
}
