:root {
  color-scheme: only light;
  --bg-top: #050505;
  --bg-bottom: #161616;
  --panel: rgba(18, 18, 18, 0.82);
  --panel-border: rgba(255, 255, 255, 0.14);
  --text: #f4f4f4;
  --muted: #b8b8b8;
  --accent: #f2f2f2;
  --accent-dark: #8b8b8b;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Apple SD Gothic Neo", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.18), transparent 28%),
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08), transparent 22%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

.app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.panel {
  width: min(100%, 540px);
  padding: 20px;
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

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

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

h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3.6vw, 2.2rem);
  line-height: 1.05;
}

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

.score-card {
  min-width: 84px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.score-card span {
  display: block;
  margin-bottom: 4px;
  font-size: 0.75rem;
  color: var(--muted);
}

.score-card strong {
  font-size: 1.2rem;
}

.game-shell {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 26px 70px rgba(0, 0, 0, 0.44);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  background: linear-gradient(180deg, rgba(6, 6, 6, 0.98), rgba(26, 26, 26, 0.98));
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.52);
}

.overlay.hidden {
  display: none;
}

.overlay-card {
  width: min(100%, 320px);
  padding: 22px 20px;
  border-radius: 22px;
  text-align: center;
  color: #f7f7f7;
  background: rgba(24, 24, 24, 0.92);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
}

.overlay-card p,
.overlay-card h2 {
  margin: 0 0 12px;
}

.overlay-card h2 {
  font-size: 1.45rem;
  line-height: 1.2;
}

#overlay-kicker {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

#overlay-text {
  color: var(--muted);
  line-height: 1.5;
}

#start-button,
.move-button {
  border: 0;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, opacity 120ms ease;
}

#start-button {
  width: 100%;
  padding: 14px 18px;
  border-radius: 999px;
  color: #0c0c0c;
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(180deg, #ffffff 0%, #a9a9a9 100%);
}

#start-button:hover,
#start-button:active,
.move-button:active {
  transform: translateY(1px) scale(0.99);
}

.controls {
  display: flex;
  gap: 26px;
  justify-content: center;
  margin-top: 22px;
}

.move-button {
  width: 138px;
  height: 78px;
  border-radius: 24px;
  font-size: 2.35rem;
  color: #fff;
  background: linear-gradient(180deg, #3b3b3b 0%, #111111 100%);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.28);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.move-button.is-active {
  background: linear-gradient(180deg, #7a7a7a 0%, #2a2a2a 100%);
}

@media (max-width: 640px) {
  .panel {
    padding: 16px;
    border-radius: 24px;
  }

  .hud {
    flex-direction: column;
    align-items: stretch;
  }

  .scoreboard {
    justify-content: space-between;
  }

  .move-button {
    flex: 1;
    max-width: 180px;
  }
}
