:root {
  --bg: #241528;
  --surface: #2E1834;
  --card: #3B1F44;
  --card-hi: #4A2755;
  --coral: #FF4D6D;
  --gold: #FFB627;
  --teal: #2EC4B6;
  --orange: #FF8C42;
  --azul: #4D9DE0;
  --lila: #B892FF;
  --rosa: #E85D9E;
  --cream: #F5EDE4;
  --muted: #C9B8CE;
  --line: rgba(245, 237, 228, 0.14);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: 'Work Sans', sans-serif;
  min-height: 100vh;
}

body {
  background-image:
    radial-gradient(circle at 15% 8%, rgba(255, 182, 39, 0.10), transparent 40%),
    radial-gradient(circle at 85% 92%, rgba(255, 77, 109, 0.10), transparent 40%);
}

button { font-family: inherit; cursor: pointer; }
a { color: inherit; }

.font-display { font-family: 'Bungee', cursive; }
.font-mono { font-family: 'Space Mono', monospace; }

#app {
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 96px;
}

.center-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 20px 16px 12px;
  background: linear-gradient(180deg, var(--bg) 65%, transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 8px; }

.badge {
  display: flex; align-items: center; gap: 4px;
  font-family: 'Space Mono', monospace; font-size: 11px;
  padding: 5px 12px; border-radius: 999px; border: 1px solid transparent;
  background: none;
}
.badge.admin { background: rgba(255, 182, 39, .15); color: var(--gold); border-color: var(--gold); }
.badge.lector { background: rgba(46, 196, 182, .15); color: var(--teal); border-color: var(--teal); }

/* Bottom nav */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; }
.bottom-nav-inner {
  max-width: 480px; margin: 0 auto; padding: 8px 12px 16px;
  background: linear-gradient(0deg, var(--bg) 70%, transparent);
}
.bottom-nav-bar {
  display: flex; justify-content: flex-start; padding: 10px 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  overflow-x: auto; gap: 2px;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 12px; background: none; border: none; color: var(--muted); font-size: 11px;
  flex: 1 0 auto;
}
.nav-item span:first-child { font-size: 28px; }
.nav-item.active { color: var(--gold); font-weight: 700; }

/* Cards & grid */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.ticket-card { position: relative; }
.ticket-card::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: -9px; height: 18px;
  background-image: radial-gradient(circle 9px at 9px 0px, var(--bg) 9px, transparent 9.5px);
  background-size: 18px 18px; background-repeat: repeat-x; background-position: left top;
}
.tipo-card-top {
  height: 92px; display: flex; align-items: center; justify-content: center;
  position: relative; border-radius: 16px 16px 0 0; overflow: hidden;
}
.tipo-card-top img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.year-stamp {
  position: absolute; top: 8px; right: 8px; transform: rotate(7deg);
  font-size: 11px; padding: 4px 8px; border-radius: 6px; background: var(--bg); z-index: 2;
}

/* Chips / tabs */
.chip {
  flex-shrink: 0; display: flex; align-items: center; gap: 4px;
  padding: 9px 13px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--card); color: var(--muted); border: 1px solid var(--line);
}
.chip.active { background: var(--gold); color: var(--bg); border-color: var(--gold); }
.scroll-hide::-webkit-scrollbar { display: none; }
.scroll-hide { -ms-overflow-style: none; scrollbar-width: none; }

.seg-toggle { display: flex; background: var(--surface); border-radius: 999px; padding: 4px; gap: 4px; }
.seg-toggle button { flex: 1; padding: 8px 10px; border-radius: 999px; border: none; font-size: 12px; font-weight: 600; background: none; color: var(--muted); }
.seg-toggle button.active { background: var(--gold); color: var(--bg); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 13px 18px; border-radius: 999px; font-size: 14.5px; font-weight: 600; border: none;
}
.btn-gold { background: var(--gold); color: var(--bg); }
.btn-teal { background: var(--teal); color: var(--bg); }
.btn-ghost { background: var(--surface); color: var(--cream); border: 1px solid var(--line); }
.btn-outline-coral { background: none; color: var(--coral); border: 1px solid var(--coral); }
.btn:disabled { opacity: .6; }

/* Forms */
input, select, textarea {
  background: var(--surface); color: var(--cream); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 11px; font-family: 'Work Sans', sans-serif;
  font-size: 13px; width: 100%;
}
textarea { resize: vertical; font-family: 'Space Mono', monospace; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input[type="file"] { padding: 8px; font-size: 12px; }
label.checkbox { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
label.checkbox input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px; flex-shrink: 0;
  border-radius: 50%; border: 1px solid var(--muted);
  background: var(--surface); position: relative; cursor: pointer; margin: 0;
}
label.checkbox input[type="checkbox"]:checked { background: var(--gold); border-color: var(--gold); }
label.checkbox input[type="checkbox"]:checked::after {
  content: ''; position: absolute; left: 5px; top: 2px;
  width: 4px; height: 8px; border: solid var(--bg); border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Calendar */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.day-cell {
  aspect-ratio: 1; border-radius: 8px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; background: none;
  border: 1px solid transparent; color: var(--cream); font-size: 12px;
}
.day-cell.selected { background: var(--card-hi); }
.day-cell.today { border-color: var(--gold); }
.dot { width: 4px; height: 4px; border-radius: 99px; display: inline-block; }

/* Song detail */
.song-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px; }
.letra-block { white-space: pre-wrap; font-family: 'Space Mono', monospace; font-size: 12.5px; line-height: 1.6; color: var(--cream); }

/* Empty state */
.empty-state {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 40px 0; color: var(--muted);
}

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

/* Bloquea el scroll general, el zoom y la selección de texto */
html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden; /* Evita que la página entera se desplace */
  touch-action: manipulation; /* Desactiva gestos de zoom táctil */
  -webkit-user-select: none; /* Evita seleccionar texto al mantener pulsado */
  user-select: none;
  -webkit-touch-callout: none; /* Desactiva el menú contextual al dejar pulsado en iOS */
}

/* Si dentro de la app tienes alguna zona de lista o letras donde SÍ necesitas scroll */
.scrollable, #app {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* Scroll suave en iPhone */
}
