@import url('https://fonts.googleapis.com/css?family=Montserrat:400,800');

* {
  box-sizing: border-box;
}
:root {
  --bg: #061b1a; /* fondo oscuro Miku */

  --card1: #baf3ee; /* turquesa pastel claro */
  --card2: #9fe5de; /* turquesa pastel */

  --btn1: #39c5bb; /* botón Miku */
  --btn2: #0f8f87; /* botón oscuro */
  --shadow: 0 18px 40px rgba(0, 0, 0, .45);
  --radius: 18px;

  --login-full: 440px;
  --login-mini: 170px;
  --reg-full: 780px;
  --reg-mini: 170px;

  --t: 380ms;
  --ease: cubic-bezier(.2, .9, .2, 1);

  --spot-x: 28%;
  --spot-y: 44%;

  --spot-1: rgba(102, 255, 240, 0.60); /* glow Miku claro */
  --spot-2: rgba(57, 197, 187, 0.40);  /* Miku principal */
  --spot-3: rgba(10, 60, 58, 0.25);    /* sombra turquesa */
  --spot-4: rgba(0, 0, 0, 0.92);       /* fondo oscuro */

  --spot-blur: 70px;

  --home-bg: rgba(255, 255, 255, .06);
  --home-border: rgba(255, 255, 255, .14);
  --home-text: #d8fff1;

  --tool-shell: rgba(8, 22, 21, 0.85);
  --tool-border: rgba(255, 255, 255, 0.08);
  --tool-icon-bg: #ffffff;
  --tool-icon-color: #3b3b3b;

  --field-text: #1b1b1b;
  --field-line: rgba(0, 0, 0, 0.18);
  --field-line-active: #0f8f87;
  --field-label: rgba(0, 0, 0, 0.42);
  --field-label-active: #0f8f87;
}

body.light {
  --bg: linear-gradient(135deg, #66e7d9 0%, #46cdbd 45%, #2fb4a7 100%);

  --card1: #eaffff;
  --card2: #c9fff5;

  --btn1: #35b39a;
  --btn2: #3fd7c6;

  --spot-1: rgba(63, 215, 198, 0.22);
  --spot-2: rgba(53, 179, 154, 0.26);
  --spot-3: rgba(107, 100, 100, 0.10);
  --spot-4: rgba(18, 70, 66, 0.18);

  --home-bg: rgba(255,255,255,0.22);
  --home-border: rgba(53,179,154,0.25);
  --home-text: #ffffff;

  --tool-shell: rgba(255,255,255,0.72);
  --tool-border: rgba(53,179,154,0.20);
  --tool-icon-bg: #ffffff;
  --tool-icon-color: #1f8f84;

  --field-text: #5f6666;
  --field-line: rgba(53,179,154,0.25);
  --field-line-active: #35b39a;
  --field-label: rgba(107,100,100,0.60);
  --field-label-active: #35b39a;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  font-family: 'Montserrat', sans-serif;
  background: var(--bg) !important;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  isolation: isolate;
  padding-top: 30px;
  padding-bottom: 30px;
  overflow: hidden;
}

body.light .logo{
  color: #0e5c50;
}
body.light .logo-line{
  background: linear-gradient(90deg,#3fd7c6,#35b39a);
}
body.light .side-toggle{
  background: linear-gradient(180deg,#3fd7c6,#35b39a);
  color:#0e5c50;
}
body.light .home-chip{
  background: linear-gradient(180deg,#3fd7c6,#35b39a);
  border:1px solid #35b39a;
  color:white;
}
body.light::before {
  opacity: 0.75;
}
body.light .bg-effect {
  --c: rgba(10, 121, 113, 0.32);
  opacity: 0.42;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at var(--spot-x) var(--spot-y),
      var(--spot-1) 0%,
      var(--spot-2) 18%,
      var(--spot-3) 34%,
      var(--spot-4) 62%);
  filter: blur(var(--spot-blur));
  animation: spotlightBreath 5s ease-in-out infinite;
}

@keyframes spotlightBreath {
  0% {
    transform: scale(.90) translate3d(0, 14px, 0);
    filter: blur(var(--spot-blur)) brightness(.92);
  }

  50% {
    transform: scale(1.12) translate3d(0, -10px, 0);
    filter: blur(calc(var(--spot-blur) + 22px)) brightness(1.22);
  }

  100% {
    transform: scale(.90) translate3d(0, 14px, 0);
    filter: blur(var(--spot-blur)) brightness(.92);
  }
}
.home-chip {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 25;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, #39c5bb, #0f8f87);
  border: 1px solid rgba(102, 255, 240, 0.25);
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
  box-shadow:
    0 10px 25px rgba(0, 0, 0, .22),
    0 0 18px rgba(57, 197, 187, 0.22);
  backdrop-filter: blur(12px);
  transition: transform .2s ease, box-shadow .2s ease, background .25s ease;
}
.link-button {
  background: none;
  border: none;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  padding: 0;
  margin: 0;
}
.link-button:hover {
  text-decoration: none;
  opacity: 0.8;
}
.home-chip:hover {
  transform: translateY(-2px);
  box-shadow:
    0 14px 30px rgba(0, 0, 0, .28),
    0 0 22px rgba(102, 255, 240, 0.30);
}

.home-chip-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #8ef6cd, #52dca3);
  color: #082016;
  font-size: 16px;
}

.side-tools {
  position: fixed;
  top: 28px;
  right: 5px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.side-toggle-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 6px;
}

.side-toggle {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  width: auto !important;
  height: auto !important;
  border-radius: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.side-toggle-img {
  width: 150px !important;
  height: auto !important;
  object-fit: contain;
  display: block;
  transition: transform .25s ease, filter .25s ease;
}

.side-toggle:hover .side-toggle-img {
  transform: scale(1.05);
}

.example-2 {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;

  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-8px) scale(.96);
  transition:
    max-height .42s ease,
    opacity .28s ease,
    transform .32s ease;
}

.side-tools.open .example-2 {
  max-height: 420px;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.example-2 .icon-content {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .24s ease, transform .24s ease;
}

.side-tools.open .example-2 .icon-content {
  opacity: 1;
  transform: translateY(0);
}

.side-tools.open .example-2 .icon-content:nth-child(1) { transition-delay: .03s; }
.side-tools.open .example-2 .icon-content:nth-child(2) { transition-delay: .06s; }
.side-tools.open .example-2 .icon-content:nth-child(3) { transition-delay: .09s; }
.side-tools.open .example-2 .icon-content:nth-child(4) { transition-delay: .12s; }
.side-tools.open .example-2 .icon-content:nth-child(5) { transition-delay: .15s; }

.example-2 .icon-content .tooltip {
  display: none !important;
}

.example-2 .icon-content a,
.example-2 .icon-content .tool-btn {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  color: var(--tool-icon-color);
  background-color: var(--tool-icon-bg);
  border: none;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 10px 18px rgba(0, 0, 0, .14);
  transition: transform .22s ease, box-shadow .22s ease;
}

.example-2 .icon-content a:hover,
.example-2 .icon-content .tool-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(0, 0, 0, .18);
}

.example-2 .icon-content a img,
.example-2 .icon-content .tool-btn img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

.tool-emoji {
  font-size: 26px;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.tool-emoji {
  position: relative;
  z-index: 1;
  font-size: 26px;
  line-height: 1;
}

.example-2 .icon-content a:hover,
.example-2 .icon-content .tool-btn:hover {
  color: white;
}

.example-2 .icon-content a .filled,
.example-2 .icon-content .tool-btn .filled {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0;
  transition: all 0.3s ease-in-out;
}

.example-2 .icon-content a:hover .filled,
.example-2 .icon-content .tool-btn:hover .filled {
  height: 100%;
}

.example-2 .icon-content a[data-social="facebook"] .filled {
  background-color: #1877f2;
}

.example-2 .icon-content a[data-social="github"] .filled {
  background-color: #24262a;
}

.example-2 .icon-content a[data-social="udec"] .filled {
  background-color: #0f766e;
}

.example-2 .icon-content .tool-btn[data-social="language"] .filled {
  background-color: #eab308;
}

.example-2 .icon-content .tool-btn[data-social="theme"] .filled {
  background-color: #7c3aed;
}

.container {
  width: min(1180px, 92vw);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 70px;
  align-items: start;
  padding-top: 0;
  padding-bottom: 20px;
}

.brand {
  text-align: left;
  margin-top: 0;
  align-self: start;
  padding-top: 0;
}

.logo {
  font-size: 92px;
  color: #66fff0;
  margin: 0;
  letter-spacing: -1px;
  line-height: 1;
  text-shadow:
    0 0 14px rgba(57, 197, 187, 0.20),
    0 0 34px rgba(57, 197, 187, 0.14);
}

.logo-line {
  margin: 14px 0 0;
  height: 10px;
  width: 620px;
  max-width: 95%;
  background: linear-gradient(90deg, #66fff0, #39c5bb, #0f8f87);
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(57, 197, 187, 0.22);
}

.logo-line.thin {
  height: 6px;
  margin-top: 12px;
  opacity: .95;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 26px;
  align-items: stretch;
  padding-top: 0;
}

.form-container {
  background: linear-gradient(180deg, var(--card1), var(--card2));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  transition: height var(--t) var(--ease), transform var(--t) var(--ease);
  transform-origin: top center;
}

.container.login-active .sign-in-container {
  height: var(--login-full);
}

.container.login-active .sign-up-container {
  height: var(--reg-mini);
}

.container.register-active .sign-in-container {
  height: var(--login-mini);
}

.container.register-active .sign-up-container {
  height: min(450px, 80vh);
}

.full-login,
.mini-login,
.full-register,
.mini-register {
  position: absolute;
  inset: 0;
  padding: 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  visibility: hidden;
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.full-login {
  padding: 58px 32px 28px;
}

.full-register {
  padding: 12px 28px 20px;
  gap: 2px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.full-register::-webkit-scrollbar {
  width: 8px;
}

.full-register::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 999px;
}

.full-register::-webkit-scrollbar-track {
  background: transparent;
}

.container.login-active .full-login {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}

.container.register-active .mini-login {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}

.container.register-active .full-register {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}

.container.login-active .mini-register {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}

.full-login h1,
.mini-login h1,
.full-register h1,
.mini-register h1 {
  margin: -5px 0 0 0;
  font-size: 40px;
  font-weight: 900;
  text-align: center;
}

.mini-login {
  padding-top: 26px;
}

.mini-login button {
  margin-top: 12px;
}

.mini-register {
  padding-top: 28px;
}

.mini-register button {
  margin-top: 8px;
}

.full-login p,
.full-register p {
  margin: -4px 0 4px;
  font-size: 14px;
  opacity: .85;
  text-align: center;
}

.input-container {
  position: relative;
  width: 100%;
  margin: 2px 0 6px;
}

.input-container input {
  width: 100%;
  height: 50px;
  border: none;
  border-bottom: 2px solid var(--field-line);
  background: transparent;
  outline: none;
  font-size: 17px;
  font-weight: 700;
  color: var(--field-text);
  padding: 18px 44px 8px 0;
  transition: border-color .25s ease;
  border-radius: 0;
  box-shadow: none;
}

.input-container input::placeholder {
  color: transparent;
}

.input-container .label {
  position: absolute;
  left: 0;
  top: 18px;
  color: var(--field-label);
  font-size: 18px;
  font-weight: 600;
  transition: all .28s ease;
  pointer-events: none;
}

.input-container .underline {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--field-line-active);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .28s ease;
}

.input-container input:focus ~ .label,
.input-container input:not(:placeholder-shown) ~ .label {
  top: -2px;
  font-size: 13px;
  color: var(--field-label-active);
}

.input-container input:focus ~ .underline,
.input-container input:not(:placeholder-shown) ~ .underline {
  transform: scaleX(1);
}

.input-container input:focus {
  border-bottom-color: transparent;
}

.recordar {
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  margin-top: 6px;
  margin-bottom: 8px;
}

.recordar:hover {
  text-decoration: underline;
}

button {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: none;
  font-weight: 900;
  cursor: pointer;
  font-size: 16px;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .18);
}

button[type="submit"] {
  background: linear-gradient(180deg, var(--btn1), var(--btn2));
  color: #fff;
  position: relative;
  overflow: hidden;
  margin-top: 8px;
}

button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, .28);
  filter: brightness(1.05);
}

button[type="submit"]:active {
  transform: translateY(0px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .18);
  filter: brightness(0.98);
}

button[type="submit"]::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(120deg, transparent 40%, rgba(255, 255, 255, .25) 50%, transparent 60%);
  transform: translateX(-60%);
  transition: transform 450ms ease;
}

button[type="submit"]:hover::after {
  transform: translateX(60%);
}

button.ghost {
  background: transparent;
  border: 2px solid rgba(0, 0, 0, .25);
}

button.ghost:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, .10);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .22);
}

button.ghost:active {
  transform: translateY(0px);
}

.password-box {
  position: relative;
}

.password-box input {
  padding-right: 56px;
}

.toggle-pass {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-35%);
  width: 24px;
  height: 24px;
  object-fit: contain;
  cursor: pointer;
  opacity: .8;
  transition: transform .2s ease, opacity .2s ease, filter .2s ease;
  z-index: 3;
}

.toggle-pass:hover {
  opacity: 1;
  transform: translateY(-35%) scale(1.12);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .12));
}

@media (max-width: 1100px) {
  .container {
    grid-template-columns: 1fr;
    gap: 24px;
    width: min(1000px, 92vw);
    padding-top: 0;
  }

  .brand {
    text-align: center;
  }

  .logo-line {
    margin-left: auto;
    margin-right: auto;
  }

  .side-tools {
    top: auto;
    bottom: 18px;
    right: 18px;
    transform: none;
    height: auto;
    min-height: 82px;
  }

  .side-tools:hover {
    width: 120px;
  }
}

@media (max-width: 680px) {
  body {
    overflow-y: auto;
    align-items: flex-start;
    padding: 90px 12px 120px;
  }

  .home-chip-text {
    display: none;
  }

  .home-chip {
    padding: 10px;
  }

  .logo {
    font-size: 64px;
  }

  .full-login,
  .mini-login,
  .full-register,
  .mini-register {
    padding: 28px 20px;
  }

  .side-tools {
    right: 10px;
    bottom: 10px;
  }
}
.bg-effect {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
  --c: rgba(63, 215, 198, 0.22); /* color light mode por defecto */
  background-image:
    radial-gradient(4px 100px at 0px 235px, var(--c), #0000),
    radial-gradient(4px 100px at 300px 235px, var(--c), #0000),
    radial-gradient(1.5px 1.5px at 150px 117.5px, var(--c) 100%, #0000 150%),
    radial-gradient(4px 100px at 0px 252px, var(--c), #0000),
    radial-gradient(4px 100px at 300px 252px, var(--c), #0000),
    radial-gradient(1.5px 1.5px at 150px 126px, var(--c) 100%, #0000 150%),
    radial-gradient(4px 100px at 0px 150px, var(--c), #0000),
    radial-gradient(4px 100px at 300px 150px, var(--c), #0000),
    radial-gradient(1.5px 1.5px at 150px 75px, var(--c) 100%, #0000 150%),
    radial-gradient(4px 100px at 0px 253px, var(--c), #0000),
    radial-gradient(4px 100px at 300px 253px, var(--c), #0000),
    radial-gradient(1.5px 1.5px at 150px 126.5px, var(--c) 100%, #0000 150%);
  background-size:
    300px 235px, 300px 235px, 300px 235px,
    300px 252px, 300px 252px, 300px 252px,
    300px 150px, 300px 150px, 300px 150px,
    300px 253px, 300px 253px, 300px 253px;
  animation: rainGrid 120s linear infinite;
  opacity: 0.55;
}

.bg-effect::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    circle at 50% 50%,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.14) 2px
  );
  background-size: 8px 8px;
  backdrop-filter: blur(0.8em) brightness(1.15);
  animation: hueGlow 10s linear infinite;
}
body.light .bg-effect::after {
  background-image: radial-gradient(
    circle at 50% 50%,
    transparent 0,
    transparent 2px,
    rgba(255, 255, 255, 0.10) 2px
  );
  backdrop-filter: blur(0.35em) brightness(0.3);
  animation: none;
}

@keyframes rainGrid {
  0% {
    background-position:
      0px 220px, 3px 220px, 151.5px 337.5px,
      25px 24px, 28px 24px, 176.5px 150px,
      50px 16px, 53px 16px, 201.5px 91px,
      75px 224px, 78px 224px, 226.5px 350.5px;
  }
  100% {
    background-position:
      0px 6800px, 3px 6800px, 151.5px 6917.5px,
      25px 13632px, 28px 13632px, 176.5px 13758px,
      50px 5416px, 53px 5416px, 201.5px 5491px,
      75px 17175px, 78px 17175px, 226.5px 17301.5px;
  }
}

@keyframes hueGlow {
  0% {
    filter: hue-rotate(0deg);
  }
  100% {
    filter: hue-rotate(360deg);
  }
}
/* ===== INICIO GLITCH BIEN ACOMODADO ===== */

  .home-chip-glitch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  padding: 12px 22px;
}

.glitch-home-wrap {
  position: relative;
  display: inline-block;
  min-width: 56px;
  text-align: center;
}

.home-chip-glitch .home-chip-text {
  position: relative;
  z-index: 2;
  display: inline-block;
}

.glitch-home-glitch {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  display: inline-block;
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
}

.home-chip-glitch:hover .glitch-home-glitch {
  animation: glitchHomeText 0.45s steps(2, end) 2;
  opacity: 1;
}

.home-chip-glitch:hover .home-chip-text {
  opacity: 0.85;
}

body:not(.light) .glitch-home-glitch {
  color: #ffd7e8;
  text-shadow:
    2px 0 #ff4fa0,
    -2px 0 #000;
}

body.light .glitch-home-glitch {
  color: #dffffa;
  text-shadow:
    2px 0 #29cfc0,
    -2px 0 #0d5c55;
}

@keyframes glitchHomeText {
  0% {
    clip-path: inset(0 0 80% 0);
    transform: translate(0, 0);
  }
  20% {
    clip-path: inset(15% 0 55% 0);
    transform: translate(-2px, 1px);
  }
  40% {
    clip-path: inset(55% 0 20% 0);
    transform: translate(2px, -1px);
  }
  60% {
    clip-path: inset(35% 0 35% 0);
    transform: translate(-1px, 0);
  }
  80% {
    clip-path: inset(70% 0 5% 0);
    transform: translate(1px, 1px);
  }
  100% {
    clip-path: inset(0 0 100% 0);
    transform: translate(0, 0);
  }
}
.side-toggle {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  border: none;
  background: linear-gradient(180deg, #7ff5e7, #29cfc0);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 22px rgba(0, 0, 0, .18);
  padding: 0;
  overflow: hidden;
}

.side-toggle{
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  width: auto !important;
  height: auto !important;
  border-radius: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
.side-toggle-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  display: block;
}
/* =========================
   MASCOTA NUEVA
========================= */

.mascot-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center; /* 🔥 CENTRADO REAL */
  margin-top: 10px;
  min-height: 520px;
  transform: translateX(-20px); /* 👈 AQUÍ se mueve */
}

/* CONTENEDOR */
.robot {
  position: relative;
  width: 300px;
  height: 420px;
  margin: 80px auto;

  transform: scale(1.2);
  transform-origin: top center;
}

/* 👇 FLOTAR SOLO CUANDO NO BAILA */
.robot:not(.bailando) {
  animation: flotar 3.2s ease-in-out infinite;
}

/* BASE */
.robot div {
  position: absolute;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

/* CAPAS */
.cabeza { z-index: 5; }
.brazo.izq { z-index: 4; }
.torso  { z-index: 3; }
.cadera { z-index: 2; }
.brazo.der { z-index: 1; }

/* ========================= */
/* CABEZA */
/* ========================= */
.cabeza {
  width: 200px;
  height: 175px;
  top: -50px;
  left: 35px;
  background-image: url("img/cabeza.png");

  transform-origin: center bottom;
  animation: 
    cabezaIdle 3.2s ease-in-out infinite,
    parpadeo 4s infinite;
  animation-delay: 0.2s;
}

/* ========================= */
/* TORSO */
/* ========================= */
.torso {
  width: 170px;
  height: 150px;
  top: 110px;
  left: 65px;
  background-image: url("img/torso.png");
}

/* ========================= */
/* CADERA */
/* ========================= */
.cadera {
  width: 120px;
  height: 150px;
  top: 220px;
  left: 110px;
  background-image: url("img/cadera.png");

  animation: caderaIdle 3.2s ease-in-out infinite;
  animation-delay: 0.1s;
}

/* ========================= */
/* BRAZOS */
/* ========================= */
.brazo {
  position: absolute;
  top: 140px;
  width: 95px;
  height: 220px;
  transform-origin: top center;
}

/* IZQUIERDO */
.brazo.izq {
  left: 15px;
  top: 120px;
  background-image: url("img/brazo_izq.png");
  animation: brazoIzq 3.4s ease-in-out infinite;
}

/* DERECHO */
.brazo.der {
  right: 5px;
  top: 112px;
  background-image: url("img/brazo_der.png");
  animation: brazoDer 3.4s ease-in-out infinite;
  animation-delay: 0.4s;
}

/* ========================= */
/* MANOS */
/* ========================= */
.mano {
  position: absolute;
  width: 75px;
  height: 75px;
  bottom: -59px;
  left: 40%;
  transform-origin: top center;
}

.mano.izq {
  transform: translateX(-60%);
  background-image: url("img/mano_izq.png");
  animation: manoIdleIzq 2.8s ease-in-out infinite;
}

.mano.der {
  left: 70%;
  transform: translateX(-30%);
  background-image: url("img/mano_der.png");
  animation: manoIdle 3s ease-in-out infinite;
}

/* ========================= */
/* ANIMACIONES BASE */
/* ========================= */

@keyframes flotar {
  0%   { transform: translateY(0px) scale(1.2); }
  50%  { transform: translateY(-10px) scale(1.2); }
  100% { transform: translateY(0px) scale(1.2); }
}

@keyframes cabezaIdle {
  0%   { transform: rotate(0deg); }
  50%  { transform: rotate(2.5deg); }
  100% { transform: rotate(0deg); }
}

@keyframes brazoIzq {
  0%   { transform: rotate(0deg); }
  50%  { transform: rotate(6deg); }
  100% { transform: rotate(0deg); }
}

@keyframes brazoDer {
  0%   { transform: rotate(0deg); }
  50%  { transform: rotate(-3deg); }
  100% { transform: rotate(0deg); }
}

@keyframes caderaIdle {
  0%   { transform: translateY(0px); }
  50%  { transform: translateY(-4px); }
  100% { transform: translateY(0px); }
}

@keyframes manoIdleIzq {
  0%   { transform: translateX(-56%) rotate(0deg); }
  50%  { transform: translateX(-56%) rotate(10deg); }
  100% { transform: translateX(-56%) rotate(0deg); }
}

@keyframes manoIdle {
  0%   { transform: translateX(-45%) rotate(0deg); }
  50%  { transform: translateX(-45%) rotate(10deg); }
  100% { transform: translateX(-45%) rotate(0deg); }
}


/* ========================= */
/* 💃 BAILE + FLOTAR */
/* ========================= */

/* animación combinada */
.robot.bailando {
  animation: baileFlotando 1.2s ease-in-out infinite;
}

.robot.bailando .torso {
  animation: torsoBaile 1.2s ease-in-out infinite;
}

.robot.bailando .cadera {
  animation: caderaBaile 1.2s ease-in-out infinite;
}

/* ❌ quitar animaciones base */
.robot.bailando .brazo,
.robot.bailando .mano {
  animation: none;
}

/* 🔥 FIX DE TAMAÑO (AQUÍ ESTÁ LO IMPORTANTE) */
.robot.bailando .brazo {
  width: 87px;
  height: 200px;
  background-size: 100% 100%;
}

/* brazos con imágenes de baile */
.robot.bailando .brazo.izq {
  background-image: url("img/brazo_izq_baile.png");
  transform: rotate(-15eg) translateY(-2px);
}

.robot.bailando .brazo.der {
  background-image: url("img/brazo_der_baile.png");
  transform: rotate(5deg) translateY(2px);
}

/* manos ajustadas */
.robot.bailando .mano.izq {
  transform: translateX(20%) rotate(-20deg) translateY(20%);
  top: 160px;   /* 👈 súbela SOLO en baile */
 right: -40px;

}

.robot.bailando .mano.der {
  transform: translateX(-90%) rotate(20deg);
}

/* ========================= */
/* KEYFRAMES BAILE */
/* ========================= */

@keyframes baileFlotando {
  0%   { transform: translateY(0px) scale(1.2) rotate(0deg); }
  25%  { transform: translateY(-6px) scale(1.2) rotate(2deg); }
  50%  { transform: translateY(-10px) scale(1.2) rotate(0deg); }
  75%  { transform: translateY(-6px) scale(1.2) rotate(-2deg); }
  100% { transform: translateY(0px) scale(1.2) rotate(0deg); }
}

@keyframes torsoBaile {
  0%   { transform: rotate(0deg); }
  25%  { transform: rotate(4deg); }
  50%  { transform: rotate(0deg); }
  75%  { transform: rotate(-4deg); }
  100% { transform: rotate(0deg); }
}

@keyframes caderaBaile {
  0%   { transform: rotate(0deg); }
  25%  { transform: rotate(-6deg); }
  50%  { transform: rotate(0deg); }
  75%  { transform: rotate(6deg); }
  100% { transform: rotate(0deg); }
}


.ojos {
  position: absolute;
  width: 50px;
  top: 85px;
  left: 122px;

  
  animation: parpadeoOjos 4s infinite;
}

/* 👁️ PARPADEO */
@keyframes parpadeoOjos {
  0%, 90%, 100% {
    content: url("img/ojos_abiertos.png");
  }

  92% {
    content: url("img/ojos_cerrados.png");
  }

  94% {
    content: url("img/ojos_abiertos.png");
  }
}

.boca {
  position: absolute;
  width: 30px;

  top: 135px;        /* 👈 sube/baja */
  left: 70%;         /* 👈 centra base */
  transform: translateX(-50%);

  transition: all 0.2s ease;
}

.robot.escribiendo {
  animation: escribir 0.3s infinite;
}

/* =========================
   🙈 CUBRIR (CON PNGs)
========================= */

/* 🚫 quitar animaciones base */
.robot.cubrir .brazo {
  animation: none;
  
}

/* 🦾 cambiar brazos completos */
.robot.cubrir .brazo.izq {
  background-image: url("img/brazo_izq_cubrir.png");
  transform: rotate(-10deg) translateX(30px) translateY(-94px);
  width: 200px;        /* 👈 tamaño independiente */
  height: 190px;
  z-index: 10;
}

.robot.cubrir .brazo.der {
  background-image: url("img/brazo_der_cubrir.png");
  transform: rotate(10deg) translateX(-18px) translateY(-93px);
   z-index: 10;
   width: 120px;        /* 👈 tamaño independiente */
  height: 190px;
}

/* ✋ ocultar manos (si tus PNG ya las incluyen) */
.robot.cubrir .mano {
  display: none;
}

/* 😮 cara */

.robot.cubrir .boca {
  content: url("img/boca_sorprendida.png");
}