/* ============================================================
   style.css — UI chrome, canvas wrapper, menu overlays
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;600;800&display=swap');

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

:root {
  --accent: #c060ff;
  --accent2: #ff6030;
  --bg: #0d0120;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: 'Fredoka One', cursive;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

/* ── Canvas wrapper ───────────────────────────────────────── */
#game-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(ellipse at center, #1a0533 0%, #060010 100%);
}

#gameCanvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: pointer;
  border-radius: 8px;
  box-shadow:
    0 0 0 2px rgba(192, 96, 255, 0.3),
    0 0 40px rgba(192, 96, 255, 0.2),
    0 0 100px rgba(50, 0, 100, 0.6);
}

/* ── Corner badges (outside canvas) ───────────────────────── */
.corner-badge {
  position: fixed;
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  font-family: 'Nunito', sans-serif;
  pointer-events: none;
  z-index: 10;
}
.corner-badge.bottom-left  { bottom: 8px; left:  10px; }
.corner-badge.bottom-right { bottom: 8px; right: 10px; }

/* ── Animated shimmer on the canvas edge ──────────────────── */
@keyframes border-shimmer {
  0%   { box-shadow: 0 0 0 2px rgba(192,96,255,0.3), 0 0 40px rgba(192,96,255,0.25); }
  50%  { box-shadow: 0 0 0 2px rgba(255,96,192,0.4), 0 0 60px rgba(255,96,192,0.30); }
  100% { box-shadow: 0 0 0 2px rgba(192,96,255,0.3), 0 0 40px rgba(192,96,255,0.25); }
}
#gameCanvas {
  animation: border-shimmer 3s ease-in-out infinite;
}

/* ── Loading bar (shown briefly before DOMContentLoaded) ──── */
#loading {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 100;
  transition: opacity 0.4s;
}
#loading h1 {
  font-size: 2.2rem;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 24px;
}
#loading-bar-outer {
  width: 300px;
  height: 10px;
  background: rgba(255,255,255,0.1);
  border-radius: 99px;
  overflow: hidden;
}
@keyframes load-anim {
  from { width: 0; }
  to   { width: 100%; }
}
#loading-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px;
  animation: load-anim 0.6s ease-out forwards;
}
#loading.hidden {
  opacity: 0;
  pointer-events: none;
}
