/* Juntos — competencia: "Torneo de la noche" (card, setup, intro, ceremony), retos del día and the family ranking.
   Loaded by every page with /js/torneo.js. Brand: coral→orange, navy, cream, gold; Fredoka + Nunito. */
:root {
  --trn-coral: #FF6B4A; --trn-orange: #FF9A3C; --trn-navy-1: #3A3D5C; --trn-navy-2: #1F2137; --trn-cream: #FFF7F0;
  --trn-gold-1: #FFF3B8; --trn-gold-2: #FFD23F; --trn-gold-3: #F5A81A; --trn-gold-4: #B87400;
}
.trn-trophy { display: block; flex: none; width: 40px; height: 40px; filter: drop-shadow(0 6px 10px rgba(184, 116, 0, .45)); }

/* ------------------------------------------------------------ buttons */
.trn-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; border: 0; color: #fff;
  background: linear-gradient(135deg, var(--trn-coral), var(--trn-orange)); font: 700 1.08rem var(--font-display);
  box-shadow: 0 14px 24px -12px rgba(255, 107, 74, .85), inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -2px 0 rgba(0, 0, 0, .1);
}
.trn-btn:active { transform: scale(.98); }
.trn-btn:focus-visible, .trn-opt:focus-visible, .trn-start:focus-visible, .trn-cancel:focus-visible, .trn-reto__claim:focus-visible { outline: 3px solid var(--trn-gold-2); outline-offset: 3px; }
.trn-btn--gold { color: #3B2A00; background: linear-gradient(180deg, #FFE27A, var(--trn-gold-3)); box-shadow: 0 14px 26px -12px rgba(245, 168, 26, .9), inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -2px 0 rgba(0, 0, 0, .12); }
.trn-btn__ic { width: 22px; height: 22px; flex: none; }

/* the host's invitation: a navy ticket with a gold trophy */
.trn-start {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px 10px 10px; border: 1px solid rgba(255, 210, 63, .45); border-radius: 18px;
  color: #fff; text-align: left; background: radial-gradient(140px 80px at 12% 20%, rgba(255, 210, 63, .28), transparent 70%), linear-gradient(135deg, var(--trn-navy-1), var(--trn-navy-2));
  box-shadow: 0 16px 28px -18px rgba(31, 33, 55, .9), inset 0 1px 0 rgba(255, 255, 255, .12); cursor: pointer;
}
.trn-start:active { transform: scale(.985); }
.trn-start__ic { width: 44px; height: 44px; }
.trn-start__txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.trn-start__txt strong { font: 700 1.08rem var(--font-display); color: #FFE6A8; }
.trn-start__txt span { font-size: .88rem; font-weight: 700; opacity: .86; }
.trn-start--picker { margin: 2px 0 4px; }
.trn-slot--lobby:not(:empty) { padding-top: 12px; margin-top: 2px; border-top: 1px dashed var(--line); }
.trn-slot--podium:not(:empty) { margin-bottom: 4px; }

/* ------------------------------------------------------------ the card (lobby + podium) */
.trn-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 20px; color: #fff; text-align: left; overflow: hidden;
  background: radial-gradient(220px 120px at 0% 0%, rgba(255, 210, 63, .22), transparent 70%), radial-gradient(240px 140px at 110% 110%, rgba(255, 107, 74, .25), transparent 70%),
    linear-gradient(160deg, var(--trn-navy-1), var(--trn-navy-2));
  border: 1px solid rgba(255, 210, 63, .35); box-shadow: 0 20px 34px -22px rgba(31, 33, 55, .95), inset 0 1px 0 rgba(255, 255, 255, .1);
  animation: ndj-in .3s ease both;
}
.trn-card.is-final { border-color: rgba(255, 210, 63, .8); box-shadow: 0 0 0 3px rgba(255, 210, 63, .18), 0 20px 34px -22px rgba(31, 33, 55, .95); }
.trn-card__head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.trn-card__trophy { width: 42px; height: 42px; }
.trn-card__titles { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.trn-card__kicker { font: 700 .72rem var(--font-display); letter-spacing: .09em; text-transform: uppercase; color: var(--trn-gold-2); }
.trn-card__round { font: 700 1.2rem var(--font-display); }
.trn-card__lead { margin: 0; font-weight: 800; font-size: 1rem; color: #FFE6A8; text-wrap: balance; }
.trn-card__acts { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.trn-card__now { margin: 0; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .08); font-weight: 700; text-align: center; }
.trn-card__now strong { color: #FFE6A8; }
.trn-end { color: #fff; min-height: 46px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .06); }
.trn-new { min-height: 48px; }
.trn-cancel { align-self: center; min-height: 44px; padding: 0 12px; border: 0; background: none; color: rgba(255, 255, 255, .72); font: 700 .86rem var(--font-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* progress: dots for 3 or 5 games, the ruleta's order as chips */
.trn-dots { display: inline-flex; gap: 5px; flex: none; }
.trn-dots__d { width: 11px; height: 11px; border-radius: 50%; background: rgba(255, 255, 255, .2); }
.trn-dots__d.is-on { background: linear-gradient(135deg, var(--trn-gold-1), var(--trn-gold-3)); box-shadow: 0 0 8px rgba(255, 210, 63, .6); }
.trn-dots__d.is-now { background: transparent; box-shadow: inset 0 0 0 2px var(--trn-gold-2); }
.trn-seq { list-style: none; margin: 0; padding: 0; display: flex; gap: 5px; flex: none; }
.trn-seq__it { position: relative; }
.trn-seq__em.ndj-emblem { width: 30px; height: 30px; border-radius: 10px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
.trn-seq__it.is-done .trn-seq__em { opacity: .45; filter: saturate(.6); }
.trn-seq__it.is-now .trn-seq__em { box-shadow: 0 0 0 2.5px var(--trn-gold-2), 0 0 12px rgba(255, 210, 63, .6); }
.trn-seq__n { position: absolute; right: -4px; bottom: -4px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 99px; display: grid; place-items: center;
  font: 700 .62rem/1 var(--font-display); color: var(--trn-navy-2); background: #fff; }
.trn-seq__it.is-done .trn-seq__n { background: #26D07C; color: #fff; }
.trn-card .trn-seq { max-width: 46%; flex-wrap: wrap; justify-content: flex-end; }

/* standings */
.trn-table { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.trn-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border-radius: 14px; background: rgba(255, 255, 255, .07); }
.trn-row.is-lead { background: linear-gradient(90deg, rgba(255, 210, 63, .32), rgba(255, 210, 63, .06) 85%); box-shadow: inset 0 0 0 1px rgba(255, 210, 63, .35); }
.trn-row.is-me { box-shadow: inset 3px 0 0 var(--trn-orange); }
.trn-row.is-lead.is-me { box-shadow: inset 3px 0 0 var(--trn-orange), inset 0 0 0 1px rgba(255, 210, 63, .35); }
.trn-row__pos { width: 24px; flex: none; text-align: center; font: 700 .95rem var(--font-display); color: rgba(255, 255, 255, .7); }
.trn-row__pos.is-medal { font-size: 1.25rem; }
.trn-row .ndj-avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.trn-row__name { flex: 1; min-width: 0; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trn-row__me { margin-left: 6px; padding: 1px 7px; border-radius: 99px; font: 700 .68rem var(--font-display); letter-spacing: .04em; text-transform: uppercase; vertical-align: 2px;
  background: rgba(255, 154, 60, .25); color: #FFD8B0; }
.trn-row__d { padding: 2px 8px; border-radius: 99px; font: 700 .8rem var(--font-display); color: #0E3B24; background: #6EE7A8; animation: trn-pop .5s cubic-bezier(.3, 1.6, .5, 1) .25s both; }
.trn-row__pts { flex: none; min-width: 54px; text-align: right; white-space: nowrap; font: 700 1.2rem var(--font-display); }
.trn-row__d { flex: none; }
@media (max-width: 380px) { .trn-row { gap: 7px; padding-inline: 8px; } .trn-row__pts { min-width: 44px; font-size: 1.1rem; } .trn-row__me { display: none; } .trn-card { padding: 12px; } }
.trn-row__pts small { font-size: .68rem; opacity: .7; }
@keyframes trn-pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ setup sheet */
.trn-setup { z-index: 330; }
.trn-setup__box { gap: 8px; max-height: calc(100dvh - 12px); overflow-y: auto; overscroll-behavior: contain; padding-top: 10px; }
.trn-setup__badge { display: grid; place-items: center; width: 74px; height: 74px; border-radius: 24px; background: radial-gradient(60px 40px at 30% 20%, rgba(255, 210, 63, .35), transparent 70%), linear-gradient(135deg, var(--trn-navy-1), var(--trn-navy-2));
  box-shadow: 0 16px 28px -14px rgba(31, 33, 55, .8), inset 0 1px 0 rgba(255, 255, 255, .15); }
.trn-setup__trophy { width: 50px; height: 50px; }
.trn-setup__title { font-size: 1.5rem; font-weight: 700; margin-top: 4px; }
.trn-setup__text { color: var(--fg-2); max-width: 34ch; font-size: 1rem; text-wrap: balance; }
.trn-setup__q { align-self: flex-start; margin-top: 8px; font: 700 .95rem var(--font-display); letter-spacing: .02em; }
.trn-opts { display: grid; gap: 8px; width: 100%; }
.trn-opts--3 { grid-template-columns: repeat(3, 1fr); }
.trn-opts--2 { grid-template-columns: repeat(2, 1fr); }
.trn-opt {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 8px 6px;
  border: 1.5px solid var(--line); border-radius: 16px; background: var(--card-2); color: var(--fg); cursor: pointer; font: inherit; text-align: center;
  transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.trn-opt:active { transform: scale(.97); }
.trn-opt__t { font: 700 1.15rem/1.1 var(--font-display); }
.trn-opts--2 .trn-opt__t { font-size: 1rem; }
.trn-opt__s { font-size: .8rem; font-weight: 700; color: var(--fg-2); line-height: 1.2; }
.trn-opt__ic { width: 24px; height: 24px; font-size: 1.2rem; line-height: 24px; color: var(--trn-coral); }
.trn-opt[aria-checked="true"] { border-color: var(--trn-coral); background: color-mix(in srgb, var(--trn-orange) 14%, var(--card)); box-shadow: 0 10px 18px -14px rgba(255, 107, 74, .9); }
.trn-opt[aria-checked="true"]::after { content: "✓"; position: absolute; top: -8px; right: -6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font: 700 .8rem/1 var(--font-display); color: #fff; background: linear-gradient(135deg, var(--trn-coral), var(--trn-orange)); box-shadow: 0 4px 8px -3px rgba(255, 107, 74, .8); }
.trn-reel { list-style: none; margin: 6px 0 0; padding: 10px; width: 100%; display: flex; flex-direction: column; gap: 6px; border-radius: 18px;
  background: linear-gradient(160deg, var(--trn-navy-1), var(--trn-navy-2)); color: #fff; }
.trn-reel[hidden], .trn-again[hidden] { display: none; }
.trn-reel__it { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 10px 4px 6px; border-radius: 12px; background: rgba(255, 255, 255, .07); }
.trn-reel__n { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 700 .78rem var(--font-display); background: rgba(255, 255, 255, .16); }
.trn-reel__em.ndj-emblem { width: 36px; height: 36px; border-radius: 12px; }
.trn-reel__name { font: 700 1rem var(--font-display); }
.trn-reel__it.is-spin .trn-reel__em { filter: blur(1.2px); transform: translateY(-1px); }
.trn-reel__it.is-spin .trn-reel__name { opacity: .25; }
.trn-reel__it.is-hit { animation: trn-hit .35s ease both; box-shadow: inset 0 0 0 1px rgba(255, 210, 63, .45); }
.trn-reel__more { text-align: center; font: 700 1.1rem var(--font-display); opacity: .6; }
@keyframes trn-hit { 0% { transform: scale(1); } 45% { transform: scale(1.04); background: rgba(255, 210, 63, .25); } 100% { transform: none; } }
.trn-again { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 99px; background: none; color: var(--trn-coral);
  font: 700 .95rem var(--font-display); cursor: pointer; }
.trn-again__ic { width: 20px; height: 20px; }
.trn-setup__rules { font-size: .86rem; font-weight: 700; color: var(--fg-2); }
@media (max-width: 360px) { .trn-opt__s { font-size: .74rem; } .trn-setup__box { padding-inline: 14px; } }

/* ------------------------------------------------------------ full-screen moments (intro, ceremony) */
.trn-ov {
  position: fixed; inset: 0; z-index: 338; overflow-y: auto; overscroll-behavior: contain; isolation: isolate;
  display: flex; flex-direction: column; align-items: center; padding: calc(24px + env(safe-area-inset-top, 0px)) 18px calc(24px + env(safe-area-inset-bottom, 0px));
  background: radial-gradient(120% 70% at 50% 0%, #4A4E7A 0%, var(--trn-navy-1) 38%, var(--trn-navy-2) 100%); color: #fff; animation: ndj-fade .25s ease both;
}
.trn-ov.is-out { opacity: 0; transition: opacity .22s ease; }
.trn-ov__glow { position: fixed; left: 50%; top: 22%; z-index: -1; width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 210, 63, .38), rgba(255, 154, 60, .12) 45%, transparent 70%); }
.trn-ov__rays { position: fixed; left: 50%; top: 22%; z-index: -1; width: 150vmax; height: 150vmax; margin: -75vmax 0 0 -75vmax; pointer-events: none; opacity: .14;
  background: repeating-conic-gradient(from 0deg, #FFE27A 0 7deg, transparent 7deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 0 16%, transparent 52%); mask: radial-gradient(circle, #000 0 16%, transparent 52%); animation: trn-spin 36s linear infinite; }
@keyframes trn-spin { to { transform: rotate(360deg); } }
.trn-ov__box { width: min(420px, 100%); margin: auto 0; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; animation: trn-rise .5s cubic-bezier(.3, 1.3, .5, 1) both; }
@keyframes trn-rise { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
.trn-ov__kicker { font: 700 .82rem var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--trn-gold-2); }
.trn-ov__title { margin: 0; font: 700 clamp(1.6rem, 7vw, 2.1rem)/1.1 var(--font-display); text-wrap: balance; text-shadow: 0 4px 18px rgba(0, 0, 0, .35); }
.trn-ov__line { margin: 0; font-weight: 800; color: #FFE6A8; }
.trn-ov__pts { list-style: none; margin: 4px 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.trn-ov__pts li { padding: 6px 12px; border-radius: 99px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); font-weight: 800; }
.trn-ov__pts b { font-family: var(--font-display); color: var(--trn-gold-2); }
.trn-ov__next { margin: 0; font-weight: 700; }
.trn-ov__next strong { color: #FFE6A8; }
.trn-ov .trn-seq__em.ndj-emblem { width: 42px; height: 42px; border-radius: 14px; }
.trn-ov .trn-seq { gap: 8px; }
.trn-ov .btn { width: 100%; margin-top: 8px; }
.trn-intro__trophy { width: 120px; height: 120px; animation: ndj-float 3s ease-in-out infinite; }

/* ceremony */
.trn-cer { z-index: 339; }
.trn-cer__trophy { width: 132px; height: 132px; animation: trn-trophy 1s cubic-bezier(.3, 1.5, .5, 1) both, ndj-float 3.2s ease-in-out 1s infinite; filter: drop-shadow(0 18px 26px rgba(184, 116, 0, .55)); }
@keyframes trn-trophy { from { opacity: 0; transform: translateY(30px) scale(.4) rotate(-12deg); } to { opacity: 1; transform: none; } }
.trn-cer__who { margin: 0; font: 700 1.35rem var(--font-display); color: #FFE6A8; }
.trn-cer.is-me .trn-cer__title { background: linear-gradient(180deg, #FFF3B8, #FFD23F 55%, #F5A81A); -webkit-background-clip: text; background-clip: text; color: transparent; }
.trn-pod { list-style: none; margin: 12px 0 0; padding: 0; width: 100%; display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; }
.trn-pod__col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; animation: trn-rise .55s cubic-bezier(.3, 1.3, .5, 1) both; }
.trn-pod__col--1 { animation-delay: .35s; }
.trn-pod__col--2 { animation-delay: .6s; }
.trn-pod__col--3 { animation-delay: .8s; }
.trn-pod__col .ndj-avatar { box-shadow: 0 0 0 3px #fff, 0 10px 18px -8px rgba(0, 0, 0, .6); }
.trn-pod__col--1 .ndj-avatar--lg { width: 70px; height: 70px; font-size: 1.9rem; }
.trn-pod__col.is-champ .ndj-avatar { margin-top: 24px; } /* room for the crown above the frame */
.trn-pod__name { max-width: 100%; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trn-pod__block { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; padding-top: 8px; border-radius: 14px 14px 6px 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 14px 22px -14px rgba(0, 0, 0, .8); }
.trn-pod__col--1 .trn-pod__block { height: 104px; background: linear-gradient(180deg, #FFE27A, #F5A81A 70%, #C98500); color: #3B2A00; }
.trn-pod__col--2 .trn-pod__block { height: 78px; background: linear-gradient(180deg, #F2F4FA, #BFC5D6 70%, #8D94AA); color: #23264A; }
.trn-pod__col--3 .trn-pod__block { height: 60px; background: linear-gradient(180deg, #FFD0A6, #E08A4E 70%, #A85A26); color: #3A1E08; }
.trn-pod__medal { font-size: 1.5rem; line-height: 1; }
.trn-pod__pts { font: 700 1rem var(--font-display); }
.trn-pod__col.is-empty { visibility: hidden; }
.trn-cer__coins { display: inline-flex; align-items: center; gap: 8px; margin: 6px 0 0; padding: 6px 16px 6px 6px; border-radius: 99px; font-weight: 800;
  background: linear-gradient(180deg, rgba(58, 61, 92, .92), rgba(31, 33, 55, .92)); border: 1px solid rgba(255, 210, 63, .6); animation: trn-pop .5s cubic-bezier(.3, 1.6, .5, 1) 1.1s both; }
.trn-cer__coins b { font: 700 1.25rem var(--font-display); color: var(--trn-gold-2); }
.trn-cer__coin { width: 30px; height: 30px; }
.trn-cer__perk { margin: 0; font-size: .92rem; font-weight: 700; opacity: .9; max-width: 32ch; }

/* ------------------------------------------------------------ retos (hub + reward screen) */
.trn-retos__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.trn-reto { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 12px 10px 10px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--line); }
.trn-reto__em.ndj-emblem, .trn-reto__ic { width: 44px; height: 44px; flex: none; border-radius: 14px; }
.trn-reto__ic { display: grid; place-items: center; font-size: 1.5rem; background: linear-gradient(135deg, color-mix(in srgb, var(--trn-orange) 24%, var(--card)), color-mix(in srgb, var(--trn-gold-2) 26%, var(--card))); }
.trn-reto__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.trn-reto__t { font-weight: 800; line-height: 1.25; }
.trn-reto__bar { display: block; height: 8px; border-radius: 99px; background: rgba(43, 45, 66, .1); overflow: hidden; }
.trn-reto__bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--trn-coral), var(--trn-orange)); transition: width .5s ease; }
.trn-reto.is-done .trn-reto__bar i { background: linear-gradient(90deg, #26D07C, #6EE7A8); }
.trn-reto__n { font-size: .8rem; font-weight: 800; color: var(--fg-2); }
.trn-reto__coins { display: inline-flex; align-items: center; gap: 4px; flex: none; font: 700 1rem var(--font-display); color: var(--fg-2); }
.trn-reto__coin { width: 20px; height: 20px; }
.trn-reto__claim { flex: none; min-height: 44px; padding: 0 14px; border: 0; border-radius: 14px; color: #3B2A00; font: 700 .98rem var(--font-display);
  background: linear-gradient(180deg, #FFE27A, var(--trn-gold-3)); box-shadow: 0 10px 18px -10px rgba(245, 168, 26, .95), inset 0 1px 0 rgba(255, 255, 255, .6);
  animation: trn-glow 1.8s ease-in-out infinite; }
@keyframes trn-glow { 50% { box-shadow: 0 10px 22px -8px rgba(245, 168, 26, 1), 0 0 0 4px rgba(255, 210, 63, .3), inset 0 1px 0 rgba(255, 255, 255, .6); } }
.trn-reto__paid { flex: none; font: 700 .9rem var(--font-display); color: #13965A; }
.trn-reto.is-paid { opacity: .78; }
.trn-reto.is-done { border-color: color-mix(in srgb, #26D07C 45%, transparent); }
.trn-retos__card, .trn-rank__card { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 22px; background: var(--card);
  border: 1px solid rgba(43, 45, 66, .07); box-shadow: 0 22px 40px -30px rgba(43, 45, 66, .5), 0 1px 0 rgba(255, 255, 255, .9) inset; }
.trn-retos__note, .trn-rank__note { margin: 0; font-size: .84rem; font-weight: 700; color: var(--fg-2); }
.trn-hub { scroll-margin-top: 76px; }

/* on the (dark) reward screen */
.trn-retos--reward { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 18px; text-align: left; color: #fff;
  background: rgba(0, 0, 0, .22); border: 1px solid rgba(255, 255, 255, .12); animation: ndj-in .4s ease .8s both; }
.trn-retos__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.trn-retos__head b { font: 700 1rem var(--font-display); }
.trn-retos__sub { font: 700 .85rem var(--font-display); opacity: .75; }
.trn-retos--reward .trn-reto { min-height: 54px; padding: 6px 10px 6px 6px; background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .1); gap: 10px; }
.trn-retos--reward .trn-reto__em.ndj-emblem, .trn-retos--reward .trn-reto__ic { width: 36px; height: 36px; border-radius: 12px; font-size: 1.2rem; }
.trn-retos--reward .trn-reto__ic { background: rgba(255, 255, 255, .12); }
.trn-retos--reward .trn-reto__t { font-size: .92rem; }
.trn-retos--reward .trn-reto__bar { background: rgba(255, 255, 255, .14); height: 6px; }
.trn-retos--reward .trn-reto__coins { color: rgba(255, 255, 255, .8); font-size: .9rem; }
.trn-retos--reward .trn-reto__paid { color: #6EE7A8; }

/* ------------------------------------------------------------ family ranking (hub) */
.trn-rank__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.trn-rank__row { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 12px 8px 8px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--line); }
.trn-rank__row.is-top1 { background: linear-gradient(90deg, rgba(255, 210, 63, .32), var(--card-2) 80%); border-color: rgba(245, 168, 26, .45); }
.trn-rank__row.is-top2 { background: linear-gradient(90deg, rgba(191, 197, 214, .4), var(--card-2) 80%); }
.trn-rank__row.is-top3 { background: linear-gradient(90deg, rgba(224, 138, 78, .25), var(--card-2) 80%); }
.trn-rank__row.is-me { box-shadow: inset 3px 0 0 var(--trn-orange); }
.trn-rank__pos { width: 30px; flex: none; text-align: center; font: 700 1rem var(--font-display); color: var(--fg-2); }
.trn-rank__row.is-top .trn-rank__pos { font-size: 1.45rem; }
.trn-rank__main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.trn-rank__name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trn-rank__name .trn-row__me { background: color-mix(in srgb, var(--trn-orange) 20%, var(--card)); color: #B5480F; }
.trn-rank__meta { font-size: .8rem; font-weight: 700; color: var(--fg-2); }
.trn-rank__pts { font: 700 1.25rem var(--font-display); }
.trn-rank__pts small { font-size: .7rem; color: var(--fg-2); }
.trn-rank__card.is-empty { flex-direction: row; align-items: center; }
.trn-rank__card.is-empty p { margin: 0; font-weight: 700; color: var(--fg-2); }
.trn-rank__trophy { width: 52px; height: 52px; }

/* ------------------------------------------------------------ dark mode */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .trn-reto__bar { background: rgba(255, 255, 255, .12); }
  :root:not([data-theme="light"]) .trn-retos__card, :root:not([data-theme="light"]) .trn-rank__card { border-color: rgba(255, 255, 255, .08); box-shadow: 0 22px 40px -30px rgba(0, 0, 0, .8); }
  :root:not([data-theme="light"]) .trn-reto__paid { color: #6EE7A8; }
  :root:not([data-theme="light"]) .trn-rank__name .trn-row__me { color: #FFD8B0; }
  :root:not([data-theme="light"]) .trn-again { color: #FF9070; }
  :root:not([data-theme="light"]) .trn-card, :root:not([data-theme="light"]) .trn-start { border-color: rgba(255, 210, 63, .5); }
}
:root[data-theme="dark"] .trn-reto__bar { background: rgba(255, 255, 255, .12); }
:root[data-theme="dark"] .trn-retos__card, :root[data-theme="dark"] .trn-rank__card { border-color: rgba(255, 255, 255, .08); box-shadow: 0 22px 40px -30px rgba(0, 0, 0, .8); }
:root[data-theme="dark"] .trn-reto__paid { color: #6EE7A8; }
:root[data-theme="dark"] .trn-rank__name .trn-row__me { color: #FFD8B0; }
:root[data-theme="dark"] .trn-again { color: #FF9070; }
:root[data-theme="dark"] .trn-card, :root[data-theme="dark"] .trn-start { border-color: rgba(255, 210, 63, .5); }

/* ------------------------------------------------------------ reduced motion: no float, spin, glow or pop */
@media (prefers-reduced-motion: reduce) {
  .trn-ov__rays, .trn-intro__trophy, .trn-cer__trophy, .trn-reto__claim, .trn-row__d, .trn-pod__col, .trn-ov__box, .trn-cer__coins, .trn-card { animation: none !important; }
}

/* ------------------------------------------------------------ small screens */
.trn-setup__box > *, .trn-ov__box > * { flex-shrink: 0; } /* a scrolling sheet never squashes its pieces */
@media (max-height: 700px) {
  .trn-cer__trophy, .trn-intro__trophy { width: 88px; height: 88px; }
  .trn-ov__box { gap: 7px; }
  .trn-pod { margin-top: 4px; }
  .trn-pod__col--1 .trn-pod__block { height: 84px; }
  .trn-pod__col--2 .trn-pod__block { height: 62px; }
  .trn-pod__col--3 .trn-pod__block { height: 48px; }
  .trn-pod__col .ndj-avatar--lg { width: 48px; height: 48px; font-size: 1.3rem; }
  .trn-pod__col--1 .ndj-avatar--lg { width: 58px; height: 58px; font-size: 1.6rem; }
  .trn-cer__perk { display: none; }
  .trn-setup__badge { width: 60px; height: 60px; border-radius: 20px; }
  .trn-setup__trophy { width: 40px; height: 40px; }
}

/* Ranking by groups: tabs (Familia, Amigos… · Otros · Todos), top 5 + "Ver los N", search when long */
.trn-rank__tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: -2px -14px 2px; padding: 2px 14px 4px; scroll-snap-type: x proximity; }
.trn-rank__tabs::-webkit-scrollbar { display: none; }
.trn-rank__tab { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card-2); color: var(--fg); font: 700 .95rem var(--font-body, inherit); cursor: pointer; scroll-snap-align: start; max-width: 70vw; }
.trn-rank__tablabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trn-rank__tabn { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font-size: .75rem; font-weight: 800; background: color-mix(in srgb, var(--fg) 10%, transparent); color: var(--fg-2); }
.trn-rank__tab.is-on { background: linear-gradient(135deg, #FF6B4A, #FF9A3C); border-color: transparent; color: #fff; box-shadow: 0 8px 18px -10px rgba(255, 107, 74, .9); }
.trn-rank__tab.is-on .trn-rank__tabn { background: rgba(255, 255, 255, .28); color: #fff; }
.trn-rank__tab:focus-visible { outline: 3px solid color-mix(in srgb, #FF6B4A 55%, transparent); outline-offset: 2px; }
.trn-rank__gap { text-align: center; font-weight: 800; color: var(--fg-2); line-height: 1; padding: 0 0 2px; letter-spacing: 2px; }
.trn-rank__all { display: flex; flex-direction: column; gap: 8px; }
.trn-rank__list--all { max-height: min(60vh, 460px); overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
.trn-rank__search { min-height: 44px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card-2); color: var(--fg); font-family: inherit; font-size: 1rem; font-weight: 700; }
.trn-rank__more { min-height: 44px; }
.trn-rank__emptytab { margin: 4px 0; font-weight: 700; color: var(--fg-2); }
.trn-rank__organize { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 12px; border-radius: 16px; border: 1px dashed color-mix(in srgb, #FF6B4A 45%, var(--line)); background: color-mix(in srgb, #FF9A3C 8%, var(--card)); color: var(--fg); text-align: left; cursor: pointer; font: inherit; }
.trn-rank__organize > span:first-child { font-size: 1.5rem; }
.trn-rank__organize > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.trn-rank__organize small { color: var(--fg-2); font-weight: 700; }
.trn-rank__go { width: 20px; height: 20px; transform: rotate(-90deg); color: var(--fg-2); flex: none; }
.trn-rank__how { font-size: .86rem; color: var(--fg-2); font-weight: 700; }
.trn-rank__how summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; list-style: none; }
.trn-rank__how summary::-webkit-details-marker { display: none; }
.trn-rank__how summary::before { content: 'ⓘ'; margin-right: 6px; }
.trn-rank__how p { margin: 4px 0 0; }
