/* Reset y Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f8fafc;
  color: #0f172a;
}

/* Layout Principal */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  padding: 1.5rem 1.5rem 0.5rem;
  color: #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.logout-button,
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.15s ease;
  border: 1px solid rgba(100,116,139,0.3);
  background: #ffffff;
  color: #475569;
}

.logout-button:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fecaca;
}

.back-button:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.6);
  color: #93c5fd;
}

.status-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
  justify-content: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.7);
  color: #e5e7eb;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #38bdf8, #1d4ed8);
  color: #e5e7eb;
  font-weight: 700;
  font-size: 0.95rem;
}

.brand-text h1 {
  margin: 0;
  font-size: 1.25rem;
}

.brand-text p {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: #9ca3af;
}

/* Main Content */
.app-main {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
}

/* Orb Container */
.orb-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #e5e7eb;
  padding: 1rem 0;
}

.orb {
  position: relative;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%, #1f2937, #020617 70%);
  box-shadow: 0 0 32px rgba(56, 189, 248, 0.45), 0 0 80px rgba(37, 99, 235, 0.35);
  animation: orbFloat 6s ease-in-out infinite;
  overflow: visible;
}

.orb-core {
  width: 190px;
  height: 190px;
  border-radius: 999px;
  background: radial-gradient(circle at 25% 25%, #ffffff, #e5e7eb 55%, #cbd5f5 80%);
  box-shadow: 0 0 24px rgba(148, 163, 184, 0.7), 0 0 40px rgba(148, 163, 184, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.orb-logo-wrapper {
  width: 88%;
  height: 88%;
  border-radius: 999px;
  overflow: hidden;
}

.orb-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.orb-ring {
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(191, 219, 254, 0.4);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.6);
}

.orb-ring-1 {
  width: 230px;
  height: 230px;
  animation: orbRingSpin 18s linear infinite;
}

.orb-ring-2 {
  width: 190px;
  height: 190px;
  border-color: rgba(129, 140, 248, 0.6);
  animation: orbRingSpinReverse 22s linear infinite;
}

.orb-pulse {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.35), transparent 70%);
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

.orb-status {
  margin-top: 1.6rem;
  max-width: 340px;
  font-size: 1.05rem;
  color: #9ca3af;
  text-shadow: 0 0 18px rgba(56, 189, 248, 0.8), 0 0 32px rgba(37, 99, 235, 0.7);
}

.orb.typing .orb-core {
  animation: orbCorePulse 0.7s ease-in-out infinite;
}

.orb.typing .orb-pulse {
  opacity: 1;
  animation: orbPulse 1.2s ease-out infinite;
}

.orb.result-found {
  box-shadow: 0 0 40px rgba(74, 222, 128, 0.7), 0 0 80px rgba(34, 197, 94, 0.5);
}

.orb.no-result {
  box-shadow: 0 0 36px rgba(148, 163, 184, 0.7), 0 0 76px rgba(148, 163, 184, 0.5);
}

/* Search Card */
.search-card {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 1rem;
  padding: 1.25rem 1.5rem 1.5rem;
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.4), 0 8px 10px -6px rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.search-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #9ca3af;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper input[type="text"] {
  width: 100%;
  padding: 0.75rem 0.9rem 0.75rem 2.5rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  outline: none;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.search-input-wrapper input[type="text"]::placeholder {
  color: #6b7280;
}

.search-input-wrapper input[type="text"]:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.6);
  background: rgba(15, 23, 42, 1);
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  font-size: 0.95rem;
  color: #6b7280;
}

.search-helper {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
}

/* Results */
.results {
  max-width: 1040px;
  width: 100%;
  margin: 0 auto 2rem;
  background: rgba(15, 23, 42, 0.75);
  border-radius: 1rem;
  padding: 0.75rem 1rem 1rem;
  border: 1px solid rgba(31, 41, 55, 0.9);
  box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.5), 0 4px 6px -4px rgba(15, 23, 42, 0.4);
  color: #e5e7eb;
}

.results-placeholder {
  padding: 0.75rem;
  font-size: 0.85rem;
  color: #6b7280;
}

.result-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.result-link:hover {
  transform: translateX(4px);
  opacity: 0.95;
}

.result {
  padding: 0.75rem 0.25rem;
  border-bottom: 1px solid rgba(31, 41, 55, 0.9);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.result-link:hover .result {
  background-color: rgba(30, 64, 175, 0.15);
  border-radius: 0.5rem;
}

.result:last-child {
  border-bottom: none;
}

.result-action {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #7dd3fc;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.result-link:hover .result-action {
  opacity: 1;
}

.result-title {
  font-weight: 600;
  font-size: 0.98rem;
}

.result-meta {
  font-size: 0.8rem;
  color: #9ca3af;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.5);
  margin-top: 0.2rem;
}

.no-results {
  padding: 0.75rem;
  font-size: 0.85rem;
  color: #9ca3af;
}

.error-message {
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.6);
  color: #fecaca;
  font-size: 0.85rem;
}

.app-footer {
  padding: 0.75rem 1.5rem 1.25rem;
  text-align: center;
  font-size: 0.75rem;
  color: #6b7280;
}

/* Login Page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #f8fafc;
}

.login-container {
  width: 100%;
  max-width: 450px;
  padding: 1.5rem;
}

.login-box {
  background: #ffffff;
  border-radius: 1.5rem;
  padding: 2.5rem 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
}

.login-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  display: block;
  border-radius: 50%;
  object-fit: contain;
}

.login-box h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  color: #1e293b;
  font-weight: 700;
}

.subtitle {
  color: #64748b;
  margin-bottom: 2rem;
  font-size: 0.95rem;
  font-weight: 400;
}

/* Alerts */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  margin-bottom: 0;
  font-size: 0.875rem;
  font-weight: 500;
}

.alert-error {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.alert-success {
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #166534;
}

/* Forms */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  color: #334155;
  font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  background: #ffffff;
  color: #1e293b;
  outline: none;
  transition: all 0.2s ease;
}

.form-group input::placeholder,
.form-group select::placeholder,
.form-group textarea::placeholder {
  color: #94a3b8;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Buttons */
.btn {
  padding: 0.875rem 1.75rem;
  border: none;
  border-radius: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: #3b82f6;
  color: #ffffff;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.btn-primary:hover {
  background: #2563eb;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-primary:active {
  background: #1d4ed8;
}

.btn-secondary {
  background: #ffffff;
  color: #475569;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-secondary:active {
  background: #f1f5f9;
}

.btn-success {
  background: #f59e0b;
  color: #ffffff;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.btn-success:hover {
  background: #d97706;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-success:active {
  background: #b45309;
}

.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #94a3b8;
}

.btn-disabled:hover {
  background: #94a3b8;
  transform: none;
}

/* Modal de Notificación */
.error-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.error-modal.show {
  display: flex;
}

.error-modal-content {
  background: rgba(15, 23, 42, 0.98);
  border-radius: 1.5rem;
  padding: 2.5rem;
  max-width: 500px;
  width: 90%;
  border: 2px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.2), 0 20px 60px rgba(0, 0, 0, 0.8);
  animation: slideIn 0.3s ease-out;
}

.error-modal-content.success {
  border-color: rgba(34, 197, 94, 0.3);
  box-shadow: 0 0 40px rgba(34, 197, 94, 0.2), 0 20px 60px rgba(0, 0, 0, 0.8);
}

.error-modal-content.error {
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.2), 0 20px 60px rgba(0, 0, 0, 0.8);
}

.error-modal-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  text-align: center;
  animation: iconBounce 0.6s ease-out;
}

.error-modal-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  text-align: center;
}

.error-modal-content.success .error-modal-title {
  color: #4ade80;
}

.error-modal-content.error .error-modal-title {
  color: #f87171;
}

.error-modal-message {
  font-size: 0.95rem;
  color: #e5e7eb;
  margin-bottom: 2rem;
  text-align: center;
  line-height: 1.6;
}

.error-modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.error-modal-btn {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.error-modal-btn-primary {
  background: linear-gradient(135deg, #1d4ed8, #38bdf8);
  color: #e5e7eb;
  box-shadow: 0 10px 15px -3px rgba(30, 64, 175, 0.8);
}

.error-modal-btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.error-modal-btn-secondary {
  background: rgba(239, 68, 68, 0.3);
  color: #fef2f2;
  border: 1px solid rgba(239, 68, 68, 0.7);
}

.error-modal-btn-secondary:hover {
  background: rgba(239, 68, 68, 0.4);
  border-color: rgba(239, 68, 68, 0.9);
}

@keyframes iconBounce {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes iconBounce {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  background: #ffffff;
  color: #3b82f6;
  border: 1px solid #e2e8f0;
  font-weight: 600;
}

.btn-small:hover {
  background: #f8fafc;
  color: #2563eb;
}

.btn-small-white {
  background: #ffffff;
  color: #3b82f6;
  border: 1px solid #e2e8f0;
}

.btn-small-white:hover {
  background: #f8fafc;
  color: #2563eb;
}

/* Container */
.container {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

/* Content wrapper para empujar el footer abajo */
.content-wrapper {
  flex: 1;
}
/* Header */
.header {
  background: #ffffff;
  padding: 1rem 1.5rem;
  border-radius: 0;
  margin-bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #e2e8f0;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 50%;
}

.header h1 {
  color: #1e293b;
  font-size: 1.125rem;
  margin: 0;
  font-weight: 600;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #475569;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Header Salida (Azul) */
.header-salida {
  background: #ffffff;
  border-bottom: 3px solid #3b82f6;
}

.header-salida h1 {
  color: #1e293b;
}

.header-salida .user-info {
  color: #475569;
}

/* Header Entrada (Verde) */
.header-entrada {
  background: #ffffff;
  border-bottom: 3px solid #10b981;
}

.header-entrada h1 {
  color: #1e293b;
}

.header-entrada .user-info {
  color: #475569;
}

/* Main Content */
.main-content {
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

/* Zona Info */
.zona-info {
  background: #f8fafc;
  color: #1e293b;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem 0.75rem 0 0;
  margin: 0;
  border-bottom: 1px solid #e2e8f0;
}

.zona-info h2 {
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
  margin-top: 0;
  font-weight: 600;
  color: #1e293b;
}

.zona-info p {
  margin: 0;
  font-size: 0.875rem;
  color: #64748b;
}

/* Zona Info Salida (Azul) */
.zona-info-salida {
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  border-bottom: none;
}

.zona-info-salida h2,
.zona-info-salida p {
  color: #ffffff;
}

/* Zona Info Entrada (Verde) */
.zona-info-entrada {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  border-bottom: none;
}

.zona-info-entrada h2,
.zona-info-entrada p {
  color: #ffffff;
}

.zona-tiempo {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tiempo-label {
  font-size: 1rem;
  font-weight: 600;
  opacity: 0.95;
}

.tiempo-valor {
  font-size: 2rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1.25rem;
  border-radius: 0.75rem;
  min-width: 120px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tiempo-valor.warning {
  background: rgba(251, 146, 60, 0.3);
  color: #fed7aa;
}

.tiempo-valor.critical {
  background: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  animation: tiempoAlerta 1s infinite;
}

@keyframes tiempoAlerta {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Preguntas Section */
.preguntas-section {
  border: none;
  border-radius: 0;
  padding: 1rem 1.5rem;
  margin: 0;
  background: #ffffff;
  flex: 1;
  overflow-y: auto;
}

.preguntas-section legend {
  font-size: 1.1rem;
  font-weight: 600;
  color: #0f172a;
  padding: 0 0 1rem 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(100,116,139,0.2);
  width: 100%;
}

/* Formulario Ronda */
.formulario-ronda {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.formulario-ronda .form-group {
  margin-bottom: 1rem;
}

.formulario-ronda button[type="submit"] {
  margin: 0 1.5rem 1.5rem 1.5rem;
  margin-top: auto;
  flex-shrink: 0;
}

/* QR Scanner */
.qr-scanner {
  text-align: center;
  padding: 2rem;
}

.qr-scanner h2 {
  color: #e5e7eb;
  margin-bottom: 0.75rem;
}

.qr-scanner p {
  color: #9ca3af;
  margin-bottom: 2rem;
}

.qr-input {
  width: 100%;
  max-width: 400px;
  padding: 0.75rem;
  border: 2px solid rgba(148, 163, 184, 0.7);
  border-radius: 0.7rem;
  font-size: 0.95rem;
  text-align: center;
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  outline: none;
  transition: border-color 0.15s ease;
}

.qr-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.6);
}

/* Status Box */
.status-box {
  background: rgba(15, 23, 42, 0.6);
  border-left: 4px solid #38bdf8;
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 5px;
}

.status-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  color: #e5e7eb;
  font-size: 0.95rem;
}

.status-item:last-child {
  border-bottom: none;
}

.status-label {
  color: #cbd5f5;
  font-weight: 600;
}

.status-value {
  color: #e5e7eb;
  font-family: monospace;
  font-size: 0.9rem;
}

.status-value.success {
  color: #86efac;
}

.status-value.error {
  color: #fecaca;
}

.status-value.info {
  color: #7dd3fc;
}

/* Button Group */
.button-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 30px;
}

.button-group:has(.btn:only-child) {
  grid-template-columns: 1fr;
}

/* Footer */
.footer {
  text-align: center;
  padding: 1.5rem;
  color: #94a3b8;
  font-size: 0.875rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  margin-top: auto;
}

/* Responsive */
@media (min-width: 641px) {
  .container {
    max-width: 600px;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0.5rem;
    max-width: 100%;
  }

  .app-main {
    padding: 0.75rem;
  }

  .header {
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    flex-direction: row;
    align-items: center;
  }

  .header-logo {
    width: 35px;
    height: 35px;
  }

  .header h1 {
    font-size: 1.1rem;
  }

  .user-info {
    font-size: 0.85rem;
  }

  .user-info span {
    display: none;
  }

  .main-content {
    padding: 0;
    border-radius: 0.75rem;
  }

  .zona-info {
    padding: 1.25rem;
    margin: 0;
    border-radius: 0.75rem 0.75rem 0 0;
  }

  .zona-info h2 {
    font-size: 1.5rem;
  }

  .zona-info p {
    font-size: 0.9rem;
  }

  .zona-tiempo {
    margin-top: 1rem;
    padding-top: 1rem;
  }

  .tiempo-label {
    font-size: 0.9rem;
  }

  .tiempo-valor {
    font-size: 1.75rem;
    padding: 0.4rem 1rem;
    min-width: 100px;
  }

  .preguntas-section {
    padding: 1rem;
  }

  .preguntas-section legend {
    font-size: 1rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .formulario-ronda .form-group {
    margin-bottom: 1rem;
  }

  .formulario-ronda button[type="submit"] {
    margin: 0 1rem 1rem 1rem;
  }

  .login-box {
    padding: 1.5rem;
  }

  .btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
  }

  .btn-small {
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
  }
}

/* Animations */
@keyframes orbFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-12px);
  }
}

@keyframes orbCorePulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 35px rgba(56, 189, 248, 0.9), 0 0 70px rgba(59, 130, 246, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 45px rgba(56, 189, 248, 1), 0 0 90px rgba(96, 165, 250, 0.9);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 35px rgba(56, 189, 248, 0.9), 0 0 70px rgba(59, 130, 246, 0.7);
  }
}

@keyframes orbRingSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes orbRingSpinReverse {
  0% {
    transform: rotate(360deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

@keyframes orbPulse {
  0% {
    opacity: 0.8;
    transform: scale(0.9);
  }
  100% {
    opacity: 0;
    transform: scale(1.2);
  }
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #ffffff;
  border-radius: 1rem;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(100,116,139,0.2);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #0f172a;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #64748b;
  line-height: 1;
  padding: 0;
}

.modal-close:hover { color: #0f172a; }

.modal-content form {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.badge-success {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.badge-naranja {
  background: #ffedd5;
  color: #9a3412;
  border-color: #fdba74;
}

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 2px solid rgba(100,116,139,0.2);
  color: #64748b;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.table td {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(100,116,139,0.1);
  color: #0f172a;
}

.table tr:last-child td { border-bottom: none; }
