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

:root {
  --bg: #0f0e17;
  --panel: #1f1b2e;
  --accent: #ff9f1c;
  --text: #f7f3ff;
  --danger: #ff3b30;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 30% 20%, #2e1f47, #0f0e17 60%);
  font-family: 'Rubik', sans-serif;
  color: var(--text);
}

canvas {
  display: block;
}

#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('../img/fondo.jpg') center / cover no-repeat;
}

#loading-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.loading-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding: 20px 26px;
  border-radius: 16px;
}

.loading-logo {
  width: min(280px, 60vw);
  height: auto;
}

.loading-bar {
  width: min(280px, 60vw);
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.loading-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  transition: width 0.2s ease;
}

#loading-screen.is-hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

#win-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#win-screen.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.win-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 26px;
  border-radius: 16px;
  background: rgba(12, 10, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f7f3ff;
}

.win-title {
  font-size: 20px;
  font-weight: 600;
}

.win-score {
  font-size: 14px;
  color: #cbbcf1;
}

#continue-btn {
  border: none;
  background: #f59e0b;
  color: #1b1300;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}

#ui {
  position: fixed;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

#hearts {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 32px;
  gap: 12px;
}

.heart {
  width: 36px;
  height: 30px;
  background-image: url('../img/corazones.png');
  background-repeat: no-repeat;
  background-size: 200% 100%;
  image-rendering: pixelated;
}

.heart.is-full {
  background-position: 0 0;
}

.heart.is-empty {
  background-position: 100% 0;
}

#score {
  font-size: 14px;
  font-weight: 600;
  color: #f7f3ff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
