:root {
  --ms-blue: #00a8e8;
  --ms-blue-deep: #007fae;
  --ms-purple: #8d2eaa;
  --ms-lime: #c6db3d;
  --ms-pink: #e91e63;
  --ms-ink: #243044;
  --ms-muted: #667085;
  --ms-surface: #ffffff;
  --ms-canvas: #f6fbff;
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--ms-ink);
  background-color: var(--ms-canvas);
  background-image:
    radial-gradient(circle at 8% 8%, rgba(198, 219, 61, .2), transparent 28%),
    radial-gradient(circle at 94% 92%, rgba(0, 168, 232, .16), transparent 32%);
  font-family: "Poppins", sans-serif;
}

.activity-shell {
  width: min(100%, 620px);
  margin-inline: auto;
  padding: 20px clamp(12px, 4vw, 28px) 24px;
  animation: activity-in .55s cubic-bezier(.2, .75, .25, 1) both;
}

.activity-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 8px;
}

.activity-copy { min-width: 0; }

.activity-kicker {
  display: block;
  margin-bottom: 2px;
  color: var(--ms-blue-deep);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.activity-header h1 {
  margin: 0;
  color: var(--ms-ink);
  font-family: "Fredoka", sans-serif;
  font-size: clamp(1.65rem, 6vw, 2.2rem);
  line-height: 1;
}

.activity-header p {
  margin: 5px 0 0;
  color: var(--ms-muted);
  font-size: .88rem;
}

.model-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid rgba(0, 168, 232, .3);
  border-radius: 999px;
  color: var(--ms-blue-deep);
  background: var(--ms-surface);
  box-shadow: 0 4px 14px rgba(36, 48, 68, .08);
  font: 600 .8rem "Poppins", sans-serif;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.model-button svg { fill: currentColor; }

.model-button:hover {
  transform: translateY(-2px);
  border-color: var(--ms-blue);
  box-shadow: 0 8px 20px rgba(0, 127, 174, .14);
}

.model-button:active { transform: translateY(0) scale(.97); }

.model-button:focus-visible,
#buttonOk:focus-visible {
  outline: 3px solid rgba(0, 168, 232, .35);
  outline-offset: 3px;
}

.activity-hint {
  margin: 0 0 10px;
  color: var(--ms-muted);
  font-size: .68rem;
  line-height: 1.45;
}

.game-stage {
  display: flex;
  justify-content: center;
  width: 100%;
}

#ardoraMain {
  display: flex;
  align-items: center;
  width: fit-content;
  padding: 10px;
  overflow: hidden;
  border: 1px solid rgba(0, 168, 232, .18);
  border-radius: 22px;
  color: var(--ms-ink);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 18px 50px rgba(36, 48, 68, .14);
  font-family: "Poppins", sans-serif;
}

#ardoraEnu { display: none; }

#ardoraAct {
  flex: 0 0 auto;
  margin: 0;
  padding: 5px;
  overflow: hidden;
  border: 1px solid rgba(36, 48, 68, .1);
  border-radius: 14px;
  background: #eef6fa;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .8);
}

.imaCell {
  overflow: hidden;
  border-color: rgba(36, 48, 68, .16) !important;
  border-style: solid !important;
  border-width: 1px !important;
  border-radius: 3px;
  background: #fff;
  transition: filter .2s ease, transform .2s ease, box-shadow .2s ease;
  animation: piece-in .45s cubic-bezier(.2, .75, .25, 1) both;
}

.imaCell:nth-of-type(2) { animation-delay: .04s; }
.imaCell:nth-of-type(3) { animation-delay: .08s; }
.imaCell:nth-of-type(4) { animation-delay: .12s; }
.imaCell:nth-of-type(5) { animation-delay: .16s; }
.imaCell:nth-of-type(6) { animation-delay: .2s; }

.imaCell:hover {
  z-index: 2;
  filter: brightness(1.04) saturate(1.05);
  box-shadow: 0 0 0 3px rgba(198, 219, 61, .65);
}

.imaCell img {
  display: block;
  width: 55px;
  height: 399px;
  max-width: none;
  box-shadow: none;
  user-select: none;
  -webkit-user-drag: none;
}

#ardoraActCanvas { border-radius: 12px; }

#ardoraTab {
  flex: 0 0 76px;
  width: 76px;
  height: 104px;
  padding: 3px;
}

#buttonOk {
  position: relative;
  inset: auto;
  width: 70px;
  height: 70px;
  overflow: visible;
  border: 0;
  border-radius: 50%;
  background: var(--ms-blue);
  box-shadow: 0 9px 22px rgba(0, 127, 174, .28);
  transition: transform .2s ease, box-shadow .2s ease;
}

#buttonOk::after {
  content: "Comprobar";
  position: absolute;
  top: 76px;
  left: 50%;
  color: var(--ms-blue-deep);
  font: 600 .65rem "Poppins", sans-serif;
  white-space: nowrap;
  transform: translateX(-50%);
}

#buttonOk:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 13px 26px rgba(0, 127, 174, .34);
}

#buttonOk:active { transform: scale(.94); }

#buttonOkCanvas { border-radius: 50%; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes activity-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes piece-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 500px) {
  .activity-shell { padding-top: 14px; }
  .activity-header { align-items: center; gap: 10px; }
  .activity-header p { font-size: .78rem; }
  .model-button { padding-inline: 11px; }
  .activity-hint { display: none; }

  #ardoraMain {
    flex-direction: column;
    padding: 7px;
    border-radius: 18px;
  }

  #ardoraTab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 330px;
    height: 80px;
  }

  #buttonOk::after {
    top: 50%;
    left: 80px;
    transform: translateY(-50%);
  }
}

@media (max-width: 370px) {
  .activity-header { align-items: flex-start; }
  .activity-header p { display: none; }
  .model-button { min-height: 38px; font-size: .72rem; }
  .game-stage { height: 421px; }
  #ardoraMain {
    transform: scale(.86);
    transform-origin: top center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
