.huellas-page {
  --field-paper: #f5edd9;
  --field-ink: #24372e;
  --field-mint: #bcebd2;
  width: 100%;
  max-width: min(100%, var(--play-width, 1060px));
}
body[data-huellas] .learning-header .header-brand { flex: 1; }
body[data-huellas] .learning-header .header-brand > div { min-width: 0; }
body[data-huellas] .learning-header .header-controls { flex: 0 0 auto; width: auto; }
.huellas-page [hidden] { display: none !important; }
.huellas-page .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.huellas-top, .huellas-heading, .huellas-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 5px 10px;
}
.huellas-top {
  padding: 0 2px 7px;
  color: var(--field-mint);
  font-size: .86rem;
  font-weight: 700;
}
.huellas-workspace {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.35fr);
  gap: clamp(9px, 1.5vw, 19px);
}
.huellas-scene {
  position: relative;
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
  border-radius: 19px;
  background: #234235;
  min-height: 320px;
}
.huellas-scene img, .huellas-scene::after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.huellas-scene img { object-fit: cover; z-index: -2; }
.huellas-scene::after {
  content: "";
  background: linear-gradient(0deg, #102219 0%, #102219bc 24%, transparent 68%);
  z-index: -1;
}
.huellas-scene-label { padding: clamp(12px, 2.6vw, 32px); color: #fff8e6; }
.huellas-scene-label p { color: var(--field-mint); font-weight: 750; }
.huellas-scene-label h2 {
  font-size: clamp(1.55rem, 3.2vw, 3.4rem);
  line-height: 1.03;
  text-wrap: balance;
  margin-top: 4px;
}
.huellas-board {
  min-width: 0;
  padding: clamp(10px, 1.7vw, 24px);
  border-radius: 19px;
  background: var(--field-paper);
  color: var(--field-ink);
}
.huellas-heading { margin-bottom: 7px; }
.huellas-heading h2, .huellas-suspects h2 { font-size: clamp(1.04rem, 1.8vw, 1.55rem); line-height: 1.18; }
#huellasCount { font-size: .82rem; font-weight: 700; }
.huellas-clues, .huellas-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(5px, 1vw, 12px); }
.huellas-clues button, .huellas-animal {
  position: relative;
  color: var(--field-ink);
  border: 2px solid #adbcad;
  border-radius: 12px;
  background: #fffaf0;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.huellas-clues button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  min-height: 48px;
  padding: 3px;
  font-size: clamp(.78rem, 1.3vw, 1.04rem);
}
.huellas-clues button[aria-pressed="true"] { background: #d6efdd; border-color: #3c7157; }
.huellas-clue-icon { font-size: 1.15em; }
.huellas-clue-check, .huellas-verdict:not(:empty) {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  place-items: center;
  width: 1.35em;
  height: 1.35em;
  border-radius: 50%;
  background: #35614b;
  color: #fff;
  font-size: .82em;
}
.huellas-page :is(button, a, summary, input, [tabindex]):focus-visible {
  outline: 3px solid #248769;
  outline-offset: 2px;
}
.huellas-scene h2:focus-visible { outline-color: var(--field-mint); }
.huellas-clue-panel {
  display: grid;
  grid-template-columns: clamp(76px, 12vw, 148px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(9px, 1.5vw, 18px);
  min-height: clamp(106px, 13vw, 167px);
  margin-top: 8px;
  padding: 8px;
  border-radius: 13px;
  background: #e9dcc0;
}
.huellas-art {
  display: grid;
  place-items: center;
  align-self: stretch;
  min-height: 72px;
  border-radius: 9px;
  background: radial-gradient(ellipse at center, #f9eed6 0%, #e5c796 100%);
}
.huellas-art svg { display: block; width: min(94%, 137px); height: auto; }
.huellas-clue-copy h3 { font-size: clamp(1rem, 1.65vw, 1.45rem); line-height: 1.1; }
.huellas-clue-copy p { margin-top: 4px; font-size: clamp(.85rem, 1.2vw, 1.08rem); line-height: 1.3; }
.huellas-clue-copy .huellas-voice { margin-top: 3px; padding: 4px 9px; }
.huellas-suspects { margin-top: clamp(10px, 1.8vw, 19px); }
.huellas-choices { margin-top: 7px; }
.huellas-animal {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 4px 2px 6px;
  font-size: clamp(.88rem, 1.35vw, 1.14rem);
}
.huellas-portrait {
  width: min(100%, clamp(54px, 8vw, 110px));
  aspect-ratio: 1;
}
.huellas-portrait img { display: block; width: 100%; height: 100%; object-fit: contain; }
.huellas-animal[aria-disabled="true"] { cursor: default; }
.huellas-animal[data-result="retry"] { background: #fae6d8; border-color: #a46343; }
.huellas-animal[data-result="retry"] .huellas-verdict { background: #914930; }
.huellas-animal[data-result="found"] { background: #d6efdd; border-color: #3c7157; }
.huellas-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 14px;
  align-items: center;
  margin-top: 8px;
}
#huellasFeedback { font-size: clamp(.86rem, 1.25vw, 1.08rem); line-height: 1.3; }
#huellasFeedback[data-state="found"] { color: #214b37; font-weight: 700; }
.huellas-next-slot { min-height: 44px; }
.huellas-next-slot:has(button[hidden]) { display: none; }
.huellas-tools { justify-content: flex-end; margin: 8px 0 2px; color: #e2f3e9; }
.huellas-tools label { display: flex; gap: 6px; align-items: center; min-height: 44px; font-size: .9rem; }
.huellas-tools input { width: 18px; height: 18px; accent-color: #58c8a0; }
#huellasNotebookOpen { margin-inline-end: auto; }
.huellas-notebook {
  width: min(calc(100% - 16px), 690px);
  max-height: 94svh;
  padding: clamp(9px, 2.5vw, 22px);
  color: #24372e;
  background: #f5edd9;
}
.huellas-notebook-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.huellas-notebook-heading h2 { margin: 0; font-size: clamp(20px, 4vw, 28px); }
.huellas-notebook > p { font-size: 14px; margin: 9px 0 13px; }
.huellas-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.huellas-notebook-card {
  display: grid; align-content: start; gap: 5px;
  min-width: 0; border: 1px solid #b8ad8e; border-radius: 12px; padding: clamp(5px, 2vw, 12px);
  background: #fffaec;
}
.huellas-notebook-card label { font-size: 13px; font-weight: 700; }
.huellas-notebook-card select { width: 100%; min-height: 44px; }
.huellas-notebook-card .huellas-art { min-height: 105px; }
.huellas-notebook-card figcaption { display: grid; gap: 4px; margin-top: 6px; font-size: 13px; line-height: 1.4; }
.huellas-sources { color: #c8d9e0; font-size: .83rem; line-height: 1.5; }
.huellas-sources summary { padding: 5px 2px; cursor: pointer; }
.huellas-sources ul { padding-left: 20px; }
.huellas-sources a { color: #bcebd2; }
@media (max-width: 700px) {
  .huellas-workspace { grid-template-columns: 1fr; }
  .huellas-scene { min-height: clamp(88px, 25vw, 155px); border-radius: 13px; }
  .huellas-scene-label { padding: 9px 12px; }
  .huellas-scene-label p { font-size: .8rem; }
  .huellas-board { border-radius: 13px; }
  .huellas-clues button { padding-right: 11px; }
  .huellas-clue-check { top: 2px; right: 2px; }
  .huellas-clue-panel:has(.huellas-voice:not([hidden])) { min-height: 150px; }
  .huellas-result { grid-template-columns: 1fr; }
}
@media (max-width: 370px) {
  .huellas-clue-icon { display: none; }
}
