/* Mando: interfaz de app móvil, oscura, operable con el pulgar. */
body.mando {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

#head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 8px;
}
#head .section { font-size: 1.2rem; font-weight: 800; }
#head .store { color: var(--muted); font-size: .85rem; font-weight: 600; }
#head .right { display: flex; align-items: center; gap: 10px; }
#conn-chip { font-size: .8rem; padding: .3em .6em; }
#conn-chip.ok { color: var(--ok); }
#conn-chip.bad { color: var(--danger); }
#menu-btn { font-size: 1.25rem; padding: .45em .8em; }

#main {
  flex: 1;
  overflow-y: auto;
  padding: 4px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Aviso persistente "Remoto cerrado" (P3) */
#remote-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #3a2a08;
  border: 1.5px solid var(--accent);
  color: #ffd88a;
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: .92rem;
}
#remote-warning button {
  color: var(--accent);
  font-weight: 800;
  padding: 4px 8px;
  flex-shrink: 0;
}

.current-card {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px 20px 22px;
  text-align: center;
  box-shadow: var(--shadow);
}
.current-card .lbl {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .78rem;
}
.current-card .num {
  font-size: clamp(4rem, 22vw, 6.2rem);
  font-weight: 900;
  line-height: 1.05;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.current-card .num.bump { animation: bump .4s ease; }
@keyframes bump { 30% { transform: scale(1.12); } }
.current-card .name {
  font-size: clamp(1.3rem, 6vw, 1.9rem);
  font-weight: 800;
  text-transform: uppercase;
  min-height: 1.3em;
}
.current-card .name.remote { color: var(--muted); font-style: italic; text-transform: none; }

.queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .78rem;
  padding: 2px 4px;
}

#queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
#queue li {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
}
#queue li.next { border-color: var(--accent); background: #241d0b; }
#queue li .n { font-weight: 900; font-variant-numeric: tabular-nums; font-size: 1.15rem; color: var(--accent); min-width: 3.2em; }
#queue li .who { font-weight: 700; font-size: 1.05rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#queue li .who.remote { color: var(--muted); font-style: italic; }
#queue li .src { font-size: .95rem; opacity: .7; }
#queue .empty { color: var(--muted); text-align: center; padding: 18px; font-weight: 600; border: none; background: none; }

#foot {
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
  position: relative;
}
#suppressed-hint {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: .85rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 5px 14px;
  white-space: nowrap;
}

/* Botón único con dos gestos: tap = pasar; mantener 1,5 s = repetir (P2). */
#pass-btn {
  position: relative;
  width: 100%;
  min-height: 92px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(91, 75, 212, .35);
  touch-action: none;
}
#pass-btn:active { filter: brightness(1.08); }
#pass-btn .content { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 3px; align-items: center; }
#pass-btn .main-lbl { font-size: 1.5rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
#pass-btn .sub-lbl { font-size: .8rem; font-weight: 600; opacity: .75; }
#pass-btn .progress {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(255, 178, 0, .85);
  transform: scaleX(0);
  transform-origin: left;
}
#pass-btn.holding .progress { transition: transform 1.5s linear; transform: scaleX(1); }
#pass-btn.held { animation: held-pulse .45s ease; }
#pass-btn.held .main-lbl::after { content: ' 🔁'; }
@keyframes held-pulse { 30% { transform: scale(1.03); } }

/* Hoja de menú */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 850;
  background: rgba(6, 8, 14, .6);
  display: flex;
  align-items: flex-end;
}
.sheet .panel {
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--line);
  width: 100%;
  padding: 14px 18px calc(20px + env(safe-area-inset-bottom));
  animation: sheet-in .22s ease;
}
@keyframes sheet-in { from { transform: translateY(40%); opacity: .4; } }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet .item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 14px 10px;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 700;
}
.sheet .item:active { background: var(--surface-2); }
.sheet .item .ico { font-size: 1.3rem; width: 1.6em; text-align: center; }
.sheet .item .meta { margin-left: auto; color: var(--muted); font-size: .85rem; font-weight: 600; }

.phrase-counter { text-align: right; color: var(--muted); font-size: .85rem; font-weight: 700; }
.phrase-counter.over { color: var(--danger); }

/* Código técnico (P30): en grande, legible a un vistazo mientras se teclea. */
.techcode {
  text-align: center;
  font-size: clamp(2.6rem, 14vw, 3.6rem);
  font-weight: 900;
  letter-spacing: .12em;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  background: var(--surface-2);
  border: 1.5px dashed var(--line);
  border-radius: 18px;
  padding: 14px 10px;
  margin: 6px 0 8px;
  user-select: text;
  -webkit-user-select: text;
}
.techcode.expired { color: var(--muted); text-decoration: line-through; }
.techcode-count { text-align: center; color: var(--muted); font-weight: 700; font-size: .95rem; min-height: 1.4em; }
.techcode-count.expired { color: var(--danger); }

.history-list { list-style: none; padding: 0; margin: 8px 0 0; max-height: 50vh; overflow-y: auto; }
.history-list li {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 9px 6px;
  border-bottom: 1px solid var(--line);
}
.history-list .n { font-weight: 900; color: var(--accent); min-width: 3em; font-variant-numeric: tabular-nums; }
.history-list .who { flex: 1; font-weight: 600; }
.history-list .when { color: var(--muted); font-size: .85rem; }
