/* ===== Herramientas de la barra (tiempo.js + extras.js) ===== */
.tools { position: relative; display: flex; align-items: center; margin-left: auto; }
.tools__menu { display: flex; align-items: center; gap: 6px; }
.tools__more { display: none; }
.tool {
  position: relative; height: 38px; min-width: 38px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 2.5px solid var(--line); border-radius: 999px; background: var(--track); color: var(--text); cursor: pointer;
  font: 800 13px/1 var(--f-body); transition: scale .2s var(--bounce), background .2s;
}
.tool svg { width: 20px; height: 20px; flex: none; }
.tool:hover { scale: 1.08; }
.tool:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.tool.is-on { background: var(--sun); color: #000; }
.tt { position: relative; }
.tt__btn.is-on { background: var(--red); color: #fff; animation: tt-pulse 2s ease-in-out infinite; }
@keyframes tt-pulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--red) 30%, transparent); } }
.tt__pop {
  position: absolute; z-index: 80; top: calc(100% + 12px); right: -60px; width: 290px; padding: 16px;
  background: var(--surface); color: var(--text); border: var(--stroke); border-radius: 20px; box-shadow: 5px 5px 0 var(--line);
  animation: tt-in .3s var(--bounce);
}
@keyframes tt-in { from { opacity: 0; translate: 0 -8px; scale: .96; } }
.tt__title { display: block; font: 400 24px/1 var(--f-display); margin-bottom: 4px; }
.tt__txt { margin: 0 0 12px; font-size: 14px; color: var(--text-soft); line-height: 1.35; }
.tt__lab { display: block; font-weight: 800; font-size: 14px; margin-bottom: 6px; }
.tt__lab output { font: 400 22px/1 var(--f-display); color: var(--red); }
.tt__pop input[type=range] { width: 100%; accent-color: var(--red); height: 28px; }
.tt__ticks { display: flex; justify-content: space-between; padding: 0 6px; margin: -4px 0 12px; }
.tt__ticks i { width: 4px; height: 8px; border-radius: 2px; background: var(--text-mute); opacity: .5; }
.tt__ticks i.is-key { background: var(--sun); opacity: 1; height: 12px; outline: 1.5px solid #000; }
.tt__row { display: flex; flex-wrap: wrap; gap: 8px; }
.tt__go, .tt__now, .tt-banner button { border: var(--stroke); border-radius: 999px; padding: 8px 16px; font: 400 16px/1 var(--f-display); cursor: pointer; box-shadow: 3px 3px 0 #000; }
.tt__go { background: var(--red); color: #fff; }
.tt__now { background: var(--surface); color: var(--text); }
.tt-banner {
  position: sticky; top: 0; z-index: 70; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px;
  padding: 8px 14px; background: repeating-linear-gradient(-45deg, #ffd34d 0 18px, #ffc21a 18px 36px); color: #000; border-bottom: 3px solid #000;
  font-size: 14px; font-weight: 600; text-align: center;
}
.tt-banner button { background: #000; color: #fff; padding: 6px 14px; font-size: 14px; box-shadow: none; }
.is-past .topbar { top: 56px; }

@media (max-width: 720px) {
  .tools__more { display: inline-flex; }
  .tools__menu {
    position: absolute; z-index: 80; top: calc(100% + 12px); right: -50px; display: none; flex-direction: column; align-items: stretch; gap: 8px;
    padding: 10px; background: var(--surface); border: var(--stroke); border-radius: 18px; box-shadow: 4px 4px 0 var(--line);
  }
  .tools.is-open .tools__menu { display: flex; animation: tt-in .25s var(--bounce); }
  .tools__menu .tool { justify-content: flex-start; padding: 0 12px; width: 100%; }
  .tools__menu .tool::after { content: attr(title); font-size: 13px; white-space: nowrap; }
  .tools__menu .tt__btn::after { content: none; }
  .tt__pop { position: fixed; left: 12px; right: 12px; top: 80px; width: auto; }
  .is-past .topbar { top: 76px; }
}

/* Aviso flotante */
.xt-toast {
  position: fixed; z-index: 120; left: 50%; bottom: 20px; translate: -50% 0; display: flex; align-items: center; gap: 10px; width: max-content; max-width: min(560px, calc(100% - 24px));
  padding: 10px 10px 10px 18px; background: var(--surface); color: var(--text); border: var(--stroke); border-radius: 999px; box-shadow: 4px 4px 0 #000;
  font-weight: 700; font-size: 14px; animation: toast-in .45s var(--bounce);
  transition: opacity .4s, translate .4s;
}
.xt-toast button { border: 2px solid #000; border-radius: 999px; background: var(--red); color: #fff; font: 800 13px/1 var(--f-body); padding: 7px 12px; cursor: pointer; white-space: nowrap; }
.xt-toast .xt-toast__x { background: transparent; color: var(--text); border: none; padding: 6px; }
@media (max-width: 560px) { .xt-toast { border-radius: 22px; font-size: 13px; } }
.xt-toast.is-out { opacity: 0; translate: -50% 20px; }
@keyframes toast-in { from { translate: -50% 40px; opacity: 0; } }

/* ===== Pokédex ===== */
.dex { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; }
.dex__card { display: flex; gap: 18px; align-items: center; padding: 16px; background: var(--card); border: var(--stroke); border-radius: 22px; box-shadow: 4px 4px 0 var(--line); }
.dex__ring {
  --c: var(--c-sol); flex: none; width: 128px; height: 128px; border-radius: 50%; display: grid; place-items: center; border: var(--stroke);
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--track, #ddd) 0); box-shadow: 3px 3px 0 #000;
}
.dex__card--luna .dex__ring { --c: var(--c-luna); }
.js [data-mount="pokedex"]:not(.is-in) .dex__ring { background: conic-gradient(var(--c) 0%, var(--track, #ddd) 0); }
@property --pp { syntax: "<number>"; inherits: false; initial-value: 0; }
[data-mount="pokedex"].is-in .dex__ring { animation: dex-fill 1.2s ease-out both; background: conic-gradient(var(--c) calc(var(--pp) * 1%), var(--track, #ddd) 0); --pp: var(--p); }
@keyframes dex-fill { from { --pp: 0; } }
.dex__in { width: 92px; height: 92px; border-radius: 50%; background: var(--surface); border: var(--stroke); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.dex__in b { font: 400 34px/1 var(--f-display); }
.dex__in small { font-size: 12px; color: var(--text-soft); font-weight: 700; }
.dex__info { min-width: 0; }
.dex__who { margin: 0; font: 400 24px/1 var(--f-display); }
.dex__card--sol .dex__who { color: var(--name-sol); }
.dex__card--luna .dex__who { color: var(--name-luna); }
.dex__pct { margin: 4px 0 10px; font-size: 14px; }
.dex__pct small { color: var(--text-mute); }
.dex__lab { margin: 0 0 6px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-soft); }
.dex__types { display: flex; flex-wrap: wrap; gap: 5px; }
.dex__t { display: inline-flex; transition: scale .2s var(--bounce); }
.dex__t:hover { scale: 1.2; }
.dex__t.is-miss { filter: grayscale(1); opacity: .28; }
.dex__miss { margin: 10px 0 0; font-size: 13px; color: var(--text-soft); }
.dex__note { margin: 12px 0 0; font-size: 12px; color: var(--text-mute); }
@media (max-width: 520px) { .dex__card { flex-direction: column; text-align: center; } .dex__types { justify-content: center; } }

/* ===== Resumen tipo "Wrapped" ===== */
.wr {
  width: min(440px, 100%); height: min(780px, 100dvh); max-width: 100%; max-height: 100dvh; padding: 0; overflow: hidden;
  border: var(--stroke); border-radius: 26px; color: #fff; box-shadow: 8px 8px 0 #000;
  background: radial-gradient(120% 70% at 0% 0%, #ff8a3d, transparent 60%), radial-gradient(120% 70% at 100% 100%, #4d6bff, transparent 60%), #1b1536;
}
.wr::backdrop { background: rgba(5, 5, 20, .75); backdrop-filter: blur(4px); }
.wr__bars { position: absolute; z-index: 5; top: 12px; left: 14px; right: 60px; display: flex; gap: 4px; }
.wr__bar { flex: 1; height: 5px; border-radius: 9px; background: rgba(255,255,255,.3); overflow: hidden; }
.wr__bar i { display: block; height: 100%; width: 0; background: #fff; }
.wr__bar.is-done i { width: 100%; }
.wr__bar.is-run i { animation: wr-bar var(--d) linear forwards; }
@keyframes wr-bar { to { width: 100%; } }
.wr__x { position: absolute; z-index: 6; top: 6px; right: 10px; width: 38px; height: 38px; border: 2px solid #fff; border-radius: 50%; background: rgba(0,0,0,.3); color: #fff; font-weight: 800; cursor: pointer; }
.wr__nav { position: absolute; z-index: 4; top: 60px; bottom: 0; width: 35%; background: none; border: 0; cursor: pointer; }
.wr__nav--prev { left: 0; }
.wr__nav--next { right: 0; width: 65%; }
.wr__nav:focus-visible { outline: 3px solid var(--sun); outline-offset: -6px; }
.wr__slide { position: absolute; inset: 0; display: none; flex-direction: column; justify-content: center; align-items: center; gap: 12px; padding: 60px 26px 40px; text-align: center; }
.wr__slide.is-on { display: flex; }
.wr__slide.is-on > * { animation: wr-in .6s var(--bounce) both; }
.wr__slide.is-on > :nth-child(2) { animation-delay: .12s; }
.wr__slide.is-on > :nth-child(3) { animation-delay: .24s; }
.wr__slide.is-on > :nth-child(4) { animation-delay: .36s; }
@keyframes wr-in { from { opacity: 0; translate: 0 30px; scale: .9; } }
.wr__kick { margin: 0; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; font-size: 13px; color: #ffd34d; }
.wr__big { margin: 0; font: 400 clamp(44px, 12vw, 64px)/.95 var(--f-display); -webkit-text-stroke: 2px #000; paint-order: stroke fill; text-shadow: 4px 5px 0 #000; }
.wr__big--s { font-size: clamp(30px, 8vw, 40px); line-height: 1.05; }
.wr__sub { margin: 0; font-size: 16px; opacity: .9; max-width: 30ch; }
.wr__two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; }
.wr__half { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; border: 3px solid #000; border-radius: 20px; box-shadow: 4px 4px 0 #000; }
.wr__half--sol { background: var(--grad-sol); }
.wr__half--luna { background: var(--grad-luna); }
.wr__half > img:not(.wr__mon) { width: 74px; height: 74px; object-fit: cover; object-position: top; border-radius: 50%; border: 3px solid #000; background: #fff; }
.wr__half b { font: 400 54px/1 var(--f-display); -webkit-text-stroke: 2px #000; paint-order: stroke fill; }
.wr__half b small { font-size: 24px; }
.wr__half span { font-weight: 800; text-shadow: 0 1px 0 #000; }
.wr__mon { width: 110px; height: 110px; object-fit: contain; filter: drop-shadow(3px 3px 0 rgba(0,0,0,.5)); }
.wr__mvp { font-size: 28px !important; }
.wr__lab { margin: 4px 0 0; font-weight: 700; opacity: .9; }
.wr__graves { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.wr__graves span { display: flex; flex-direction: column; align-items: center; width: 84px; padding: 10px 4px 6px; border: 3px solid #000; border-radius: 40px 40px 8px 8px; background: linear-gradient(160deg, #b9bfcc, #8d94a6); color: #1a1d28; animation: wr-in .6s calc(.3s + var(--i) * .15s) var(--bounce) both; }
.wr__graves img { width: 56px; height: 56px; object-fit: contain; filter: grayscale(1); }
.wr__graves small { font-weight: 800; font-size: 12px; }
.wr__again { position: relative; z-index: 6; border: 3px solid #000; border-radius: 999px; background: #ffd34d; color: #000; font: 400 18px/1 var(--f-display); padding: 10px 20px; cursor: pointer; box-shadow: 3px 3px 0 #000; }
.wr .hi-play { position: relative; z-index: 6; }
@media (max-width: 520px) { .wr { border-radius: 0; border: 0; height: 100dvh; } }
@media (prefers-reduced-motion: reduce) {
  .wr__slide.is-on > *, .wr__graves span, .tt__btn.is-on, .xt-toast, .tt__pop { animation: none !important; }
  .wr__bar.is-run i { animation: none; width: 100%; }
}
.tools > .tools__more { display: none; }
@media (max-width: 720px) { .tools > .tools__more { display: inline-flex; } }
