:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --navy: #103943;
  --navy-soft: #245a65;
  --slate: #68838a;
  --blue: #65d1dc;
  --purple: #77d7df;
  --orange: #36bdca;
  --mint: #80dbe3;
  --paper: #fbfdfc;
  --line: rgba(20, 76, 86, .14);
  --ink: #123d47;
  --study-wash:
    radial-gradient(ellipse 110% 55% at 48% -3%, rgba(217, 250, 252, .72) 0, rgba(217, 250, 252, .34) 42%, transparent 70%),
    radial-gradient(ellipse 80% 70% at 12% 84%, rgba(122, 218, 226, .54) 0, transparent 68%),
    radial-gradient(ellipse 78% 68% at 93% 70%, rgba(31, 178, 194, .34) 0, transparent 70%),
    linear-gradient(125deg, #8bdde4 0%, #55ced9 42%, #28bdcd 72%, #54cbd3 100%);
  background: #fff;
  color: var(--ink);
}

* { box-sizing: border-box; }

html, body { width: 100%; height: 100%; background: #fff; }

body {
  margin: 0;
  overflow: hidden;
  background: #fff;
  overscroll-behavior: none;
}

button { font: inherit; }

.study-app {
  width: min(100%, 56rem);
  height: 100dvh;
  min-height: 0;
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) clamp(1rem, 4vw, 2rem) max(.8rem, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(.75rem, 2vh, 1.25rem);
  touch-action: none;
  overscroll-behavior: none;
  background: #fff;
}

.study-app:has(.solo-deck-picker:not([hidden])){height:auto;min-height:100dvh;display:block;background:transparent;touch-action:pan-y;overscroll-behavior:auto}
.study-app:has(.solo-deck-picker:not([hidden])) .solo-deck-picker{overflow:visible}
body:has(.solo-deck-picker:not([hidden])){height:auto;min-height:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:auto}
.study-app [hidden]{display:none!important}

.solo-deck-picker{min-height:0;overflow:auto;padding:.35rem .2rem 11rem;grid-row:1/-1;touch-action:pan-y}.solo-deck-picker>header{margin-bottom:1.4rem}.solo-deck-picker>header>span{color:var(--theme-deep,#267681);font-size:.72rem;font-weight:900;letter-spacing:.1em;text-transform:uppercase}.solo-deck-picker h1{margin:.2rem 0 .35rem;color:var(--navy);font-size:clamp(2rem,7vw,3.5rem)}.solo-deck-picker p{margin:0;color:var(--slate)}.solo-deck-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,17rem),1fr));gap:clamp(1rem,3.5vw,1.5rem);padding:.7rem .7rem 1rem 0}.solo-deck{--pack-a:#bdebd7;--pack-b:#6fc7a5;position:relative;min-height:clamp(12rem,30vw,15rem);padding:0;border:0;background:transparent;color:var(--ink);cursor:pointer;perspective:700px}.solo-deck[data-color="blue"]{--pack-a:#c6e9f5;--pack-b:#79c7df}.solo-deck[data-color="lilac"]{--pack-a:#e1d5f5;--pack-b:#ae91da}.solo-deck[data-color="yellow"]{--pack-a:#f6e8bb;--pack-b:#ddb968}.solo-deck-stack{position:absolute;inset:0}.solo-deck-sheet,.solo-deck-cover{position:absolute;inset:0;border:1px solid rgba(255,255,255,.56);border-radius:1.6rem;background:linear-gradient(145deg,var(--pack-a),var(--pack-b));box-shadow:0 1rem 2rem rgba(36,94,89,.13)}.solo-deck-sheet:nth-child(1){transform:translate(.65rem,-.65rem) rotate(3deg);opacity:.48}.solo-deck-sheet:nth-child(2){transform:translate(.35rem,-.35rem) rotate(1.6deg);opacity:.7}.solo-deck-sheet:nth-child(3){transform:translate(.12rem,-.12rem) rotate(.6deg);opacity:.84}.solo-deck-cover{padding:1.25rem;display:flex;flex-direction:column;align-items:flex-start;justify-content:space-between;overflow:hidden;text-align:left;transition:transform .25s ease}.solo-deck:hover .solo-deck-cover,.solo-deck:focus-visible .solo-deck-cover{transform:translateY(-.3rem) rotate(-1deg)}.solo-deck:focus-visible{outline:none}.solo-deck-icon{width:2.6rem;height:2.6rem;display:grid;place-items:center;border:1px solid rgba(255,255,255,.82);border-radius:.8rem;background:rgba(255,255,255,.58);font-size:1.25rem}.solo-deck strong{position:relative;z-index:1;max-width:12ch;font-size:clamp(1.35rem,4vw,2.1rem);line-height:1}.solo-deck small{font-size:.75rem;font-weight:750}.solo-deck-cover>span:last-child{position:relative;z-index:1;align-self:flex-end;font-size:.78rem;font-weight:900}

@media(max-width:620px){.solo-deck-grid{grid-template-columns:1fr;gap:1.15rem}.solo-deck{min-height:12rem}.solo-deck-cover{padding:1rem}.solo-deck strong{font-size:clamp(1.4rem,8vw,2rem)}}

@media(max-width:700px){
  body:has(.solo-deck-picker:not([hidden])){max-width:100%;overflow-x:hidden}
  .study-app:has(.solo-deck-picker:not([hidden])){width:100%;max-width:100%;padding-inline:clamp(.85rem,4vw,1.25rem)}
  .solo-deck-picker{width:100%;min-width:0;padding-inline:0}
  .solo-deck-grid{width:100%;min-width:0;grid-template-columns:minmax(0,1fr);gap:1.15rem;padding:.7rem .7rem 11rem 0}
  .solo-deck{width:100%;min-width:0;min-height:12rem}
  .solo-deck-stack,.solo-deck-cover{min-width:0}
  .solo-deck-cover{padding:1rem}
  .solo-deck strong{max-width:100%;font-size:clamp(1.4rem,8vw,2rem);overflow-wrap:anywhere}
}

@media(max-width:380px){
  .study-app:has(.solo-deck-picker:not([hidden])){padding-inline:.75rem}
  .solo-deck-grid{padding-right:.55rem}
  .solo-deck{min-height:11.5rem}
  .solo-deck small,.solo-deck-cover>span:last-child{font-size:.72rem}
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3rem;
}

.brand { display: flex; align-items: center; gap: .65rem; color: var(--navy); font-weight: 900; font-size: 1.08rem; }
.brand-mark { width: 2.2rem; height: 2.2rem; display: grid; place-items: center; border-radius: .65rem; background: linear-gradient(145deg, #1a6270, #103943); color: white; box-shadow: 0 .4rem 1rem rgba(16, 57, 67, .14); }
.progress { display: flex; align-items: center; gap: .75rem; color: var(--slate); font-size: .85rem; }
.progress strong { padding: .45rem .75rem; border-radius: 999px; background: rgba(255,255,255,.82); color: var(--navy); box-shadow: 0 .25rem .9rem rgba(16, 57, 67, .08); backdrop-filter: blur(12px); }
.skipped-counter { padding: .38rem .65rem; border-radius: 999px; background: rgba(255,255,255,.52); font-size: .72rem; }
.skipped-counter b { color: var(--navy); }

.card-stage {
  position: relative;
  min-height: 0;
  perspective: 1400px;
  -webkit-perspective: 1400px;
  cursor: grab;
}

.card-stage:active { cursor: grabbing; }

.swipe-trail {
  position: absolute;
  inset: .65rem .65rem -.45rem;
  border-radius: clamp(1.5rem, 5vw, 2.4rem);
  display: none;
  transform: scale(.97);
}

.study-card {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: clamp(1.5rem, 5vw, 2.4rem);
  outline: none;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform .18s ease-out, opacity .18s ease-out;
  -webkit-tap-highlight-color: transparent;
}

.study-card-preview {
  position: absolute;
  z-index: 1;
  inset: 0;
  opacity: 0;
  transform: translate3d(0, calc(100% + .75rem), 0) scale(.985);
  pointer-events: none;
  will-change: transform, opacity;
}

.study-card-preview .card-inner { transition: none; }

.study-card:focus-visible { box-shadow: 0 0 0 .3rem rgba(52, 141, 243, .35); }

.flip-hit-area {
  position: absolute;
  z-index: 5;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.flip-hit-area:focus-visible {
  outline: .25rem solid rgba(16, 57, 67, .34);
  outline-offset: -.45rem;
}

.study-card.is-flipped .flip-hit-area { pointer-events: none; }

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform .68s cubic-bezier(.2, .75, .25, 1);
  will-change: transform;
}

.study-card.is-flipped .card-inner {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}

.study-card.is-switching .card-face {
  transition: none;
}

.card-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid rgba(20, 145, 159, .28);
  border-radius: clamp(1.5rem, 5vw, 2.4rem);
  box-shadow: none;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: opacity 0s linear .34s, visibility 0s linear .34s;
}

.card-front {
  padding: clamp(1.5rem, 6vw, 4rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--ink);
  background: var(--study-wash);
  background-blend-mode: soft-light, normal, screen, normal;
  opacity: 1;
  visibility: visible;
  padding-bottom: clamp(5rem, 10vh, 6rem);
}

.card-front::before, .card-front::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
}

.card-front::before {
  width: 150%;
  height: 10rem;
  top: 17%;
  left: -25%;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  filter: blur(24px);
  transform: rotate(-14deg);
}
.card-front::after {
  width: 145%;
  height: 9rem;
  right: -28%;
  bottom: 18%;
  border-radius: 50%;
  background: rgba(0, 145, 162, .12);
  filter: blur(26px);
  transform: rotate(16deg);
}

.subject-pill { position: absolute; top: clamp(1.5rem, 4vw, 2.25rem); left: clamp(1.5rem, 4vw, 2.25rem); padding: .55rem .9rem; border: 1px solid rgba(255,255,255,.64); border-radius: 999px; background: rgba(255,255,255,.66); color: #14718a; box-shadow: 0 .35rem 1rem rgba(32, 105, 88, .1); backdrop-filter: blur(10px); font-size: .78rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.card-front h1 { position: relative; z-index: 1; max-width: 18ch; margin: 0; font-size: clamp(2rem, 7vw, 4.2rem); line-height: 1.08; text-wrap: balance; }

.card-front.has-image,
.card-front:has(.question-image:not([hidden])) {
  justify-content: flex-start;
  align-items: stretch;
  padding-top: clamp(5.75rem, 12vh, 6.5rem);
  text-align: left;
}

.card-front.has-image h1,
.card-front:has(.question-image:not([hidden])) h1 {
  flex: 0 0 auto;
  max-width: none;
  margin: 0 0 clamp(.75rem, 2vh, 1.25rem);
  font-size: clamp(1.35rem, 4.8vw, 2.4rem);
  line-height: 1.1;
}

.card-front.is-text-only {
  justify-content: center;
  align-items: center;
  padding: clamp(1.5rem, 6vw, 4rem);
  text-align: center;
}

.card-front.is-text-only h1 {
  max-width: 16ch;
  margin: 0;
  font-size: clamp(2.5rem, 8.5vw, 5rem);
  line-height: 1.04;
}

.question-image {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: clamp(1rem, 3vw, 1.5rem);
  object-fit: contain;
  background: rgba(225, 250, 252, .38);
  box-shadow: inset 0 0 2rem rgba(255,255,255,.22);
}

.question-image[hidden] { display: none; }
.card-back {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--paper);
  opacity: 0;
  visibility: hidden;
  padding-bottom: clamp(4rem, 8vh, 4.75rem);
}

.study-card.is-flipped .card-front {
  opacity: 0;
  visibility: hidden;
}

.study-card.is-flipped .card-back {
  opacity: 1;
  visibility: visible;
}

.back-question {
  padding: clamp(1.15rem, 4vw, 2rem);
  background:
    radial-gradient(ellipse 100% 150% at 48% -10%, rgba(217, 250, 252, .72), transparent 68%),
    radial-gradient(ellipse 80% 120% at 92% 80%, rgba(31, 178, 194, .3), transparent 72%),
    linear-gradient(125deg, #8bdde4, #42c5d2);
  color: var(--ink);
}
.back-question span { display: block; margin-bottom: .45rem; color: #3c8583; font-size: .72rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.back-question h2 { max-width: 29ch; margin: 0; font-size: clamp(1.2rem, 4.2vw, 2rem); line-height: 1.15; text-wrap: balance; }

/* El sello indica el intento de cada tarjeta durante Boomerang. */
.boomerang-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .35rem .65rem;
  border: 1px solid #bca2e0;
  border-radius: .8rem;
  background: #f2eafa;
  color: #593682;
  box-shadow: 0 .2rem .6rem rgba(89, 54, 130, .1);
  font-size: .7rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
}
.boomerang-badge[hidden] { display: none; }
.boomerang-mark { position: relative; flex: 0 0 2rem; width: 2rem; height: 2rem; overflow: hidden; }
.boomerang-mark img { position: absolute; top: 50%; left: 50%; width: 2.75rem; height: 2.75rem; max-width: none; object-fit: cover; transform: translate(-50%, -50%); }
.boomerang-attempt { font-size: .72rem; font-weight: 800; }
.card-front > .boomerang-badge { position: absolute; z-index: 2; top: .5rem; right: 1rem; }
[data-study-app][data-package-color] .has-boomerang-badge .subject-pill {
  max-width: calc(100% - 11rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.back-card-meta { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.back-card-meta > [data-back-category] { min-width: 0; overflow-wrap: anywhere; }
.back-card-meta > .boomerang-badge { flex-shrink: 0; }

.answer-grid { min-height: 0; padding: clamp(.65rem, 2vw, 1rem); display: grid; grid-template-rows: repeat(4, minmax(0, 1fr)); gap: clamp(.45rem, 1.5vh, .75rem); }
.answer-option { position: relative; width: 100%; min-height: 0; border: 1px solid var(--line); border-radius: clamp(.8rem, 2.5vw, 1.15rem); padding: .75rem clamp(.8rem, 3vw, 1.25rem) .75rem clamp(3.2rem, 10vw, 4.25rem); background: white; color: var(--ink); text-align: left; font-weight: 800; font-size: clamp(1rem, 3.7vw, 1.45rem); box-shadow: inset 0 0 2rem rgba(255,255,255,.28); transition: transform .15s ease, border-color .15s ease, background .15s ease, color .15s ease; }
.answer-option:nth-child(1) { background: linear-gradient(120deg, #e1f7f9, #bcecf1); border-color: #92d7de; }
.answer-option:nth-child(2) { background: linear-gradient(120deg, #d9f4f7, #abe3e9); border-color: #83cfd7; }
.answer-option:nth-child(3) { background: linear-gradient(120deg, #e1f7f9, #bcecf1); border-color: #92d7de; }
.answer-option:nth-child(4) { background: linear-gradient(120deg, #d9f4f7, #abe3e9); border-color: #83cfd7; }
.answer-option::before { content: attr(data-letter); position: absolute; left: clamp(.75rem, 2.5vw, 1.1rem); top: 50%; transform: translateY(-50%); width: clamp(2rem, 7vw, 2.65rem); height: clamp(2rem, 7vw, 2.65rem); display: grid; place-items: center; border-radius: .7rem; background: rgba(255,255,255,.72); color: #23626b; font-size: .84rem; }
.answer-option:nth-child(2)::before { background: rgba(255,255,255,.72); color: #176f7a; }
.answer-option:nth-child(3)::before { background: rgba(255,255,255,.72); color: #23626b; }
.answer-option:nth-child(4)::before { background: rgba(255,255,255,.72); color: #176f7a; }
.answer-option:hover { transform: translateY(-1px); border-color: var(--blue); }
.answer-option:focus-visible { outline: .2rem solid rgba(52, 141, 243, .3); outline-offset: .1rem; }
/* Keep result colors above deck and night-theme option styles. */
[data-study-app][data-package-color] .answer-option.is-correct { border-color: #50ad7c; background: #afe3c4; color: #1d533b; }
[data-study-app][data-package-color] .answer-option.is-incorrect { border-color: #ce6969; background: #f0b3b3; color: #792828; }
[data-study-app][data-package-color] .answer-option:is(.is-correct, .is-incorrect)::before { background: rgba(255,255,255,.55); color: inherit; }
[data-button-theme="night"] [data-study-app][data-package-color] .answer-option.is-correct { border-color: #70bc93; background: #286348; color: #dff8eb; }
[data-button-theme="night"] [data-study-app][data-package-color] .answer-option.is-incorrect { border-color: #d38389; background: #71343e; color: #ffe3e5; }
[data-button-theme="night"] [data-study-app][data-package-color] .answer-option:is(.is-correct, .is-incorrect)::before { background: rgba(255,255,255,.1); color: inherit; }
.answer-option:disabled { cursor: default; }

.answer-feedback { min-height: 2.4rem; margin: 0; padding: .2rem 1rem max(.65rem, env(safe-area-inset-bottom)); display: grid; place-items: center; color: var(--slate); font-weight: 800; font-size: .82rem; text-align: center; }
.answer-feedback.correct { color: #147548; }
.answer-feedback.incorrect { color: #bd3b0c; }

.gesture-help {
  position: absolute;
  z-index: 8;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: clamp(4rem, 9vh, 5rem);
  padding: .7rem 1rem max(.7rem, env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .65rem;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.82);
  text-shadow: 0 1px 8px rgba(16,57,67,.22);
  box-shadow: none;
  font-size: clamp(.92rem, 3vw, 1.1rem);
  font-weight: 600;
  letter-spacing: .01em;
  text-align: center;
  pointer-events: none;
  animation: gesture-coach 5.6s cubic-bezier(.22, 1, .36, 1) .6s 1 forwards;
}
.gesture-help.is-dismissed {
  visibility: hidden;
  opacity: 0;
  transform: translateY(-.2rem);
  animation: none;
  transition: opacity .35s ease, transform .35s ease, visibility 0s linear .35s;
}
.down-arrow {
  width: 2.15rem;
  height: 2.15rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 50%;
  background: rgba(255,255,255,.14);
  color: rgba(255,255,255,.9);
  box-shadow: 0 .35rem 1rem rgba(16,57,67,.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-weight: 800;
  animation: none;
}

.profile-dock {
  --dock-surface: #eef9fa;
  --dock-ink: #155a65;
  --dock-border: rgba(21,90,101,.16);
  --dock-shadow: rgba(16,90,101,.13);
  position: fixed;
  z-index: 50;
  right: max(24px, calc(env(safe-area-inset-right) + 14px));
  bottom: max(14px, env(safe-area-inset-bottom));
  width: 3.5rem;
  height: 3.5rem;
}

.profile-fab,
.quick-action {
  display: grid;
  place-items: center;
  border: 1px solid var(--dock-border);
  border-radius: 50%;
  background: var(--dock-surface);
  color: var(--dock-ink);
  box-shadow: 0 .65rem 1.8rem var(--dock-shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.profile-fab { position: relative; z-index: 2; width: 3.5rem; height: 3.5rem; padding: 0; font: inherit; cursor: pointer; touch-action: manipulation; }
.quick-action { width: 3rem; height: 3rem; }
.quick-action svg { width: 1.35rem; }
.study-stack-action { overflow: hidden; }
.quick-action .study-stack-icon {
  width: 1.35rem;
  height: 1.35rem;
  max-width: none;
  flex: none;
  stroke-width: 1.35;
}
.quick-action svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.profile-fab { -webkit-touch-callout: none; user-select: none; }
.profile-fab:focus-visible,
.quick-action:focus-visible { outline: .22rem solid rgba(54,189,202,.32); outline-offset: .16rem; }

.quick-actions {
  position: absolute;
  inset: .25rem;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0s linear .3s;
}

.profile-dock.is-open .quick-actions {
  visibility: visible;
  pointer-events: auto;
  transition: none;
}

.quick-action {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translate(0, 0) scale(.72);
  transition: opacity .18s ease, transform .36s cubic-bezier(.18,.88,.25,1.18);
}
.quick-action span { position: absolute; right: 3.55rem; width: max-content; padding: .34rem .55rem; border-radius: .55rem; background: rgba(16,57,67,.9); color: white; font-size: .68rem; font-weight: 800; opacity: 0; transform: translateX(.3rem); transition: opacity .16s, transform .16s; pointer-events: none; }
.quick-action:hover span, .quick-action:focus-visible span { opacity: 1; transform: none; }
.profile-dock.is-open .quick-action { opacity: 1; }
.profile-dock.is-open .action-game { transform: translate(-4.25rem, 0) scale(1); transition-delay: .03s; }
.profile-dock.is-open .action-create { transform: translate(0, -4.25rem) scale(1); transition-delay: .06s; }
.profile-dock.is-open .action-decks { transform: translate(0, -8rem) scale(1); transition-delay: .09s; }
.profile-dock.is-open .action-stats { transform: translate(0, -11.75rem) scale(1); transition-delay: .12s; }
.profile-dock.is-open .action-profile { transform: translate(-3.65rem, -3.65rem) scale(1); transition-delay: .075s; }

.menu-lines { position: relative; width: 1.35rem; height: 1.05rem; display: block; }
.menu-lines i { position: absolute; left: 0; width: 100%; height: 2px; border-radius: 999px; background: currentColor; transform-origin: center; transition: top .22s ease, transform .28s cubic-bezier(.2,.8,.25,1), opacity .16s ease; }
.menu-lines i:nth-child(1) { top: 0; }
.menu-lines i:nth-child(2) { top: calc(50% - 1px); }
.menu-lines i:nth-child(3) { top: calc(100% - 2px); }
.profile-dock.is-open .menu-lines i:nth-child(1) { top: calc(50% - 1px); transform: rotate(45deg); }
.profile-dock.is-open .menu-lines i:nth-child(2) { opacity: 0; transform: scaleX(.3); }
.profile-dock.is-open .menu-lines i:nth-child(3) { top: calc(50% - 1px); transform: rotate(-45deg); }
.profile-dock.is-open .profile-fab { background: #dff4f5; box-shadow: 0 .75rem 2rem rgba(16,90,101,.19); }

.study-card.is-leaving { opacity: 0; transform: translateY(-48vh) rotate(-3deg); }
.study-card.is-entering { animation: enter-card .38s cubic-bezier(.2,.8,.25,1); }

@keyframes enter-card { from { opacity: 0; transform: translateY(18vh) scale(.96); } }
@keyframes gesture-coach {
  0% { opacity: 0; transform: translateY(.5rem); }
  12%, 30% { opacity: .9; transform: translateY(0); }
  42% { opacity: 0; transform: translateY(-.25rem); }
  50% { opacity: 0; transform: translateY(.5rem); }
  62%, 80% { opacity: .9; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-.25rem); visibility: hidden; }
}
@keyframes gesture-reduced {
  0%, 78% { opacity: .9; }
  100% { opacity: 0; visibility: hidden; }
}

@media (max-height: 620px) {
  .study-app { gap: .45rem; }
  .topbar { min-height: 2.4rem; }
  .gesture-help { min-height: 1.6rem; }
  .answer-grid { gap: .35rem; }
  .back-question { padding-block: .85rem; }
}

@media (max-width: 430px) {
  .progress > [data-category] { display: none; }
  .progress { gap: .4rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .gesture-help:not(.is-dismissed) { animation: gesture-reduced 4s linear .3s 1 forwards !important; transform: none; }
}

[data-button-theme="night"] .solo-deck-icon{
  border-color:rgba(221,230,247,.28);
  background:rgba(18,31,51,.52);
  color:#e8edfb;
  box-shadow:none;
  backdrop-filter:none;
}
[data-button-theme="night"] .solo-deck[data-color="green"] .solo-deck-icon{color:#a8e1c8}
[data-button-theme="night"] .solo-deck[data-color="blue"] .solo-deck-icon{color:#bdebf1}
[data-button-theme="night"] .solo-deck[data-color="lilac"] .solo-deck-icon{color:#d9d0f6}
[data-button-theme="night"] .solo-deck[data-color="yellow"] .solo-deck-icon{color:#f3d995}

/* Flujo individual: modalidad, juego con color del mazo y resultado sin ranking. */
.study-app:has(.solo-mode-picker:not([hidden])),.study-app:has(.solo-result:not([hidden])){height:auto;min-height:100dvh;display:block;touch-action:pan-y;overscroll-behavior:auto;background:transparent}
body:has(.solo-mode-picker:not([hidden])),body:has(.solo-result:not([hidden])){height:auto;min-height:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:auto}
.solo-mode-picker,.solo-result{min-height:calc(100dvh - 2rem);padding:.35rem .2rem 7rem}.solo-flow-back{margin-bottom:1.4rem;padding:.55rem 0;border:0;background:transparent;color:var(--slate);font-weight:850;cursor:pointer}.solo-mode-picker>header{max-width:44rem;margin-bottom:1.6rem}.solo-mode-picker>header>span,.solo-result-kicker{color:var(--theme-deep,#725795);font-size:.72rem;font-weight:950;letter-spacing:.12em;text-transform:uppercase}.solo-mode-picker h1,.solo-result h1{margin:.25rem 0 .55rem;color:var(--navy);font-size:clamp(2.3rem,7vw,4rem);line-height:.96;letter-spacing:-.04em}.solo-mode-picker header p,.solo-result>p{margin:0;color:var(--slate);line-height:1.5}.solo-mode-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1.2rem}.solo-mode-card{position:relative;min-height:22rem;padding:1.45rem;display:flex;flex-direction:column;align-items:flex-start;border:1.5px solid rgba(255,255,255,.8);border-radius:1.8rem;color:#123d47;text-align:left;cursor:pointer;box-shadow:0 1rem 2rem rgba(62,68,104,.12);transition:transform .18s,box-shadow .18s}.solo-mode-card:hover{transform:translateY(-4px);box-shadow:0 1.3rem 2.4rem rgba(62,68,104,.17)}.solo-mode-card.is-mastery{background:#c5afe7}.solo-mode-card.is-exam{background:#8fd6bb}.solo-mode-icon{width:3.8rem;height:3.8rem;display:grid;place-items:center;border:1px solid rgba(255,255,255,.82);border-radius:1.15rem;background:rgba(255,255,255,.55);font-size:1.15rem;font-weight:950}.solo-mode-card small{margin-top:2.2rem;font-size:.65rem;font-weight:950;letter-spacing:.08em;text-transform:uppercase}.solo-mode-card strong{margin-top:.4rem;font-size:clamp(1.55rem,4vw,2.15rem);line-height:1}.solo-mode-card p{margin:.8rem 0 0;color:#315b64;font-size:.8rem;line-height:1.5}.solo-mode-card b{margin-top:auto;font-size:.8rem}.solo-result{max-width:46rem;margin:0 auto;text-align:center}.solo-result>p{max-width:34rem;margin-inline:auto}.solo-result-score{width:12rem;height:12rem;margin:2rem auto 1.5rem;display:grid;place-content:center;border:1px solid rgba(255,255,255,.82);border-radius:50%;background:linear-gradient(145deg,#c5afe7,#8fd6bb);box-shadow:0 1rem 2.5rem rgba(62,68,104,.16)}.solo-result-score strong{font-size:3rem;line-height:1}.solo-result-score small{margin-top:.35rem;color:#315b64;font-weight:800}.solo-result-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:.8rem}.solo-result-stats>span{padding:1rem;border:1px solid var(--line);border-radius:1rem;background:rgba(255,255,255,.72)}.solo-result-stats b,.solo-result-stats small{display:block}.solo-result-stats b{font-size:1.5rem}.solo-result-stats small{margin-top:.2rem;color:var(--slate);font-size:.68rem}.solo-result-actions{margin-top:1.2rem;display:grid;grid-template-columns:repeat(3,1fr);gap:.65rem}.solo-result-actions button{min-height:3.2rem;padding:.65rem;border:1px solid var(--button-main-border,#8d6fba);border-radius:999px;background:var(--button-main,#a98bd2);color:var(--button-main-ink,#2f2340);font-weight:900;cursor:pointer}.solo-result-actions button:nth-child(n+2){border-color:var(--line);background:var(--theme-surface,#e9f3f4);color:var(--ink)}
[data-study-app][data-package-color="green"]{--solo-pack-a:#bdebd7;--solo-pack-b:#6fc7a5}[data-study-app][data-package-color="blue"]{--solo-pack-a:#c6e9f5;--solo-pack-b:#79c7df}[data-study-app][data-package-color="lilac"]{--solo-pack-a:#e1d5f5;--solo-pack-b:#ae91da}[data-study-app][data-package-color="gold"]{--solo-pack-a:#f6e8bb;--solo-pack-b:#ddb968}
[data-study-app][data-package-color] .card-front{border-color:rgba(255,255,255,.58);background:linear-gradient(145deg,var(--solo-pack-a),var(--solo-pack-b));background-blend-mode:normal;color:#123d47}
[data-study-app][data-package-color] .card-back{border-color:color-mix(in srgb,var(--solo-pack-b) 42%,white);background:linear-gradient(145deg,color-mix(in srgb,var(--solo-pack-a) 42%,white),#fbfdfc);color:#123d47}
[data-study-app][data-package-color] .card-front::before,[data-study-app][data-package-color] .card-front::after{display:none}
[data-button-theme="night"] [data-study-app][data-package-color="green"]{--solo-pack-a:#28564f;--solo-pack-b:#183c38}[data-button-theme="night"] [data-study-app][data-package-color="blue"]{--solo-pack-a:#28516c;--solo-pack-b:#19384f}[data-button-theme="night"] [data-study-app][data-package-color="lilac"]{--solo-pack-a:#4a4169;--solo-pack-b:#302b50}[data-button-theme="night"] [data-study-app][data-package-color="gold"]{--solo-pack-a:#5b4d30;--solo-pack-b:#3d3427}
[data-button-theme="night"] [data-study-app][data-package-color] .card-front{border-color:rgba(211,222,242,.24);background:linear-gradient(145deg,var(--solo-pack-a),var(--solo-pack-b));color:#eef2ff}
[data-button-theme="night"] [data-study-app][data-package-color] .card-back{border-color:rgba(211,222,242,.2);background:linear-gradient(145deg,color-mix(in srgb,var(--solo-pack-a) 58%,#142238),color-mix(in srgb,var(--solo-pack-b) 52%,#101d33));color:#eef2ff}
[data-button-theme="night"] .solo-mode-picker h1,[data-button-theme="night"] .solo-result h1{color:var(--ink)}[data-button-theme="night"] .solo-mode-card{border-color:rgba(211,222,242,.22);color:#f1f4ff;box-shadow:0 1rem 2rem rgba(1,7,17,.34)}[data-button-theme="night"] .solo-mode-card.is-mastery{background:linear-gradient(145deg,#4a4169,#302b50)}[data-button-theme="night"] .solo-mode-card.is-exam{background:linear-gradient(145deg,#28564f,#183c38)}[data-button-theme="night"] .solo-mode-icon{border-color:rgba(221,230,247,.3);background:rgba(18,31,51,.48);color:#e8edfb}[data-button-theme="night"] .solo-mode-card p{color:#bdc9dc}[data-button-theme="night"] .solo-result-score{border-color:rgba(211,222,242,.22);background:linear-gradient(145deg,#4a4169,#28564f);color:#f1f4ff;box-shadow:0 1rem 2.5rem rgba(1,7,17,.38)}[data-button-theme="night"] .solo-result-score small{color:#bdc9dc}[data-button-theme="night"] .solo-result-stats>span{border-color:var(--line);background:var(--theme-pale);color:var(--ink)}
.solo-result-stats>span:first-child{border-color:rgba(45,154,112,.32);background:#dff5e8;color:#245f47;transform:scale(1.035);box-shadow:0 .55rem 1.2rem rgba(45,154,112,.12)}.solo-result-stats>span:first-child b{font-size:1.8rem}.solo-result-stats>span:nth-child(2){color:#9b5550}.solo-result h1{max-width:15ch;margin-inline:auto;text-wrap:balance}[data-button-theme="night"] .solo-result-stats>span:first-child{border-color:rgba(98,198,154,.34);background:#235c47;color:#dff8eb}[data-button-theme="night"] .solo-result-stats>span:nth-child(2){color:#efaaa4}
/* La tarjeta individual replica las proporciones del juego con amigos. */
[data-study-app][data-package-color] .card-stage{border-radius:clamp(1.75rem,6vw,2.5rem)}[data-study-app][data-package-color] .study-card,[data-study-app][data-package-color] .card-face{border-radius:inherit}[data-study-app][data-package-color] .card-face{clip-path:inset(0 round clamp(1.75rem,6vw,2.5rem));-webkit-clip-path:inset(0 round clamp(1.75rem,6vw,2.5rem));contain:paint}[data-study-app][data-package-color] .card-front{padding:clamp(1.5rem,6vw,4rem);padding-bottom:clamp(5rem,10vh,6rem)}[data-study-app][data-package-color] .card-front h1{max-width:16ch;font-size:clamp(2.5rem,8.5vw,5rem);line-height:1.04}[data-study-app][data-package-color] .card-back{padding:clamp(1rem,4vw,1.6rem);padding-bottom:clamp(5.5rem,11vh,6.25rem)}[data-study-app][data-package-color] .back-question{padding:0 0 .8rem;background:transparent}[data-study-app][data-package-color] .answer-grid{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:.7rem;padding:0}[data-study-app][data-package-color] .answer-option{min-height:5.2rem;padding:.8rem .8rem .8rem 2.9rem;border-radius:1rem;font-size:clamp(.82rem,2vw,1rem)}[data-study-app][data-package-color] .answer-option::before{left:.65rem;width:1.75rem;height:1.75rem;border-radius:.55rem;font-size:.75rem}
.solo-mode-icon img{display:block;width:100%;height:100%;object-fit:cover;border-radius:inherit}
@media(max-width:680px){.solo-mode-grid{grid-template-columns:1fr}.solo-mode-card{min-height:18rem}.solo-result-actions{grid-template-columns:1fr}.solo-result-stats{gap:.45rem}.solo-result-stats>span{padding:.75rem .4rem}}

/* Solo celebrates progress across time instead of multiplayer placement. */
.solo-result { max-width: 43rem; padding: 1rem .25rem 2rem; color: var(--ink); }
.solo-result header h1 { max-width: none; font-size: clamp(2rem, 7vw, 3.7rem); margin: .5rem 0; }
.solo-result-brand { width: 9rem; height: auto; margin: .5rem auto; }
.solo-result header p { color: var(--muted, var(--slate)); font-size: .8rem; margin: .1rem 0 1.2rem; }
.solo-summary-card { width: min(100%, 29rem); margin: auto; padding: 1.2rem; border: 2px solid var(--theme-surface); border-radius: 2rem; background: var(--theme-pale); box-shadow: 0 .6rem 1.7rem var(--theme-glow); }
.solo-hero-avatar { display: block; width: 6.5rem; height: 6.5rem; object-fit: contain; border: .4rem solid var(--theme-surface); border-radius: 50%; margin: 0 auto .5rem; background: var(--theme-soft); }
.solo-result-name { display: block; font-size: 1.5rem; overflow-wrap: anywhere; }
.solo-main-score { display: flex; align-items: baseline; justify-content: center; gap: .45rem; color: var(--theme-deep); }
.solo-main-score strong { font-size: clamp(3.5rem, 12vw, 5.5rem); line-height: 1.2; }
.solo-main-score span { font-size: clamp(1rem, 4vw, 1.6rem); font-weight: 850; }
.solo-summary-card p { margin: .4rem 0 0; font-weight: 800; text-wrap: balance; }
.solo-timeline { display: flex; justify-content: center; list-style: none; padding: 0; margin: 2rem 0 1.4rem; }
.solo-moment { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.solo-moment::after { content: ""; position: absolute; top: 7.1rem; left: 50%; width: 100%; height: .22rem; background: var(--button-main); }
.solo-moment:last-child::after { display: none; }
.solo-moment-avatar { width: 5.5rem; height: 5.5rem; border: .3rem solid var(--theme-surface); border-radius: 50%; object-fit: contain; background: var(--theme-soft); opacity: .6; margin: .4rem 0 .5rem; }
.solo-moment.is-current .solo-moment-avatar { opacity: 1; transform: scale(1.12); outline: .2rem solid var(--button-main-border); outline-offset: .18rem; }
.solo-moment-dot { position: relative; z-index: 1; width: 1.4rem; height: 1.4rem; border: .3rem solid var(--button-main); border-radius: 50%; background: var(--theme-pale); }
.solo-moment.is-current .solo-moment-dot { transform: scale(1.3); border-color: var(--button-main-border); box-shadow: 0 .15rem .4rem var(--theme-glow); }
.solo-moment time { font-size: .85rem; font-weight: 850; }
.solo-moment strong { font-size: clamp(.85rem, 3.5vw, 1.3rem); color: var(--theme-deep); white-space: nowrap; }
.solo-progress-summary { display: grid; grid-template-columns: 1fr 1fr; padding: 1rem .5rem; border: 2px solid var(--theme-surface); border-radius: 1.5rem; background: var(--theme-pale); box-shadow: 0 .5rem 1.2rem var(--theme-glow); }
.solo-progress-summary>div { display: flex; flex-direction: column; justify-content: center; gap: .3rem; padding: 0 .4rem; }
.solo-progress-summary>div+div { border-left: 1px solid var(--button-main-border); }
.solo-progress-summary strong { font-size: clamp(1.05rem, 4vw, 1.6rem); color: var(--theme-deep); }
.solo-progress-summary small { font-size: .75rem; }
.solo-result .solo-scoring-note { font-size: .7rem; margin: .7rem auto; color: var(--muted, var(--slate)); }
.solo-history summary { width: fit-content; margin: 1rem auto .5rem; cursor: pointer; font-size: .85rem; font-weight: 800; color: var(--theme-deep); }
.solo-history ol { max-height: 16rem; overflow: auto; padding: 0 1rem; list-style: none; border-radius: 1rem; background: var(--theme-pale); }
.solo-history li { display: flex; justify-content: space-between; gap: .7rem; padding: .7rem 0; font-size: .8rem; border-bottom: 1px solid var(--theme-surface); }
.solo-history-note { display: block; color: var(--muted, var(--slate)); font-size: .65rem; }
.solo-result-actions { grid-template-columns: 1fr; gap: .7rem; }
.solo-result-actions button,.solo-result-actions a { display: grid; place-items: center; min-height: 3.5rem; border-radius: 1.2rem; font-size: 1.05rem; font-weight: 900; text-decoration: none; }
.solo-result-actions a { background: var(--secondary-soft); border: 1px solid var(--secondary-border); color: var(--secondary-ink); }
.solo-secondary-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem 1.5rem; margin-top: 1rem; }
.solo-secondary-actions button { border: 0; padding: .4rem; background: transparent; color: var(--theme-deep); font: inherit; font-size: .75rem; cursor: pointer; text-decoration: underline; }
@media(max-width:400px) {
  .solo-moment-avatar { width: 4rem; height: 4rem; }
  .solo-moment::after { top: 5.6rem; }
  .solo-moment time { font-size: .75rem; }
  .solo-summary-card { padding: 1rem .6rem; }
}

/* La partida se distribuye dentro de la altura disponible, también en horizontal. */
.study-app:has(.card-stage:not([hidden])) {
  width: min(100%, 64rem);
  height: 100dvh;
  min-height: 0;
  padding-top: max(.5rem, env(safe-area-inset-top));
  padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
  gap: clamp(.35rem, 1.5dvh, .8rem);
}
body:has(.card-stage:not([hidden])) { overflow: hidden; }
.study-app:has(.card-stage:not([hidden])) .card-stage { overflow: clip; }
.study-app:has(.card-stage:not([hidden])) { user-select: none; -webkit-user-select: none; }
.study-app:has(.card-stage:not([hidden])) .topbar { min-width: 0; min-height: 2.2rem; gap: .5rem; }
.study-app:has(.card-stage:not([hidden])) .brand { min-width: 0; font-size: clamp(.75rem, 2.8vw, 1rem); }
.study-app:has(.card-stage:not([hidden])) .brand-mark { flex-shrink: 0; }
.study-app:has(.card-stage:not([hidden])) .progress { flex-shrink: 0; }
[data-study-app][data-package-color] .card-front {
  padding: clamp(3.5rem, 10dvh, 5rem) clamp(1rem, 4vw, 2.5rem) 2.5rem;
}
[data-study-app][data-package-color] .card-front h1 {
  max-width: 24ch;
  font-size: clamp(1.25rem, min(6vw, 6dvh), 3.5rem);
  line-height: 1.12;
  overflow-wrap: anywhere;
}
[data-study-app][data-package-color] .card-front.has-image h1 {
  max-width: none;
  font-size: clamp(1rem, min(4vw, 4dvh), 2rem);
}
[data-study-app][data-package-color] .subject-pill { top: .8rem; left: 1rem; max-width: calc(100% - 2rem); font-size: .65rem; }
[data-study-app][data-package-color] .card-back {
  padding: clamp(.65rem, 2dvh, 1.25rem);
  gap: clamp(.3rem, 1dvh, .65rem);
}
[data-study-app][data-package-color] .back-question { padding: 0; min-width: 0; }
[data-study-app][data-package-color] .back-question span { margin-bottom: .2rem; font-size: .65rem; }
[data-study-app][data-package-color] .back-question h2 {
  max-width: none;
  font-size: clamp(1rem, min(4vw, 4dvh), 1.75rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}
[data-study-app][data-package-color] .answer-grid { gap: clamp(.35rem, 1dvh, .7rem); }
[data-study-app][data-package-color] .answer-option {
  min-height: 0;
  min-width: 0;
  padding: .5rem .5rem .5rem 2.65rem;
  font-size: clamp(.9rem, min(2.8vw, 3.4dvh), 1.15rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
[data-study-app][data-package-color] .answer-feedback { min-height: 0; padding: .25rem; font-size: .75rem; }
[data-study-app][data-package-color] .gesture-help { min-height: 2rem; padding: .35rem; font-size: .75rem; }
[data-study-app][data-package-color] .is-flipped .gesture-help { display: none; }
@media (max-width: 600px) {
  .study-app:has(.card-stage:not([hidden])) .progress > [data-category] { display: none; }
}
/* En escritorio limitamos el alto; en móvil las opciones usan todo el ancho. */
@media (min-width: 900px) and (min-height: 700px) {
  .study-app:has(.card-stage:not([hidden])) {
    height: min(100dvh, 52rem);
    position: relative;
    top: max(0px, calc((100dvh - 52rem) / 2));
  }
}
@media (max-width: 600px) and (orientation: portrait) {
  .study-app:has(.card-stage:not([hidden])) { padding-inline: max(.75rem, env(safe-area-inset-left)) max(.75rem, env(safe-area-inset-right)); }
  [data-study-app][data-package-color] .answer-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(4, minmax(0, 1fr));
  }
  [data-study-app][data-package-color] .answer-option { padding-left: 3rem; }
  [data-study-app][data-package-color] .answer-option::before { left: .75rem; }
  [data-study-app][data-package-color] .card-front h1 { font-size: clamp(1.25rem, min(7vw, 5dvh), 2.25rem); }
  [data-study-app][data-package-color] .card-front.has-image h1 { font-size: clamp(1rem, 4.5vw, 1.4rem); }
}
@media (max-height: 450px) {
  .study-app:has(.card-stage:not([hidden])) { padding-inline: 1rem; padding-bottom: max(.5rem, env(safe-area-inset-bottom)); padding-right: calc(5rem + env(safe-area-inset-right)); }
  [data-study-app][data-package-color] .card-front { padding-top: 3rem; }
  [data-study-app][data-package-color] .card-front h1 { max-width: 36ch; }
}

/* Resultado individual: celebración y progreso, sin controles de micrófono. */
:root body:has(.solo-result:not([hidden])) {
  background-color: #fff0cf;
  background-image: radial-gradient(ellipse at 50% 35%, #fff8e7, transparent 70%);
  background-size: 100% 100%;
}
:root .study-app:has(.solo-result:not([hidden])) { width: min(100%, 58rem); background: transparent; }
.solo-result:not([hidden]) {
  --result-purple: #a176d7;
  --result-ink: #123d47;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 42rem;
  padding: .6rem 0 4.5rem;
  color: var(--result-ink);
}
.solo-result .solo-result-kicker { color: #8a6718; font-size: .8rem; letter-spacing: .16em; }
.solo-result header h1 { color: var(--result-ink); font-size: clamp(2.2rem, 6.5vw, 4rem); margin: .65rem 0; line-height: 1.06; }
.solo-result .solo-result-brand { width: clamp(9rem, 25vw, 14rem); margin: .45rem auto; }
.solo-result header p { margin: .1rem 0 1.15rem; color: #5b7e84; }
.solo-result .solo-summary-card {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 5rem) minmax(0, auto);
  grid-template-areas: "avatar score" "name score";
  column-gap: 1.25rem;
  row-gap: .15rem;
  align-items: center;
  padding: .75rem 1.1rem;
  border: 2px solid white;
  border-radius: 1.5rem;
  background: rgba(255,255,255,.58);
  box-shadow: 0 .6rem 1.4rem #b7984c18;
}
.solo-result .solo-hero-avatar { grid-area: avatar; justify-self: center; width: 4.5rem; height: 4.5rem; margin: 0; border: .25rem solid white; background: #dbeef4; box-shadow: 0 .4rem .9rem #6e644c20; }
.solo-result .solo-result-name { grid-area: name; align-self: start; text-align: center; margin-top: .3rem; font-size: 1.2rem; line-height: 1.2; }
.solo-result .solo-main-score { grid-area: score; align-self: center; justify-content: center; flex-wrap: wrap; min-width: 0; color: var(--result-purple); gap: .3rem; }
.solo-result .solo-main-score strong { font-size: clamp(2rem, 7vw, 3rem); line-height: 1.05; overflow-wrap: anywhere; min-width: 0; }
.solo-result .solo-main-score span { font-size: 1.1rem; }
.solo-result .solo-result-message { color: #426c76; font-size: .85rem; font-weight: 800; text-wrap: balance; margin: .75rem auto 0; padding-inline: .5rem; }
.solo-result .solo-result-message:not(:empty)::before { content: '★'; color: #f4be40; font-size: 1.1rem; vertical-align: -.04em; margin-right: .35rem; }
.solo-result .solo-timeline { margin: 2.4rem 0 1.5rem; }
.solo-result .solo-moment { gap: .5rem; }
.solo-result .solo-moment-avatar { width: 6rem; height: 6rem; border: .35rem solid white; background: #dbeef4; margin: .4rem 0 .9rem; }
.solo-result .solo-moment.is-current .solo-moment-avatar { outline-color: #f2c66f; outline-width: .22rem; box-shadow: 0 .5rem .8rem #b7984c20; }
.solo-result .solo-moment::after { top: 8.55rem; height: .28rem; background: var(--result-purple); }
.solo-result .solo-moment-dot { width: 1.5rem; height: 1.5rem; border-color: var(--result-purple); background: white; }
.solo-result .solo-moment.is-current .solo-moment-dot { border-color: #9669cd; box-shadow: 0 .2rem .5rem #77529335; }
.solo-result .solo-moment time { font-size: 1rem; }
.solo-result .solo-moment strong { color: #a490b4; font-size: 1.5rem; }
.solo-result .solo-moment.is-current strong { color: var(--result-purple); }
.solo-result .solo-progress-summary { padding: 1rem .65rem; border: 2px solid white; border-radius: 1.8rem; background: #ffffff99; box-shadow: 0 .5rem 1rem #b7984c18; }
.solo-result .solo-progress-summary > div { flex-direction: row; gap: .65rem; align-items: center; }
.solo-result .solo-progress-summary > div + div { border-color: #f3dca7; }
.solo-result .solo-stat-icon { flex: 0 0 3.4rem; height: 3.4rem; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; }
.solo-result .is-growth { background: #dcefd6; color: #24a568; }
.solo-result .is-record { background: #ffedbc; }
.solo-result .solo-stat-copy { display: flex; flex-direction: column; gap: .25rem; text-align: left; }
.solo-result .solo-progress-summary strong { color: var(--result-purple); font-size: 1.2rem; }
.solo-result .solo-progress-summary > div:first-child strong { color: #23a467; }
.solo-result .solo-progress-summary small { color: #426c76; font-size: .8rem; }
.solo-result .solo-result-actions { order: 1; margin-top: 1.4rem; gap: .8rem; }
.solo-result .solo-result-actions button, .solo-result .solo-result-actions a { min-height: 4.3rem; border-radius: 1.35rem; font-size: 1.35rem; box-shadow: 0 .35rem .6rem #9473351c; }
.solo-result .solo-result-actions button { display: flex; justify-content: center; gap: .8rem; color: white; border: 1px solid #9768ce; background: linear-gradient(120deg, #a880dc, #996cce); }
.solo-result .solo-result-actions button span { font-size: 2.5rem; line-height: 1; }
.solo-result .solo-result-actions a { color: #72531a; border: 1px solid #ecc46e; background: linear-gradient(120deg, #ffe8b2, #ffe0a0); }
.solo-result .solo-secondary-actions { order: 2; margin-top: 1rem; }
.solo-result .solo-secondary-actions button { color: #795399; }
.solo-result .solo-history { order: 3; }
.solo-result .solo-history summary { color: #16b7bb; list-style: none; font-weight: 500; padding-bottom: .15rem; border-bottom: 2px dotted currentColor; }
.solo-result .solo-history summary::-webkit-details-marker { display: none; }
.solo-result .solo-history summary:focus-visible { outline: 2px solid currentColor; outline-offset: .3rem; }
.solo-result .solo-history ol { background: #ffffff80; }
.solo-result .solo-scoring-note { order: 4; color: #5b7e84; }
.solo-result .solo-history-note { order: 5; color: #5b7e84; }
@media (max-width: 480px) {
  .solo-result .solo-summary-card { column-gap: .75rem; padding: .85rem; }
  .solo-result .solo-hero-avatar { width: 3.75rem; height: 3.75rem; }
  .solo-result .solo-moment-avatar { width: 4.4rem; height: 4.4rem; }
  .solo-result .solo-moment::after { top: 6.95rem; }
  .solo-result .solo-moment time { font-size: .8rem; }
  .solo-result .solo-moment strong { font-size: 1.2rem; }
  .solo-result .solo-stat-icon { flex-basis: 2.3rem; height: 2.3rem; font-size: 1.4rem; }
  .solo-result .solo-progress-summary > div { gap: .35rem; padding: 0 .2rem; }
  .solo-result .solo-progress-summary strong { font-size: .95rem; }
  .solo-result .solo-progress-summary small { font-size: .65rem; }
  .solo-result .solo-result-actions button, .solo-result .solo-result-actions a { min-height: 3.8rem; font-size: 1.15rem; }
}

.solo-result .solo-history-note:empty { display: none; }

/* Confeti limitado al resultado, como la capa del podio de amigos. */
.solo-result[data-result-mode="exam"] {
  position: relative;
  isolation: isolate;
}
.solo-result[data-result-mode="exam"]:not([hidden]):has(.solo-summary-card:not([hidden]))::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle, #e9b949 0 3px, transparent 4px), radial-gradient(circle, #65c5cd 0 3px, transparent 4px), radial-gradient(circle, #b59ade 0 3px, transparent 4px);
  background-size: 83px 97px, 107px 89px, 71px 113px;
  opacity: .6;
}
@media (prefers-reduced-motion: no-preference) {
  .solo-result[data-result-mode="exam"]::before {
    animation: solo-confetti-fall 8s linear infinite;
  }
  .solo-result[data-result-mode="exam"]:not([hidden]) .solo-summary-card:not([hidden]) {
    animation: solo-podium-up .65s both;
  }
  .solo-result[data-result-mode="exam"]:not([hidden]) .solo-summary-card:not([hidden]) .solo-hero-avatar {
    animation: solo-avatar-celebrate 1.8s cubic-bezier(.2,.8,.25,1) infinite alternate;
  }
}
@keyframes solo-confetti-fall {
  to { background-position: 0 194px, 0 178px, 0 226px; }
}
@keyframes solo-podium-up {
  from { opacity: 0; transform: translateY(5rem); }
}
@keyframes solo-avatar-celebrate {
  0%, 65% { transform: translateY(0) rotate(-1deg); }
  100% { transform: translateY(-.45rem) rotate(2deg); }
}

.saved-practice-list{display:grid;gap:.65rem;margin-top:1.5rem;padding-bottom:2rem}
.saved-practice-list h2{font-size:1.1rem;color:var(--navy);margin:1rem 0 .2rem}
.saved-practice-list .solo-flow-back{display:block;position:static;text-align:left;white-space:normal;overflow-wrap:anywhere;padding:.85rem 1rem;border:1px solid #dce5e8;border-radius:1rem;background:rgba(255,255,255,.85);color:var(--navy);text-decoration:none;font:inherit;cursor:pointer}

.solo-mode-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.solo-mode-card.is-squad{background:#b8dfea}@media(max-width:680px){.solo-mode-grid{grid-template-columns:1fr}}

.solo-mode-card.is-squad .solo-mode-icon svg{width:100%;height:100%;padding:.35rem}

@media (min-width: 681px) {
  [data-public-practice] .solo-mode-grid,
  [data-public-practice] .solo-result-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.solo-mode-picker header .public-deck-source {
  margin: .7rem 0;
  padding-inline-start: .75rem;
  border-inline-start: .18rem solid var(--button-main-border);
  font-size: .875rem;
}

.public-deck-source a {
  color: inherit;
  font-weight: 750;
  text-underline-offset: .15em;
}

.public-deck-review {
  margin-top: .75rem;
  line-height: 1.5;
}

.public-deck-review summary {
  width: fit-content;
  cursor: pointer;
  font-weight: 700;
}

.public-deck-review ol {
  padding-inline-start: 1.5rem;
}

.public-deck-review li p {
  margin: .25rem 0 1rem;
}

.solo-result .solo-result-signup {
  order: 2;
  margin: 1.25rem auto 0;
  padding: 1rem 1.25rem;
  border: 1px solid #17645126;
  border-radius: 1.25rem;
  background: #e2f4e9;
}
.solo-result-signup p {
  margin: 0 0 .65rem;
  color: #315b64;
  line-height: 1.5;
  text-wrap: balance;
}
.solo-result-signup a {
  display: inline-grid;
  place-items: center;
  min-height: 2.75rem;
  padding: .5rem 1rem;
  border-radius: .85rem;
  background: #176451;
  color: white;
  font-weight: 900;
  text-decoration: none;
}
.solo-result-signup a:hover { background: #124c3e; }
.solo-result-signup a:focus-visible { outline: 2px solid #176451; outline-offset: 3px; }
.solo-result .solo-result-back {
  order: 3;
  margin-block-start: 1.25rem;
}

/* Match the existing BlitzKards deck covers. */
.solo-mode-grid {
  gap: 1.65rem;
  padding: .9rem .8rem 1.25rem .2rem;
  align-items: stretch;
}
.solo-mode-card {
  --pack-a: #e1d5f5;
  --pack-b: #ae91da;
  isolation: isolate;
  min-height: 17rem;
  padding: 1.25rem;
  overflow: visible;
  border: 1px solid rgba(255,255,255,.56);
  border-radius: 1.6rem;
  box-shadow: 0 1rem 2rem rgba(36,94,89,.13);
  transition: transform .25s ease;
}
.solo-mode-card::before,
.solo-mode-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 1px solid rgba(255,255,255,.56);
  border-radius: inherit;
  background: linear-gradient(145deg,var(--pack-a),var(--pack-b));
  pointer-events: none;
}
.solo-mode-card::before {
  transform: translate(.65rem,-.65rem) rotate(3deg);
  opacity: .48;
  z-index: -2;
}
.solo-mode-card::after {
  transform: translate(.35rem,-.35rem) rotate(1.6deg);
  opacity: .7;
}
.solo-mode-card.is-mastery {
  background: linear-gradient(145deg,var(--pack-a),var(--pack-b));
}
.solo-mode-card.is-exam {
  --pack-a: #bdebd7;
  --pack-b: #6fc7a5;
  background: linear-gradient(145deg,var(--pack-a),var(--pack-b));
}
.solo-mode-card.is-squad {
  --pack-a: #c6e9f5;
  --pack-b: #79c7df;
  background: linear-gradient(145deg,var(--pack-a),var(--pack-b));
}
.solo-mode-card .solo-mode-icon {
  width: 3.6rem;
  height: 3.6rem;
  border: 0;
  border-radius: .8rem;
  background: rgba(255,255,255,.55);
  padding: .25rem;
}
.solo-mode-card .solo-mode-icon img { object-fit: contain; }
.solo-mode-card.is-mastery .solo-mode-icon img { transform: scale(1.65); }
.solo-mode-card.is-exam .solo-mode-icon img { transform: scale(1.2); }
.solo-mode-card.is-squad .solo-mode-icon svg { padding: .1rem; }
.solo-mode-card small { margin-top: 1.35rem; font-size: .6rem; }
.solo-mode-card strong {
  font-size: clamp(1.32rem,3vw,1.8rem);
  line-height: 1.05;
  letter-spacing: -.025em;
}
.solo-mode-card p { margin: .65rem 0 1.4rem; font-size: .78rem; }
.solo-mode-card b {
  width: 100%;
  margin-top: auto;
  font-size: .78rem;
}
.solo-mode-card:hover { transform: translateY(-.3rem); box-shadow: 0 1rem 2rem rgba(36,94,89,.13); }
.solo-mode-card:focus-visible { outline: 3px solid var(--navy); outline-offset: 4px; }
[data-button-theme="night"] .solo-mode-card.is-mastery { background: linear-gradient(145deg,#4a4169,#302b50); }
[data-button-theme="night"] .solo-mode-card.is-exam { background: linear-gradient(145deg,#28564f,#183c38); }
[data-button-theme="night"] .solo-mode-card.is-squad { background: linear-gradient(145deg,#2f5468,#1c354b); }
@media (max-width:680px) {
  .solo-mode-grid { gap: 1rem; }
  .solo-mode-card { min-height: 15rem; }
}
@media (prefers-reduced-motion:reduce) {
  .solo-mode-card { transition: none; }
  .solo-mode-card:hover { transform: none; }
}
.solo-mode-card { padding: 0; }
.solo-mode-cover {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  min-height: inherit;
  padding: 1.25rem;
  border-radius: inherit;
  background: inherit;
  text-align: left;
}
[data-button-theme="night"] .solo-mode-card.is-mastery { --pack-a: #4a4169; --pack-b: #302b50; }
[data-button-theme="night"] .solo-mode-card.is-exam { --pack-a: #28564f; --pack-b: #183c38; }
[data-button-theme="night"] .solo-mode-card.is-squad { --pack-a: #2f5468; --pack-b: #1c354b; }

.solo-result-actions [data-open-solo-rating] {
  grid-column: 1 / -1;
}

.solo-rating {
  --rating-surface: #fdeef2;
  --rating-copy: #46626b;
  --rating-button: #ffc1d7;
  --rating-pressed: #851f50;
  --rating-ink: #791945;
  position: fixed;
  inset: auto 0 max(.75rem, env(safe-area-inset-bottom));
  width: min(calc(100% - 1.5rem), 28rem);
  max-height: calc(100% - 2rem);
  margin: 0 auto;
  padding: clamp(.9rem, 4vw, 1.4rem);
  border: 0;
  border-radius: 1.35rem;
  background: var(--rating-surface);
  color: var(--result-ink);
  box-shadow: 0 1rem 3rem #33142635;
  text-align: start;
}

.solo-rating::backdrop {
  background: #102b3e65;
}

@media (min-width: 681px) {
  .solo-rating {
    inset: 0;
    margin: auto;
  }
}

.solo-rating-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.solo-rating h2 {
  margin: 0;
  font-size: clamp(1.25rem, 5vw, 1.65rem);
  line-height: 1.2;
}

.solo-rating p {
  margin: .4rem 0 1rem;
  color: var(--rating-copy);
  line-height: 1.4;
}

.solo-rating button {
  width: 100%;
  border: 0;
  border-radius: 1rem;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.solo-rating button.solo-rating-close {
  width: 2.75rem;
  min-height: 2.75rem;
  background: transparent;
  color: var(--rating-copy);
  font-size: 1.5rem;
}

.solo-rating button[type="submit"] {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 3.5rem;
  padding: .65rem 1rem;
  background: var(--rating-button);
  color: var(--rating-ink);
}

.solo-rating button[type="submit"] span {
  font-size: 1.5em;
  line-height: 1;
}

.solo-rating button[type="submit"][aria-pressed="true"] {
  background: var(--rating-pressed);
  color: white;
}

.solo-rating button[aria-disabled="true"] {
  cursor: wait;
}

.solo-rating button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.solo-rating .solo-rating-status {
  margin: .5rem 0 0;
  font-size: .875rem;
}

.solo-rating .solo-rating-status:empty {
  margin: 0;
}

.solo-rating .solo-rating-retry {
  min-height: 2.75rem;
  margin-top: .4rem;
  padding: .4rem .75rem;
  background: transparent;
  color: var(--rating-copy);
}

[data-button-theme="night"] .solo-rating {
  --rating-surface: #39263e;
  --rating-copy: #ead0e0;
  --rating-button: #e6a6c6;
}
