/* ============ MOBILE STAGE ============ */
.mob-stage {
  grid-column: 2 / 4;
  background: transparent;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 0;
  position: relative;
  overflow-y: auto;
}

.mob-stage-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px 40px 16px;
  gap: 24px;
  z-index: 2;
}

.mob-stage-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px 40px;
  min-height: 0;
}

.mob-context {
  max-width: 460px;
  min-width: 0;
}
.mob-context-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
  margin-bottom: 6px;
}
.mob-context-help {
  font-size: 13px;
  color: var(--fg-dim);
  line-height: 1.5;
  text-wrap: pretty;
}

.mob-sun-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  flex-shrink: 0;
  background: var(--bg-panel);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: all 0.15s;
}
.mob-sun-toggle:hover { color: var(--fg); border-color: var(--fg-muted); }
.mob-stage.sunlight .mob-sun-toggle { background: var(--amarillo); color: #2b1e0e; border-color: var(--amarillo); }

/* ============ APP INSIDE PHONE ============ */
.mob-app {
  height: 100%;
  padding: 60px 0 34px; /* respeta dynamic island + home indicator */
  color: #fff;
  font-family: -apple-system, "SF Pro Text", system-ui, sans-serif;
  background: #0a0a0c;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Sunlight mode — contraste extremo */
.mob-stage.sunlight .mob-app {
  background: #000;
}
.mob-stage.sunlight .mob-app * {
  --accent-mobile: #fff !important;
}

/* Design tokens específicos para el modo móvil */
.mob-app {
  --mob-accent: #d4ff3f;
  --mob-warn: #ff9a3c;
  --mob-danger: #ff4d5f;
  --mob-ok: #4ade80;
  --mob-dim: rgba(255,255,255,0.55);
  --mob-mute: rgba(255,255,255,0.35);
  --mob-line: rgba(255,255,255,0.1);
  --mob-surface: rgba(255,255,255,0.06);
  --mob-surface-2: rgba(255,255,255,0.1);
}

/* Sunlight overrides — maximum contrast */
.mob-stage.sunlight .mob-app {
  --mob-accent: #ffffff;
  --mob-dim: rgba(255,255,255,0.85);
  --mob-mute: rgba(255,255,255,0.6);
  --mob-line: rgba(255,255,255,0.25);
  --mob-surface: rgba(255,255,255,0.12);
  --mob-surface-2: rgba(255,255,255,0.2);
}

/* ============ LOBBY SCREEN ============ */
/* Bug corregido: .mob-app tiene overflow:hidden y .mob-lobby usaba
   height:100% SIN overflow-y — cuando el contenido (chip de cuenta +
   nombre de grupo + tarjeta con bloques) supera la altura visible real
   (pantallas con más bloques planificados, o el navegador móvil real con
   menos alto útil que el mockup de 844px), el resto del contenido —
   incluidos los botones "Empezar clase"/"Ver detalle completo" — queda
   recortado y es IMPOSIBLE de alcanzar: no hay scroll posible porque el
   padre corta el overflow. Con overflow-y:auto aquí, el lobby scrollea
   internamente y los botones siguen siendo alcanzables aunque el
   contenido no quepa entero. */
.mob-lobby {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Chip de cuenta: en móvil el sidebar de escritorio (único sitio donde se
   ve la cuenta conectada y el botón "Cerrar sesión") está oculto por CSS
   bajo 768px, así que este chip lo hace visible directamente en "En clase"
   — evita que una cookie de sesión de otra cuenta/dispositivo pase
   desapercibida sin dar opción de cambiarla. */
.mob-lobby-account {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--mob-surface);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
}
.mob-lobby-account-avatar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(212, 255, 63, 0.16);
  color: #d4ff3f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.mob-lobby-account-info { flex: 1; min-width: 0; }
.mob-lobby-account-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mob-lobby-account-email {
  font-size: 12px;
  color: var(--mob-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mob-lobby-account-action {
  flex-shrink: 0;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: transparent;
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  font-weight: 600;
}
.mob-lobby-account-action.primary {
  background: #d4ff3f;
  border-color: #d4ff3f;
  color: #14210a;
}

.mob-lobby-eyebrow {
  font-size: 13px;
  color: var(--mob-mute);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  padding-top: 4px;
}
.mob-lobby-group { }
.mob-lobby-group-name {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 6px;
}
.mob-lobby-group-meta {
  font-size: 15px;
  color: var(--mob-dim);
  font-weight: 500;
}

.mob-lobby-loading {
  text-align: center;
  color: var(--mob-dim);
  font-size: 13px;
  padding: 8px 0;
}

.mob-lobby-card {
  background: var(--mob-surface);
  border: 1px solid var(--mob-line);
  border-radius: 22px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mob-lobby-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-wrap: balance;
}
.mob-lobby-stats {
  display: flex;
  gap: 24px;
}
.mob-lobby-stat { }
.mob-lobby-stat-num {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--mob-accent);
}
.mob-lobby-stat-unit {
  font-size: 12px;
  color: var(--mob-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
  font-weight: 600;
}

.mob-lobby-blocks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--mob-line);
}
.mob-lobby-block {
  display: grid;
  grid-template-columns: 4px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
}
.mob-lobby-block-stripe {
  width: 4px;
  height: 28px;
  border-radius: 2px;
}
.mob-lobby-block-name {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}
.mob-lobby-block-time {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--mob-dim);
}

/* Big buttons */
.mob-big-btn {
  padding: 20px 24px;
  border-radius: 22px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: transform 0.1s, opacity 0.1s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 68px;
  white-space: nowrap;
  width: 100%;
}
.mob-big-btn > span { white-space: nowrap; }
.mob-big-btn.primary {
  background: var(--mob-accent);
  color: #0a0a0c;
  box-shadow: 0 6px 24px rgba(212, 255, 63, 0.3);
}
.mob-big-btn.primary:active { transform: scale(0.98); }
.mob-big-btn.secondary {
  background: var(--mob-surface);
  color: #fff;
  border: 1px solid var(--mob-line);
}
.mob-stage.sunlight .mob-big-btn.primary { box-shadow: 0 6px 24px rgba(255,255,255,0.15); }
.mob-stage.sunlight .mob-big-btn.secondary { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.3); }

/* ============ RUNNING SCREEN ============ */
.mob-run {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 12px 0 0;
}

/* TOP */
.mob-run-top {
  padding: 8px 22px 12px;
}
.mob-segs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
.mob-seg {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: var(--mob-line);
  overflow: hidden;
}
.mob-seg.done { background: var(--mob-accent); }
.mob-seg-fill {
  height: 100%;
  background: var(--mob-accent);
  transition: width 1s linear;
}
.mob-run-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mob-run-phase {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--mob-dim);
  letter-spacing: -0.005em;
}
.mob-run-phase-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.mob-run-phase-dot.color-coral { background: #ff6b4a; }
.mob-run-phase-dot.color-azul { background: #6bb6ff; }
.mob-run-phase-dot.color-verde { background: #4ade80; }
.mob-run-phase-dot.color-amarillo { background: #fbbf24; }
.mob-run-total {
  font-family: -apple-system, "SF Mono", monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--mob-accent);
  font-variant-numeric: tabular-nums;
}

/* HERO */
.mob-run-hero {
  flex: 1;
  padding: 20px 22px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  min-height: 0;
}
.mob-run-material {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.mob-run-material-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--mob-surface);
  border: 1px solid var(--mob-line);
  color: var(--mob-dim);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.mob-run-material-chip.empty { opacity: 0.7; font-style: italic; }

.mob-run-title {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
  text-wrap: balance;
  color: #fff;
}
.mob-stage.sunlight .mob-run-title { font-weight: 900; }

.mob-run-timer-wrap {
  padding: 20px 0 4px;
  text-align: left;
}
.mob-run-timer {
  font-family: -apple-system, "SF Pro Display", system-ui;
  font-size: 96px;
  font-weight: 200;
  letter-spacing: -0.05em;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: color 0.2s;
}
.mob-run.paused .mob-run-timer { color: var(--mob-mute); }
.mob-run.near-end .mob-run-timer { color: var(--mob-warn); }
.mob-run.time-up .mob-run-timer { color: var(--mob-danger); animation: mobBlink 1s ease-in-out infinite; }
@keyframes mobBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.mob-run-timer-label {
  font-size: 12px;
  color: var(--mob-mute);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  margin-top: 4px;
}
.mob-run.time-up .mob-run-timer-label { color: var(--mob-danger); }

.mob-detail-link {
  align-self: flex-start;
  color: var(--mob-dim);
  font-size: 14px;
  font-weight: 600;
  padding: 4px 0;
  border-bottom: 1px solid var(--mob-line);
}
.mob-detail-link:active { color: var(--mob-accent); }

/* BOTTOM */
.mob-run-bottom {
  padding: 12px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mob-next {
  background: var(--mob-surface);
  border: 1px solid var(--mob-line);
  border-radius: 16px;
  padding: 12px 14px;
}
.mob-next.final {
  padding: 16px 14px;
  text-align: center;
  color: var(--mob-dim);
  font-size: 14px;
  font-style: italic;
}
.mob-next-label {
  font-size: 11px;
  color: var(--mob-mute);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin-bottom: 6px;
}
.mob-next-body {
  display: grid;
  grid-template-columns: 4px 1fr auto;
  gap: 10px;
  align-items: center;
}
.mob-next-stripe {
  width: 4px;
  height: 22px;
  border-radius: 2px;
}
.mob-next-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}
.mob-next-time {
  font-size: 13px;
  font-weight: 700;
  color: var(--mob-dim);
  font-variant-numeric: tabular-nums;
}

.mob-run-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
}
.mob-action-btn {
  padding: 18px 12px;
  border-radius: 18px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 64px;
  transition: transform 0.1s;
}
.mob-action-btn:active { transform: scale(0.97); }
.mob-action-btn.secondary {
  background: var(--mob-surface);
  color: #fff;
  border: 1px solid var(--mob-line);
}
.mob-action-btn.primary {
  background: var(--mob-accent);
  color: #0a0a0c;
  box-shadow: 0 4px 16px rgba(212, 255, 63, 0.35);
}
.mob-stage.sunlight .mob-action-btn.primary { box-shadow: 0 4px 16px rgba(255,255,255,0.2); }

/* Color helpers para stripes (reutilizadas del design system) */
.mob-lobby-block-stripe.color-coral, .mob-next-stripe.color-coral, .mob-finish-stripe.color-coral { background: #ff6b4a; }
.mob-lobby-block-stripe.color-azul, .mob-next-stripe.color-azul, .mob-finish-stripe.color-azul { background: #6bb6ff; }
.mob-lobby-block-stripe.color-verde, .mob-next-stripe.color-verde, .mob-finish-stripe.color-verde { background: #4ade80; }
.mob-lobby-block-stripe.color-amarillo, .mob-next-stripe.color-amarillo, .mob-finish-stripe.color-amarillo { background: #fbbf24; }

/* ============ FINISHED ============ */
.mob-finish {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mob-finish-check {
  color: var(--mob-accent);
  margin: 12px 0 4px;
}
.mob-finish-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.mob-finish-sub {
  font-size: 15px;
  color: var(--mob-dim);
  margin-bottom: 8px;
}
.mob-finish-summary {
  background: var(--mob-surface);
  border: 1px solid var(--mob-line);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mob-finish-row {
  display: grid;
  grid-template-columns: 4px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--mob-line);
}
.mob-finish-row:last-child { border-bottom: none; }
.mob-finish-stripe { width: 4px; height: 24px; border-radius: 2px; }
.mob-finish-name { font-size: 14px; font-weight: 600; }
.mob-finish-time { font-size: 13px; font-weight: 700; color: var(--mob-dim); font-variant-numeric: tabular-nums; }

/* ============ BOTTOM SHEET (detail) ============ */
.mob-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 30;
  animation: mobFade 0.15s ease-out;
}
@keyframes mobFade { from { opacity: 0; } to { opacity: 1; } }

.mob-sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: #1a1a1e;
  border-radius: 22px 22px 0 0;
  max-height: 82%;
  display: flex;
  flex-direction: column;
  animation: mobSheetIn 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes mobSheetIn {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.mob-sheet-handle {
  width: 40px; height: 5px;
  border-radius: 3px;
  background: rgba(255,255,255,0.3);
  margin: 10px auto 4px;
}
.mob-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px 8px;
}
.mob-sheet-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  padding-right: 16px;
}
.mob-sheet-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 16px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.mob-sheet-scroll {
  padding: 8px 20px 40px;
  overflow-y: auto;
  color: #fff;
}
.mob-sheet-lede {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  line-height: 1.5;
  margin-bottom: 20px;
  text-wrap: pretty;
}
.mob-sheet-sec { margin-bottom: 22px; }
.mob-sheet-sec h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.5);
  margin-bottom: 10px;
  font-weight: 700;
}
.mob-sheet-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mob-sheet-steps li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255,255,255,0.9);
  align-items: start;
  text-wrap: pretty;
}
.mob-sheet-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--mob-accent);
  color: #0a0a0c;
  display: grid; place-items: center;
  font-size: 12px;
  font-weight: 700;
}
.mob-sheet-rules {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mob-sheet-rules li {
  padding: 10px 12px;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(255,255,255,0.85);
  text-wrap: pretty;
}
.mob-sheet-adapt {
  padding: 12px;
  background: rgba(107, 182, 255, 0.12);
  border: 1px solid rgba(107, 182, 255, 0.25);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: #fff;
  margin-bottom: 6px;
  text-wrap: pretty;
}
.mob-sheet-empty {
  padding: 40px 20px;
  text-align: center;
  color: rgba(255,255,255,0.4);
  font-size: 14px;
  font-style: italic;
}

/* ============ LOBBY DETAIL SHEET ============ */
.mob-lobby-sheet-eyebrow {
  font-family: -apple-system, "SF Mono", monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin-bottom: 4px;
}
.mob-lobby-sheet-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px;
  background: rgba(255,255,255,0.06);
  border-radius: 14px;
  margin-bottom: 24px;
}
.mob-lobby-sheet-stat {
  text-align: center;
  padding: 4px 0;
}
.mob-lobby-sheet-stat-num {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #d4ff3f;
  line-height: 1;
}
.mob-lobby-sheet-stat-label {
  font-family: -apple-system, "SF Mono", monospace;
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin-top: 4px;
}

.mob-lobby-sheet-phasetime {
  float: right;
  color: rgba(255,255,255,0.65);
  font-family: -apple-system, "SF Mono", monospace;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0;
}

.mob-lobby-sheet-blocks {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mob-lobby-sheet-block {
  display: grid;
  grid-template-columns: 4px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.mob-lobby-sheet-block:last-child { border-bottom: none; }
.mob-lobby-sheet-stripe {
  width: 4px;
  height: 28px;
  border-radius: 2px;
}
.mob-lobby-sheet-stripe.color-coral { background: #ff6b4a; }
.mob-lobby-sheet-stripe.color-azul { background: #6bb6ff; }
.mob-lobby-sheet-stripe.color-verde { background: #4ade80; }
.mob-lobby-sheet-stripe.color-amarillo { background: #fbbf24; }
.mob-lobby-sheet-block-body { min-width: 0; }
.mob-lobby-sheet-block-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}
.mob-lobby-sheet-block-meta {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mob-lobby-sheet-block-time {
  font-family: -apple-system, "SF Mono", monospace;
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  font-variant-numeric: tabular-nums;
}

.mob-lobby-sheet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mob-lobby-sheet-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  font-weight: 600;
}
.mob-lobby-sheet-chip.alt {
  background: rgba(212, 255, 63, 0.12);
  border-color: rgba(212, 255, 63, 0.3);
  color: #d4ff3f;
}

/* ============================================================ */
/* ============ RESPONSIVE — TABLET (768px – 1279px) ========== */
/* ============================================================ */
@media (max-width: 1279px) {
  /* .app pasa a 2 columnas (76px 1fr) — .mob-stage ya no debe intentar
     ocupar un 3er tramo que no existe */
  .mob-stage { grid-column: 2; }
}

/* ============================================================ */
/* ============ RESPONSIVE — MOBILE (< 768px) ================= */
/* ============================================================ */
/* Spec: en móvil real solo tiene sentido la vista "En clase". App.tsx
   fuerza view='mobile' por debajo de 768px vía JS. El mockup de iPhone
   deja de ser un "bisel" decorativo (pensado para verse en escritorio)
   y pasa a ocupar la pantalla real, sin notch ni barra de estado falsa. */
@media (max-width: 767px) {
  .mob-stage {
    grid-column: auto;
    width: 100%;
    /* Ver comentario detallado del bug 100vh vs 100dvh en styles.css
       (bloque @media móvil de .app) — mismo problema aquí: con 100vh fijo,
       en Safari iOS real (toolbar expandido) parte de la pantalla "En
       clase" quedaba fuera del área visible sin poder hacer scroll. */
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .mob-stage-header { display: none; }

  .mob-stage-frame {
    padding: 0;
    flex: 1;
    min-height: 0;
    align-items: stretch;
  }
  .ios-device {
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  .ios-notch,
  .ios-statusbar-wrap,
  .ios-home-wrap {
    display: none;
  }
  .ios-content {
    height: 100%;
  }
  .mob-app { padding-top: 16px; }
}

/* ============================================================ */
/* ============ RUNNING — LAYOUT PRINCIPAL + TIMELINE ========= */
/* ============================================================ */

/* Contenedor flex horizontal: hero a la izquierda, timeline a la derecha */
.mob-run-main {
  flex: 1;
  display: flex;
  flex-direction: row;
  min-height: 0;
  overflow: hidden;
}

/* Hero — ocupa el espacio restante */
.mob-run-hero {
  flex: 1;
  padding: 16px 12px 12px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  min-height: 0;
  min-width: 0;
}

/* Fila inferior del hero: link de detalle + toggle auto */
.mob-run-hero-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Ajuste de tamaño del timer cuando hay timeline al lado */
.mob-run-main .mob-run-title {
  font-size: 34px;
}
.mob-run-main .mob-run-timer {
  font-size: 76px;
}
.mob-run-main .mob-run-timer-wrap {
  padding: 8px 0 2px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Cuando NO hay timeline (bloques < 2) el hero puede usar el ancho completo */
.mob-run-main:not(:has(.mob-timeline)) .mob-run-hero {
  padding-right: 22px;
}
.mob-run-main:not(:has(.mob-timeline)) .mob-run-title {
  font-size: 44px;
}
.mob-run-main:not(:has(.mob-timeline)) .mob-run-timer {
  font-size: 96px;
}

/* ============ AUTO-ADVANCE TOGGLE ============ */
.mob-aa-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px 5px 7px;
  border-radius: 999px;
  border: 1px solid var(--mob-line);
  background: var(--mob-surface);
  color: var(--mob-mute);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 0.15s;
  flex-shrink: 0;
}
.mob-aa-toggle.on {
  border-color: rgba(212, 255, 63, 0.35);
  background: rgba(212, 255, 63, 0.12);
  color: #d4ff3f;
}
.mob-aa-toggle-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.mob-aa-toggle.off .mob-aa-toggle-dot {
  background: var(--mob-mute);
}

/* ============ AUTO-ADVANCE COUNTDOWN ============ */
.mob-auto-advance {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 44px;
  height: 44px;
  cursor: pointer;
  flex-shrink: 0;
  align-self: flex-start;
}
.mob-aa-ring {
  position: absolute;
  inset: 0;
}
.mob-aa-bg {
  fill: none;
  stroke: rgba(255, 77, 95, 0.2);
  stroke-width: 3;
}
.mob-aa-arc {
  fill: none;
  stroke: var(--mob-danger);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 0.9s linear;
}
.mob-aa-num {
  position: relative;
  font-size: 14px;
  font-weight: 800;
  color: var(--mob-danger);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* Row del timer-wrap cuando hay countdown: alineados horizontalmente */
.mob-run-timer-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
/* Cuando hay countdown mostramos el anillo + número en fila con el timer */
.mob-run-timer-wrap > .mob-auto-advance + .mob-run-timer {
  /* ya están en columna, sin cambios */
}

/* ============ MINI-TIMELINE LATERAL ============ */
.mob-timeline {
  width: 92px;
  flex-shrink: 0;
  padding: 20px 12px 12px 4px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Separador sutil */
  border-left: 1px solid var(--mob-line);
}

.mob-tl-row {
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-items: stretch;
  min-height: 0;
}

/* Columna izquierda: punto + líneas conectoras */
.mob-tl-line-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 16px;
  flex-shrink: 0;
}
.mob-tl-line-top,
.mob-tl-line-bot {
  width: 2px;
  flex: 1;
  min-height: 6px;
  background: var(--mob-line);
  border-radius: 1px;
  transition: background 0.3s;
}
.mob-tl-line-top.filled,
.mob-tl-line-bot.filled {
  background: var(--mob-accent);
}

/* Punto de bloque */
.mob-tl-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  transition: all 0.2s;
  /* Colores de fondo por defecto (pending) */
  background: var(--mob-surface-2);
  border-color: var(--mob-line);
}
.mob-tl-dot.color-coral { border-color: rgba(255, 107, 74, 0.5); }
.mob-tl-dot.color-azul  { border-color: rgba(107, 182, 255, 0.5); }
.mob-tl-dot.color-verde { border-color: rgba(74, 222, 128, 0.5); }
.mob-tl-dot.color-amarillo { border-color: rgba(251, 191, 36, 0.5); }

/* Activo: relleno sólido con el color */
.mob-tl-dot.active.color-coral { background: #ff6b4a; border-color: #ff6b4a; box-shadow: 0 0 6px rgba(255,107,74,0.5); }
.mob-tl-dot.active.color-azul  { background: #6bb6ff; border-color: #6bb6ff; box-shadow: 0 0 6px rgba(107,182,255,0.5); }
.mob-tl-dot.active.color-verde { background: #4ade80; border-color: #4ade80; box-shadow: 0 0 6px rgba(74,222,128,0.5); }
.mob-tl-dot.active.color-amarillo { background: #fbbf24; border-color: #fbbf24; box-shadow: 0 0 6px rgba(251,191,36,0.5); }

/* Completado: acento con check */
.mob-tl-dot.done {
  background: var(--mob-accent);
  border-color: var(--mob-accent);
  color: #0a0a0c;
}

/* Cuerpo del bloque (nombre + barra progreso o duración) */
.mob-tl-body {
  flex: 1;
  min-width: 0;
  padding: 3px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mob-tl-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--mob-mute);
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transition: color 0.2s;
}
.mob-tl-row.active .mob-tl-name {
  color: #fff;
  font-weight: 700;
}
.mob-tl-row.done .mob-tl-name {
  color: var(--mob-mute);
  text-decoration: line-through;
  text-decoration-color: rgba(255,255,255,0.2);
}

/* Barra de progreso del bloque activo */
.mob-tl-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.mob-tl-progress-bar {
  height: 3px;
  border-radius: 2px;
  background: var(--mob-line);
  overflow: hidden;
}
.mob-tl-progress-fill {
  height: 100%;
  background: var(--mob-accent);
  border-radius: 2px;
  transition: width 1s linear;
}
.mob-tl-time-left {
  font-size: 10px;
  font-weight: 700;
  color: var(--mob-accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* Duración de los bloques pendientes/completados */
.mob-tl-duration {
  font-size: 10px;
  font-weight: 600;
  color: var(--mob-mute);
  font-variant-numeric: tabular-nums;
}
.mob-tl-row.done .mob-tl-duration {
  color: var(--mob-accent);
  font-size: 11px;
}

/* ═══════════════════════════════════════════════════════════════════
   BARRA DE NAVEGACIÓN INFERIOR (Clase / Herramientas)
   ═══════════════════════════════════════════════════════════════════ */
.mob-bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(15, 18, 26, 0.97);
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: stretch;
  z-index: 50;
  backdrop-filter: blur(8px);
}
.mob-bottom-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.38);
  transition: color 0.15s;
  padding: 0;
  font-family: inherit;
}
.mob-bottom-nav-btn span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.mob-bottom-nav-btn.active {
  color: var(--mob-accent, #7dd3fc);
}
.mob-bottom-nav-btn:active {
  opacity: 0.7;
}

/* Empujar el contenido de sesión/herramientas hacia arriba para dejar
   espacio a la barra inferior */
.mob-app {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.mob-lobby,
.mob-run,
.mob-finish,
.mob-tools {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  /* Padding bottom para que el contenido no quede bajo la nav bar */
  padding-bottom: 56px;
}

/* ═══════════════════════════════════════════════════════════════════
   PANTALLA DE HERRAMIENTAS MÓVIL
   ═══════════════════════════════════════════════════════════════════ */
.mob-tools {
  display: flex;
  flex-direction: column;
  background: var(--mob-bg, #0f121a);
  color: var(--mob-text, #e8edf5);
}

.mob-tools-header {
  padding: 16px 16px 0;
  flex-shrink: 0;
}
.mob-tools-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--mob-text, #e8edf5);
}

/* Sub-tabs herramientas */
.mob-tools-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 12px 0;
  flex-shrink: 0;
}
.mob-tools-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  cursor: pointer;
  color: rgba(255,255,255,0.45);
  font-family: inherit;
  transition: all 0.15s;
}
.mob-tools-tab-emoji { font-size: 17px; line-height: 1; }
.mob-tools-tab-label { font-size: 9.5px; font-weight: 600; letter-spacing: 0.02em; }
.mob-tools-tab.active {
  background: rgba(125, 211, 252, 0.12);
  border-color: rgba(125, 211, 252, 0.3);
  color: var(--mob-accent, #7dd3fc);
}

/* Área de contenido de la herramienta activa */
.mob-tools-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 12px 8px;
}

/* Botones comunes de herramientas */
.mob-tool-primary-btn {
  width: 100%;
  padding: 13px 16px;
  background: var(--mob-accent, #7dd3fc);
  color: #0f121a;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
  margin-top: 8px;
}
.mob-tool-primary-btn:active { opacity: 0.8; }
.mob-tool-primary-btn.busy { opacity: 0.6; cursor: default; }

.mob-tool-ghost-btn {
  width: 100%;
  padding: 11px 16px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 8px;
}
.mob-tool-ghost-btn:active { background: rgba(255,255,255,0.1); }

/* ─── Marcador móvil ─────────────────────────────────────────────── */
.mob-tool-scoreboard { display: flex; flex-direction: column; gap: 8px; }
.mob-sb-teams { display: flex; gap: 8px; }
.mob-sb-team {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: border-color 0.2s;
}
.mob-sb-team--winner {
  border-color: var(--tc);
  background: color-mix(in srgb, var(--tc) 10%, transparent);
}
.mob-sb-name {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--tc);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  letter-spacing: 0.03em;
}
.mob-sb-name-input {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--tc);
  border-radius: 6px;
  color: var(--mob-text, #e8edf5);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  padding: 4px 6px;
  text-align: center;
}
.mob-sb-score {
  font-size: 52px;
  font-weight: 900;
  line-height: 1;
  color: var(--mob-text, #e8edf5);
  font-variant-numeric: tabular-nums;
}
.mob-sb-btns {
  display: flex;
  gap: 5px;
  width: 100%;
}
.mob-sb-btn {
  flex: 1;
  padding: 9px 0;
  border: none;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.12s;
}
.mob-sb-btn:active { opacity: 0.7; }
.mob-sb-btn--minus { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5); }
.mob-sb-btn--plus  { background: var(--tc); color: #fff; font-size: 13px; }
.mob-sb-btn--plus5 { background: color-mix(in srgb, var(--tc) 60%, transparent); color: #fff; font-size: 11px; }
.mob-sb-win {
  font-size: 11px;
  font-weight: 800;
  color: var(--tc);
  letter-spacing: 0.04em;
}

/* ─── Selector de equipos móvil ──────────────────────────────────── */
.mob-tool-teams { display: flex; flex-direction: column; gap: 10px; }
.mob-team-field { display: flex; flex-direction: column; gap: 6px; }
.mob-team-label { font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.55); letter-spacing: 0.03em; }
.mob-team-hint { font-weight: 400; color: rgba(255,255,255,0.3); }
.mob-team-num-row { display: flex; gap: 6px; }
.mob-team-num-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.55);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.mob-team-num-btn.active {
  background: var(--mob-accent, #7dd3fc);
  border-color: var(--mob-accent, #7dd3fc);
  color: #0f121a;
}
.mob-team-textarea {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: var(--mob-text, #e8edf5);
  font-size: 13px;
  font-family: inherit;
  padding: 10px 12px;
  resize: none;
  width: 100%;
  box-sizing: border-box;
}
.mob-team-textarea:focus { outline: none; border-color: var(--mob-accent, #7dd3fc); }
.mob-team-result { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.mob-team-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  overflow: hidden;
}
.mob-team-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mob-team-card-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tc);
  flex-shrink: 0;
}
.mob-team-card-name { font-size: 13px; font-weight: 700; color: var(--tc); flex: 1; }
.mob-team-card-count {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.06);
  border-radius: 20px;
  padding: 1px 8px;
}
.mob-team-card-list { list-style: none; margin: 0; padding: 8px 12px 10px; display: flex; flex-direction: column; gap: 3px; }
.mob-team-card-list li { font-size: 13px; color: rgba(255,255,255,0.75); }

/* ─── Temporizador libre móvil ───────────────────────────────────── */
.mob-tool-timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.mob-timer-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}
.mob-timer-preset {
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.mob-timer-preset.active {
  background: rgba(125,211,252,0.15);
  border-color: var(--mob-accent, #7dd3fc);
  color: var(--mob-accent, #7dd3fc);
}
.mob-timer-ring-wrap {
  position: relative;
  width: 160px;
  height: 160px;
}
.mob-timer-svg { transform: none; }
.mob-timer-track {
  fill: none;
  stroke: rgba(255,255,255,0.07);
  stroke-width: 8;
}
.mob-timer-arc {
  fill: none;
  stroke: var(--mob-accent, #7dd3fc);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dasharray 1s linear;
}
.mob-timer-ring-wrap.near-end .mob-timer-arc { stroke: #f59e0b; }
.mob-timer-ring-wrap.done .mob-timer-arc { stroke: #10b981; }
.mob-timer-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.mob-timer-display {
  font-size: 30px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--mob-text, #e8edf5);
}
.mob-timer-ring-wrap.near-end .mob-timer-display { color: #f59e0b; }
.mob-timer-ring-wrap.done .mob-timer-display { display: none; }
.mob-timer-done-icon { font-size: 36px; color: #10b981; }
.mob-timer-done-label { font-size: 12px; font-weight: 700; color: #10b981; }
.mob-timer-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

/* ─── Torneo móvil ───────────────────────────────────────────────── */
.mob-tool-tournament { display: flex; flex-direction: column; gap: 10px; }
.mob-tourn-play { gap: 12px; }
.mob-tourn-table-wrap {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  overflow: hidden;
}
.mob-tourn-table-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  padding: 8px 12px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mob-tourn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.mob-tourn-table th {
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.35);
  text-align: center;
  letter-spacing: 0.04em;
}
.mob-tourn-table th:first-child { text-align: left; padding-left: 12px; }
.mob-tourn-table td {
  padding: 7px 8px;
  text-align: center;
  color: rgba(255,255,255,0.7);
  border-top: 1px solid rgba(255,255,255,0.05);
}
.mob-tourn-team-name { text-align: left !important; padding-left: 12px !important; color: var(--mob-text, #e8edf5) !important; font-weight: 600; }
.mob-tourn-pts { font-weight: 800; color: var(--mob-accent, #7dd3fc) !important; }
.mob-tourn-leader { background: rgba(125,211,252,0.05); }

.mob-tourn-matches-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
}
.mob-tourn-matches { display: flex; flex-direction: column; gap: 6px; }
.mob-tourn-match {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 8px 10px;
}
.mob-tourn-match.played { border-color: rgba(125,211,252,0.2); }
.mob-tourn-match-team { flex: 1; font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.75); }
.mob-tourn-match-team:last-child { text-align: right; }
.mob-tourn-score-input {
  width: 36px;
  height: 34px;
  text-align: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: var(--mob-text, #e8edf5);
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.mob-tourn-score-input::-webkit-outer-spin-button,
.mob-tourn-score-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mob-tourn-score-input:focus { outline: none; border-color: var(--mob-accent, #7dd3fc); }
.mob-tourn-match-sep { font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.3); }

/* ═══════════════════════════════════════════════════════════════════
   MEJORAS v2: Haptic / Persistencia / Sonido / Compartir / Multi-equipo
   ═══════════════════════════════════════════════════════════════════ */

/* ── Selector de nº de equipos en Marcador ── */
.mob-sb-num-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 0 16px 12px;
}
.mob-sb-num-btn {
  flex: 1;
  padding: 7px 4px;
  border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.55);
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.mob-sb-num-btn.active {
  border-color: var(--mob-accent, #7dd3fc);
  background: rgba(125,211,252,0.12);
  color: var(--mob-accent, #7dd3fc);
}

/* ── Layout 3-4 equipos en columna compacta ── */
.mob-sb-teams--multi {
  flex-direction: column;
  gap: 8px;
}
.mob-sb-team--compact {
  flex-direction: row;
  align-items: center;
  padding: 10px 12px;
  gap: 10px;
  min-height: unset;
}
.mob-sb-team--compact .mob-sb-name {
  flex: 1;
  font-size: 13px;
  justify-content: flex-start;
  padding: 0;
  background: none;
  border: none;
  gap: 4px;
}
.mob-sb-score--sm {
  font-size: 32px !important;
  min-width: 48px;
  text-align: center;
}
.mob-sb-team--compact .mob-sb-btns {
  gap: 4px;
}
.mob-sb-team--compact .mob-sb-btn {
  width: 36px;
  height: 36px;
  font-size: 13px;
}
.mob-sb-team--compact .mob-sb-win {
  font-size: 11px;
  padding: 2px 8px;
}

/* ── Botón compartir torneo ── */
.mob-tourn-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.mob-tourn-copy-btn {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid rgba(125,211,252,0.35);
  background: rgba(125,211,252,0.08);
  color: var(--mob-accent, #7dd3fc);
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.mob-tourn-copy-btn.copied {
  border-color: #4ade80;
  background: rgba(74,222,128,0.12);
  color: #4ade80;
}

/* ═══════════════════════════════════════════════════════════════════
   NUEVOS COMPONENTES v3: Notas · Cronómetro · Dado · Silbato · Historial
   ═══════════════════════════════════════════════════════════════════ */

/* ── Caja de nota rápida de sesión ── */
.mob-note-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 12px;
}
.mob-note-textarea {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  padding: 10px 12px;
  resize: none;
  width: 100%;
  box-sizing: border-box;
  line-height: 1.5;
}
.mob-note-textarea:focus { outline: none; border-color: var(--mob-accent, #7dd3fc); }
.mob-note-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mob-note-actions .mob-tool-ghost-btn,
.mob-note-actions .mob-tool-primary-btn {
  margin-top: 0;
}
.mob-tool-primary-btn.saved {
  background: #4ade80;
  color: #052e16;
}

/* ── Cronómetro (Stopwatch) ── */
.mob-stopwatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.mob-sw-display {
  font-size: 52px;
  font-weight: 200;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: #fff;
  font-family: -apple-system, "SF Pro Display", system-ui;
  line-height: 1;
  padding: 10px 0;
}
.mob-sw-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  align-items: center;
  justify-content: center;
}
.mob-sw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 12px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  padding: 12px 16px;
  transition: opacity 0.15s;
}
.mob-sw-btn:active { opacity: 0.7; }
.mob-sw-btn:disabled { opacity: 0.3; cursor: default; }
.mob-sw-btn--lap {
  flex: 1;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.1);
}
.mob-sw-btn--toggle {
  flex: 2;
  background: var(--mob-accent, #7dd3fc);
  color: #0f121a;
}
.mob-sw-btn--toggle.running {
  background: rgba(255,180,0,0.85);
  color: #fff;
}
.mob-sw-btn--reset {
  width: 46px;
  height: 46px;
  padding: 0;
  font-size: 18px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 50%;
}

/* Lista de vueltas */
.mob-sw-laps {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mob-sw-laps-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35);
  padding: 0 2px;
}
.mob-sw-laps-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 140px;
  overflow-y: auto;
}
.mob-sw-lap-row {
  display: grid;
  grid-template-columns: 24px 1fr 1fr;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.mob-sw-lap-num {
  color: rgba(255,255,255,0.35);
  font-weight: 700;
  text-align: center;
}
.mob-sw-lap-diff {
  color: rgba(255,255,255,0.75);
  font-weight: 600;
}
.mob-sw-lap-total {
  color: rgba(255,255,255,0.4);
  text-align: right;
}

/* ── Dado ── */
.mob-dice-tool {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mob-dice-num-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mob-dice-area {
  width: 100%;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s;
  padding: 16px;
  flex-wrap: wrap;
}
.mob-dice-area:active { transform: scale(0.97); }
.mob-dice-area.rolling {
  border-color: var(--mob-accent, #7dd3fc);
  animation: diceShake 0.08s linear infinite;
}
@keyframes diceShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px) rotate(-2deg); }
  75% { transform: translateX(3px) rotate(2deg); }
}
.mob-dice-face {
  font-size: 52px;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
  transition: transform 0.1s;
}
.mob-dice-placeholder {
  font-size: 52px;
  opacity: 0.25;
  line-height: 1;
}
.mob-dice-total {
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
}
.mob-dice-total strong {
  color: var(--mob-accent, #7dd3fc);
  font-size: 18px;
}

/* ── Silbato ── */
.mob-whistle-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.mob-whistle-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  text-align: center;
  line-height: 1.5;
  text-wrap: pretty;
  padding: 0 8px;
}
.mob-whistle-btn {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(255,255,255,0.15), rgba(255,255,255,0.03));
  border: 3px solid rgba(255,255,255,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.06s, border-color 0.1s, background 0.1s;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.mob-whistle-btn:active,
.mob-whistle-btn.pressing {
  transform: scale(0.93);
  border-color: var(--mob-accent, #7dd3fc);
  background: radial-gradient(circle at 40% 35%, rgba(125,211,252,0.2), rgba(125,211,252,0.05));
}
.mob-whistle-emoji { font-size: 48px; line-height: 1; }
.mob-whistle-label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.mob-whistle-secondary {
  display: flex;
  gap: 8px;
  width: 100%;
}
.mob-whistle-secondary .mob-tool-ghost-btn {
  flex: 1;
}
.mob-whistle-count {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  text-align: center;
}

/* ── Historial de sesiones ── */
.mob-history {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mob-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 4px;
}
.mob-history-count {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
}
.mob-history-clear-btn {
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255,77,95,0.3);
  background: rgba(255,77,95,0.08);
  color: rgba(255,77,95,0.7);
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.mob-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mob-history-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.mob-history-item:active { background: rgba(255,255,255,0.07); }
.mob-history-item.expanded { border-color: rgba(125,211,252,0.25); }
.mob-history-item-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.mob-history-item-left { flex: 1; min-width: 0; }
.mob-history-item-date {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.mob-history-item-group {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.mob-history-item-right {
  text-align: right;
  flex-shrink: 0;
}
.mob-history-item-dur {
  font-size: 13px;
  font-weight: 800;
  color: var(--mob-accent, #7dd3fc);
  font-variant-numeric: tabular-nums;
}
.mob-history-item-blocks {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  margin-top: 2px;
}
.mob-history-item-note {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  font-style: italic;
  line-height: 1.5;
}
.mob-history-item-time {
  margin-top: 4px;
  font-size: 10px;
  color: rgba(255,255,255,0.25);
}
.mob-history-empty {
  text-align: center;
  padding: 32px 16px;
  color: rgba(255,255,255,0.4);
}
.mob-history-empty-icon { font-size: 36px; margin-bottom: 12px; }
.mob-history-empty p { font-size: 14px; margin: 0 0 6px; }
.mob-history-empty-hint { font-size: 12px !important; color: rgba(255,255,255,0.25) !important; line-height: 1.5; }

/* ── Botón de notificaciones en header de herramientas ── */
.mob-tools-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mob-notif-btn {
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid rgba(212,255,63,0.3);
  background: rgba(212,255,63,0.08);
  color: #d4ff3f;
  font-size: 10px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
  letter-spacing: 0.02em;
}
.mob-notif-btn.busy { opacity: 0.5; cursor: default; }
.mob-notif-denied {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  white-space: nowrap;
}
