/* Tema por defecto: Jardín. Los demás solo redefinen estos tokens,
   así que un color nuevo debe declararse aquí para existir en todos. */
:root {
  font-family: ui-rounded, "Trebuchet MS", Arial, sans-serif;
  font-synthesis: none;
  font-size: 16px;
  --bg: #f6f8f4;
  --bg-soft: #f8faf5;
  --tint: #e9f0e7;
  --tint-strong: #dceddf;
  --halo: #d7e9df;
  --shadow: #e6ece4;
  --shadow-deep: #c4dacf;
  --accent: #356e62;
  --accent-soft: #467f6d;
  --accent-deep: #244f46;
  --accent-line: #88ac9c;
  --on-accent: #e1ece6;
  --ink: #263e38;
  --ink-soft: #354e45;
  --muted: #66746c;
  --muted-soft: #819487;
  --line: #dce5dc;
  --line-strong: #adbfaf;
  --cast: #263e3826;
  --veil: #263e3855;
  /* Fijos en todos los temas: distinguen juegos y estados, no el tema. */
  --paper: #fff;
  --focus: #385fa9;
  --danger: #a24343;
  --pink: #f9e1e5;
  --yellow: #f6eac0;
  --blue: #e0ebfa;
  color: var(--ink);
  background: var(--bg);
}
[data-theme="flor"] {
  --bg: #fdf6f8;
  --bg-soft: #fef9fa;
  --tint: #fbecf1;
  --tint-strong: #f8dde6;
  --halo: #f6d3e0;
  --shadow: #f2e2e8;
  --shadow-deep: #e5c0d0;
  --accent: #9d3f68;
  --accent-soft: #b45c81;
  --accent-deep: #7a2e4e;
  --accent-line: #d5a3b8;
  --on-accent: #f7e4ec;
  --ink: #422730;
  --ink-soft: #5c3a45;
  --muted: #7a6a70;
  --muted-soft: #9b8a90;
  --line: #efdde4;
  --line-strong: #c9aeb8;
  --cast: #42273026;
  --veil: #42273055;
}
[data-theme="cielo"] {
  --bg: #f4f7fb;
  --bg-soft: #f8fafd;
  --tint: #e8f0f8;
  --tint-strong: #d9e7f4;
  --halo: #cfe1f2;
  --shadow: #e2e9f0;
  --shadow-deep: #bdd2e5;
  --accent: #2f5f8f;
  --accent-soft: #43749f;
  --accent-deep: #23486c;
  --accent-line: #97b4cd;
  --on-accent: #dfeaf5;
  --ink: #23323f;
  --ink-soft: #35485a;
  --muted: #64707c;
  --muted-soft: #8593a0;
  --line: #dbe4ed;
  --line-strong: #a9b9c8;
  --cast: #23323f26;
  --veil: #23323f55;
}
[data-theme="lavanda"] {
  --bg: #f8f6fc;
  --bg-soft: #fbf9fd;
  --tint: #efe9f7;
  --tint-strong: #e5dcf1;
  --halo: #ded2ee;
  --shadow: #e9e3f0;
  --shadow-deep: #cbbbe2;
  --accent: #6a4a92;
  --accent-soft: #7f61a5;
  --accent-deep: #4e3570;
  --accent-line: #b3a1cd;
  --on-accent: #e9e2f3;
  --ink: #2f2740;
  --ink-soft: #453a5c;
  --muted: #6f6880;
  --muted-soft: #8f89a0;
  --line: #e5dfee;
  --line-strong: #b6adc6;
  --cast: #2f274026;
  --veil: #2f274055;
}
[data-theme="durazno"] {
  --bg: #fdf7f3;
  --bg-soft: #fefaf7;
  --tint: #fbeee4;
  --tint-strong: #f8e0cf;
  --halo: #f7d7c0;
  --shadow: #f3e5da;
  --shadow-deep: #e8c6ab;
  --accent: #a5511f;
  --accent-soft: #c47142;
  --accent-deep: #8a4320;
  --accent-line: #e0ab88;
  --on-accent: #fbe8da;
  --ink: #402c1f;
  --ink-soft: #5c4232;
  --muted: #7d6d61;
  --muted-soft: #9e8c7e;
  --line: #efe1d7;
  --line-strong: #cbb2a0;
  --cast: #402c1f26;
  --veil: #402c1f55;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 5px;
}
button {
  border: 0;
}
button:disabled {
  cursor: default;
}
svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
button svg {
  pointer-events: none;
}
h1,
h2,
h3,
p {
  margin: 0;
}
button {
  transition:
    background 0.16s,
    transform 0.16s;
}
button:active:not(:disabled) {
  transform: translateY(2px);
}
.wrap {
  width: min(1080px, calc(100% - 64px));
  margin: auto;
}
.topbar {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  background: none;
  text-align: left;
  padding: 0;
}
.brand-mark {
  width: 43px;
  height: 43px;
  background: var(--accent);
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: white;
}
.brand strong {
  font-size: 21px;
  letter-spacing: -0.6px;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 1.4px;
  margin-top: 3px;
  text-transform: uppercase;
}
.tools {
  display: flex;
  align-items: center;
  gap: 10px;
}
.quiet {
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  min-height: 46px;
}
.quiet:hover {
  background: var(--tint);
}
.icon-btn {
  border: 1px solid var(--line);
  background: #fff;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.intro {
  padding: 30px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--accent);
}
h1 {
  font-size: clamp(28px, 4vw, 41px);
  letter-spacing: -1.3px;
  font-weight: 800;
  line-height: 1.15;
  margin-top: 8px;
}
.pill {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  background: var(--tint);
  padding: 9px 13px;
  border-radius: 30px;
  font-size: 13px;
  white-space: nowrap;
}
.home-layout {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 24px;
}
.companion {
  border-radius: 28px;
  background: var(--tint);
  position: relative;
  overflow: hidden;
  min-height: 470px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 25px 28px 0;
}
.companion .hello {
  font-weight: 700;
  font-size: 23px;
  letter-spacing: -0.5px;
  background: #fff;
  padding: 14px 24px;
  border-radius: 22px;
  z-index: 1;
}
.companion p {
  color: var(--ink-soft);
  font-size: 16px;
  margin-top: 12px;
  position: relative;
  z-index: 1;
}
.capy-main {
  display: block;
  width: 100%;
  max-width: 400px;
  height: 320px;
  object-fit: contain;
  mix-blend-mode: multiply;
  margin-top: 0;
}
.companion .name {
  position: absolute;
  bottom: 21px;
  left: 24px;
  background: #ffffffdd;
  border-radius: 20px;
  padding: 8px 13px;
  font-size: 13px;
}
.games {
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.game-card {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 108px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 22px;
  padding: 18px 20px;
  text-align: left;
  width: 100%;
  box-shadow: 0 3px 0 var(--shadow);
}
.game-card:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
}
.game-card.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 0 var(--accent-deep);
}
.card-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 33px;
  font-weight: 800;
  flex-shrink: 0;
  letter-spacing: -2px;
  background: var(--tint-strong);
  color: var(--accent);
}
.primary .card-icon {
  background: #ffffff22;
  color: white;
}
.game-card:nth-child(2) .card-icon {
  background: var(--yellow);
  color: #846524;
}
.game-card:nth-child(3) .card-icon {
  background: var(--pink);
  color: #99556b;
}
.game-card:nth-child(4) .card-icon {
  background: var(--blue);
  color: #526a97;
}
.card-copy {
  flex: 1;
}
.card-copy h2 {
  font-size: 20px;
  letter-spacing: -0.5px;
}
.card-copy p {
  color: var(--muted);
  font-size: 14px;
  margin-top: 5px;
  line-height: 1.4;
}
.primary .card-copy p {
  color: var(--on-accent);
}
.go {
  border: 1px solid var(--line);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.primary .go {
  border-color: #ffffff44;
}
.go svg {
  width: 17px;
}
.garden-strip {
  margin: 24px 0;
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
}
.garden-strip .garden-symbol {
  font-size: 32px;
}
.garden-strip h3 {
  font-size: 17px;
}
.garden-strip p {
  font-size: 14px;
  color: var(--muted);
  margin-top: 5px;
}
.garden-strip .quiet {
  margin-left: auto;
  color: var(--accent);
  white-space: nowrap;
}
.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  gap: 14px;
  padding: 0 4px 24px;
}
.foot span {
  display: flex;
  gap: 6px;
  align-items: center;
}
.foot svg {
  width: 16px;
  height: 16px;
}
.lesson {
  max-width: 800px;
  margin: auto;
  text-align: center;
  padding: 24px 0 40px;
}
.lesson-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 26px;
}
.lesson-nav .quiet {
  padding-left: 0;
}
.lesson h1 {
  font-size: clamp(27px, 4vw, 38px);
  margin-top: 16px;
}
.lesson-sub {
  font-size: 17px;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.5;
}
.listen {
  background: #fff;
  border: 1px solid var(--line);
  padding: 12px 18px;
  border-radius: 28px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 19px;
  font-weight: 700;
  color: var(--accent);
}
.letter-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin: 34px auto 26px;
}
.letter {
  font-family: "Trebuchet MS", Arial, sans-serif;
  width: 155px;
  min-height: 167px;
  font-size: 91px;
  line-height: 1.2;
  border: 2px solid var(--shadow);
  border-radius: 25px;
  background: #fff;
  box-shadow: 0 6px 0 var(--shadow);
  padding: 12px;
  color: var(--ink-soft);
}
.letter:nth-child(2) {
  background: #fff8e5;
}
.letter:nth-child(3) {
  background: #f9ecf0;
}
.letter:nth-child(4) {
  background: #e9f1fc;
}
.letter:nth-child(5) {
  background: var(--tint-strong);
}
.letter.hint {
  border-color: var(--accent-soft);
  box-shadow:
    0 0 0 5px var(--halo),
    0 6px 0 var(--shadow-deep);
}
.letter.correct {
  background: var(--tint-strong);
  border-color: var(--accent-soft);
}
.letter.syllable {
  font-size: 67px;
}
.letter.explore {
  width: 120px;
  min-height: 145px;
  font-size: 75px;
}
.feedback {
  min-height: 56px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 8px 0;
  gap: 12px;
}
.feedback.good {
  color: var(--accent);
}
.lesson-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 16px;
  padding: 16px 25px;
  min-height: 55px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  box-shadow: 0 3px 0 var(--accent-deep);
}
.button.secondary {
  color: var(--accent);
  background: var(--tint);
  box-shadow: none;
}
.mini-capy {
  width: 85px;
  height: 85px;
  object-fit: contain;
  mix-blend-mode: multiply;
  border-radius: 25px;
}
.buddy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  font-size: 15px;
  margin-top: 28px;
}
.rounds {
  display: flex;
  gap: 7px;
  align-items: center;
}
.rounds span {
  display: block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--line);
}
.rounds span.done {
  background: var(--accent-soft);
}
.rounds span.now {
  box-shadow: 0 0 0 2px var(--accent-soft);
  background: #fff;
}
.model-letter {
  display: inline-block;
  font-size: 68px;
  line-height: 1.2;
  padding: 10px 32px;
  border-radius: 22px;
  background: var(--tint-strong);
  color: var(--accent);
  margin-top: 23px;
  font-weight: 700;
}
.join-row {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: center;
  margin: 25px 0;
}
.join-part {
  background: white;
  font-size: 70px;
  line-height: 1.2;
  font-weight: bold;
  min-width: 115px;
  border-radius: 23px;
  padding: 18px 12px;
  box-shadow: 0 4px 0 var(--shadow);
}
.join-part:last-child {
  background: #f9e9ec;
}
.join-plus {
  font-size: 32px;
  color: var(--muted-soft);
}
.vowel-picker {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 24px 0;
}
.vowel-picker button {
  font-size: 26px;
  min-width: 53px;
  min-height: 53px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
}
.vowel-picker button.selected {
  background: var(--accent);
  color: white;
}
.end-card {
  background: var(--tint);
  border-radius: 30px;
  padding: 28px;
  max-width: 530px;
  margin: 24px auto;
}
.end-card img {
  width: min(270px, 100%);
  height: 230px;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.end-card h1 {
  font-size: 33px;
}
.flower-field {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin: 28px auto;
  padding: 25px;
  max-width: 650px;
  background: var(--tint);
  border-radius: 25px;
}
.flower-field span {
  font-size: 45px;
}
.empty-garden {
  line-height: 1.7;
  color: var(--muted);
  font-size: 17px;
}
.settings {
  text-align: left;
  max-width: 780px;
  margin: auto;
  padding: 28px 0;
}
.settings h1 {
  font-size: 32px;
}
.settings .lead {
  color: var(--muted);
  line-height: 1.6;
  margin: 14px 0 25px;
}
.settings-card {
  background: #fff;
  border: 1px solid var(--line);
  padding: 22px;
  border-radius: 22px;
  margin: 18px 0;
}
.settings-card h2 {
  font-size: 20px;
  margin-bottom: 15px;
}
.setting {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--tint);
}
.setting:last-child {
  border: 0;
}
.setting label {
  font-weight: 700;
}
.setting small {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  margin-top: 5px;
  line-height: 1.5;
}
.setting input[type="checkbox"] {
  width: 24px;
  height: 24px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.setting select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px;
  background: var(--bg-soft);
  color: var(--ink);
  max-width: 48%;
}
.setting input[type="range"] {
  max-width: 130px;
  accent-color: var(--accent);
}
.voice-note,
.note {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
  margin-top: 13px;
}
.table-scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  text-align: left;
}
th,
td {
  padding: 13px 9px;
  border-bottom: 1px solid var(--line);
}
th {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}
td:first-child {
  font-weight: 700;
  font-size: 21px;
}
.danger {
  background: #fff2f2;
  color: var(--danger);
  box-shadow: none;
}
.setting .letter-options {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.letter-option {
  display: flex;
  gap: 4px;
  align-items: center;
  min-width: 45px;
}
.letter-option input {
  width: 20px !important;
  height: 20px !important;
}
.setting .theme-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.theme-option {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px 8px 9px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 15px;
  min-height: 44px;
}
/* El punto usa el color del tema que ofrece, no el que está activo. */
.theme-option .swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 2px #ffffff66;
}
.theme-option.selected {
  border-color: var(--swatch);
  background: var(--tint);
  font-weight: 700;
  color: var(--ink);
}
.theme-option.selected .swatch {
  box-shadow:
    inset 0 0 0 2px #ffffff66,
    0 0 0 3px var(--halo);
}
.record-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.record-row strong {
  min-width: 42px;
  font-size: 20px;
}
.record-row button {
  font-size: 14px;
  background: var(--tint);
  padding: 10px;
  border-radius: 11px;
}
.record-row button.recording {
  background: #f9e1e5;
  color: #873e53;
}
.record-row small {
  font-size: 13px;
  color: var(--muted);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 25px;
  padding: 30px;
  max-width: 430px;
  width: calc(100% - 32px);
  color: var(--ink);
  box-shadow: 0 20px 90px var(--cast);
}
dialog::backdrop {
  background: var(--veil);
  backdrop-filter: blur(4px);
}
dialog h2 {
  font-size: 25px;
}
dialog p {
  font-size: 16px;
  line-height: 1.6;
  margin-top: 14px;
}
dialog input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 13px;
  margin-top: 18px;
}
dialog .lesson-actions {
  justify-content: flex-start;
}
.audio-warning {
  max-width: 610px;
  margin: 16px auto;
  background: #fff1d4;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.6;
  color: #73521c;
}
.record-help {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}
.hidden {
  display: none !important;
}
.reduce-motion * {
  animation: none !important;
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
@media (max-width: 720px) {
  .wrap {
    width: calc(100% - 32px);
  }
  .topbar {
    height: 80px;
  }
  .brand strong {
    font-size: 18px;
  }
  .brand small {
    font-size: 11px;
  }
  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }
  .tools {
    gap: 5px;
  }
  .tools .quiet {
    font-size: 0;
    padding: 9px;
  }
  .tools .quiet svg {
    width: 22px;
  }
  .intro {
    padding-top: 23px;
  }
  .intro .pill {
    display: none;
  }
  .home-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .companion {
    min-height: 190px;
    height: 190px;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    padding: 22px;
    width: 100%;
  }
  .companion .hello {
    max-width: 53%;
    font-size: 19px;
    padding: 12px 15px;
  }
  .companion p {
    max-width: 50%;
    font-size: 14px;
    line-height: 1.5;
  }
  .capy-main {
    position: absolute;
    right: -12px;
    bottom: -13px;
    height: 215px;
    width: 53%;
    margin: 0;
  }
  .companion .name {
    display: none;
  }
  .game-card {
    min-height: 94px;
    padding: 15px;
    gap: 14px;
    border-radius: 20px;
  }
  .card-copy h2 {
    font-size: 19px;
  }
  .card-icon {
    width: 54px;
    height: 54px;
    font-size: 30px;
  }
  .garden-strip {
    padding: 17px 14px;
    gap: 12px;
  }
  .garden-strip .quiet {
    font-size: 13px;
    padding: 8px;
  }
  .garden-strip p {
    font-size: 13px;
  }
  .foot {
    font-size: 12px;
    align-items: flex-start;
  }
  .foot span:last-child {
    display: none;
  }
  .letter {
    width: 128px;
    min-height: 150px;
    font-size: 80px;
  }
  .letter.explore {
    width: 90px;
    min-height: 114px;
    font-size: 63px;
  }
  .letter-row {
    gap: 15px;
    margin-top: 28px;
  }
  .lesson {
    padding-top: 14px;
  }
  .lesson-nav {
    margin-bottom: 24px;
  }
  .lesson-nav .quiet {
    font-size: 14px;
  }
  .lesson .eyebrow {
    font-size: 12px;
  }
  .lesson-actions .button {
    padding: 15px 18px;
  }
  .setting {
    gap: 12px;
  }
  .settings-card {
    padding: 17px;
  }
  .feedback {
    font-size: 18px;
  }
  .buddy-note {
    margin-top: 20px;
  }
  .mini-capy {
    width: 65px;
    height: 65px;
  }
  .settings .setting select {
    max-width: 46%;
    font-size: 14px;
  }
  .join-part {
    font-size: 62px;
    min-width: 100px;
  }
  .settings h1 {
    font-size: 28px;
  }
}
@media (max-width: 360px) {
  .brand small {
    display: none;
  }
  .letter {
    width: 110px;
  }
  .game-card {
    gap: 10px;
  }
  .card-copy h2 {
    font-size: 17px;
  }
  .go {
    display: none;
  }
  .companion .hello {
    font-size: 17px;
  }
  .intro h1 {
    font-size: 28px;
  }
}
