:root {
  --bg-dark: #090d16;
  --surface: #131b2e;
  --surface-alt: #1b253d;
  --border: #2a3759;
  --gold: #f5b942;
  --gold-hover: #e0a32b;
  --emerald: #10b981;
  --emerald-hover: #059669;
  --danger: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --radius: 14px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at top, #16223d 0%, var(--bg-dark) 65%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 16px;
}

.app-container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.brand-header {
  text-align: center;
  padding: 12px 0 4px;
}

.badge-live {
  display: inline-block;
  background: rgba(245, 185, 66, 0.14);
  color: var(--gold);
  border: 1px solid rgba(245, 185, 66, 0.35);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.brand-header h1 {
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #ffffff;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 4px;
}

.subtitle strong {
  color: var(--gold);
}

.card-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.card-panel h2 {
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.helper-text {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.4;
  margin-bottom: 18px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.input-group label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

input[type="text"],
input[type="password"] {
  width: 100%;
  background: var(--bg-dark);
  border: 1.5px solid var(--border);
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 13px 14px;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s;
}

input:focus {
  border-color: var(--gold);
}

.btn-primary,
.btn-success,
.btn-secondary {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.1s, background-color 0.2s, opacity 0.2s;
}

.btn-primary {
  background: var(--gold);
  color: #111827;
}

.btn-primary:hover:not(:disabled) {
  background: var(--gold-hover);
}

.btn-success {
  background: var(--emerald);
  color: #ffffff;
}

.btn-success:hover:not(:disabled) {
  background: var(--emerald-hover);
}

.btn-secondary {
  background: var(--surface-alt);
  color: var(--text-main);
  border: 1px solid var(--border);
  margin-top: 10px;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button:active:not(:disabled) {
  transform: scale(0.985);
}

.error-msg {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  font-size: 0.86rem;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.session-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-dark);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.session-bar strong {
  color: var(--gold);
  font-family: monospace;
  font-size: 0.95rem;
}

.pill-once {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
}

.instructions-box {
  background: var(--surface-alt);
  border-left: 3px solid var(--gold);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #e2e8f0;
  line-height: 1.4;
  margin-bottom: 16px;
}

/* GRILLA DE 3 RASPADITAS */
.scratch-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.scratch-card {
  background: var(--bg-dark);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.25s, opacity 0.25s;
}

.scratch-card.active-choice {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(245, 185, 66, 0.25);
}

.scratch-card.locked-choice {
  opacity: 0.48;
  pointer-events: none;
}

.card-header-label {
  background: var(--surface-alt);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
}

.scratch-area {
  position: relative;
  width: 100%;
  height: 104px;
  user-select: none;
  -webkit-user-select: none;
}

.prize-underlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #1e293b 0%, #0f172a 100%);
  padding: 10px;
  text-align: center;
}

.prize-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 4px;
}

.prize-value {
  font-size: 1.35rem;
  font-weight: 900;
  color: #ffffff;
}

.scratch-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  transition: opacity 0.45s ease;
}

.scratch-canvas.revealed {
  opacity: 0;
  pointer-events: none;
}

.lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(9, 13, 22, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  z-index: 5;
}

.lock-overlay[hidden] {
  display: none;
}

/* TARJETA DE COMPROBANTE */
.voucher-card {
  margin-top: 18px;
  background: linear-gradient(180deg, #132a24 0%, #0f172a 100%);
  border: 1.5px solid var(--emerald);
  border-radius: 12px;
  padding: 18px;
  animation: popIn 0.3s ease-out;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.voucher-top {
  text-align: center;
  border-bottom: 1px dashed rgba(16, 185, 129, 0.4);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.voucher-status {
  font-size: 0.78rem;
  font-weight: 800;
  color: #6ee7b7;
  letter-spacing: 0.05em;
}

.voucher-top h3 {
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--gold);
  margin-top: 4px;
}

.voucher-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.88rem;
  margin-bottom: 12px;
}

.voucher-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.voucher-row span {
  color: var(--text-muted);
}

.voucher-row strong {
  font-family: monospace;
  font-size: 1rem;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 6px;
}

.voucher-note {
  font-size: 0.82rem;
  color: #cbd5e1;
  text-align: center;
  margin-bottom: 14px;
}

.app-footer {
  text-align: center;
  padding: 8px 0 16px;
}

.app-footer a {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-decoration: none;
}

.app-footer a:hover {
  color: var(--gold);
}

/* ESTILOS ADICIONALES PANEL ADMIN */
.admin-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.tab-btn {
  background: var(--bg-dark);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--surface-alt);
  color: var(--gold);
  border-color: var(--gold);
}

.result-box {
  margin-top: 14px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  font-size: 0.88rem;
}

.result-box pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: monospace;
  background: var(--surface);
  padding: 10px;
  border-radius: 8px;
  margin: 10px 0;
  color: #e2e8f0;
  font-size: 0.84rem;
}

.status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
}

.status-active {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.status-pending {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.status-paid {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
}
