:root {
  --ink: #2a2634;
  --muted: #6a6473;
  --paper: rgba(255, 255, 255, 0.94);
  --line: rgba(42, 38, 52, 0.14);
  --rose: #ff70a6;
  --aqua: #41c7d8;
  --mint: #77d59f;
  --gold: #ffd166;
  --violet: #7669d8;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    linear-gradient(135deg, rgba(255, 245, 250, 0.88), rgba(221, 249, 255, 0.82)),
    url("../../res/images/backgrounds/Soda.png") center / cover fixed;
  touch-action: manipulation;
}

button,
a {
  font: inherit;
}

.game-shell {
  width: min(1040px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 34px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 26px;
}

.topbar a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: clamp(14px, 3vw, 28px);
}

.eyebrow {
  margin: 0 0 8px;
  color: #a33768;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(2.35rem, 7vw, 4.8rem);
  line-height: 0.96;
}

.hero p:last-child {
  max-width: 690px;
  margin: 14px 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

.hero-art {
  width: clamp(92px, 17vw, 150px);
  aspect-ratio: 1;
  object-fit: cover;
  border: 5px solid rgba(255, 255, 255, 0.84);
  border-radius: 50%;
  box-shadow: 0 22px 44px rgba(118, 105, 216, 0.22);
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(42, 38, 52, 0.13);
}

.hud {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.hud span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.hud strong {
  display: block;
  margin-top: 2px;
  font-size: 1.35rem;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: #241f2d;
  background: linear-gradient(135deg, var(--gold), var(--mint));
  font-weight: 900;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.playfield {
  position: relative;
  margin-top: 16px;
  aspect-ratio: 16 / 9;
  min-height: 320px;
  border: 1px solid rgba(42, 38, 52, 0.16);
  border-radius: 8px;
  background: #faf7ff;
  overflow: hidden;
  box-shadow: 0 24px 54px rgba(42, 38, 52, 0.18);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 22px;
  color: white;
  text-align: center;
  background:
    linear-gradient(rgba(35, 28, 56, 0.58), rgba(35, 28, 56, 0.76)),
    url("../../res/images/backgrounds/Be-Shinning.png") center / cover;
}

.overlay[hidden] {
  display: none;
}

.overlay-kicker {
  margin: 0;
  color: #fff2a8;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0;
}

.overlay h2 {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  line-height: 1;
}

.overlay p {
  width: min(620px, 100%);
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.75;
}

.overlay button {
  margin-top: 6px;
  background: linear-gradient(135deg, #ff9cc7, #ffe089);
}

.touch-controls {
  display: grid;
  grid-template-columns: repeat(6, minmax(44px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.touch-controls button {
  min-height: 48px;
  padding: 0;
  color: white;
  background: linear-gradient(135deg, rgba(118, 105, 216, 0.92), rgba(65, 199, 216, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.48);
  box-shadow: 0 14px 26px rgba(42, 38, 52, 0.12);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.touch-controls button:active,
.touch-controls button.is-pressed {
  transform: translateY(1px) scale(0.98);
  filter: brightness(1.1);
}

.message {
  margin-top: 16px;
  padding: 14px 16px;
  color: var(--muted);
  line-height: 1.6;
}

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

  .hero-art {
    justify-self: start;
    width: 86px;
  }

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

  .hud button {
    grid-column: 1 / -1;
  }

  .playfield {
    min-height: 260px;
  }
}

@media (max-width: 520px) {
  .hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .touch-controls {
    grid-template-columns: repeat(3, minmax(44px, 1fr));
  }
}
