/* =========================================================
   NEON//FOCUS — estilos cyberpunk
   ========================================================= */
:root {
  --bg: #05010f;
  --bg-2: #0d0420;
  --panel: rgba(12, 6, 30, 0.72);
  --panel-border: rgba(0, 240, 255, 0.28);
  --text: #e8f7ff;
  --muted: #8f8aa8;
  --magenta: #ff2bd6;
  --cyan: #00f0ff;
  --yellow: #fcee0a;
  --lime: #39ff88;
  --red: #ff3355;
  --violet: #8a2be2;

  /* Acento según modo (lo cambia body[data-mode]) */
  --accent: var(--magenta);
  --accent-2: var(--cyan);
  --accent-rgb: 255, 43, 214;

  /* Color de batería (lo cambia JS según el nivel) */
  --bat: var(--lime);
  --bat-rgb: 57, 255, 136;

  --font-display: "Orbitron", "Segoe UI", sans-serif;
  --font-mono: "Share Tech Mono", ui-monospace, Consolas, monospace;
  --radius: 4px;
}

body[data-mode="short"] {
  --accent: var(--cyan);
  --accent-2: var(--magenta);
  --accent-rgb: 0, 240, 255;
}
body[data-mode="long"] {
  --accent: var(--lime);
  --accent-2: var(--cyan);
  --accent-rgb: 57, 255, 136;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 120%, #2a0845 0%, var(--bg-2) 45%, var(--bg) 100%);
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; cursor: pointer; }

/* ---------- Fondo ---------- */
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.025) 0px,
    rgba(255, 255, 255, 0.025) 1px,
    transparent 2px,
    transparent 4px
  );
  mix-blend-mode: overlay;
  animation: scan-flicker 6s infinite steps(1);
}
.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.75) 100%);
}
@keyframes scan-flicker {
  0%, 100% { opacity: 1; }
  47% { opacity: 0.6; }
  48% { opacity: 1; }
}

/* ---------- Estructura ---------- */
.app {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 16px 28px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }

.logo {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.25rem, 3.2vw, 2rem);
  letter-spacing: 0.12em;
  color: var(--text);
  text-shadow: 0 0 8px rgba(var(--accent-rgb), 0.9), 0 0 24px rgba(var(--accent-rgb), 0.5);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.6);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  white-space: nowrap;
}
.chip .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
body.running .chip .dot { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

.icon-btn {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--cyan);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: color .2s, box-shadow .2s, transform .2s;
}
.icon-btn:hover { color: var(--yellow); transform: rotate(30deg); }

.grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  grid-template-areas:
    "timer battery"
    "info  info";
  gap: 20px;
}
.timer-panel { grid-area: timer; }
.battery-panel { grid-area: battery; }
.info-panel { grid-area: info; }

/* ---------- Paneles ---------- */
.panel {
  position: relative;
  padding: 26px 24px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: inset 0 0 40px rgba(var(--accent-rgb), 0.06), 0 0 30px rgba(0, 0, 0, 0.5);
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
}
.panel::before {
  /* línea superior luminosa */
  content: "";
  position: absolute;
  top: 0; left: 18px; right: 30%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  box-shadow: 0 0 10px var(--accent);
}
.corner {
  position: absolute;
  width: 14px; height: 14px;
  border-color: var(--accent);
  border-style: solid;
  opacity: 0.85;
}
.corner.tl { display: none; }
.corner.tr { top: 6px; right: 6px; border-width: 2px 2px 0 0; }
.corner.bl { bottom: 6px; left: 6px; border-width: 0 0 2px 2px; }
.corner.br { display: none; }

.panel-title {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.25em;
  color: var(--accent-2);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}
.panel-title::before { content: "▸ "; color: var(--yellow); }

/* ---------- Temporizador ---------- */
.timer-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 18px;
}
.mode-btn {
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: all .2s;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.mode-btn:hover { color: var(--text); border-color: rgba(var(--accent-rgb), 0.5); }
.mode-btn.active {
  color: #05010f;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.6);
}

.timer-label {
  margin: 0 0 6px;
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  color: var(--accent);
  text-align: center;
  text-shadow: 0 0 8px rgba(var(--accent-rgb), 0.6);
}

.ring-wrap {
  position: relative;
  width: min(100%, 340px);
  aspect-ratio: 1;
  margin: 4px 0 18px;
}
.ring {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}
.stop-a { stop-color: var(--accent); }
.stop-b { stop-color: var(--accent-2); }
.ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 10;
}
.ring-ticks {
  fill: none;
  stroke: rgba(var(--accent-rgb), 0.35);
  stroke-width: 6;
  stroke-dasharray: 1.5 7.3;
}
.ring-progress {
  fill: none;
  stroke: url(#ringGrad);
  stroke-width: 10;
  stroke-linecap: butt;
  filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.9));
  transition: stroke-dashoffset 0.3s linear;
}
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 14%;
}
.time {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 10vw, 4.2rem);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--text);
  text-shadow: 0 0 10px rgba(var(--accent-rgb), 0.9), 0 0 32px rgba(var(--accent-rgb), 0.5);
  font-variant-numeric: tabular-nums;
}
.next {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid rgba(var(--accent-rgb), 0.5);
  background: rgba(var(--accent-rgb), 0.06);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: background .2s, box-shadow .2s, color .2s, transform .1s;
}
.btn:hover { background: rgba(var(--accent-rgb), 0.16); box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.35); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  min-width: 170px;
  padding: 16px 28px;
  font-size: 1rem;
  font-weight: 900;
  color: #05010f;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 22px rgba(var(--accent-rgb), 0.55);
}
.btn.primary:hover { background: var(--yellow); border-color: var(--yellow); box-shadow: 0 0 28px rgba(252, 238, 10, 0.6); }
.btn.small { padding: 9px 12px; font-size: 0.68rem; }
.btn:focus-visible, .mode-btn:focus-visible, .icon-btn:focus-visible, .preset:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

.cycle {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: var(--muted);
  flex-wrap: wrap;
  justify-content: center;
}
.cycle-dots { display: flex; gap: 8px; }
.cycle-dots span {
  width: 14px; height: 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.6);
  transform: rotate(45deg);
  transition: all .3s;
}
.cycle-dots span.done {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.cycle-dots span.current {
  border-color: var(--yellow);
  box-shadow: 0 0 8px rgba(252, 238, 10, 0.6);
}
body.running[data-mode="work"] .cycle-dots span.current { animation: blink 1.2s infinite; }
.cycle-count { color: var(--yellow); }

/* ---------- Batería ---------- */
.battery-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.battery-panel .panel-title { align-self: flex-start; }

.battery {
  position: relative;
  width: min(100%, 300px);
  margin: 6px auto 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.battery-cap {
  width: 34%;
  height: 16px;
  background: rgba(var(--bat-rgb), 0.25);
  border: 2px solid var(--bat);
  border-bottom: none;
  box-shadow: 0 0 12px rgba(var(--bat-rgb), 0.6);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 100%, 0 100%);
  transition: border-color .6s, background .6s;
}
.battery-body {
  position: relative;
  width: 62%;
  aspect-ratio: 1 / 1.7;
  border: 3px solid var(--bat);
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 0 18px rgba(var(--bat-rgb), 0.55), inset 0 0 24px rgba(var(--bat-rgb), 0.15);
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
  transition: border-color .6s, box-shadow .6s;
}
.battery-fill {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 100%;
  background:
    linear-gradient(to top, rgba(var(--bat-rgb), 0.95), rgba(var(--bat-rgb), 0.55));
  box-shadow: 0 0 30px rgba(var(--bat-rgb), 0.8);
  transition: height 0.6s ease, background .6s;
}
.battery-fill::before {
  /* rayas en movimiento */
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to top,
    rgba(255, 255, 255, 0) 0 9px,
    rgba(255, 255, 255, 0.22) 9px 14px
  );
  opacity: 0;
}
.battery-fill::after {
  /* borde superior brillante */
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: #fff;
  box-shadow: 0 0 12px #fff, 0 0 24px rgba(var(--bat-rgb), 1);
  opacity: 0.85;
}
.battery-cells {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: repeat(10, 1fr);
  pointer-events: none;
}
.battery-cells span { border-bottom: 2px solid rgba(5, 1, 15, 0.85); }
.battery-cells span:last-child { border-bottom: none; }

.battery-bolt {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity .4s;
}
.battery-bolt svg {
  width: 44%;
  fill: var(--yellow);
  filter: drop-shadow(0 0 10px var(--yellow)) drop-shadow(0 0 2px #000);
}

/* Estados de la batería */
.battery.charging .battery-bolt { opacity: 1; animation: bolt-pulse 1.4s infinite; }
.battery.charging .battery-fill::before { opacity: 1; animation: stripes-up 1.2s linear infinite; }
.battery.draining .battery-fill::before { opacity: 0.6; animation: stripes-down 2.8s linear infinite; }
.battery.low .battery-body { animation: low-flicker 1.6s infinite; }

@keyframes bolt-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.12); opacity: 0.7; }
}
@keyframes stripes-up { from { background-position: 0 0; } to { background-position: 0 -28px; } }
@keyframes stripes-down { from { background-position: 0 0; } to { background-position: 0 28px; } }
@keyframes low-flicker {
  0%, 100% { box-shadow: 0 0 18px rgba(var(--bat-rgb), 0.6); }
  50% { box-shadow: 0 0 4px rgba(var(--bat-rgb), 0.2); }
  52% { box-shadow: 0 0 26px rgba(var(--bat-rgb), 0.9); }
}

.battery-readout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
}
.battery-pct {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.2rem, 6vw, 3rem);
  color: var(--bat);
  text-shadow: 0 0 12px rgba(var(--bat-rgb), 0.8);
  font-variant-numeric: tabular-nums;
  transition: color .6s;
}
.battery-state {
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  color: var(--muted);
  text-align: center;
}

.stats {
  width: 100%;
  margin: 0 0 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.stats div {
  padding: 10px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
}
.stats dt {
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.stats dd {
  margin: 0;
  font-size: 1.02rem;
  color: var(--yellow);
}
.battery-hint {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

/* ---------- Info ---------- */
.protocol {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.protocol li {
  counter-increment: step;
  position: relative;
  padding: 14px 14px 14px 46px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.88rem;
  line-height: 1.45;
}
.protocol li::before {
  content: "0" counter(step);
  position: absolute;
  left: 12px; top: 12px;
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--magenta);
  text-shadow: 0 0 8px rgba(255, 43, 214, 0.7);
}
.protocol b { color: var(--cyan); font-weight: normal; }
.muted { margin: 6px 0 0; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
kbd {
  padding: 1px 6px;
  border: 1px solid rgba(0, 240, 255, 0.5);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.footer {
  margin-top: 20px;
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: rgba(143, 138, 168, 0.7);
}

/* ---------- Glitch ---------- */
.glitch { position: relative; display: inline-block; }
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
}
.glitch::before { color: var(--cyan); text-shadow: none; }
.glitch::after { color: var(--magenta); text-shadow: none; }
.glitch.glitching::before { opacity: 0.85; animation: glitch-a 0.35s steps(2) both; }
.glitch.glitching::after { opacity: 0.85; animation: glitch-b 0.35s steps(2) both; }
.logo.glitch::before { animation: glitch-a 4s infinite steps(1); opacity: .8; }
.logo.glitch::after { animation: glitch-b 5s infinite steps(1); opacity: .8; }

@keyframes glitch-a {
  0%   { clip-path: inset(0 0 100% 0); transform: translate(0); }
  2%   { clip-path: inset(20% 0 55% 0); transform: translate(-3px, 0); }
  4%   { clip-path: inset(70% 0 5% 0); transform: translate(3px, 0); }
  6%   { clip-path: inset(0 0 100% 0); transform: translate(0); }
  100% { clip-path: inset(0 0 100% 0); }
}
@keyframes glitch-b {
  0%   { clip-path: inset(0 0 100% 0); transform: translate(0); }
  3%   { clip-path: inset(50% 0 20% 0); transform: translate(3px, 0); }
  5%   { clip-path: inset(10% 0 80% 0); transform: translate(-2px, 0); }
  7%   { clip-path: inset(0 0 100% 0); transform: translate(0); }
  100% { clip-path: inset(0 0 100% 0); }
}
/* En .glitching la animación dura 0.35s: se usan porcentajes más amplios */
.glitch.glitching::before { animation-name: glitch-burst-a; }
.glitch.glitching::after { animation-name: glitch-burst-b; }
@keyframes glitch-burst-a {
  0%   { clip-path: inset(10% 0 60% 0); transform: translate(-4px, 0); }
  50%  { clip-path: inset(60% 0 10% 0); transform: translate(4px, 0); }
  100% { clip-path: inset(0 0 100% 0); transform: translate(0); }
}
@keyframes glitch-burst-b {
  0%   { clip-path: inset(55% 0 25% 0); transform: translate(4px, 0); }
  50%  { clip-path: inset(15% 0 70% 0); transform: translate(-3px, 0); }
  100% { clip-path: inset(0 0 100% 0); transform: translate(0); }
}

/* ---------- Configuración ---------- */
.settings {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--cyan);
  background: rgba(10, 4, 26, 0.96);
  color: var(--text);
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.35);
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
}
.settings::backdrop { background: rgba(5, 1, 15, 0.75); backdrop-filter: blur(3px); }
.settings-inner { padding: 26px 24px; }
.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.preset {
  padding: 8px 12px;
  border: 1px solid rgba(255, 43, 214, 0.5);
  background: rgba(255, 43, 214, 0.06);
  color: var(--text);
  font-size: 0.8rem;
  transition: all .2s;
}
.preset:hover { background: var(--magenta); color: #05010f; }

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.fields label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}
.fields input {
  padding: 10px 12px;
  border: 1px solid rgba(0, 240, 255, 0.35);
  background: rgba(0, 0, 0, 0.45);
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: 1.1rem;
}
.fields input:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 12px rgba(252, 238, 10, 0.4); }

.toggles { display: grid; gap: 10px; margin-bottom: 18px; }
.toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  cursor: pointer;
}
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle span {
  flex: none;
  position: relative;
  width: 40px; height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.5);
  transition: all .2s;
}
.toggle span::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 12px; height: 12px;
  background: var(--muted);
  transition: all .2s;
}
.toggle input:checked + span { border-color: var(--lime); box-shadow: 0 0 10px rgba(57, 255, 136, 0.4); }
.toggle input:checked + span::after { left: 23px; background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.toggle input:focus-visible + span { outline: 2px solid var(--yellow); outline-offset: 2px; }

.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.settings-footer { display: flex; justify-content: flex-end; gap: 10px; }
.settings-footer .btn.primary { min-width: 0; padding: 12px 22px; font-size: 0.85rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  transform: translate(-50%, 30px);
  max-width: calc(100vw - 32px);
  padding: 12px 20px;
  border: 1px solid var(--yellow);
  background: rgba(10, 4, 26, 0.95);
  color: var(--yellow);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  box-shadow: 0 0 20px rgba(252, 238, 10, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: all .3s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Flash al cambiar de fase */
body.flash .app { animation: phase-flash .6s; }
@keyframes phase-flash {
  0% { filter: brightness(1); }
  20% { filter: brightness(1.8) hue-rotate(40deg); }
  40% { filter: brightness(0.8); }
  100% { filter: brightness(1); }
}

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr;
    grid-template-areas: "timer" "battery" "info";
  }
  .protocol { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .app { padding: 14px 16px 22px; }
  .panel { padding: 22px 16px; }
  .protocol { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; row-gap: 10px; }
  .topbar-right { margin-left: auto; }
  .logo { font-size: 1.2rem; }
  .chip { font-size: 0.68rem; padding: 5px 9px; }
  .controls .btn.ghost span { display: none; }
  .controls .btn.ghost { padding: 14px; }
  .btn.primary { min-width: 150px; }
  .stats dd { font-size: 0.92rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
