/* Vista de logs apk.vhoda.sh (consola + Bootstrap solo para botones/badges) */
:root {
  color-scheme: dark light;
  --bg: #0f1419;
  --surface: #1a2332;
  --border: #2d3a4d;
  --text: #e7ecf3;
  --muted: #8b9aaf;
  --accent: #3d8bfd;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f6f9;
    --surface: #fff;
    --border: #d8dee9;
    --text: #1a2332;
    --muted: #5c6b80;
    --accent: #0d6efd;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
}

body.body-log {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.page--log {
  width: 100%;
  max-width: 1100px;
  padding: 0.75rem 1rem max(2rem, env(safe-area-inset-bottom, 0px));
}

header.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 1040;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

@media (prefers-color-scheme: dark) {
  header.page-head {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  }
}

.page-head h1 {
  margin: 0;
  font-weight: 600;
}

.meta {
  font-size: 0.875rem;
  color: var(--muted);
}

.meta strong {
  color: var(--text);
  font-weight: 600;
}

.actions {
  margin-left: auto;
}

.actions-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.actions a {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
}

.actions a:hover {
  filter: brightness(1.08);
  color: #fff;
}

.empty {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 12px;
}

.empty[hidden] {
  display: none !important;
}

.hint {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0 0 0.65rem;
  line-height: 1.45;
}

.live-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #2ecc71;
  margin-right: 0.35rem;
  vertical-align: middle;
  box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.25);
  animation: live-pulse 2s ease-in-out infinite;
}

.live-dot--off {
  background: var(--muted);
  box-shadow: none;
  animation: none;
}

@keyframes live-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.log-scroll {
  overflow: visible;
  padding: 0.65rem 1rem max(1.25rem, env(safe-area-inset-bottom, 0px));
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.log-scroll[hidden] {
  display: none !important;
}

/* Consola de eventos (sin acordeón: no se re-renderiza al llegar datos nuevos) */
.log-console {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

.log-console-line {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.log-console-line:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.log-console-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.35rem;
  padding: 0.25rem 0;
  font-size: 0.8125rem;
  border-left: 3px solid var(--accent);
  padding-left: 0.65rem;
}

.log-abs-ts {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

.log-plain,
.log-json {
  margin: 0;
  padding: 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--muted);
  background: var(--bg);
  border-radius: 8px;
  overflow-x: auto;
  overscroll-behavior: contain;
}

.sum-main {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.5rem;
  min-width: 0;
}

.sum-num {
  color: var(--muted);
  font-weight: 600;
}

.rel-time {
  color: var(--accent);
  font-weight: 700;
}

.sum-meta {
  color: var(--muted);
  font-weight: 500;
}

/* ─────────────────────────────────────────────────────────────────────────
   Desbloquear MundoGo — formulario y resultados
   ───────────────────────────────────────────────────────────────────────── */

.unlock-card {
  margin-top: 1rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.unlock-form .form-label {
  font-weight: 600;
  color: var(--text);
}

.unlock-form .form-text {
  color: var(--muted);
  font-size: 0.8125rem;
}

.unlock-input {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875rem;
  background: var(--bg);
  border-color: var(--border);
  color: var(--text);
}

.unlock-input:focus {
  background: var(--bg);
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 0.2rem rgba(61, 139, 253, 0.25);
}

.unlock-result {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.unlock-result h2,
.unlock-result h3 {
  color: var(--text);
}

.unlock-password {
  font-size: 1.125rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  background: rgba(46, 204, 113, 0.15);
  border-radius: 6px;
  color: #2ecc71;
}

.unlock-analysis {
  margin-top: 1rem;
}

.unlock-table {
  background: var(--bg);
  font-size: 0.875rem;
}

.unlock-table th {
  width: 180px;
  color: var(--muted);
  font-weight: 600;
  background: var(--surface);
}

.unlock-table td {
  color: var(--text);
}

.unlock-code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  word-break: break-all;
  color: var(--accent);
}

.unlock-code-sm {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.75rem;
  word-break: break-all;
  color: var(--muted);
}

.unlock-hex {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.75rem;
  word-break: break-all;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.unlock-hipotesis {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.unlock-hipotesis li {
  margin-bottom: 0.35rem;
}

.unlock-hipotesis li:last-child {
  margin-bottom: 0;
}

.unlock-history {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.unlock-history h2 {
  color: var(--text);
}

.unlock-history .table {
  margin-bottom: 0;
}

.unlock-history .table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-color: var(--border);
}

.unlock-history .table td {
  color: var(--text);
  font-size: 0.875rem;
  border-color: var(--border);
  vertical-align: middle;
}

.unlock-history .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(0, 0, 0, 0.04);
}

[data-bs-theme="dark"] .unlock-history .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(255, 255, 255, 0.03);
}

.unlock-candidates {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.unlock-candidate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.unlock-candidate:first-child {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(61, 139, 253, 0.2);
}

.unlock-candidate-num {
  font-weight: 700;
  color: var(--muted);
  min-width: 1.5rem;
}

.unlock-candidate-pass {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.75rem;
  background: rgba(46, 204, 113, 0.15);
  border-radius: 6px;
  color: #2ecc71;
}

.unlock-candidate:first-child .unlock-candidate-pass {
  font-size: 1.5rem;
  background: rgba(46, 204, 113, 0.25);
}

.unlock-candidate-method {
  font-size: 0.75rem;
  margin-left: auto;
}

@media (max-width: 576px) {
  .unlock-candidate-method {
    width: 100%;
    margin-left: 1.75rem;
    margin-top: -0.25rem;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   index.php — lista de APK: mínimo, legible en Android TV (10-foot / D-pad)
   Paleta alineada a vhoda.sh style2 (oscuro + acento violeta)
   ───────────────────────────────────────────────────────────────────────── */

.body-downloader {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: #e8e8f0;
  background-color: #000000;
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(108, 92, 231, 0.12), transparent 55%),
    radial-gradient(ellipse 90% 60% at 100% 50%, rgba(200, 220, 255, 0.06), transparent 45%),
    radial-gradient(ellipse 80% 50% at 0% 80%, rgba(255, 220, 230, 0.05), transparent 40%);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  font-size: clamp(1.05rem, 2.8vw, 1.35rem);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.downloader-page {
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.downloader {
  box-sizing: border-box;
  flex: 1 0 auto;
  max-width: 42rem;
  margin: 0 auto;
  width: 100%;
  padding: clamp(1.25rem, 4vw, 2rem) clamp(1rem, 4vw, 2rem) clamp(1rem, 3vw, 1.5rem);
}

.downloader-foot {
  flex-shrink: 0;
  margin-top: auto;
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
}

.downloader-foot-inner {
  box-sizing: border-box;
  max-width: 42rem;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.85rem 1.75rem;
  padding: 1rem clamp(1rem, 4vw, 2rem) 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.downloader-foot-img {
  display: block;
  height: auto;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  opacity: 0.92;
}

.downloader-foot-img--sleeper {
  max-height: clamp(2.75rem, 9vw, 4.5rem);
}

.downloader-foot-img--logo {
  max-height: clamp(2.25rem, 7vw, 3.75rem);
}

.downloader-head {
  margin-bottom: clamp(1rem, 3vw, 1.5rem);
  padding-bottom: clamp(0.85rem, 2.5vw, 1.15rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.downloader-title {
  margin: 0 0 0.35rem;
  font-weight: 700;
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  letter-spacing: -0.02em;
  color: #e8e8f0;
}

.downloader-sub {
  margin: 0;
  font-size: 0.88em;
  color: #a0a0b8;
}

.downloader-empty {
  margin: 0;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  text-align: center;
  color: #6a6a80;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 14px;
}

.downloader-code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  color: #a78bfa;
}

.downloader-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.downloader-item {
  margin: 0;
}

.downloader-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  min-height: 3.25rem;
  padding: 0.85rem 1.1rem;
  text-decoration: none;
  color: #e8e8f0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

.downloader-link:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(167, 139, 250, 0.35);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.downloader-link:focus {
  outline: none;
}

.downloader-link:focus-visible {
  outline: 3px solid #a78bfa;
  outline-offset: 3px;
}

.downloader-link:active {
  transform: scale(0.99);
}

.downloader-link-text {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
  font-weight: 600;
}

.downloader-link-meta {
  flex: 0 0 auto;
  font-size: 0.78em;
  font-weight: 500;
  color: #6a6a80;
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  .downloader-link {
    transition: none;
  }

  .downloader-link:active {
    transform: none;
  }
}
