:root {
  --bg-top: #100726;
  --bg-mid: #150f3a;
  --bg-bottom: #04040d;
  --panel: rgba(9, 13, 31, 0.76);
  --panel-border: rgba(157, 111, 255, 0.22);
  --text: #f6f4ff;
  --muted: #bdb5e8;
  --accent: #78f0ff;
  --accent-2: #ff8bd1;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(120, 240, 255, 0.15), transparent 24%),
    radial-gradient(circle at 20% 20%, rgba(255, 139, 209, 0.12), transparent 18%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 45%, var(--bg-bottom) 100%);
}

.shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 40px;
}

.masthead,
.playfield {
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  background: var(--panel);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  padding: 28px 30px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  line-height: 0.95;
}

.intro {
  max-width: 560px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #98fbcb);
  color: #07141c;
  font-weight: 700;
  text-decoration: none;
}

.playfield {
  margin-top: 20px;
  padding: 18px;
}

.hud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.hud p {
  margin: 0;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.92rem;
}

.hud strong {
  color: var(--text);
}

#game-container {
  position: relative;
}

#canvas {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(120, 240, 255, 0.22);
  border-radius: 24px;
  background:
    radial-gradient(circle at top, rgba(95, 112, 255, 0.18), transparent 26%),
    linear-gradient(180deg, #171134 0%, #090b1c 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.button {
  position: absolute;
  display: grid;
  place-items: center;
  border: 1px solid rgba(120, 240, 255, 0.28);
  border-radius: 22px;
  background: rgba(7, 12, 28, 0.72);
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.08em;
}

#left-controls {
  position: absolute;
  left: 1px;
  bottom: 0;
  display: none;
}

#right-controls {
  position: absolute;
  right: 1px;
  bottom: 0;
  display: none;
}

#up {
  width: 200px;
  height: 100px;
  bottom: 100px;
}

#left {
  width: 100px;
  height: 100px;
  bottom: 0;
}

#right {
  width: 100px;
  height: 100px;
  bottom: 0;
  left: 100px;
}

#space {
  width: 200px;
  height: 200px;
  bottom: 0;
  right: 0;
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 18px, 1080px);
    padding-top: 18px;
    padding-bottom: 24px;
  }

  .masthead {
    align-items: start;
    flex-direction: column;
    padding: 22px;
  }

  .playfield {
    padding: 12px;
  }
}
