:root {
  color-scheme: light;
  --ink: #182033;
  --paper: #fff7df;
  --accent: #e54b4b;
  --accent-dark: #a72d3a;
  --panel: rgba(255, 247, 223, 0.92);
}

@font-face {
  font-family: "Pixelon";
  src: url("src/assets/font/Pixelon.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Pixelon", "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(180deg, #79d1ff 0%, #f8d878 52%, #74b566 100%);
}

button,
input {
  font: inherit;
}

.game-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2vh 2vw;
}

.game-panel {
  position: relative;
  width: min(90vw, 160vh);
  max-width: 1728px;
  aspect-ratio: 16 / 9;
  border: 4px solid #182033;
  border-radius: 8px;
  overflow: hidden;
  background: #79d1ff;
  box-shadow: 0 20px 60px rgba(24, 32, 51, 0.35);
}

.game-panel:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  border: 0;
  border-radius: 0;
  background: #182033;
  display: grid;
  place-items: center;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: auto;
}

.game-panel:fullscreen canvas {
  width: min(100vw, 177.7778vh);
  height: min(56.25vw, 100vh);
}

.fullscreen-button {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 5;
  min-width: 0;
  width: 60px;
  height: 42px;
  padding: 0;
  border: 0;
  color: transparent;
  background: transparent;
  box-shadow: none;
}

.fullscreen-button:hover,
.fullscreen-button:focus-visible {
  background: rgba(255, 247, 223, 0.18);
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 28px;
  text-align: center;
  background: var(--panel);
}

.overlay.hidden {
  display: none;
}

.overlay.fade-in {
  animation: overlayFadeIn 420ms ease-out both;
}

@keyframes overlayFadeIn {
  from {
    opacity: 0;
    transform: scale(1.02);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(42px, 8vw, 76px);
}

h2 {
  font-size: clamp(34px, 6vw, 54px);
}

button {
  min-width: 150px;
  border: 0;
  border-radius: 6px;
  padding: 10px 16px;
  color: white;
  background: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

.designer-link {
  min-width: 150px;
  border-radius: 6px;
  padding: 10px 16px;
  color: #182033;
  background: rgba(255, 255, 255, 0.75);
  font-weight: 700;
  text-decoration: none;
}

button:hover,
button:focus-visible {
  background: var(--accent-dark);
}

input {
  width: 160px;
  border: 2px solid #182033;
  border-radius: 6px;
  padding: 8px;
  text-align: center;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.slider-row {
  width: min(100%, 420px);
  grid-template-columns: 1fr;
  text-align: left;
}

.slider-row input {
  width: 100%;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 720px;
}

.controls span {
  border: 2px solid rgba(24, 32, 51, 0.18);
  border-radius: 6px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.55);
}

.level-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  width: min(100%, 640px);
}

.level-list button {
  min-width: 0;
  min-height: 68px;
  display: grid;
  gap: 4px;
  align-content: center;
}

.level-list small {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.76em;
}

.level-list button:disabled {
  color: rgba(24, 32, 51, 0.58);
  background: rgba(255, 255, 255, 0.58);
  cursor: not-allowed;
}

.level-list button:disabled small {
  color: rgba(24, 32, 51, 0.5);
}
