:root {
  color-scheme: dark;
  --ink: #f7f1df;
  --muted: #b8b3a4;
  --line: rgba(247, 241, 223, 0.16);
  --panel: rgba(18, 23, 35, 0.9);
  --green: #78e08f;
  --gold: #f9c846;
  --cyan: #55e6ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(120, 224, 143, 0.18), transparent 26%),
    radial-gradient(circle at 82% 18%, rgba(85, 230, 255, 0.14), transparent 26%),
    linear-gradient(135deg, #081018, #121a2b 56%, #080c14);
}

button,
input {
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

button {
  min-height: 44px;
  padding: 0.72rem 0.9rem;
  color: var(--ink);
  background: #232a37;
  font-weight: 900;
  cursor: pointer;
}

button:hover {
  border-color: var(--green);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--green);
}

.primary {
  color: #101319;
  background: linear-gradient(135deg, var(--green), var(--gold));
}

.snakeApp {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: 14px;
}

.arena {
  min-width: 0;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1420;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.snakeControls {
  display: grid;
  align-content: start;
  gap: 12px;
  overflow: auto;
}

.sideHeader,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
  backdrop-filter: blur(16px);
}

.panel {
  display: grid;
  gap: 10px;
}

.panel button {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.kicker {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 1000;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.45rem;
  line-height: 1.05;
}

h2 {
  font-size: 1rem;
}

p {
  color: var(--muted);
  line-height: 1.42;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 850;
}

label span {
  color: var(--gold);
}

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

.scoreStrip span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.58rem 0.64rem;
  color: var(--muted);
  background: rgba(9, 13, 23, 0.72);
}

.scoreStrip strong {
  display: block;
  color: var(--ink);
  font-size: 1.35rem;
}

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

  .snakeApp {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100dvh;
  }

  canvas {
    height: min(62vh, 560px);
  }
}
