:root {
  --bg: #05060f;
  --surface: #12142a;
  --surface-2: #1b1e3d;
  --text: #f2f3fb;
  --text-dim: #a8abd0;
  --accent: #6c8cff;
  --accent-2: #ffb266;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  overflow: hidden;
}

body {
  background-image: radial-gradient(1px 1px at 20% 30%, #ffffff55 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 60%, #ffffff44 50%, transparent 51%),
    radial-gradient(2px 2px at 85% 20%, #ffffff33 50%, transparent 51%),
    radial-gradient(1px 1px at 40% 80%, #ffffff33 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 15%, #ffffff55 50%, transparent 51%);
  background-repeat: repeat;
  background-size: 300px 300px;
}

.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  text-align: center;
}

.screen.is-active {
  display: flex;
}

.title {
  font-size: clamp(2.5rem, 10vw, 4rem);
  margin: 0 0 var(--space-2);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text) 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  color: var(--text-dim);
  margin: 0 0 var(--space-8);
  font-size: 1.05rem;
}

.modes {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
  justify-content: center;
  max-width: 640px;
}

.mode-card {
  appearance: none;
  border: 1px solid #ffffff1a;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  color: var(--text);
  border-radius: 20px;
  padding: var(--space-6) var(--space-8);
  width: 260px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: transform 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 8px 24px #00000055;
}

.mode-card:active {
  transform: scale(0.97);
}

.mode-card:hover {
  box-shadow: 0 10px 28px #00000077;
}

.mode-aventura .mode-name {
  color: var(--accent-2);
}

.mode-real .mode-name {
  color: var(--accent);
}

.mode-name {
  font-size: 1.3rem;
  font-weight: 700;
}

.mode-desc {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.4;
}

.spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 4px solid #ffffff22;
  border-top-color: var(--accent);
  animation: spin 900ms linear infinite;
  margin-bottom: var(--space-4);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  color: var(--text-dim);
}

#player {
  padding: 0;
}

#mode-frame {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  border: 0;
  display: block;
}

#back-btn {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #ffffff33;
  background: #00000088;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
  }
}
