/* ——— Reset & Tokens ——— */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0f0f1a;
  --surface:    #1a1a2e;
  --border:     #2a2a4a;
  --accent:     #7c6af7;
  --accent2:    #f76a8c;
  --text:       #e8e6ff;
  --text-muted: #888;
  --radius:     12px;
  --font:       'Inter', system-ui, sans-serif;
}

/* ——— Google Font ——— */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden; /* Prevent scrolling */
}

/* ——— Layout ——— */
#game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 16px;
  width: 100%;
  max-width: 600px;
  height: 100%;
  max-height: 100dvh;
}

header {
  display: flex;
  align-items: baseline;
  gap: 20px;
}

#game-title {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

#level-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

#level-controls button {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}

#level-controls button:hover {
  background: var(--border);
}

#level-controls select {
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 4px;
  cursor: pointer;
}

#level-controls select option {
  background: var(--surface);
  color: var(--text);
}


/* ——— Canvas wrapper ——— */
#canvas-wrapper {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(124, 106, 247, 0.3), 0 4px 24px rgba(0,0,0,0.6);
  background: var(--surface);
  border: 1px solid var(--border);
  width: 100%;
  max-width: fit-content;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game-canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ——— Win Overlay ——— */
#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 15, 26, 0.85);
  backdrop-filter: blur(8px);
  transition: opacity 0.3s ease;
}

#overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

#overlay-content {
  text-align: center;
  animation: pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#overlay-title {
  font-size: 2.4rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

#overlay-sub {
  color: var(--text-muted);
  font-size: 1rem;
}

@keyframes pop-in {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
