/* ===========================================
   AMIGO OCULTO DE PÁSCOA — Design System
   Theme: Easter Chocolate (default)
   
   All visual tokens live in :root as CSS custom properties.
   To create a new theme (e.g. Christmas, Halloween), 
   just override the variables under a [data-theme="christmas"] selector.
   =========================================== */

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

/* ── Theme Tokens ── */
:root {
  /* Surfaces */
  --color-bg:          #1A0F0A;
  --color-surface:     #2D1B14;
  --color-surface-alt: #3D2317;
  --color-glass:       rgba(45, 27, 20, 0.6);
  --color-glass-border: rgba(212, 175, 55, 0.25);
  --color-input-bg:    rgba(0, 0, 0, 0.25);
  --color-input-border: rgba(255, 255, 255, 0.08);

  /* Accent */
  --color-gold:        #D4AF37;
  --color-caramel:     #C68642;
  --color-gold-muted:  rgba(212, 175, 55, 0.5);
  --color-gold-subtle: rgba(212, 175, 55, 0.15);

  /* Text */
  --color-text:        #F5E6D3;
  --color-text-muted:  rgba(245, 230, 211, 0.55);
  --color-text-on-cta: #1A0F0A;

  /* Feedback */
  --color-success:     #4ADE80;
  --color-error:       #F87171;

  /* Glow / Ambience */
  --glow-primary:      radial-gradient(circle at 50% -10%, rgba(198, 134, 66, 0.2), transparent 60%);
  --glow-secondary:    radial-gradient(circle at 100% 100%, rgba(212, 175, 55, 0.08), transparent 50%);

  /* CTA Gradient */
  --gradient-cta:      linear-gradient(135deg, var(--color-caramel), var(--color-gold));

  /* Spacing Scale (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;

  /* Safe area */
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Page Background Glow ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--glow-primary), var(--glow-secondary);
  pointer-events: none;
  z-index: 0;
}

/* ── App Shell ── */
#app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
}

.view {
  display: none;
  flex: 1;
  padding: var(--space-4);
  padding-bottom: calc(80px + var(--safe-area-bottom) + var(--space-4));
  animation: fadeIn 300ms ease;
}

.view.active {
  display: flex;
  flex-direction: column;
}

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

/* ── Header ── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(26, 15, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-gold);
  font-style: italic;
  letter-spacing: 0.02em;
}

.header-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-full);
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.header-btn:active {
  background: rgba(255,255,255,0.1);
}

/* ── Bottom Navigation ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  z-index: 50;
  display: flex;
  background: rgba(26, 15, 10, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--color-glass-border);
  padding: var(--space-2) var(--space-4) calc(var(--space-2) + var(--safe-area-bottom));
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-2) 0;
  text-decoration: none;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nav-item.active {
  color: var(--color-gold);
}

.nav-item .icon {
  font-size: 24px;
}

.nav-item .label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Glass Card ── */
.card {
  background: var(--color-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  position: relative;
  overflow: hidden;
}

.card + .card {
  margin-top: var(--space-4);
}

/* Subtle corner glow on cards */
.card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 120px; height: 120px;
  background: var(--color-gold-subtle);
  filter: blur(60px);
  border-radius: 50%;
  pointer-events: none;
}

/* ── Form Elements ── */
.form-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-gold);
  margin-bottom: var(--space-3);
}

.form-input {
  width: 100%;
  padding: var(--space-4);
  background: var(--color-input-bg);
  border: 1px solid var(--color-input-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.9375rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

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

textarea.form-input {
  resize: none;
  min-height: 100px;
}

/* Input with icon */
.input-group {
  position: relative;
}

.input-group .input-icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-gold-muted);
  font-size: 18px;
  pointer-events: none;
}

.input-group .form-input {
  padding-left: calc(var(--space-4) + 28px);
}

/* Input with delete button */
.input-group .input-delete {
  position: absolute;
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.input-group .input-delete:hover {
  color: var(--color-error);
  background: rgba(248, 113, 113, 0.1);
}

/* ── PIN Input ── */
.pin-group {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
}

.pin-input {
  width: 48px; height: 56px;
  background: var(--color-input-bg);
  border: 2px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius-md);
  text-align: center;
  font-family: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-gold);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-text-security: disc;
}

.pin-input:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px var(--color-gold-subtle);
}

/* ── Buttons ── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-4);
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition-fast), filter var(--transition-fast), opacity var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--gradient-cta);
  color: var(--color-text-on-cta);
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.2);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-secondary {
  background: transparent;
  border: 2px dashed rgba(212, 175, 55, 0.3);
  color: var(--color-gold);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-gold-subtle);
}

.btn-small {
  width: auto;
  padding: var(--space-2) var(--space-3);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: var(--radius-sm);
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: var(--color-gold);
}

/* ── Progress Bar ── */
.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.progress-label-text {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

.progress-label-count {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-gold);
}

.progress-bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gradient-cta);
  border-radius: var(--radius-full);
  transition: width 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-hint {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}

/* ── Participant List (Admin) ── */
.participant-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* ── Invite Link List ── */
.invite-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.invite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3);
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-input-border);
}

.invite-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
}

.invite-code {
  font-size: 10px;
  color: var(--color-gold-muted);
  font-style: italic;
  margin-top: 2px;
}

/* ── Golden Ticket (Reveal Result) ── */
.golden-ticket {
  background: linear-gradient(135deg, #BF953F, #FCF6BA, #B38728, #FBF5B7, #AA771C);
  background-size: 300% 300%;
  animation: shimmer 4s ease infinite;
  color: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
  transform: rotate(0.5deg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.golden-ticket::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 8px;
  background: repeating-conic-gradient(var(--color-bg) 0% 25%, transparent 0% 50%) 0 0 / 16px 8px;
}

.ticket-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.6;
  margin-bottom: var(--space-2);
}

.ticket-name {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: var(--space-4);
}

.ticket-detail {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: 0.875rem;
  margin-bottom: var(--space-2);
}

.ticket-detail .icon {
  font-size: 18px;
  margin-top: 1px;
  opacity: 0.7;
}

.ticket-footer {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(45, 27, 20, 0.15);
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.4;
  font-family: monospace;
}

/* ── Section Headings ── */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.section-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: var(--space-6);
}

/* ── Status Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
}

.badge-success {
  background: rgba(74, 222, 128, 0.15);
  color: var(--color-success);
}

.badge-waiting {
  background: var(--color-gold-subtle);
  color: var(--color-gold);
}

/* ── Helper Text ── */
.hint {
  font-size: 11px;
  color: var(--color-text-muted);
  font-style: italic;
  text-align: center;
}

/* ── Decorative Easter Egg Icon ── */
.deco-egg {
  display: flex;
  justify-content: center;
  margin-top: var(--space-8);
  opacity: 0.12;
  font-size: 72px;
  color: var(--color-gold);
}

/* ── Toast Notification ── */
.toast {
  position: fixed;
  bottom: calc(80px + var(--safe-area-bottom) + var(--space-4));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-glass-border);
  color: var(--color-text);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base);
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* ── Success Card ── */
.success-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.success-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(74, 222, 128, 0.15);
  border-radius: var(--radius-sm);
  color: var(--color-success);
}

/* ── Loading Spinner ── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--color-gold-subtle);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

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

/* ── Utility ── */
.text-center { text-align: center; }
.text-gold   { color: var(--color-gold); }
.text-muted  { color: var(--color-text-muted); }
.text-error  { color: var(--color-error); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.hidden { display: none !important; }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* ── Monitor View ── */
.monitor-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.monitor-badges {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.monitor-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.monitor-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-input-border);
}

.monitor-avatar {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.monitor-avatar.submitted {
  background: rgba(74, 222, 128, 0.15);
  color: var(--color-success);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.monitor-avatar.pending {
  background: var(--color-gold-subtle);
  color: var(--color-gold);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.monitor-info {
  flex: 1;
  min-width: 0;
}

.monitor-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
}

.monitor-pref {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.monitor-status-icon {
  flex-shrink: 0;
  font-size: 20px;
}

.monitor-status-icon.done { color: var(--color-success); }
.monitor-status-icon.wait { color: var(--color-gold-muted); }

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

.refreshing .material-symbols-outlined {
  animation: refreshSpin 600ms linear;
}

