/* Cinema Force web: interfaz al estilo de la app de cine en iOS 26. */

:root {
  --yellow: #f5c518;
  --bg: #000;
  --card: #1a1a1a;
  --text: #fff;
  --muted: #a8a8a8;
  --link: #5799ef;
  --sep: #2a2a2a;
  --chip: #3a3a3a;
  --placeholder: #2b2b2b;
  --glass: rgba(40, 40, 40, 0.55);
  --glass-border: rgba(255, 255, 255, 0.14);
  --menu: rgba(38, 38, 38, 0.82);
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f6f6f6;
  --card: #fff;
  --text: #121212;
  --muted: #6b6b6b;
  --link: #0e63be;
  --sep: #dedede;
  --chip: #d3d3d3;
  --placeholder: #d9d9d9;
  --glass: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(0, 0, 0, 0.08);
  --menu: rgba(248, 248, 248, 0.85);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}

svg { width: 1em; height: 1em; display: block; }
input, select { font: inherit; -webkit-user-select: text; user-select: text; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.link { color: var(--link); font-size: 16px; }

#app { position: fixed; top: 0; left: 0; right: 0; height: var(--app-h, 100%); }

/* MARK: Pestañas y páginas */

.tab-root { position: absolute; inset: 0; display: none; overflow: hidden; }
.tab-root.active { display: block; }

.page {
  position: absolute;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  transition: transform 0.36s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.36s;
  will-change: transform;
}
.page.enter { transform: translateX(100%); }
.page.leave { transform: translateX(100%); }
.page.covered { transform: translateX(-28%); filter: brightness(0.75); }

.scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-bottom: calc(96px + var(--bottom));
}

.tab-bar {
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: calc(var(--bottom) + 2px);
  transform: translateX(-50%);
  width: min(300px, calc(100% - 100px));
  height: 62px;
  border-radius: 31px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 6px;
}
.tab-bar button { position: relative; flex: 1; height: 54px; display: grid; place-items: center; font-size: 26px; color: var(--text); }
.tab-bar .tab-pill { position: absolute; inset: 0 2px; border-radius: 27px; background: transparent; transition: background 0.2s; }
.tab-bar button.active .tab-pill { background: rgba(127, 127, 127, 0.22); }
.tab-bar svg { position: relative; }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  border: 0.5px solid var(--glass-border);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.glass-circle {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 19px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  border: 0.5px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.nav-bar {
  flex: none;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  padding: calc(var(--top) + 4px) 12px 6px;
  min-height: calc(var(--top) + 56px);
  background: var(--bg);
  position: relative;
  z-index: 2;
}
.nav-title { text-align: center; font-weight: 600; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-side.right { display: flex; justify-content: flex-end; }

/* MARK: Piezas comunes */

.poster { position: relative; background: var(--placeholder); overflow: hidden; border-radius: 2px; }
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster.empty { display: grid; place-items: center; color: var(--muted); font-size: 26px; opacity: 0.85; }
.poster-wrap { position: relative; flex: none; }

.ribbon { position: absolute; top: 0; left: 0; width: 32px; height: 44px; display: grid; justify-items: center; color: #fff; font-size: 16px; }
.ribbon > svg:first-child { position: absolute; inset: 0; width: 100%; height: 100%; fill: rgba(0, 0, 0, 0.55); }
.ribbon > svg:last-child { position: relative; margin-top: 7px; }
.ribbon.added > svg:first-child { fill: var(--yellow); }
.ribbon.added { color: #000; }
.ribbon.small { width: 27px; height: 37px; font-size: 13px; }
.ribbon.small > svg:last-child { margin-top: 6px; }
.ribbon.large { width: 34px; height: 46px; }

.rating { display: inline-flex; align-items: center; gap: 5px; font-size: 16px; }
.rating .star, .big-rating .star { color: var(--yellow); font-size: 0.85em; }
.rating.small { font-size: 14px; }
.rating .muted { margin-left: 2px; }

.section-header { display: flex; align-items: center; gap: 10px; padding: 0 16px; }
.section-header .bar { width: 4px; height: 24px; border-radius: 2px; background: var(--yellow); }
.section-header h2 { margin: 0; font-size: 21px; font-weight: 700; }
.section-header svg { font-size: 16px; }

.meta { display: flex; gap: 12px; font-size: 16px; }

.empty-state { padding: 60px 24px; text-align: center; color: var(--muted); }

/* MARK: Inicio */

.home { padding-top: calc(var(--top) + 6px); }
.home > section { margin-top: 30px; }
.home-brand { padding: 0 16px; }
.brand-badge {
  display: inline-flex; align-items: center; height: 32px; padding: 0 7px; border-radius: 5px;
  background: var(--yellow); color: #000; font-weight: 900; font-size: 20px; letter-spacing: -0.5px;
}
.carousel { display: flex; gap: 10px; overflow-x: auto; padding: 14px 16px 4px; scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.poster-card { flex: none; width: 128px; background: var(--card); border-radius: 4px; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.poster.card { width: 128px; height: 190px; border-radius: 0; }
.card-text { padding: 6px 8px 10px; display: grid; gap: 6px; }
.card-title { font-size: 15px; line-height: 1.25; height: 2.5em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.explore .section-header { margin-bottom: 10px; }
.chart-link { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 16px; text-align: left; position: relative; }
.chart-link::after { content: ""; position: absolute; left: 58px; right: 0; bottom: 0; height: 0.5px; background: var(--sep); }
.chart-icon { color: var(--yellow); font-size: 22px; width: 28px; display: grid; place-items: center; }
.chart-text { flex: 1; display: grid; gap: 2px; }
.chart-text small { font-size: 14px; color: var(--muted); }
.chevron { color: var(--muted); font-size: 14px; }

/* MARK: Top 250 */

.top-header { display: grid; gap: 18px; padding-bottom: 4px; }
.subtitle { margin: 16px 18px 0; font-size: 17px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 18px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 16px;
  border: 1px solid var(--chip); border-radius: 20px; font-size: 17px; white-space: nowrap;
}
.chip.active { background: rgba(245, 197, 24, 0.25); }
.chip .tri { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid currentColor; }
.count-row { display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 18px; }
.count-tools { display: flex; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; font-size: 24px; color: var(--muted); }

.rank-row { position: relative; display: flex; gap: 10px; padding: 10px 0 10px 11px; border-bottom: 0.5px solid var(--sep); }
.poster.row { width: 94px; height: 140px; }
.rank-text { flex: 1; min-width: 0; padding-top: 14px; padding-right: 44px; display: grid; gap: 5px; align-content: start; }
.rank-num { font-size: 17px; }
.rank-title { font-size: 18px; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rank-text .link { justify-self: start; margin-top: 1px; }
.row-more { position: absolute; top: 10px; right: 4px; width: 44px; height: 32px; display: grid; place-items: center; color: var(--muted); font-size: 18px; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 10px; padding: 8px 12px; }
.grid-item { display: grid; gap: 4px; align-content: start; min-width: 0; }
.poster.grid { width: 100%; aspect-ratio: 2 / 3; }
.grid-title { font-size: 15px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* MARK: Ficha */

.movie-title { padding: 8px 16px 0; display: grid; gap: 6px; }
.movie-title h1 { margin: 0; font-size: 30px; font-weight: 400; line-height: 1.15; }
.movie-title .meta { font-size: 15px; }
.movie-top { display: flex; gap: 14px; padding: 16px 16px 0; align-items: flex-start; }
.poster.detail { width: 112px; height: 166px; border-radius: 4px; }
.movie-info { flex: 1; min-width: 0; display: grid; gap: 10px; }
.genre-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.genre-chip { flex: none; height: 30px; padding: 0 10px; border: 1px solid var(--chip); border-radius: 6px; font-size: 14px; }
.synopsis { margin: 0; font-size: 15px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.synopsis.expanded { -webkit-line-clamp: unset; }
.rating-row { display: flex; padding: 18px 16px 0; }
.rating-row > * { flex: 1; }
.big-rating { display: flex; align-items: center; gap: 6px; }
.big-rating .star { font-size: 22px; }
.big-rating b { font-size: 18px; font-weight: 600; }
.big-rating .muted { font-size: 14px; }
.rate-btn { display: flex; align-items: center; gap: 6px; color: var(--link); font-size: 16px; font-weight: 600; }
.rate-btn svg { font-size: 22px; }
.rate-btn b { color: var(--text); }
.rank-link { display: flex; align-items: center; gap: 8px; margin: 14px 16px 0; font-size: 15px; }
.rank-link .trophy { color: var(--yellow); font-size: 18px; }
.rank-link > svg { color: var(--muted); font-size: 13px; }
.yellow-btn {
  display: flex; align-items: center; gap: 8px; width: calc(100% - 32px); margin: 18px 16px 0; height: 50px; padding: 0 16px;
  background: var(--yellow); color: #000; border-radius: 6px; font-weight: 600; font-size: 16px;
}
.yellow-btn.center { justify-content: center; width: 100%; margin: 6px 0 0; }
.yellow-btn:disabled { background: var(--placeholder); color: var(--muted); }
.outline-btn { display: block; width: calc(100% - 32px); margin: 10px 16px 0; min-height: 44px; border: 1px solid var(--chip); border-radius: 6px; color: var(--link); font-weight: 600; font-size: 16px; }
.credits { margin-top: 22px; }
.credit-row { display: flex; gap: 14px; padding: 13px 16px; border-top: 0.5px solid var(--sep); font-size: 16px; }
.credit-row strong { font-weight: 600; }
.link-text { color: var(--link); }
.movie > .section-header { margin-top: 28px; }
.cast { display: flex; gap: 16px; overflow-x: auto; padding: 14px 16px 0; scrollbar-width: none; }
.cast-item { flex: none; width: 100px; display: grid; justify-items: center; gap: 8px; text-align: center; font-size: 14px; font-weight: 600; }
.bubble { width: 92px; height: 92px; border-radius: 50%; background: var(--placeholder); color: var(--muted); display: grid; place-items: center; font-size: 28px; font-weight: 500; }
.details { margin-top: 28px; }
.details .section-header { margin-bottom: 10px; }
.detail-line { display: grid; gap: 3px; padding: 8px 16px; }
.detail-line strong { font-size: 16px; font-weight: 600; }
.detail-line .muted { font-size: 15px; }

/* MARK: Búsqueda y perfil */

.search-field {
  display: flex; align-items: center; gap: 8px; margin: 6px 16px 10px; height: 40px; padding: 0 12px;
  border-radius: 20px; background: rgba(127, 127, 127, 0.2); color: var(--muted); font-size: 17px;
}
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font-size: 17px; }
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; }
.list-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 16px 6px; font-size: 13px; text-transform: uppercase; color: var(--muted); }
.list-header .link { text-transform: none; font-size: 15px; }
.list-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border-bottom: 0.5px solid var(--sep); text-align: left; }
.list-row span:first-of-type { flex: 1; }
.list-row > svg:last-child { color: var(--muted); font-size: 13px; }
.list-row.recent svg { color: var(--muted); }
.search-row { display: flex; gap: 12px; align-items: center; padding: 6px 16px; border-bottom: 0.5px solid var(--sep); }
.search-row > div:last-child { display: grid; gap: 4px; }
.poster.thumb { width: 50px; height: 74px; flex: none; font-size: 18px; }
.profile-head { display: flex; align-items: center; gap: 14px; padding: 16px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 64px; color: var(--muted); }

/* MARK: Menús y hojas */

.menu-backdrop { position: fixed; inset: 0; z-index: 60; }
.menu {
  position: fixed; overflow-y: auto; border-radius: 22px; padding: 6px 0; background: var(--menu);
  transform: scale(0.6); opacity: 0; transition: transform 0.22s cubic-bezier(0.3, 1.3, 0.5, 1), opacity 0.15s;
}
.menu-backdrop.open .menu { transform: scale(1); opacity: 1; }
.menu-item { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 16px 0 10px; gap: 6px; text-align: left; font-size: 17px; }
.menu-item:active { background: rgba(127, 127, 127, 0.25); }
.menu-check { width: 20px; font-size: 15px; display: grid; place-items: center; }
.menu-label { flex: 1; }
.menu-icon { font-size: 19px; }
.menu-divider { height: 8px; }
.menu-header { padding: 8px 16px 4px 36px; font-size: 13px; color: var(--muted); }

.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0); transition: background 0.3s; }
.sheet-backdrop.open { background: rgba(0, 0, 0, 0.4); }
.sheet {
  position: absolute; left: 6px; right: 6px; bottom: 6px; padding: 8px 20px calc(var(--bottom) + 20px);
  border-radius: 34px; background: var(--card); transform: translateY(105%); transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet-backdrop.open .sheet { transform: translateY(0); }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--chip); margin: 0 auto 6px; }
.sheet-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 44px; }
.sheet-bar .link { justify-self: end; font-weight: 600; }
.sheet-body { display: grid; gap: 14px; padding: 10px 0; }
.sheet-body.center { justify-items: center; text-align: center; }
.sheet-body p { margin: 0; font-size: 15px; }
.tv-icon { font-size: 44px; color: var(--muted); }
.poster.rate { width: 90px; height: 134px; border-radius: 4px; }
.rate-kicker { color: var(--yellow); text-transform: uppercase; font-weight: 600; font-size: 13px; }
.rate-title { font-size: 20px; }
.stars { display: flex; gap: 4px; }
.stars button { font-size: 27px; color: var(--muted); }
.stars button.on { color: var(--link); }
.danger { color: #ff453a; }

/* MARK: Zona secreta */

.secret-zone { position: fixed; z-index: 30; background: rgba(255, 255, 255, 0.001); touch-action: none; }
.secret-zone.topLeft, .secret-zone.topRight { top: 0; width: 110px; height: max(24px, var(--top)); }
.secret-zone.bottomLeft, .secret-zone.bottomRight { bottom: 0; width: 46px; height: calc(64px + var(--bottom)); }
.secret-zone.topLeft, .secret-zone.bottomLeft { left: 0; }
.secret-zone.topRight, .secret-zone.bottomRight { right: 0; }

/* MARK: Falsa pantalla de código */

.lock { position: fixed; inset: 0; z-index: 130; overflow: hidden; color: #fff; touch-action: none; transition: opacity 0.28s ease-in; }
.lock.fade-in { animation: lockFade 0.25s ease-out; }
@keyframes lockFade { from { opacity: 0; } }
.lock-wallpaper { position: absolute; inset: 0; }
.lock-wallpaper::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.12); }
.lock-content { position: absolute; inset: 0; transition: opacity 0.28s ease-in, transform 0.28s ease-in; }
.lock.unlocking { opacity: 0; }
.lock.unlocking .lock-content { opacity: 0; transform: scale(1.06); }
.lock-content > * { position: absolute; transform: translate(-50%, -50%); }
.lock-title { font-size: 21px; white-space: nowrap; }
.lock-dots { display: flex; gap: 24px; }
.lock-dots span { width: 13px; height: 13px; border-radius: 50%; border: 1.3px solid #fff; }
.lock-dots span.on { background: #fff; }
.lock-dots.shake { animation: shake 0.45s linear; }
@keyframes shake {
  0%, 100% { transform: translate(-50%, -50%); }
  12% { transform: translate(calc(-50% - 14px), -50%); }
  28% { transform: translate(calc(-50% + 12px), -50%); }
  44% { transform: translate(calc(-50% - 9px), -50%); }
  60% { transform: translate(calc(-50% + 6px), -50%); }
  76% { transform: translate(calc(-50% - 3px), -50%); }
}
.lock-key {
  width: var(--key); height: var(--key); border-radius: 50%; color: #fff;
  display: grid; place-items: center; touch-action: none; transition: background 0.35s ease-out, box-shadow 0.35s;
}
.lock-key .kd { grid-area: 1 / 1; font-size: calc(var(--key) * 0.5); font-weight: 400; line-height: 1; }
.lock-key .kd.up { transform: translateY(calc(var(--key) * -0.075)); }
.lock-key .kl { grid-area: 1 / 1; font-size: calc(var(--key) * 0.135); font-weight: 700; letter-spacing: calc(var(--key) * 0.04); transform: translateY(calc(var(--key) * 0.225)); padding-left: calc(var(--key) * 0.04); }
.glass-keys .lock-key {
  background: rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(2px) saturate(160%) brightness(1.08);
  backdrop-filter: blur(2px) saturate(160%) brightness(1.08);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), inset 0 -1px 1px rgba(255, 255, 255, 0.12), inset 0 0 0 0.5px rgba(255, 255, 255, 0.25), 0 1px 6px rgba(0, 0, 0, 0.08);
}
.glass-keys .lock-key.pressed { background: rgba(255, 255, 255, 0.4); transition: none; }
.classic .lock-key { background: rgba(255, 255, 255, 0.17); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.classic .lock-key.pressed { background: rgba(255, 255, 255, 0.55); transition: none; }
.lock-text { font-size: 17.5px; color: #fff; white-space: nowrap; padding: 10px; }
.lock-clock { text-align: center; }
.lock-date { font-size: 17px; font-weight: 600; opacity: 0.85; text-transform: capitalize; }
.lock-time { font-size: 64px; font-weight: 700; opacity: 0.9; font-variant-numeric: tabular-nums; line-height: 1.05; }
.lock-island { top: 10px; width: 204px; height: 52px; border-radius: 26px; background: #000; transform: translateX(-50%); left: 50%; display: flex; align-items: center; justify-content: space-between; padding: 0 21px 0 25px; }
.lock-content > .lock-island { top: calc(10px + 26px); transform: translate(-50%, -50%); }
.isl-lock { color: #ebebeb; font-size: 20px; }
.isl-face { color: #4dd964; font-size: 26px; }

/* MARK: Panel de ajustes */

.settings-modal { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, 0); transition: background 0.3s; }
.settings-modal.open { background: rgba(0, 0, 0, 0.4); }
.settings-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; top: calc(var(--top) + 10px); border-radius: 14px 14px 0 0;
  background: #1c1c1e; color: #fff; display: flex; flex-direction: column; transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); color-scheme: dark;
}
.settings-modal.open .settings-sheet { transform: translateY(0); }
.s-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 54px; padding: 0 16px; flex: none; }
.s-bar .link { justify-self: end; font-weight: 600; color: #0a84ff; }
.s-bar .link:first-child { justify-self: start; font-size: 22px; }
.s-scroll { flex: 1; overflow-y: auto; padding: 0 16px calc(var(--bottom) + 40px); -webkit-user-select: none; }
.s-status { margin: 4px 0 8px; padding: 12px 14px; border-radius: 12px; font-size: 15px; line-height: 1.35; }
.s-status.ok { background: rgba(48, 209, 88, 0.16); color: #7ee89a; }
.s-status.warn { background: rgba(255, 159, 10, 0.16); color: #ffcc66; }
.s-group-title { margin: 22px 16px 7px; font-size: 13px; text-transform: uppercase; color: #8e8e93; }
.s-group { background: #2c2c2e; border-radius: 12px; overflow: hidden; }
.s-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 46px;
  padding: 8px 16px; text-align: left; font-size: 16px; border-bottom: 0.5px solid #3a3a3c;
}
.s-group > :last-child { border-bottom: 0; }
.s-row.column { flex-direction: column; align-items: stretch; }
.s-value { display: flex; align-items: center; gap: 6px; color: #8e8e93; min-width: 0; text-align: right; }
.s-value svg { flex: none; font-size: 12px; }
.s-value select { appearance: none; -webkit-appearance: none; border: 0; background: none; color: #8e8e93; text-align: right; max-width: 52vw; font-size: 16px; direction: rtl; }
.s-button { color: #0a84ff; }
.s-button.danger { color: #ff453a; }
.s-note { margin: 7px 16px 0; font-size: 13px; color: #8e8e93; line-height: 1.35; }
.s-note.inline { margin: 4px 0 0; }
.s-input { border: 0; outline: 0; background: none; color: #8e8e93; text-align: right; font-size: 16px; min-width: 0; flex: 1; }
.s-row input[type="range"] { width: 100%; accent-color: #0a84ff; }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 51px; height: 31px; border-radius: 16px; background: #39393d; position: relative; transition: background 0.2s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; transition: transform 0.2s; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); }
.switch:checked { background: #30d158; }
.switch:checked::after { transform: translateX(20px); }
.wall-grid { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.wall { width: 48px; height: 86px; border-radius: 8px; border: 2px solid transparent; display: grid; place-items: center; background: #3a3a3c; color: #8e8e93; font-size: 20px; }
.wall.on { border-color: #0a84ff; }
.settings-sheet .search-field { margin: 4px 0 10px; }

/* MARK: Guía de la primera vez */

.onboarding { position: fixed; inset: 0; z-index: 120; background: rgba(0, 0, 0, 0.55); display: grid; place-items: center; padding: calc(var(--top) + 12px) 14px calc(var(--bottom) + 12px); opacity: 0; transition: opacity 0.25s; }
.onboarding.open { opacity: 1; }
.ob-card { width: 100%; max-width: 440px; max-height: 100%; display: flex; flex-direction: column; background: #1c1c1e; color: #fff; border-radius: 24px; overflow: hidden; color-scheme: dark; }
.ob-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 0; }
.ob-dots { display: flex; gap: 6px; }
.ob-dots span { width: 7px; height: 7px; border-radius: 50%; background: #48484a; }
.ob-dots span.on { background: var(--yellow); }
.ob-skip { color: #8e8e93; font-size: 15px; }
.ob-body { flex: 1; overflow-y: auto; padding: 6px 22px 10px; font-size: 16px; line-height: 1.42; }
.ob-body h3 { font-size: 23px; margin: 10px 0 12px; }
.ob-body h4 { margin: 16px 0 6px; font-size: 16px; color: var(--yellow); }
.ob-body p { margin: 0 0 10px; }
.ob-body ol, .ob-body ul { margin: 0 0 10px; padding-left: 22px; }
.ob-body li { margin-bottom: 7px; }
.ob-body li svg { display: inline-block; vertical-align: -2px; color: #0a84ff; }
.ob-list { list-style: none; padding-left: 0 !important; }
.ob-note { font-size: 14px; color: #8e8e93; }
.ob-actions { display: flex; justify-content: space-between; gap: 12px; padding: 12px 18px 18px; }
.ob-actions button { flex: 1; height: 48px; border-radius: 12px; font-weight: 600; }
.ob-back { background: #2c2c2e; }
.ob-next { background: var(--yellow); color: #000; }
.ob-form { display: grid; gap: 8px; margin: 4px 0 12px; }
.ob-input { height: 46px; border-radius: 12px; border: 1px solid #3a3a3c; background: #2c2c2e; color: #fff; padding: 0 14px; font-size: 16px; outline: 0; }
.ob-input:focus { border-color: var(--yellow); }
.ob-save { width: 100%; height: 46px; border-radius: 12px; background: #0a84ff; color: #fff; font-weight: 600; margin: 4px 0 8px; }
.ob-save:disabled { opacity: 0.5; }
.ob-status { font-size: 14px; color: #8e8e93; min-height: 1em; }
.ob-status.ok { color: #7ee89a; }
.ob-status.error { color: #ff6b5e; }

/* MARK: Altura real de la pantalla (ver js/viewport.js) */

.lock, .settings-modal, .onboarding, .sheet-backdrop, .menu-backdrop {
  inset: auto;
  top: 0;
  left: 0;
  right: 0;
  height: var(--app-h, 100%);
}
.secret-zone.bottomLeft, .secret-zone.bottomRight { bottom: auto; top: calc(var(--app-h, 100vh) - 64px - var(--bottom)); }

/* MARK: iOS 26 instalada: sin «position: fixed» para las capas grandes
   En el iPhone, lo que va fijo en la pantalla se recorta a la altura que informa
   el navegador (más corta que la real). Por eso la página entera mide el alto del
   teléfono (--app-h) y las capas se ubican dentro de ella. */

html, body { height: var(--app-h, 100%); }
body { position: relative; }
#app, .lock, .settings-modal, .onboarding, .sheet-backdrop, .menu-backdrop, .secret-zone { position: absolute; }

/* MARK: Código de acceso (js/license.js) */

.gate { position: absolute; inset: 0; height: var(--app-h, 100%); z-index: 200; background: #000; color: #fff; display: grid; place-items: start center; padding: calc(var(--top) + 6vh) 22px calc(var(--bottom) + 16px); overflow-y: auto; color-scheme: dark; -webkit-user-select: text; user-select: text; }
.gate-card { width: 100%; max-width: 400px; display: grid; gap: 14px; }
.gate-logo { justify-self: start; background: var(--yellow); color: #000; font-weight: 900; font-size: 22px; letter-spacing: -0.5px; padding: 4px 8px; border-radius: 5px; }
.gate h2 { margin: 6px 0 0; font-size: 26px; }
.gate p { margin: 0; color: #c7c7cc; line-height: 1.4; }
.gate ol { margin: 0; padding-left: 22px; line-height: 1.45; }
.gate li { margin-bottom: 8px; }
.gate li svg { display: inline-block; vertical-align: -2px; color: #0a84ff; }
.gate-input { height: 52px; border-radius: 12px; border: 1px solid #3a3a3c; background: #1c1c1e; color: #fff; padding: 0 16px; font-size: 20px; letter-spacing: 1px; text-transform: uppercase; outline: 0; text-align: center; }
.gate-input:focus { border-color: var(--yellow); }
.gate-button { height: 52px; border-radius: 12px; background: var(--yellow); color: #000; font-weight: 700; font-size: 17px; }
.gate-button:disabled { opacity: 0.5; }
.gate-status { min-height: 1.3em; font-size: 15px; line-height: 1.4; color: #8e8e93; }
.gate-status.error { color: #ff6b5e; }
.gate-status.warn { color: #ffcc66; }

/* MARK: Pantallas de PIN de Android (js/lockscreen-android.js) */

.lock.android { font-family: "Google Sans", "Google Sans Text", Roboto, "Segoe UI", system-ui, sans-serif; }
.lock.samsung { font-family: "SamsungOne", "Samsung Sans", Roboto, system-ui, sans-serif; }
.a-wallpaper { position: absolute; inset: -40px; transform: scale(1.05); }
.pixel .a-wallpaper { filter: blur(26px) saturate(1.1) brightness(0.72); }
.samsung .a-wallpaper { filter: blur(34px) brightness(0.55); }
.a-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.18); }
.a-content {
  position: absolute; left: 0; right: 0; top: 0; height: var(--a-h, 100%);
  display: flex; flex-direction: column; align-items: center;
  padding: calc(var(--top) + 8px) 0 calc(var(--bottom) + 18px);
  transition: opacity 0.28s ease-in, transform 0.28s ease-in;
}
.lock.android.unlocking .a-content { opacity: 0; transform: scale(1.04); }
.a-clock { margin-top: 6%; font-size: 64px; font-weight: 400; font-variant-numeric: tabular-nums; opacity: 0.95; }
.a-head { display: flex; flex-direction: column; align-items: center; margin-top: calc(18% + var(--a-shift, 0px)); width: 100%; }
.a-clock + .a-head { margin-top: calc(6% + var(--a-shift, 0px)); }
.a-lock { font-size: 22px; opacity: 0.92; margin-bottom: 18px; }
.a-title { font-size: 24px; font-weight: 400; letter-spacing: 0.1px; }
.a-dots { height: 44px; margin-top: 26px; display: flex; align-items: center; justify-content: center; gap: 14px; }
.a-dots span { width: 12px; height: 12px; border-radius: 50%; background: #fff; animation: dotIn 0.16s ease-out; }
@keyframes dotIn { from { transform: scale(0.3); opacity: 0; } }
.a-dots.shake { animation: aShake 0.45s linear; }
@keyframes aShake { 0%, 100% { transform: none; } 15% { transform: translateX(-12px); } 35% { transform: translateX(10px); } 55% { transform: translateX(-7px); } 75% { transform: translateX(4px); } }
.a-error { min-height: 20px; margin-top: 4px; font-size: 14px; color: #ffb4ab; }
.a-pad { margin-top: auto; display: grid; grid-template-columns: repeat(3, var(--ak)); gap: var(--ag-y) var(--ag-x); --ak: min(23vw, 86px); --ag-x: min(6vw, 26px); --ag-y: min(2.2vh, 18px); }
.a-key { width: var(--ak); height: var(--ak); display: grid; place-items: center; color: #fff; touch-action: none; }
.a-key span { font-size: calc(var(--ak) * 0.42); line-height: 1; }
.a-key svg { width: calc(var(--ak) * 0.34); height: calc(var(--ak) * 0.34); }
.a-emergency { margin-top: 26px; color: #fff; }

/* Android puro: teclas tonales redondas que se vuelven «cuadradas» al tocar. */
.pixel .a-key { border-radius: 50%; background: rgba(232, 226, 245, 0.17); transition: border-radius 0.25s ease-out, background 0.25s ease-out; }
.pixel .a-key.pressed { border-radius: 28%; background: rgba(232, 226, 245, 0.32); transition: none; }
.pixel .a-del { background: rgba(232, 226, 245, 0.1); }
.pixel .a-ok { background: #d0bcff; color: #381e72; }
.pixel .a-ok.pressed { background: #e8ddff; }
.pixel .a-emergency { padding: 10px 22px; border-radius: 22px; background: rgba(232, 226, 245, 0.16); font-size: 15px; font-weight: 500; }

/* Samsung: números sueltos, sin fondo, y «OK» en texto. */
.samsung .a-title { font-size: 20px; }
.samsung .a-head { margin-top: calc(26% + var(--a-shift, 0px)); }
.samsung .a-dots span { width: 10px; height: 10px; }
.samsung .a-pad { --ak: min(24vw, 92px); --ag-x: min(4vw, 18px); --ag-y: min(1.2vh, 10px); }
.samsung .a-key { height: calc(var(--ak) * 0.8); border-radius: 18px; transition: background 0.3s; }
.samsung .a-key span { font-size: calc(var(--ak) * 0.4); font-weight: 300; }
.samsung .a-key.pressed { background: rgba(255, 255, 255, 0.14); transition: none; }
.samsung .samsung-ok span { font-size: calc(var(--ak) * 0.22); font-weight: 500; }
.samsung .a-ok:not(.ready) { opacity: 0.45; }
.samsung .a-emergency { font-size: 15px; opacity: 0.9; padding: 8px 14px; }
.lock.android { background: #000; }
.lock.android .a-wallpaper { inset: -80px; }

/* MARK: Instrucciones dentro de la app */

.help { color: #f2f2f7; font-size: 15px; line-height: 1.5; -webkit-user-select: text; user-select: text; padding-bottom: 20px; }
.help > h1:first-child, .help > p:nth-child(2) { display: none; }
.help h2 { font-size: 20px; margin: 22px 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--yellow); }
.help h3 { font-size: 16px; margin: 16px 0 6px; color: var(--yellow); }
.help p, .help li { margin: 0 0 8px; }
.help ul, .help ol { padding-left: 20px; margin: 0 0 10px; }
.help code { font-family: ui-monospace, Menlo, monospace; background: #3a3a3c; padding: 1px 5px; border-radius: 4px; }
.help table { width: 100%; border-collapse: collapse; margin: 6px 0 12px; font-size: 14px; }
.help th { text-align: left; background: #3a3a3c; padding: 6px 8px; }
.help td { padding: 6px 8px; border-bottom: 0.5px solid #3a3a3c; vertical-align: top; }
.help .nota { background: rgba(245, 197, 24, 0.12); border-left: 3px solid var(--yellow); padding: 8px 10px; border-radius: 0 8px 8px 0; margin: 8px 0 12px; }

/* El campo del código va arriba (el teclado no lo tapa) con «Pegar» al lado. */
.gate-field { display: flex; gap: 8px; }
.gate-field .gate-input { flex: 1; min-width: 0; -webkit-appearance: none; appearance: none; }
.gate-input::-webkit-search-cancel-button, .gate-input::-webkit-search-decoration { -webkit-appearance: none; }
.gate-paste { flex: none; padding: 0 16px; border-radius: 12px; background: #2c2c2e; color: #fff; font-weight: 600; font-size: 16px; }
/* La tarjeta del código nunca más ancha que la pantalla (el texto largo la estiraba). */
.gate { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.gate-card { width: 100%; min-width: 0; }
.gate-card > * { min-width: 0; max-width: 100%; }
.gate p { overflow-wrap: anywhere; }
.gate-input { width: 100%; font-size: 19px; letter-spacing: 0.5px; }
