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

body {
  background: #060614;
  overflow: hidden;
  font-family: 'Segoe UI', Arial, sans-serif;
}

#game-container {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #060614;
}

#game-canvas {
  display: block;
  cursor: none;
  background: #0d0d2b;
  border: 2px solid #1e2460;
  border-radius: 6px;
  box-shadow:
    0 0 0 1px #0a0c2a,
    0 0 40px rgba(60, 100, 255, 0.18),
    0 8px 48px rgba(0, 0, 0, 0.6);
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #fff;
  background: rgba(6, 6, 20, 0.92);
}

.screen.hidden {
  display: none;
}

.screen h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: #7eb8ff;
  text-shadow: 0 0 24px rgba(126, 184, 255, 0.5);
  letter-spacing: 2px;
}

.screen h2 {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
}

.screen .subtitle {
  font-size: clamp(0.9rem, 1.6vw, 1.1rem);
  color: #8888aa;
  margin-bottom: 8px;
}

.screen button {
  padding: 14px 52px;
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  background: #2a4a8a;
  color: #fff;
  border: 2px solid #4a7acc;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 1px;
}

.screen button:hover  { background: #3a5aaa; transform: scale(1.04); }
.screen button:active { transform: scale(0.98); }

.how-to-play {
  margin-top: 12px;
  text-align: center;
  color: #6666aa;
  font-size: clamp(0.8rem, 1.2vw, 0.9rem);
  line-height: 1.8;
}

.score-label {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  color: #ffdd66;
}

.highscore-label {
  font-size: clamp(0.8rem, 1.4vw, 1rem);
  color: #8888aa;
  min-height: 1.2em;
}

#screen-levelcomplete h2 {
  color: #66eebb;
  text-shadow: 0 0 20px rgba(100, 220, 180, 0.5);
  letter-spacing: 2px;
}

.stars {
  display: flex;
  gap: 14px;
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin: 4px 0;
}

.star-filled { color: #ffcc00; text-shadow: 0 0 14px rgba(255, 200, 0, 0.7); }
.star-empty  { color: #2a3050; }

#screen-win h1 {
  color: #ffdd66;
  text-shadow: 0 0 24px rgba(255, 210, 80, 0.5);
}

#screen-unlock h2 {
  color: #ffe066;
  text-shadow: 0 0 28px rgba(255, 200, 60, 0.6);
  letter-spacing: 2px;
}

#unlock-badge {
  font-size: clamp(0.75rem, 1.2vw, 0.9rem);
  font-weight: 700;
  letter-spacing: 3px;
  color: #fff;
  background: #e05820;
  padding: 5px 18px;
  border-radius: 20px;
  text-shadow: none;
}

#unlock-subtitle {
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  color: #aaddff;
}

/* ── Rank display ─────────────────────────────────────────────────────────── */
.rank-label {
  font-size: clamp(0.85rem, 1.4vw, 1.05rem);
  color: #ffcc55;
  text-shadow: 0 0 10px rgba(255, 180, 40, 0.4);
  letter-spacing: 1px;
  min-height: 1.2em;
}

/* ── Daily label ──────────────────────────────────────────────────────────── */
.daily-label {
  color: #66ddaa;
}

/* ── Level Select grid ────────────────────────────────────────────────────── */
#screen-levelselect {
  overflow-y: auto;
  padding: 24px;
  gap: 12px;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  max-width: 560px;
  width: 100%;
  margin: 4px 0 8px;
}

.level-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px 6px;
  min-width: 0;
  background: #1a2a55;
  border: 2px solid #2a4a8a;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s, transform 0.1s, box-shadow 0.12s;
  gap: 2px;
}

.level-btn:hover {
  background: #2a3e7a;
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(100, 160, 255, 0.4);
}

.level-btn:active { transform: scale(0.96); }

.level-btn.locked {
  background: #111120;
  border-color: #1e1e35;
  color: #333355;
  cursor: not-allowed;
  opacity: 0.55;
}

.level-btn.locked:hover { transform: none; box-shadow: none; background: #111120; }

.level-btn.boss {
  border-color: #cc6600;
  box-shadow: 0 0 10px rgba(200, 100, 0, 0.35);
}

.level-btn.boss:hover {
  box-shadow: 0 0 18px rgba(255, 140, 0, 0.55);
}

.level-btn-num {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 700;
  color: #aaccff;
}

.level-btn.boss .level-btn-num { color: #ffaa44; }
.level-btn.locked .level-btn-num { color: #333355; }

.level-btn-stars {
  display: flex;
  gap: 1px;
  font-size: clamp(0.55rem, 1vw, 0.7rem);
}

/* ── Settings screen ──────────────────────────────────────────────────────── */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 280px;
  padding: 10px 0;
  border-bottom: 1px solid #1e2460;
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  color: #aaaacc;
}

.toggle-btn {
  padding: 8px 28px !important;
  font-size: clamp(0.85rem, 1.4vw, 1rem) !important;
  font-weight: 700;
  letter-spacing: 2px;
  min-width: 72px;
  border-radius: 20px !important;
}

.toggle-btn.toggle-on {
  background: #1a6a3a !important;
  border-color: #33cc77 !important;
  color: #88ffbb !important;
  box-shadow: 0 0 10px rgba(50, 200, 100, 0.3);
}

.toggle-btn.toggle-off {
  background: #5a1a1a !important;
  border-color: #cc3333 !important;
  color: #ffaaaa !important;
}
