:root {
  --cream: #fff7e8;
  --cream-2: #ffecd1;
  --orange: #ff8a3d;
  --orange-dark: #bf4b12;
  --blue: #1f8bd6;
  --blue-dark: #0a4f86;
  --purple: #8f70ff;
  --purple-dark: #4d35a7;
  --ink: #231a12;
  --muted: #6f5e50;
  --card: #ffffff;
  --success: #168a54;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(68, 42, 12, 0.14);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.skip-link {
  background: var(--ink);
  color: #fff;
  left: 1rem;
  padding: 0.7rem 1rem;
  position: absolute;
  top: -5rem;
  z-index: 20;
}

.skip-link:focus {
  top: 1rem;
}

.hero {
  background:
    radial-gradient(circle at 15% 8%, rgba(255, 138, 61, 0.25), transparent 28rem),
    radial-gradient(circle at 86% 12%, rgba(143, 112, 255, 0.22), transparent 24rem),
    linear-gradient(180deg, #fffaf0, var(--cream));
  overflow: hidden;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1120px;
  padding: 1rem;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-weight: 900;
  gap: 0.55rem;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  height: 2.1rem;
  justify-content: center;
  width: 2.1rem;
}

.reset-button,
.text-button {
  background: #fff;
  border: 2px solid rgba(35, 26, 18, 0.18);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 800;
  min-height: 44px;
  padding: 0.65rem 0.95rem;
}

.reset-button:hover,
.text-button:hover,
.bell-button:hover {
  border-color: var(--orange);
}

.hero-grid {
  display: grid;
  gap: 1.8rem;
  margin: 0 auto;
  max-width: 1120px;
  padding: 1.4rem 1rem 3rem;
}

.eyebrow,
.section-kicker {
  color: var(--orange-dark);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  margin: 0 0 0.45rem;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.3rem, 11vw, 5rem);
  letter-spacing: 0;
  line-height: 0.92;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.65rem, 8vw, 3rem);
  line-height: 1;
  margin-bottom: 0.65rem;
}

h3 {
  font-size: 1.35rem;
  line-height: 1.12;
}

.hero-text,
.section-heading p,
.map-tips,
.footer {
  color: var(--muted);
}

.hero-text {
  font-size: 1.08rem;
  max-width: 40rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-weight: 950;
  justify-content: center;
  min-height: 50px;
  padding: 0.8rem 1.1rem;
  text-decoration: none;
}

.button.primary {
  background: var(--ink);
  color: #fff;
}

.button.ghost {
  background: #fff;
  border: 2px solid rgba(35, 26, 18, 0.15);
}

.tilin-stage {
  min-height: 310px;
  position: relative;
}

.dog-card {
  align-items: center;
  animation: floaty 4s ease-in-out infinite;
  background: #fff;
  border: 3px solid rgba(35, 26, 18, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0 auto;
  max-width: 310px;
  padding: 1.3rem;
}

.dog {
  height: 210px;
  position: relative;
  width: 230px;
}

.dog-fluff,
.dog-face,
.dog-ear {
  position: absolute;
}

.dog-fluff {
  background: radial-gradient(circle, #ffb35f 0 58%, #f07a2a 59% 100%);
  border-radius: 48% 52% 45% 55%;
  inset: 22px 12px 0;
}

.dog-face {
  background: #ffd29a;
  border-radius: 48% 48% 44% 44%;
  height: 120px;
  left: 55px;
  top: 52px;
  width: 120px;
  z-index: 2;
}

.dog-ear {
  background: #e56824;
  height: 78px;
  top: 18px;
  width: 58px;
  z-index: 1;
}

.dog-ear.left {
  border-radius: 80% 20% 70% 30%;
  left: 38px;
  transform: rotate(-24deg);
}

.dog-ear.right {
  border-radius: 20% 80% 30% 70%;
  right: 38px;
  transform: rotate(24deg);
}

.eye,
.nose,
.smile {
  position: absolute;
}

.eye {
  background: var(--ink);
  border-radius: 50%;
  height: 13px;
  top: 45px;
  width: 13px;
}

.eye.left {
  left: 33px;
}

.eye.right {
  right: 33px;
}

.nose {
  background: var(--ink);
  border-radius: 45% 45% 55% 55%;
  height: 16px;
  left: 52px;
  top: 65px;
  width: 18px;
}

.smile {
  border-bottom: 3px solid var(--ink);
  border-radius: 0 0 999px 999px;
  height: 18px;
  left: 42px;
  top: 76px;
  width: 38px;
}

.speech-bubble {
  background: var(--blue);
  border-radius: 999px;
  color: #fff;
  font-weight: 950;
  padding: 0.65rem 1rem;
}

.sparkle {
  background: var(--purple);
  border-radius: 50%;
  height: 20px;
  position: absolute;
  width: 20px;
}

.sparkle-a {
  left: 1rem;
  top: 2rem;
}

.sparkle-b {
  bottom: 4rem;
  right: 1.2rem;
}

main,
.footer {
  margin: 0 auto;
  max-width: 1120px;
  padding: 0 1rem;
}

.section,
.progress-panel {
  margin: 1rem 0;
}

.progress-panel,
.section {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(35, 26, 18, 0.08);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(68, 42, 12, 0.08);
  padding: 1rem;
}

.progress-panel {
  align-items: center;
  display: grid;
  gap: 1rem;
}

.progress-wrap {
  align-items: center;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: 1fr auto;
}

.progress-track {
  background: #f1d9ba;
  border-radius: 999px;
  height: 16px;
  overflow: hidden;
}

.progress-fill {
  background: linear-gradient(90deg, var(--orange), var(--purple), var(--blue));
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width 0.35s ease;
  width: 0%;
}

.section-heading {
  margin-bottom: 1rem;
  max-width: 42rem;
}

.section-heading.compact {
  max-width: 34rem;
}

.mission-grid,
.info-grid,
.care-grid {
  display: grid;
  gap: 0.8rem;
}

.mission-card,
.info-card,
.rule-list article,
.care-grid article {
  background: var(--card);
  border: 2px solid rgba(35, 26, 18, 0.08);
  border-radius: var(--radius);
  box-shadow: 0 8px 18px rgba(68, 42, 12, 0.07);
}

.mission-card {
  color: var(--ink);
  display: grid;
  gap: 0.35rem;
  min-height: 122px;
  padding: 1rem;
  text-align: left;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.mission-card:hover,
.mission-card:focus-visible,
.choice-button:hover,
.choice-button:focus-visible {
  transform: translateY(-2px);
}

.mission-card.done {
  background: #effaf4;
  border-color: var(--success);
}

.mission-card.done::after {
  color: var(--success);
  content: "Patita ganada";
  font-weight: 950;
}

.badge,
.round-pill {
  background: var(--cream-2);
  border-radius: 999px;
  color: var(--orange-dark);
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 950;
  padding: 0.25rem 0.55rem;
  width: fit-content;
}

.game-shell {
  background: var(--ink);
  border-radius: var(--radius);
  color: #fff;
  padding: 0.9rem;
}

.game-screen {
  background: linear-gradient(145deg, #342414, #5a341d);
  border-radius: var(--radius);
  min-height: 250px;
  padding: 1rem;
  text-align: center;
}

.signal-icon {
  align-items: center;
  background: #fff;
  border-radius: 50%;
  color: var(--ink);
  display: inline-flex;
  font-size: 3rem;
  height: 6.4rem;
  justify-content: center;
  margin: 1rem 0;
  width: 6.4rem;
}

.game-actions {
  display: grid;
  gap: 0.65rem;
  margin: 0.8rem 0;
}

.choice-button {
  background: #fff;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 950;
  min-height: 52px;
  padding: 0.85rem 1rem;
  transition: transform 0.18s ease, background 0.18s ease;
}

.choice-button.correct {
  background: #b8ffd7;
}

.choice-button.wrong {
  background: #ffd0ca;
}

.score-row {
  align-items: center;
  display: flex;
  gap: 0.8rem;
  justify-content: space-between;
}

.bell-grid {
  display: grid;
  gap: 1rem;
}

.mini-steps {
  display: grid;
  gap: 0.7rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mini-steps li,
.bell-sim {
  background: #fff;
  border: 2px solid rgba(35, 26, 18, 0.08);
  border-radius: var(--radius);
  box-shadow: 0 8px 18px rgba(68, 42, 12, 0.07);
  padding: 0.9rem;
}

.bell-sim {
  align-content: center;
  display: grid;
  gap: 0.75rem;
}

.bell-button {
  background: var(--blue);
  border: 2px solid var(--blue-dark);
  border-radius: 999px;
  color: #fff;
  font-weight: 950;
  min-height: 54px;
  padding: 0.85rem 1rem;
}

.bell-feedback {
  color: var(--muted);
  font-weight: 800;
  margin: 0;
}

.checklist {
  display: grid;
  gap: 0.7rem;
}

.checklist label {
  align-items: center;
  background: #fff;
  border: 2px solid rgba(35, 26, 18, 0.08);
  border-radius: var(--radius);
  display: flex;
  gap: 0.75rem;
  min-height: 56px;
  padding: 0.8rem;
}

.materials label {
  background: #fffaf2;
}

.checklist input {
  accent-color: var(--success);
  height: 1.35rem;
  width: 1.35rem;
}

.timeline {
  counter-reset: day;
  display: grid;
  gap: 0.7rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  background: #fff;
  border-left: 6px solid var(--purple);
  border-radius: var(--radius);
  padding: 0.85rem;
}

.home-map {
  display: grid;
  gap: 1rem;
}

.room {
  aspect-ratio: 1 / 0.82;
  background:
    linear-gradient(90deg, rgba(31, 139, 214, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(31, 139, 214, 0.12) 1px, transparent 1px),
    #fff;
  background-size: 28px 28px;
  border: 4px solid var(--blue-dark);
  border-radius: var(--radius);
  min-height: 260px;
  position: relative;
}

.map-label,
.bath-base {
  position: absolute;
}

.map-label {
  background: var(--cream-2);
  border: 2px solid rgba(35, 26, 18, 0.08);
  border-radius: 999px;
  font-weight: 900;
  padding: 0.45rem 0.65rem;
}

.sofa {
  left: 1rem;
  top: 1rem;
}

.food {
  right: 1rem;
  top: 34%;
}

.gate {
  bottom: 1rem;
  left: 1rem;
}

.bath-base {
  align-items: center;
  background: var(--blue);
  border: 4px solid #fff;
  border-radius: var(--radius);
  bottom: 1rem;
  color: #fff;
  display: flex;
  flex-direction: column;
  font-weight: 950;
  justify-content: center;
  min-height: 112px;
  padding: 0.7rem;
  right: 1rem;
  text-align: center;
  width: min(46%, 230px);
}

.bath-base small {
  font-weight: 700;
}

.map-tips {
  margin: 0;
  padding-left: 1.2rem;
}

.info-card,
.care-grid article {
  padding: 1rem;
}

.info-card span,
.care-grid span {
  display: block;
  font-size: 2rem;
  margin-bottom: 0.4rem;
}

.info-card p,
.care-grid p {
  color: var(--muted);
  margin-bottom: 0;
}

.rule-list {
  display: grid;
  gap: 0.7rem;
}

.rule-list article {
  display: grid;
  gap: 0.25rem;
  padding: 0.9rem;
}

.accident-section {
  background: #fff9f2;
}

.rule-list span {
  color: var(--muted);
}

.alert-section {
  background: #fff1f0;
  border-color: rgba(180, 35, 24, 0.25);
}

.alert-section h2 {
  color: var(--danger);
}

.alert-section p {
  margin-bottom: 0;
}

.footer {
  padding-bottom: 2rem;
  padding-top: 1.2rem;
}

.footer h2 {
  color: var(--ink);
  font-size: 1.35rem;
}

.footer ul {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding-left: 1.2rem;
}

:focus-visible {
  outline: 4px solid rgba(31, 139, 214, 0.45);
  outline-offset: 3px;
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-10px) rotate(1deg);
  }
}

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

@media (min-width: 680px) {
  .hero-grid,
  .progress-panel,
  .home-map,
  .bell-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero-grid {
    align-items: center;
    padding-bottom: 4.5rem;
    padding-top: 3rem;
  }

  .mission-grid,
  .info-grid,
  .care-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-actions {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 960px) {
  .mission-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .info-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .care-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .section,
  .progress-panel {
    padding: 1.35rem;
  }
}
