@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@200;300;400;600;700&display=swap');

:root {
  --shell-bg: rgba(7, 10, 19, 0.7);
  --shell-border: rgba(255, 255, 255, 0.14);
  --shell-copy: rgba(234, 242, 255, 0.72);
  --shell-muted: rgba(234, 242, 255, 0.5);
  --shell-bright: rgba(255, 255, 255, 0.94);
  --shell-accent: #8fe6ff;
  --shell-accent-strong: #c9fff2;
  --shell-shadow: 0 32px 80px rgba(0, 0, 0, 0.32);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0a0a0f;
  overflow: hidden;
  touch-action: none;
  font-family: 'Outfit', sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

button {
  font: inherit;
}

canvas {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
}

#ui {
  position: fixed;
  inset: 0;
  z-index: 10;
}

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

#hud.visible {
  opacity: 1;
}

#score {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.9);
  font-size: 48px;
  font-weight: 200;
  letter-spacing: 4px;
  transition: transform 0.15s ease;
}

#score.bump {
  transform: translateX(-50%) scale(1.2);
}

#level-label {
  position: absolute;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.3);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 6px;
  text-transform: uppercase;
}

#combo-label {
  position: absolute;
  top: 118px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 5px;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

#combo-label.active {
  color: rgba(255, 255, 255, 0.5);
}

#best {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.26);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 4px;
  text-transform: uppercase;
}

#shell {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.screen {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  transform: scale(0.98);
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.shell-card {
  position: relative;
  width: min(100%, 560px);
  padding: 30px;
  border: 1px solid var(--shell-border);
  border-radius: 28px;
  background:
    radial-gradient(circle at top, rgba(143, 230, 255, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(16, 20, 35, 0.9), rgba(7, 10, 19, 0.78));
  box-shadow: var(--shell-shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.shell-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 28%),
    radial-gradient(circle at bottom right, rgba(201, 255, 242, 0.08), transparent 34%);
  pointer-events: none;
}

.shell-home,
.shell-panel,
.shell-gameover {
  display: grid;
  gap: 18px;
}

.shell-kicker {
  position: relative;
  z-index: 1;
  color: var(--shell-accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.shell-card h1,
.shell-card h2 {
  position: relative;
  z-index: 1;
  color: var(--shell-bright);
  font-weight: 300;
  letter-spacing: 0.08em;
}

.shell-card h1 {
  font-size: clamp(3rem, 9vw, 4.6rem);
  text-transform: uppercase;
}

.shell-card h2 {
  font-size: clamp(2rem, 6vw, 3rem);
}

.shell-copy {
  position: relative;
  z-index: 1;
  color: var(--shell-copy);
  font-size: 15px;
  line-height: 1.65;
  max-width: 48ch;
}

.shell-actions {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
}

.shell-button,
.inline-link {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--shell-bright);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.shell-button {
  min-height: 52px;
  padding: 14px 18px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 600;
}

.shell-button:hover,
.shell-button:focus-visible,
.inline-link:hover,
.inline-link:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(143, 230, 255, 0.55);
  background: rgba(143, 230, 255, 0.12);
  outline: none;
}

.shell-button-primary {
  background: linear-gradient(135deg, rgba(143, 230, 255, 0.22), rgba(201, 255, 242, 0.18));
  border-color: rgba(143, 230, 255, 0.48);
}

.inline-link {
  justify-self: start;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.feature-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
}

.feature-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--shell-copy);
  font-size: 14px;
  line-height: 1.5;
}

.gameover-score {
  position: relative;
  z-index: 1;
  color: var(--shell-accent-strong);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#constellation-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

#constellation-overlay.visible {
  opacity: 1;
}

@media (max-width: 640px) {
  #shell,
  .screen {
    padding: 16px;
  }

  .shell-card {
    width: 100%;
    padding: 24px 20px;
    border-radius: 24px;
  }

  #score {
    top: 24px;
    font-size: 38px;
  }

  #level-label {
    top: 74px;
    font-size: 11px;
    letter-spacing: 4px;
  }

  #combo-label {
    top: 94px;
    font-size: 10px;
    letter-spacing: 3px;
  }

  #best {
    bottom: 18px;
    font-size: 10px;
    letter-spacing: 3px;
  }
}
