* {
  box-sizing: border-box;
}

:root {
  --rojo:#ff0000;
  --verde:#4caf50;
  --amarillo:#ffb300;
  --amarillo_oscuro:#f9520f;
  --naranja:#ff5722;
  --rosa:#e91e63;
  --gris:#7b7878a1;
  --texto:#fff;
}

body {
  margin:0; font-family:"Arial Rounded MT Bold", Arial, sans-serif;
  background:#fefefe; color:#333;
}

header{
  background:var(--rojo);
  color:#fff;
  padding:12px 20px;
  font-size:28px;
  font-weight:700;
  position:sticky;
  top:0; z-index:5;
  display:flex;
  align-items:center;
  justify-content:space-between;
}

#burbujaTiempo{
  width:60px;
  height:60px;
  border-radius:50%;
  background:conic-gradient(var(--verde) 0deg, var(--verde) 360deg);
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
}

#tiempoTexto{
  position:absolute;
  font-size:14px;
  font-weight:700;
  color:#fff;
  text-align:center;
  text-shadow:0 1px 2px rgba(0,0,0,.3);
}

#busqueda{
  display:flex; justify-content:center; gap:10px; padding:16px;
  background:#fff; border-bottom:1px solid #eee;
}

#busquedaQuery{
  padding:12px 16px; font-size:18px; border-radius:25px; border:2px solid #ddd; width:100%; box-sizing:border-box; outline:none;
}

button{
  background:var(--rojo); color:#fff; border:none; padding:12px 20px; font-size:16px; border-radius:25px; cursor:pointer; transition:.2s;
}

button:hover{ background:#cc0000; }

#videos{
  display:grid; grid-template-columns:repeat(auto-fit, minmax(320px, 1fr));
  gap:20px; padding:20px; justify-items:center;
}

/* Video card container */
.video{
  background:#fff; border-radius:20px; box-shadow:0 4px 10px rgba(0,0,0,.1);
  padding:4px; width:320px; transition:transform .15s;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-bottom: 0;
  /*height: 200px;*/
}

.video:hover{ transform:scale(1.03); }
.video h4{ font-size:16px; margin-top:10px; height:40px; overflow:hidden; }

.pill{
  display:inline-block;
  background:var(--gris);
  color:#fff;
  font-size:13px;
  font-weight:700;
  padding:4px 10px;
  border-radius:999px;
  margin-bottom:8px;
  box-shadow:0 2px 6px rgba(0,0,0,.2);
  max-width: 80px;
  margin-left: 0;
  margin-right: auto; 
}

.bloqueado{ color:var(--rosa); font-weight:700; font-size:22px; text-align:center; margin-top:40px;}

#parental{
  margin:6px auto 28px; padding:16px; border-radius:15px; background:#f4f4f4; width:320px; text-align:center;
  border:1px solid #e9e9e9;
}

#parental h3{ margin:6px 0 12px; }
#parental input{
  margin:6px 0; padding:10px; border-radius:10px; border:1px solid #ccc; width:100%; font-size:14px; box-sizing:border-box;
}

/* Player wrapper with 16:9 aspect ratio */
.player {
  position: relative;
  width: 100%;
  /*padding-top: 56.25%;*/ /* 16:9 aspect ratio */
  margin-bottom: 1px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

/* Make the iframe fill the .player container */
.player iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

#loading{
  display:none; text-align:center; margin-top:20px; font-weight:bold; font-size:18px;
}

.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
}

.spinner {
  border: 6px solid #f3f3f3; /* fondo del círculo */
  border-top: 6px solid #4caf50; /* color del spinner */
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: girar 1s linear infinite;
  margin-bottom: 10px;
}

.spinner-text {
  font-weight: bold;
  font-size: 16px;
  color: #333;
}

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

.login-container {
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  text-align: center;
  width: 90%;              /* ✅ ocupa el 90% del ancho disponible */
  max-width: 400px;        /* ✅ no se hace gigante en pantallas grandes */
  margin: 50px auto;
}

.login-container h2 {
  margin-bottom: 20px;
}

.login-container input {
  display: block;
  width: 100%;          /* ocupa todo el ancho del contenedor */
  margin-bottom: 15px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 14px;
}

.login-container button {
  width: 100%;
  padding: 10px;
  border: none;
  background: #e62117; /* estilo YouTube Kids */
  color: white;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
}

.login-container button:hover {
  background: #c81d13;
}

/* ✅ Ajustes específicos para pantallas pequeñas */
@media (max-width: 480px) {
  .login-container {
    margin: 20px auto;
    padding: 15px;
  }

  .login-container input,
  .login-container button {
    font-size: 14px;
    padding: 10px;
  }
}

.error {
  color: red;
  margin-bottom: 10px;
}
