/* =========================================================
   AZAHAR · lofi radio — hoja de estilos
   paleta y tipos: /root/lofi/BRAND.md
   ========================================================= */

@font-face { font-family: "Fraunces"; src: url("../assets/fonts/fraunces-var.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../assets/fonts/fraunces-italic-var.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../assets/fonts/inter-var.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../assets/fonts/plexmono-300.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../assets/fonts/plexmono-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../assets/fonts/plexmono-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  /* dentro de casa: madera, crema, ámbar y terracota (la marca azul queda fuera, tras el cristal) */
  --noche: #2A1A12;          /* texto oscuro sobre ámbar y fondo base */
  --noche-2: #1E120C;
  --cristal: #24324A;        /* azul de fuera (sólo detalles) */
  --madera: #4A2E1F;
  --niebla: #BFA88E;         /* texto secundario cálido */
  --niebla-2: #D8C6AE;
  --azahar: #F4EEE1;
  --lampara: #F2B66D;
  --naranja: #E07B39;
  --hoja: #5E7F63;
  --hoja-2: #9DBF9F;
  --terracota: #C8643B;
  --terracota-2: #D97A4E;

  --glass-bg: linear-gradient(165deg, rgba(92, 58, 38, .62) 0%, rgba(52, 32, 21, .72) 55%, rgba(38, 23, 15, .78) 100%);
  --glass-line: rgba(255, 226, 190, .16);
  --glass-shadow: 0 28px 70px -22px rgba(16, 8, 3, .75), 0 1px 0 rgba(255, 236, 210, .10) inset, 0 0 0 1px rgba(20, 10, 4, .18);
  --blur: blur(24px) saturate(1.35);

  --f-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --f-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(16px, 2.4vw, 32px);
  --ease: cubic-bezier(.22, .8, .24, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--noche);
  color: var(--azahar);
  font: 400 15px/1.5 var(--f-ui);
  font-feature-settings: "ss01", "cv11";
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100vh; height: 100dvh;
  overscroll-behavior: none;
}
::selection { background: rgba(242, 182, 109, .35); color: var(--azahar); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
svg { display: block; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--lampara); outline-offset: 3px; border-radius: 10px; }

/* =========================================================
   ESCENA
   ========================================================= */
.scene { position: fixed; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; inset: 0; overflow: hidden; background: linear-gradient(180deg, #3e271b 0%, #5a3a2a 70%, #5e3c2c 100%); z-index: 0; }
.scene__layer { position: absolute; top: -1.6%; right: -1.6%; bottom: -1.6%; left: -1.6%; width: 103.2%; height: 103.2%; inset: -1.6%; will-change: transform; }
.scene__img, .scene__rain, .scene__fx { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; width: 100%; height: 100%; }
.scene__img { object-fit: cover; user-select: none; -webkit-user-drag: none; }
/* con JS la imagen se coloca a mano (mismo encaje que la lluvia y el gato) */
.js .scene__img { object-fit: fill; width: auto; height: auto; top: auto; right: auto; bottom: auto; left: auto; inset: auto; }
/* frente de madera del alféizar bajo la ilustración vertical */
.is-portrait-art .scene { background: linear-gradient(180deg, #4e2e22 0%, #3b2219 40%, #24150f 100%); }
.scene__rain { opacity: 0; transition: opacity 1.8s ease; pointer-events: none; }
.scene__rain.is-on { opacity: 1; }
.scene__fx { pointer-events: none; }

.scene__shade {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 0% 0%, rgba(22, 12, 6, .55), rgba(22, 12, 6, 0) 65%),
    radial-gradient(40% 36% at 100% 0%, rgba(22, 12, 6, .38), rgba(22, 12, 6, 0) 70%),
    linear-gradient(to top, rgba(22, 12, 6, .62), rgba(22, 12, 6, .14) 20%, rgba(22, 12, 6, 0) 36%),
    radial-gradient(130% 120% at 50% 45%, rgba(0, 0, 0, 0) 60%, rgba(30, 15, 6, .35) 100%);
  transition: background-color 1.2s ease;
}
body.focus-mode .scene__shade { background-color: rgba(26, 14, 7, .58); }
body.tools-open .scene__shade { background-color: rgba(24, 14, 8, .12); }

/* luces y detalles vivos (posicionados por JS sobre la ilustración) */
.fx { position: absolute; border-radius: 50%; mix-blend-mode: screen; opacity: .9; }
.fx--desk {
  background: radial-gradient(circle, rgba(255, 214, 150, .38) 0%, rgba(255, 186, 110, .16) 28%, rgba(255, 170, 90, .05) 52%, rgba(255, 170, 90, 0) 70%);
  animation: lamp-breathe 7s ease-in-out infinite alternate;
}
.fx--pool {
  background: radial-gradient(closest-side, rgba(255, 190, 120, .16), rgba(255, 170, 90, .05) 55%, rgba(255, 170, 90, 0));
  animation: lamp-breathe 7s ease-in-out infinite alternate;
}
.fx--street {
  background: radial-gradient(circle, rgba(255, 222, 160, .42) 0%, rgba(255, 180, 100, .17) 25%, rgba(255, 160, 80, .05) 50%, rgba(255, 160, 80, 0) 70%);
  animation: street-flicker 9s linear infinite;
}
.fx--wet {
  border-radius: 40%;
  background: radial-gradient(closest-side, rgba(255, 196, 130, .22), rgba(255, 196, 130, 0));
  transform: scaleX(.45);
  animation: wet-shimmer 3.6s ease-in-out infinite alternate;
}
.fx--candle {
  background: radial-gradient(circle, rgba(255, 210, 140, .5) 0%, rgba(255, 170, 90, .2) 30%, rgba(255, 150, 70, .06) 55%, rgba(255, 150, 70, 0) 70%);
  animation: candle-glow 2.7s linear infinite;
}
.fx--wet2 { transform: scaleX(.6); animation-duration: 4.4s; }
.fx-flame { position: absolute; mix-blend-mode: screen; pointer-events: none; }
.fx-flame i {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; inset: 0;
  border-radius: 50% 50% 46% 46% / 64% 64% 36% 36%;
  background: radial-gradient(ellipse 50% 60% at 50% 72%, rgba(255, 255, 238, .95) 0%, rgba(255, 232, 150, .85) 28%, rgba(255, 166, 70, .5) 56%, rgba(255, 120, 40, 0) 78%);
  transform-origin: 50% 92%;
  filter: blur(.5px);
  animation: flame-sway 1.9s ease-in-out infinite alternate, flame-flick .27s steps(2, end) infinite;
}
.cat { position: absolute; pointer-events: none; }
.cat > img, .cat > video { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; width: 100%; height: 100%; display: block; }
.cat__base, .cat__sleep { transition: opacity .6s ease; }
.cat__sleep { transform-origin: 55% 88%; animation: cat-breathe 3.6s ease-in-out infinite; }
.cat__video { object-fit: fill; opacity: 0; transition: opacity .6s ease; }
.cat__video.is-masked { -webkit-mask-image: url("../assets/cat/gato-mascara.png"); mask-image: url("../assets/cat/gato-mascara.png"); -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }
.cat--video .cat__video { opacity: 1; }
.cat--video .cat__sleep, .cat--video .cat__base { opacity: 0; transition-delay: .15s; }
.cat--nobase .cat__base { display: none; }
.cat__shadow { display: none; }
.cat--portrait .cat__shadow {
  display: block; position: absolute; left: 24%; right: 11%; bottom: 7.5%; height: 15%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(52, 26, 12, .6), rgba(52, 26, 12, 0));
  filter: blur(3px);
}
.fx--radio {
  background: radial-gradient(closest-side, rgba(255, 205, 130, .75), rgba(255, 170, 90, .18) 55%, rgba(255, 170, 90, 0));
  opacity: 0; transition: opacity 1.4s ease;
}
body.is-playing .fx--candle {
  background: radial-gradient(circle, rgba(255, 210, 140, .5) 0%, rgba(255, 170, 90, .2) 30%, rgba(255, 150, 70, .06) 55%, rgba(255, 150, 70, 0) 70%);
  animation: candle-glow 2.7s linear infinite;
}
.fx--wet2 { transform: scaleX(.6); animation-duration: 4.4s; }
.fx-flame { position: absolute; mix-blend-mode: screen; pointer-events: none; }
.fx-flame i {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; inset: 0;
  border-radius: 50% 50% 46% 46% / 64% 64% 36% 36%;
  background: radial-gradient(ellipse 50% 60% at 50% 72%, rgba(255, 255, 238, .95) 0%, rgba(255, 232, 150, .85) 28%, rgba(255, 166, 70, .5) 56%, rgba(255, 120, 40, 0) 78%);
  transform-origin: 50% 92%;
  filter: blur(.5px);
  animation: flame-sway 1.9s ease-in-out infinite alternate, flame-flick .27s steps(2, end) infinite;
}
.cat { position: absolute; pointer-events: none; }
.cat > img, .cat > video { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; width: 100%; height: 100%; display: block; }
.cat__base, .cat__sleep { transition: opacity .6s ease; }
.cat__sleep { transform-origin: 55% 88%; animation: cat-breathe 3.6s ease-in-out infinite; }
.cat__video { object-fit: fill; opacity: 0; transition: opacity .6s ease; }
.cat__video.is-masked { -webkit-mask-image: url("../assets/cat/gato-mascara.png"); mask-image: url("../assets/cat/gato-mascara.png"); -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }
.cat--video .cat__video { opacity: 1; }
.cat--video .cat__sleep, .cat--video .cat__base { opacity: 0; transition-delay: .15s; }
.cat--nobase .cat__base { display: none; }
.cat__shadow { display: none; }
.cat--portrait .cat__shadow {
  display: block; position: absolute; left: 24%; right: 11%; bottom: 7.5%; height: 15%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(52, 26, 12, .6), rgba(52, 26, 12, 0));
  filter: blur(3px);
}
.fx--radio { opacity: .9; animation: radio-beat .8s ease-in-out infinite alternate; }

.fx-steam { position: absolute; }
.fx-steam i {
  position: absolute; left: 34%; bottom: 0; width: 32%; height: 46%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 244, 228, .4), rgba(255, 244, 228, 0));
  filter: blur(3px);
  opacity: 0;
  animation: steam 6.4s ease-in infinite;
}
.fx-steam i:nth-child(2) { animation-delay: 2.1s; left: 28%; }
.fx-steam i:nth-child(3) { animation-delay: 4.3s; left: 40%; }

@keyframes lamp-breathe { from { opacity: .78; } to { opacity: 1; } }
@keyframes street-flicker {
  0%, 100% { opacity: .92; } 7% { opacity: .86; } 7.6% { opacity: .62; } 8.2% { opacity: .9; }
  31% { opacity: .96; } 46% { opacity: .84; } 46.5% { opacity: .7; } 47.2% { opacity: .95; } 47.8% { opacity: .78; } 48.6% { opacity: .94; }
  72% { opacity: 1; } 88% { opacity: .88; }
}
@keyframes wet-shimmer { from { opacity: .55; transform: scaleX(.42) scaleY(1); } to { opacity: .95; transform: scaleX(.5) scaleY(1.06); } }
@keyframes radio-beat { from { transform: scale(.94); } to { transform: scale(1.06); } }
@keyframes cat-breathe { 0%, 100% { transform: scale(1, 1); } 42% { transform: scale(1.005, 1.019); } 55% { transform: scale(1.005, 1.018); } }
@keyframes candle-glow {
  0%, 100% { opacity: .8; transform: scale(1); } 13% { opacity: .95; } 21% { opacity: .72; transform: scale(.97); }
  37% { opacity: .92; transform: scale(1.03); } 52% { opacity: .78; } 64% { opacity: 1; transform: scale(1.02); } 81% { opacity: .84; transform: scale(.98); }
}
@keyframes flame-sway {
  0% { transform: rotate(-2deg) scale(1, 1); }
  23% { transform: rotate(3deg) scale(.93, 1.09) translateX(4%); }
  48% { transform: rotate(-3.5deg) scale(1.05, .94) translateX(-3%); }
  71% { transform: rotate(2deg) scale(.96, 1.06); }
  100% { transform: rotate(-1deg) scale(1.02, .98); }
}
@keyframes flame-flick { 0%, 100% { opacity: .92; } 50% { opacity: .78; } }
@keyframes steam {
  0% { transform: translate(0, 0) scale(.55, .7); opacity: 0; }
  18% { opacity: .9; }
  60% { opacity: .5; }
  100% { transform: translate(14%, -95%) scale(1.25, 1.2); opacity: 0; }
}

/* =========================================================
   CAPAS DE INTERFAZ
   ========================================================= */
.ui-fade { transition: opacity .7s var(--ease), transform .7s var(--ease), visibility 0s linear 0s; }
body.focus-mode .ui-fade { opacity: 0; visibility: hidden; transition: opacity .6s var(--ease), transform .6s var(--ease), visibility 0s linear .6s; }
body.focus-mode .top { transform: translateY(-8px); }
body.focus-mode .player { transform: translate(-50%, 10px); }

/* ---------- cabecera ---------- */
.top {
  position: fixed; z-index: 5; left: 0; right: 0; top: 0;
  padding: calc(var(--gutter) + var(--safe-t) - 4px) var(--gutter) 0;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.brand { display: block; border-radius: 8px; margin-left: -6px; }
.brand img { display: block; width: clamp(132px, 12vw, 176px); height: auto; filter: drop-shadow(0 2px 14px rgba(14, 7, 3, .55)); }

.top__right { display: flex; align-items: center; gap: 18px; }
.clock { text-align: right; line-height: 1.1; text-shadow: 0 1px 18px rgba(14, 7, 3, .7); }
.clock__time { display: block; font: 300 clamp(24px, 2.2vw, 31px)/1 var(--f-mono); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.clock__date { display: block; margin-top: 6px; font-size: 12.5px; color: var(--niebla-2); letter-spacing: .01em; }
.top__actions { display: flex; gap: 6px; padding: 5px; border-radius: 999px; background: rgba(30, 18, 11, .35); border: 1px solid rgba(244, 238, 225, .07); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

.icon-btn {
  position: relative;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--azahar); opacity: .82;
  transition: background .25s, opacity .25s, color .25s;
}
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn svg .fill, .dock__btn svg .fill { fill: currentColor; stroke: none; }
.icon-btn:hover { background: rgba(244, 238, 225, .08); opacity: 1; }
.icon-btn[aria-pressed="true"] { color: var(--lampara); opacity: 1; background: rgba(242, 182, 109, .12); }
.icon-btn--sm { width: 34px; height: 34px; }
.icon-btn--bare { width: 34px; height: 34px; }
.icon-btn[data-tip]::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 10px); right: 50%; transform: translate(50%, -4px);
  white-space: nowrap; pointer-events: none;
  font: 500 11px/1 var(--f-mono); letter-spacing: .02em;
  color: var(--azahar); background: rgba(30, 18, 11, .88); border: 1px solid var(--glass-line);
  padding: 7px 9px; border-radius: 8px; opacity: 0; transition: opacity .2s, transform .2s;
}
.icon-btn[data-tip]:hover::after, .icon-btn[data-tip]:focus-visible::after { opacity: 1; transform: translate(50%, 0); }
#btnHelp[data-tip]::after { right: 0; transform: translate(0, -4px); }
#btnHelp[data-tip]:hover::after, #btnHelp[data-tip]:focus-visible::after { transform: translate(0, 0); }

/* ---------- frase del día ---------- */
.quote {
  position: fixed; z-index: 3; margin: 0;
  left: var(--gutter); top: calc(var(--gutter) + var(--safe-t) + 92px);
  max-width: 318px; width: 30vw; width: min(318px, 30vw);
  padding: 16px 20px 12px;
  border-radius: 20px;
  background: linear-gradient(165deg, rgba(92, 58, 38, .42), rgba(42, 26, 17, .55));
  border: 1px solid rgba(255, 226, 190, .12);
  box-shadow: 0 18px 40px -20px rgba(16, 8, 3, .7);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  opacity: 0; transition: opacity 1.2s ease .4s;
}
.scene-ready .quote { opacity: 1; }
.quote.is-off { display: none; }
.quote__label {
  display: flex; align-items: center; gap: 10px;
  font: 500 10.5px/1 var(--f-mono); letter-spacing: .2em; color: var(--lampara); opacity: .85;
}
.quote__label::before { content: ""; width: 22px; height: 1px; background: currentColor; opacity: .7; }
.quote__text {
  margin: 12px 0 0;
  font: italic 340 clamp(17px, 1.35vw, 21px)/1.34 var(--f-display);
  font-optical-sizing: auto;
  color: rgba(244, 238, 225, .93);
  text-wrap: balance;
  text-shadow: 0 2px 22px rgba(14, 7, 3, .8);
  transition: opacity .35s ease, transform .35s ease, filter .35s ease;
}
.quote__text.is-out { opacity: 0; transform: translateY(4px); filter: blur(3px); }
.quote__more {
  margin-top: 12px; font: 400 12px/1 var(--f-mono); color: var(--niebla-2); letter-spacing: .04em;
  padding: 6px 0; opacity: .7; transition: opacity .2s, color .2s;
}
.quote__more:hover { opacity: 1; color: var(--azahar); }

/* ---------- vidrio común ---------- */
.glass, .player, .dock, .tools, .help, .toast {
  background: var(--glass-bg);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--blur);
          backdrop-filter: var(--blur);
}

/* ---------- reproductor ---------- */
.player {
  position: fixed; z-index: 6;
  left: 50%; bottom: calc(var(--gutter) + var(--safe-b));
  transform: translateX(-50%);
  max-width: 640px; width: calc(100vw - 2 * var(--gutter)); width: min(640px, calc(100vw - 2 * var(--gutter)));
  border-radius: 26px;
  transition: left .5s var(--ease), opacity .7s var(--ease), transform .7s var(--ease), visibility 0s;
  padding: 14px 16px 14px 14px;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 16px;
}
.player::before {
  /* reflejo cálido de la lámpara en el borde superior */
  content: ""; position: absolute; left: 18%; right: 18%; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(242, 182, 109, .55), transparent);
  opacity: .55; transition: opacity 1s;
}
body.is-playing .player::before { opacity: 1; }
.player__logo { width: 52px; height: 52px; border-radius: 50%; display: block; box-shadow: 0 0 0 1px rgba(244, 238, 225, .12), 0 6px 18px rgba(0, 0, 0, .35); }
body.is-playing .player__logo { animation: logo-spin 24s linear infinite; }
@keyframes logo-spin { to { transform: rotate(360deg); } }

.player__info { min-width: 0; }
.player__status { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.live { display: inline-flex; align-items: center; gap: 7px; font: 500 10.5px/1 var(--f-mono); letter-spacing: .14em; color: var(--niebla-2); }
.live__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--niebla); position: relative; flex: none; }
.live--on { color: var(--lampara); }
.live--on .live__dot { background: var(--lampara); box-shadow: 0 0 10px rgba(242, 182, 109, .8); }
.live--on .live__dot::after {
  content: ""; position: absolute; top: -4px; right: -4px; bottom: -4px; left: -4px; inset: -4px; border-radius: 50%; border: 1px solid var(--lampara);
  animation: live-ring 2.4s ease-out infinite;
}
.live--wait .live__dot { background: var(--lampara); animation: blink 1s ease-in-out infinite alternate; }
.live--demo { color: var(--hoja-2); }
.live--demo .live__dot { background: var(--hoja-2); }
.live--rest .live__dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--niebla); }
@keyframes live-ring { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.9); opacity: 0; } }
@keyframes blink { from { opacity: .35; } to { opacity: 1; } }
.player__listeners { font: 400 11px/1 var(--f-mono); color: var(--niebla); letter-spacing: .04em; }
.player__listeners::before { content: "·"; margin-right: 10px; opacity: .6; }

.player__now { display: flex; flex-direction: column; min-width: 0; }
.player__now.swap { animation: np-in .7s var(--ease); }
@keyframes np-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.player__title {
  font: italic 380 19px/1.25 var(--f-display); font-optical-sizing: auto;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player__artist { font-size: 13px; color: var(--niebla-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.player__controls { display: flex; align-items: center; gap: 12px; }
.play {
  position: relative; flex: none;
  width: 58px; height: 58px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #F8CB8E, var(--lampara) 55%, #E3A158);
  color: var(--noche);
  display: grid; place-items: center;
  box-shadow: 0 10px 28px -6px rgba(242, 182, 109, .55), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .25s var(--ease), box-shadow .5s ease;
}
.play:hover { transform: scale(1.045); }
.play:active { transform: scale(.97); }
.play svg { width: 24px; height: 24px; fill: currentColor; grid-area: 1 / 1; transition: opacity .2s, transform .3s var(--ease); }
.play__icon--play { transform: translateX(1px); }
.play__icon--pause { opacity: 0; transform: scale(.7); }
body.is-playing .play__icon--play { opacity: 0; transform: scale(.7); }
body.is-playing .play__icon--pause { opacity: 1; transform: none; }
body.is-playing .play { box-shadow: 0 0 0 7px rgba(242, 182, 109, .12), 0 12px 36px -4px rgba(242, 182, 109, .6), inset 0 1px 0 rgba(255, 255, 255, .35); }
.play__spin { position: absolute; top: -5px; right: -5px; bottom: -5px; left: -5px; inset: -5px; border-radius: 50%; border: 1.5px solid transparent; border-top-color: var(--lampara); opacity: 0; }
body.is-connecting .play__spin { opacity: 1; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.volume { display: flex; align-items: center; gap: 4px; }
.volume .icon-btn svg { width: 20px; height: 20px; }
.vol-x { display: none; }
.icon-btn.is-muted .vol-wave { display: none; }
.icon-btn.is-muted .vol-x { display: inline; }
.icon-btn.is-muted { color: var(--niebla); }

.player__msg {
  grid-column: 1 / -1;
  margin-top: 12px; padding-top: 11px;
  border-top: 1px solid rgba(244, 238, 225, .08);
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px;
  font: italic 360 15px/1.35 var(--f-display); color: rgba(244, 238, 225, .86);
  animation: np-in .8s var(--ease);
}
.link-btn {
  font: 500 11.5px/1 var(--f-mono); letter-spacing: .06em; color: var(--lampara);
  padding: 6px 0; border-bottom: 1px solid rgba(242, 182, 109, .35); border-radius: 0;
  font-style: normal;
}
.link-btn:hover { border-bottom-color: var(--lampara); }

/* deslizadores */
.range {
  --val: 80%;
  -webkit-appearance: none; appearance: none;
  width: 112px; height: 22px; background: transparent; cursor: pointer; margin: 0;
}
.range--sm { width: 100%; }
.range::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--lampara) 0 var(--val), rgba(244, 238, 225, .16) var(--val) 100%);
}
.range::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(244, 238, 225, .16); }
.range::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--lampara); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; margin-top: -5px; border-radius: 50%;
  background: var(--azahar); box-shadow: 0 2px 8px rgba(0, 0, 0, .45);
  transition: transform .2s;
}
.range::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--azahar); box-shadow: 0 2px 8px rgba(0, 0, 0, .45); }
.range:hover::-webkit-slider-thumb { transform: scale(1.15); }
.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--noche), 0 0 0 5px var(--lampara); }
.range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--noche), 0 0 0 5px var(--lampara); }

/* ---------- dock ---------- */
.dock {
  position: fixed; z-index: 6;
  right: var(--gutter); top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 4px;
  padding: 6px; border-radius: 22px;
  transition: right .45s var(--ease), opacity .7s var(--ease), visibility 0s;
}
body.tools-open .dock { opacity: 0; visibility: hidden; transform: translate(12px, -50%); transition: opacity .3s var(--ease), transform .45s var(--ease), visibility 0s linear .3s; }
.dock__btn {
  position: relative;
  width: 60px; padding: 11px 0 9px; border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: rgba(244, 238, 225, .82);
  transition: background .25s, color .25s;
}
.dock__btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.dock__label { font: 500 10px/1 var(--f-mono); letter-spacing: .08em; color: var(--niebla-2); transition: color .25s; }
.dock__btn:hover { background: rgba(244, 238, 225, .07); color: var(--azahar); }
.dock__btn.is-active { background: rgba(242, 182, 109, .13); color: var(--lampara); }
.dock__btn.is-active .dock__label { color: var(--lampara); }
.dock__mini {
  font: 500 10.5px/1 var(--f-mono); color: var(--lampara); letter-spacing: .02em;
  margin-top: -1px; font-variant-numeric: tabular-nums;
}
.dock__mini.is-paused { color: var(--niebla-2); }
.dock__btn:has(.dock__mini:not([hidden])) .dock__label { display: none; }
.dock__count {
  position: absolute; top: 6px; right: 10px;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--lampara); color: var(--noche);
  font: 500 10px/17px var(--f-mono); text-align: center;
}
.dock__dot { position: absolute; top: 9px; right: 15px; width: 7px; height: 7px; border-radius: 50%; background: var(--hoja-2); box-shadow: 0 0 8px rgba(147, 181, 150, .8); }

/* ---------- panel ---------- */
.tools {
  position: fixed; z-index: 7;
  right: var(--gutter); top: calc(var(--gutter) + 78px + var(--safe-t));
  max-height: calc(100vh - var(--gutter) * 2 - 78px - var(--safe-t) - var(--safe-b));
  max-height: calc(100dvh - var(--gutter) * 2 - 78px - var(--safe-t) - var(--safe-b));
  width: 380px;
  border-radius: 26px;
  display: flex; flex-direction: column;
  opacity: 0; transform: translateX(24px);
  transition: opacity .32s var(--ease), transform .45s var(--ease);
  overflow: hidden;
}
.tools.is-open { opacity: 1; transform: none; }
.tools__grab { display: none; }
.tools__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 0 22px; }
.tabs { display: flex; gap: 22px; }
.tabs [role="tab"] {
  position: relative; padding: 10px 0 12px;
  font: 500 13.5px/1 var(--f-ui); color: var(--niebla-2); letter-spacing: .01em;
  transition: color .2s;
}
.tabs [role="tab"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; border-radius: 2px;
  background: var(--lampara); transform: scaleX(0); transition: transform .35s var(--ease);
}
.tabs [role="tab"]:hover { color: var(--azahar); }
.tabs [role="tab"][aria-selected="true"] { color: var(--azahar); }
.tabs [role="tab"][aria-selected="true"]::after { transform: scaleX(1); }
.tab-panel { flex: 1; overflow-y: auto; padding: 18px 22px 24px; scrollbar-width: thin; scrollbar-color: rgba(244, 238, 225, .2) transparent; }
.tools__head { border-bottom: 1px solid rgba(244, 238, 225, .07); }

/* pomodoro */
.pomo { display: flex; flex-direction: column; align-items: center; }
.pomo__modes { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(24, 14, 8, .35); border: 1px solid rgba(244, 238, 225, .06); }
.pomo__modes button { padding: 7px 12px; border-radius: 999px; font-size: 12.5px; color: var(--niebla-2); transition: background .25s, color .25s; }
.pomo__modes button:hover { color: var(--azahar); }
.pomo__modes button[aria-checked="true"] { background: rgba(244, 238, 225, .1); color: var(--azahar); }
.pomo__dial { position: relative; width: 212px; height: 212px; margin: 22px 0 18px; }
.pomo__ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.pomo__track { fill: none; stroke: rgba(244, 238, 225, .08); stroke-width: 2.5; }
.pomo__arc { fill: none; stroke: var(--lampara); stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset .3s linear, stroke .6s; filter: drop-shadow(0 0 6px rgba(242, 182, 109, .45)); }
.pomo[data-mode="corto"] .pomo__arc, .pomo[data-mode="largo"] .pomo__arc { stroke: var(--hoja-2); filter: drop-shadow(0 0 6px rgba(147, 181, 150, .45)); }
.pomo__center { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; inset: 0; display: grid; place-content: center; text-align: center; }
.pomo__time { font: 300 52px/1 var(--f-mono); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.pomo__phase { margin-top: 10px; font: italic 360 16px/1 var(--f-display); color: var(--niebla-2); }
.pomo__controls { display: flex; align-items: center; gap: 14px; }
.pill-btn {
  min-width: 132px; padding: 13px 22px; border-radius: 999px;
  background: var(--lampara); color: var(--noche);
  font: 600 14px/1 var(--f-ui); letter-spacing: .01em;
  box-shadow: 0 8px 22px -8px rgba(242, 182, 109, .6);
  transition: transform .2s var(--ease), background .2s;
}
.pill-btn:hover { transform: translateY(-1px); background: #F6C485; }
.pill-btn--soft { background: rgba(244, 238, 225, .1); color: var(--azahar); box-shadow: none; border: 1px solid rgba(244, 238, 225, .14); }
.pill-btn--soft:hover { background: rgba(244, 238, 225, .16); }
.ghost-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--niebla-2); border: 1px solid rgba(244, 238, 225, .1); transition: color .2s, background .2s; }
.ghost-btn:hover { color: var(--azahar); background: rgba(244, 238, 225, .07); }
.ghost-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pomo__sessions { margin-top: 20px; display: flex; align-items: center; gap: 12px; font: 400 12px/1 var(--f-mono); color: var(--niebla-2); letter-spacing: .02em; }
.pomo__dots { display: flex; gap: 5px; }
.pomo__dots i { width: 7px; height: 7px; border-radius: 50%; box-shadow: inset 0 0 0 1.2px rgba(244, 238, 225, .35); }
.pomo__dots i.done { background: var(--lampara); box-shadow: 0 0 6px rgba(242, 182, 109, .6); }
.pomo__settings { align-self: stretch; margin-top: 22px; border-top: 1px solid rgba(244, 238, 225, .07); padding-top: 12px; }
.pomo__settings summary { cursor: pointer; font: 500 12px/1 var(--f-mono); color: var(--niebla-2); letter-spacing: .06em; padding: 6px 0; list-style: none; display: flex; align-items: center; gap: 8px; }
.pomo__settings summary::-webkit-details-marker { display: none; }
.pomo__settings summary::before { content: "+"; width: 12px; color: var(--lampara); }
.pomo__settings[open] summary::before { content: "–"; }
.settings-grid { display: grid; gap: 10px; margin-top: 12px; font-size: 13.5px; }
.settings-grid label { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--azahar); }
.settings-grid label > span { color: var(--niebla-2); font-size: 12.5px; }
.settings-grid input[type="number"] {
  width: 56px; padding: 6px 8px; margin-right: 4px; border-radius: 8px; text-align: center;
  background: rgba(24, 14, 8, .45); border: 1px solid rgba(244, 238, 225, .12); color: var(--azahar);
  font: 400 13px var(--f-mono); -moz-appearance: textfield;
}
.settings-grid input[type="number"]:focus-visible { outline: 2px solid var(--lampara); outline-offset: 1px; }
.switch { justify-content: flex-start !important; cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; width: 32px; height: 18px; border-radius: 10px; background: rgba(244, 238, 225, .16); position: relative; margin: 0; cursor: pointer; transition: background .25s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--azahar); transition: transform .25s var(--ease); }
.switch input:checked { background: var(--lampara); }
.switch input:checked::after { transform: translateX(14px); background: var(--noche); }
.switch > span { color: var(--azahar) !important; font-size: 13.5px !important; }

/* tareas */
.task-form { display: flex; gap: 8px; }
.task-form input {
  flex: 1; min-width: 0; padding: 12px 14px; border-radius: 14px;
  background: rgba(24, 14, 8, .42); border: 1px solid rgba(244, 238, 225, .1);
  color: var(--azahar); font-size: 14.5px;
  transition: border-color .2s, background .2s;
}
.task-form input::placeholder { color: var(--niebla); font-family: var(--f-display); font-style: italic; }
.task-form input:focus { border-color: rgba(242, 182, 109, .55); background: rgba(24, 14, 8, .55); outline: none; }
.add-btn { width: 46px; border-radius: 14px; background: var(--lampara); color: var(--noche); display: grid; place-items: center; flex: none; }
.add-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.task-list { list-style: none; margin: 14px 0 0; padding: 0; }
.task { display: flex; align-items: flex-start; gap: 12px; padding: 11px 4px 11px 2px; border-bottom: 1px solid rgba(244, 238, 225, .06); animation: np-in .4s var(--ease); }
.task__check {
  appearance: none; -webkit-appearance: none; flex: none; margin: 1px 0 0;
  width: 19px; height: 19px; border-radius: 50%;
  border: 1.5px solid rgba(244, 238, 225, .4); cursor: pointer; position: relative;
  transition: background .25s, border-color .25s;
}
.task__check:hover { border-color: var(--lampara); }
.task__check:checked { background: var(--lampara); border-color: var(--lampara); }
.task__check:checked::after { content: ""; position: absolute; left: 5.5px; top: 2.5px; width: 4px; height: 8px; border: solid var(--noche); border-width: 0 1.8px 1.8px 0; transform: rotate(45deg); }
.task__text { flex: 1; font-size: 14.5px; line-height: 1.4; cursor: pointer; word-break: break-word; transition: color .3s; }
.task.is-done .task__text { color: var(--niebla); text-decoration: line-through; text-decoration-color: rgba(191, 168, 142, .6); }
.task__del { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: var(--niebla); opacity: 0; transition: opacity .2s, color .2s, background .2s; flex: none; margin-top: -3px; }
.task__del svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.task:hover .task__del, .task__del:focus-visible { opacity: 1; }
.task__del:hover { color: var(--azahar); background: rgba(244, 238, 225, .08); }
@media (hover: none) { .task__del { opacity: .7; } }
.task-empty { margin: 26px 6px 0; font: italic 360 16px/1.45 var(--f-display); color: var(--niebla-2); text-align: center; text-wrap: balance; }
.task-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font: 400 12px/1 var(--f-mono); color: var(--niebla-2); }

/* mezclador */
.mixer__hint { margin: 0 0 16px; font: italic 360 14.5px/1.45 var(--f-display); color: var(--niebla-2); }
.mixer { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mix {
  padding: 12px 14px 10px; border-radius: 18px;
  background: rgba(24, 14, 8, .3); border: 1px solid rgba(244, 238, 225, .06);
  transition: background .35s, border-color .35s;
}
.mix.is-on { background: rgba(242, 182, 109, .08); border-color: rgba(242, 182, 109, .22); }
.mix__toggle { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border-radius: 12px; }
.mix__icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(244, 238, 225, .07); color: var(--niebla-2); transition: background .35s, color .35s; flex: none; }
.mix__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.mix.is-on .mix__icon { background: var(--lampara); color: var(--noche); }
.mix__name { flex: 1; font-size: 14.5px; }
.mix__state { font: 500 10px/1 var(--f-mono); letter-spacing: .14em; color: var(--lampara); }
.mix .range { margin-top: 6px; display: block; }
.mix:not(.is-on) .range { opacity: .55; }
.scene-opts { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(244, 238, 225, .07); font-size: 13px; color: var(--niebla-2); }
.scene-opts select {
  appearance: none; -webkit-appearance: none;
  padding: 8px 30px 8px 12px; border-radius: 10px;
  background: rgba(24, 14, 8, .45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%23D8C6AE' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center / 12px;
  border: 1px solid rgba(244, 238, 225, .12); color: var(--azahar); font-size: 13px;
}
.scene-opts select option { background: var(--noche); }

/* ---------- concentración ---------- */
.focus {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; inset: 0; z-index: 8;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: var(--gutter);
  opacity: 0; transition: opacity .9s var(--ease);
  pointer-events: none;
}
.focus.is-on { opacity: 1; pointer-events: auto; }
.focus__phase { font: italic 340 clamp(18px, 2vw, 24px)/1 var(--f-display); color: var(--lampara); letter-spacing: .01em; }
.focus__time {
  margin: 18px 0 30px;
  font: 300 clamp(84px, 15vw, 190px)/.9 var(--f-mono); letter-spacing: -.06em;
  font-variant-numeric: tabular-nums;
  color: var(--azahar);
  text-shadow: 0 0 60px rgba(242, 182, 109, .22), 0 4px 40px rgba(14, 7, 3, .7);
}
.focus__actions { display: flex; align-items: center; gap: 22px; }
.focus__task {
  margin: -8px 0 34px; max-width: 560px; max-width: min(560px, 90vw);
  font: italic 340 clamp(17px, 1.6vw, 21px)/1.35 var(--f-display); color: rgba(244, 238, 225, .82);
  text-wrap: balance;
}
.focus__task::before { content: "ahora · "; font: 500 11px/1 var(--f-mono); font-style: normal; letter-spacing: .16em; color: var(--niebla-2); vertical-align: 3px; }
.focus .link-btn { color: var(--niebla-2); border-bottom-color: rgba(216, 198, 174, .3); }

/* ---------- ayuda ---------- */
.help {
  color: var(--azahar); border-radius: 26px; padding: 28px 30px 26px;
  max-width: 440px; width: calc(100vw - 32px); width: min(440px, calc(100vw - 32px));
  background: linear-gradient(180deg, rgba(36, 50, 74, .92), rgba(18, 24, 36, .95));
}
.help::backdrop { background: rgba(20, 12, 7, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.help h2 { margin: 0 0 18px; font: italic 380 26px/1.1 var(--f-display); }
.keys { margin: 0; display: grid; gap: 2px; }
.keys > div { display: flex; align-items: center; gap: 16px; padding: 7px 0; border-bottom: 1px solid rgba(244, 238, 225, .06); }
.keys dt { width: 78px; flex: none; }
.keys dd { margin: 0; font-size: 14px; color: var(--niebla-2); }
kbd { display: inline-block; min-width: 28px; padding: 5px 8px; border-radius: 7px; text-align: center; font: 500 12px/1 var(--f-mono); color: var(--azahar); background: rgba(244, 238, 225, .08); border: 1px solid rgba(244, 238, 225, .14); border-bottom-width: 2px; }
.help__note { margin: 18px 0 20px; font: italic 360 15px/1.45 var(--f-display); color: var(--niebla-2); }

/* ---------- aviso ---------- */
.toast {
  position: fixed; z-index: 9; left: 50%; bottom: calc(var(--gutter) + var(--safe-b) + 108px);
  transform: translate(-50%, 8px);
  padding: 11px 18px; border-radius: 999px;
  font-size: 13.5px; color: var(--azahar); white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis;
  opacity: 0; pointer-events: none; transition: opacity .35s, transform .45s var(--ease);
}
body.has-msg .toast { bottom: calc(var(--gutter) + var(--safe-b) + 160px); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
body.focus-mode .toast { bottom: calc(var(--gutter) + var(--safe-b) + 20px); }

.credits-link {
  display: inline-block; margin-top: 18px;
  font: 400 11.5px/1 var(--f-mono); letter-spacing: .06em; color: var(--niebla-2);
  text-decoration: none; padding: 6px 0; border-bottom: 1px solid rgba(216, 198, 174, .3);
}
.credits-link:hover { color: var(--azahar); }
.help__note a { color: var(--lampara); white-space: nowrap; }


.noscript { position: fixed; z-index: 10; left: 50%; bottom: 32px; transform: translateX(-50%); padding: 14px 20px; border-radius: 16px; background: rgba(20, 26, 38, .9); font: italic 16px var(--f-display); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
/* con el panel abierto, el reproductor se aparta para no taparse */
@media (min-width: 761px) and (max-width: 1640px) {
  body.tools-open .player { left: calc((100vw - 380px - var(--gutter)) / 2); }
}
@media (min-width: 761px) and (max-width: 1200px) {
  body.tools-open .player { max-width: 560px; width: calc(100vw - 380px - 3 * var(--gutter)); width: min(560px, calc(100vw - 380px - 3 * var(--gutter))); }
  body.tools-open .player .volume .range { display: none; }
}

/* tabletas y móviles en vertical: el panel pasa a hoja inferior */
@media (max-width: 760px), (max-aspect-ratio: 4/5) and (max-width: 900px) {
  .top { padding-top: calc(14px + var(--safe-t)); }
  .brand img { width: 128px; }
  .top__right { gap: 10px; }
  .clock__time { font-size: 22px; }
  .clock__date { font-size: 11.5px; margin-top: 4px; }
  .top__actions { gap: 0; padding: 3px; }
  .icon-btn { width: 36px; height: 36px; }
  .icon-btn[data-tip]::after { display: none; }

  .player {
    bottom: calc(12px + var(--safe-b));
    width: calc(100vw - 24px);
    border-radius: 24px;
    padding: 12px 12px 12px 12px; column-gap: 12px;
  }
  .player__logo { width: 42px; height: 42px; }
  .player__title { font-size: 17px; }
  .play { width: 54px; height: 54px; }

  .dock {
    top: auto; right: auto; left: 50%;
    bottom: calc(12px + var(--safe-b) + 96px);
    transform: translateX(-50%);
    flex-direction: row; border-radius: 20px; padding: 5px;
  }
  body.has-msg .dock { bottom: calc(12px + var(--safe-b) + 150px); }
  body.tools-open .dock { right: auto; opacity: 0; visibility: hidden; }
  .dock__btn { width: 76px; flex-direction: row; justify-content: center; gap: 7px; padding: 10px 0; }
  .dock__btn svg { width: 19px; height: 19px; }
  .dock__count { top: 2px; right: 4px; }
  .dock__dot { top: 6px; right: 8px; }

  .tools {
    left: 0; right: 0; top: auto; bottom: 0; width: auto;
    max-height: 82vh;
    max-height: min(82vh, 640px); height: auto;
    max-height: min(82dvh, 640px);
    border-radius: 26px 26px 0 0; border-bottom: 0;
    padding-bottom: var(--safe-b);
    transform: translateY(105%); opacity: 1;
    transition: transform .5s var(--ease);
  }
  .tools.is-open { transform: none; }
  .tools__grab { display: block; width: 40px; height: 4px; border-radius: 4px; background: rgba(244, 238, 225, .25); margin: 10px auto 0; }
  .tools__head { padding-top: 4px; }
  .tab-panel { padding-bottom: 28px; }
  body.tools-open .player { opacity: 0; visibility: hidden; }
  .toast { bottom: calc(12px + var(--safe-b) + 160px); }
  body.has-msg .toast { bottom: calc(12px + var(--safe-b) + 210px); }
}

@media (max-width: 520px) {
  .volume .range { display: none; }
  .clock__date { display: none; }
  .player__msg { font-size: 14px; }
  .pomo__dial { width: 190px; height: 190px; margin: 16px 0 14px; }
  .pomo__time { font-size: 44px; }
}
@media (max-width: 380px) {
  .brand img { width: 112px; }
  #btnFull { display: none; }
}

/* pantallas bajitas (portátiles pequeños en horizontal) */
@media (max-height: 640px) and (min-width: 761px) {
  .tools { top: calc(var(--gutter) + 60px); }
  .pomo__dial { width: 170px; height: 170px; margin: 12px 0; }
  .pomo__time { font-size: 40px; }
}

/* =========================================================
   MOVIMIENTO REDUCIDO
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .15s !important; }
  .fx-steam { display: none; }
  body.is-playing .player__logo { animation: none; }
}

/* =========================================================
   OPTIMIZACIONES SMART TV / HARDWARE LIGERO
   ========================================================= */
.is-tv *,
.is-tv *::before,
.is-tv *::after {
  /* Desactivar backdrop-filter que colapsa la GPU de las Smart TVs */
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.is-tv .glass,
.is-tv .player,
.is-tv .dock,
.is-tv .tools,
.is-tv .help,
.is-tv .toast,
.is-tv .cstr,
.is-tv .quote {
  background: rgba(38, 24, 16, 0.96) !important;
  box-shadow: 0 14px 40px -12px rgba(10, 5, 2, 0.9) !important;
}
.is-tv .top__actions {
  background: rgba(28, 17, 10, 0.9) !important;
}
/* Detener animaciones secundarias de luz en la escena que saturan la GPU */
.is-tv .fx--desk,
.is-tv .fx--pool,
.is-tv .fx--street,
.is-tv .fx--wet,
.is-tv .fx--wet2 {
  animation: none !important;
}
.is-tv .cat__shadow {
  filter: none !important;
}
.is-tv .fx-flame i {
  filter: none !important;
}
/* Foco claramente visible para navegación con mando a distancia */
.is-tv button:focus,
.is-tv a:focus,
.is-tv input:focus,
.is-tv [tabindex]:focus {
  outline: 3px solid var(--lampara) !important;
  outline-offset: 3px !important;
  border-radius: 8px !important;
}

