body {
   box-sizing: border-box;
}

* {
   margin: 0;
   padding: 0;
   box-sizing: border-box;
}

html, body {
   height: 100%;
   width: 100%;
   overflow-x: hidden; /* Cambiado de overflow: hidden */
   overflow-y: auto;   /* Permitir scroll vertical */
}

body {
   font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
   background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
   display: flex;
   flex-direction: column; /* Agregado */
   align-items: center;
   min-height: 100vh; /* Cambiado para permitir contenido más alto */
   padding: 1rem;
}

.container {
   width: 100%;
   max-width: 500px;
   background: white;
   border-radius: 24px;
   box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
   padding: 2rem;
   display: flex;
   flex-direction: column;
   gap: 1.5rem;
   margin-bottom: 2rem; /* Agregado para separación */
}

.header {
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 1rem;
}
.header h1 {
   font-size: 2rem;
   font-weight: 800;
   color: #1e293b;
   margin-bottom: 0.5rem;
}

.logoapp {
   width:100px;
}

.mode-selector {
   display: flex;
   gap: 0.75rem;
   background: #f1f5f9;
   padding: 0.5rem;
   border-radius: 12px;
}

.mode-btn {
   flex: 1;
   padding: 0.75rem;
   border: none;
   border-radius: 8px;
   font-size: 1rem;
   font-weight: 600;
   cursor: pointer;
   transition: all 0.3s ease;
   background: transparent;
   color: #64748b;
}

.mode-btn.active {
   background: #667eea;
   color: white;
   box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.timer-display {
   text-align: center;
   padding: 2rem 1rem;
   background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
   border-radius: 16px;
   color: white;
}

.phase-label {
   font-size: 1.25rem;
   font-weight: 600;
   margin-bottom: 1rem;
   text-transform: uppercase;
   letter-spacing: 2px;
}

.time {
   font-size: 5rem;
   font-weight: 800;
   line-height: 1;
   margin-bottom: 1rem;
   font-variant-numeric: tabular-nums;
}

.round-info {
   font-size: 1.25rem;
   font-weight: 500;
   opacity: 0.9;
}

.settings {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
   gap: 1rem;
}

.setting-group {
   background: #f8fafc;
   padding: 1rem;
   border-radius: 12px;
}

.setting-group label {
   display: block;
   font-size: 0.875rem;
   font-weight: 600;
   color: #64748b;
   margin-bottom: 0.5rem;
   text-transform: uppercase;
   letter-spacing: 0.5px;
}

.setting-group input {
   width: 100%;
   padding: 0.75rem;
   border: 2px solid #e2e8f0;
   border-radius: 8px;
   font-size: 1rem;
   font-weight: 600;
   text-align: center;
   transition: border-color 0.3s ease;
}

.setting-group input:focus {
   outline: none;
   border-color: #667eea;
}

.controls {
   display: flex;
   gap: 0.75rem;
}

.control-btn {
   flex: 1;
   padding: 1rem;
   border: none;
   border-radius: 12px;
   font-size: 1rem;
   font-weight: 700;
   cursor: pointer;
   transition: all 0.3s ease;
   text-transform: uppercase;
   letter-spacing: 1px;
}

.start-btn {
   background: #10b981;
   color: white;
}

.start-btn:hover {
   background: #059669;
   transform: translateY(-2px);
   box-shadow: 0 8px 16px rgba(16, 185, 129, 0.3);
}

.pause-btn {
   background: #f59e0b;
   color: white;
}

.pause-btn:hover {
   background: #d97706;
   transform: translateY(-2px);
   box-shadow: 0 8px 16px rgba(245, 158, 11, 0.3);
}

.reset-btn {
   background: #ef4444;
   color: white;
}

.reset-btn:hover {
   background: #dc2626;
   transform: translateY(-2px);
   box-shadow: 0 8px 16px rgba(239, 68, 68, 0.3);
}

.control-btn:disabled {
   opacity: 0.5;
   cursor: not-allowed;
   transform: none;
}

.work-phase {
   background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.rest-phase {
   background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Estilos para toolsnav */
.toolsnav {
   display: grid;
   width: 100%;
   max-width: 500px;
   grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
   gap: 10px;
   margin-bottom: 1rem;
   padding: 0 1rem;
}

.toolsnav a {
   background: rgba(255, 255, 255, 0.9);
   color: #667eea;
   text-decoration: none;
   padding: 0.75rem 1rem;
   border-radius: 8px;
   text-align: center;
   font-weight: 600;
   font-size: 0.875rem;
   transition: all 0.3s ease;
}

.toolsnav a:hover {
   background: white;
   transform: translateY(-2px);
   box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Estilos para footer */
.footer {
   display: flex;
   align-items: center;
   justify-content: center;
   text-align: center;
   line-height: 1.6;
   color: rgba(255, 255, 255, 0.9);
   background: rgba(0, 0, 0, 0.1);
   padding: 1.25rem 0.75rem;
   width: 100%;
   max-width: 500px;
   border-radius: 12px;
   margin-bottom: 1rem;
}

.footer p {
   font-size: 0.875rem;
}

.footer a {
   color: #fff;
   text-decoration: none;
   font-weight: 600;
}

.footer a:hover {
   text-decoration: underline;
}

@media (max-width: 480px) {
   .container {
      padding: 1.5rem;
      gap: 1.25rem;
   }

   .header h1 {
      font-size: 1.75rem;
   }

   .time {
      font-size: 4rem;
   }

   .settings {
      grid-template-columns: 1fr;
   }

   .controls {
      flex-direction: column;
   }
   
   .toolsnav {
      grid-template-columns: 1fr 1fr;
   }
   
   .toolsnav a {
      font-size: 0.75rem;
      padding: 0.6rem 0.5rem;
   }
}

@media (max-width: 360px) {
   .time {
      font-size: 3.5rem;
   }

   .phase-label {
      font-size: 1rem;
   }
   
   .toolsnav {
      grid-template-columns: 1fr;
   }
}

@view-transition { navigation: auto; }