/* Clock web: copia del Reloj de iOS 26 (medidas tomadas de capturas del iPhone 16 de Ariel,
   393 × 852 pt; 1 px de CSS = 1 pt) y el menú secreto, al estilo de los Ajustes del iPhone. */
:root {
  --app-h: 100dvh;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  --green: #30d158;
  --green-fill: #0d3315;
  --red: #ff453a;
  --red-fill: #330f0f;
  --gray-fill: #333333;
  --gray-off: #1c1c1c;
  --sep: #303030;
  --orange: #ff9f0a;
  --muted: #8c8c8c;
  --cell: #1c1c1e;
  --cell-line: #38383a;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: var(--app-h); background: #000; color: #fff; overflow: hidden; }
body {
  font: 17px/1.25 -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  position: relative; overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* MARK: Pestañas */
#app { position: absolute; inset: 0; }
.page { position: absolute; inset: 0; overflow: hidden; display: none; }
.page.on { display: block; }
.scroll { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-top: var(--top); padding-bottom: 120px; }
.scroll::-webkit-scrollbar { display: none; }

.tabbar {
  position: absolute; left: 21px; right: 21px; bottom: calc(max(var(--bottom), 34px) - 11px); height: 60px;
  display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; padding: 0 4px;
  border-radius: 30px; z-index: 5;
  background: rgba(28, 28, 30, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%);
  box-shadow: inset 0 0.5px 0 rgba(255,255,255,0.22), inset 0 0 0 0.5px rgba(255,255,255,0.08), 0 8px 30px rgba(0,0,0,0.5);
}
.tabbar button {
  height: 52px; border-radius: 26px; display: grid; justify-items: center; align-content: center; gap: 2px;
  color: #fff; font-size: 10.5px; font-weight: 600; letter-spacing: 0.1px; touch-action: manipulation;
}
.tabbar button.on { color: var(--orange); background: rgba(255,255,255,0.11); }
.tabbar svg { width: 25px; height: 25px; display: block; }

/* Encabezado de Reloj mundial, Alarmas y Temporizadores: botones de vidrio y título grande. */
.head { padding: 8px 16px 0; }
.head-row { display: flex; justify-content: space-between; align-items: center; height: 44px; }
.glass {
  height: 44px; min-width: 44px; padding: 0 16px; border-radius: 22px; display: inline-grid; place-items: center;
  background: rgba(40, 40, 42, 0.8); color: #fff; font-size: 17px;
  box-shadow: inset 0 0.5px 0 rgba(255,255,255,0.25), inset 0 0 0 0.5px rgba(255,255,255,0.06);
}
.glass.round { padding: 0; width: 44px; }
.glass svg { width: 19px; height: 19px; }
.title { font-size: 34px; font-weight: 700; margin: 18px 0 0; letter-spacing: 0.3px; }
.sep { height: 0.5px; background: var(--sep); }

/* MARK: Cronómetro */
.sw { position: absolute; inset: 0; }
.faces {
  position: absolute; left: 0; right: 0; top: calc(var(--app-h) * 0.15); height: calc(var(--app-h) * 0.29);
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.faces::-webkit-scrollbar { display: none; }
.face { flex: 0 0 100%; scroll-snap-align: center; position: relative; display: grid; place-items: center; }
.digits {
  font-size: min(90px, 22.9vw); font-weight: 100; letter-spacing: -0.5px; white-space: nowrap;
  font-variant-numeric: tabular-nums; transform: translateY(6px);
}
.dial { width: 100%; height: 100%; }
.rehearsal { position: absolute; top: 4px; left: 20px; right: 20px; text-align: center; color: #ffd60a; font-size: 11px; }

.controls {
  position: absolute; left: 16px; right: 16px; top: calc(var(--app-h) * 0.509 - 42px); height: 84px;
  display: flex; justify-content: space-between; align-items: center;
}
.cbtn {
  width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 18px;
  touch-action: manipulation; transition: opacity 0.1s;
}
.cbtn.pressed { opacity: 0.6; }
.cbtn:disabled { cursor: default; }
.dots { display: flex; gap: 10px; }
.dots i { width: 7.5px; height: 7.5px; border-radius: 50%; background: #808080; }
.dots i.on { background: #fff; }
.dots.hint i:not(.on) { background: #9e9e9e; }

.laps {
  position: absolute; left: 16px; right: 16px; top: calc(var(--app-h) * 0.509 + 58px); bottom: 0;
  overflow-y: auto; border-top: 0.5px solid var(--sep); padding-bottom: 100px; scrollbar-width: none;
}
.laps::-webkit-scrollbar { display: none; }
.lap { display: flex; justify-content: space-between; align-items: center; height: 43.5px; border-bottom: 0.5px solid var(--sep); font-size: 18px; }
.lap.fast { color: var(--green); }
.lap.slow { color: var(--red); }

/* MARK: Reloj mundial */
.city { display: flex; align-items: center; justify-content: space-between; height: 95px; border-bottom: 0.5px solid var(--sep); }
.city small { display: block; font-size: 15px; color: #8c8c8c; margin-bottom: 4px; }
.city b { font-size: 26px; font-weight: 400; }
.city .clock { font-size: 58px; font-weight: 100; font-variant-numeric: tabular-nums; letter-spacing: -0.5px; }

/* MARK: Alarmas */
.section-label { display: flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 600; }
.alarm { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 0.5px solid var(--sep); }
.alarm .big { font-size: 58px; font-weight: 100; line-height: 1.1; font-variant-numeric: tabular-nums; }
.alarm small { font-size: 13px; display: block; }
.alarm.off { color: #8c8c8c; }
.pill { font-size: 13px; font-weight: 600; color: var(--orange); background: #2b2b2b; border-radius: 14px; padding: 6px 10px; }
.switch {
  position: relative; width: 51px; height: 31px; border-radius: 16px; background: #39393d; flex: 0 0 auto; transition: background 0.2s;
}
.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.3); }
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(20px); }

/* MARK: Temporizadores */
.wheel { position: relative; height: 216px; margin: 70px 16px 0; }
.wheel .band { position: absolute; left: 0; right: 0; top: 92px; height: 32px; border-radius: 8px; background: rgba(255,255,255,0.1); pointer-events: none; }
.wheel .cols { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); padding: 0 8px; }
.wheel .col {
  overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; height: 216px;
  -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
  mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
}
.wheel .col::-webkit-scrollbar { display: none; }
.wheel .col div { height: 32px; line-height: 32px; scroll-snap-align: center; font-size: 23px; width: 42%; text-align: right; }
.wheel .col div.pad { scroll-snap-align: none; }
.wheel .unit { position: absolute; top: 92px; line-height: 32px; font-size: 17px; font-weight: 600; pointer-events: none; }
.tbtns { display: flex; justify-content: space-between; margin: 14px 16px 0; }
.group { margin: 34px 16px 0; background: #1c1c1c; border-radius: 26px; padding: 0 16px; }
.group .row { display: flex; justify-content: space-between; align-items: center; height: 52px; }
.group .row + .row { border-top: 0.5px solid var(--sep); }
.recent { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 0.5px solid var(--sep); color: #8c8c8c; }
.play { width: 58px; height: 58px; border-radius: 50%; background: var(--green-fill); display: grid; place-items: center; }
.play svg { width: 22px; height: 22px; fill: var(--green); }

/* MARK: Menú secreto (estilo Ajustes del iPhone, siempre oscuro) */
.secret {
  position: absolute; inset: 0; z-index: 20; background: #000; overflow: hidden;
  transform: translateY(100%); transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.secret.open { transform: none; }
.screen { position: absolute; inset: 0; background: #000; transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1); }
.screen.under { transform: translateX(-30%); }
.screen.right { transform: translateX(100%); }
.nav {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2; padding-top: var(--top); height: calc(var(--top) + 52px);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding-left: 12px; padding-right: 12px;
  background: rgba(0,0,0,0.85); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.nav h1 { margin: 0; font-size: 17px; font-weight: 600; text-align: center; white-space: nowrap; }
.nav .l { justify-self: start; }
.nav .r { justify-self: end; }
.nav-btn { color: var(--orange); font-size: 17px; height: 40px; min-width: 40px; display: inline-flex; align-items: center; gap: 2px; }
.nav-btn svg { width: 22px; height: 22px; }
.body { position: absolute; inset: 0; overflow-y: auto; padding: calc(var(--top) + 60px) 16px calc(var(--bottom) + 40px); -webkit-user-select: none; }
.body::-webkit-scrollbar { display: none; }

.card { background: var(--cell); border-radius: 22px; padding: 16px; }
.card + .card, .card + .block, .block + .card, .block + .block { margin-top: 22px; }
.block h3 { margin: 0 4px 2px; font-size: 20px; font-weight: 700; }
.block .cap { margin: 0 4px 10px; font-size: 13px; color: var(--muted); }
.now { display: flex; gap: 14px; align-items: flex-start; }
.now.active { background: rgba(255,159,10,0.16); box-shadow: inset 0 0 0 1px rgba(255,159,10,0.5); }
.now .what { flex: 1; min-width: 0; }
.now small { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.now b { display: block; font-size: 20px; font-weight: 600; margin: 4px 0 2px; }
.now span { font-size: 15px; color: var(--muted); }
.badge { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; font-size: 18px; }
.btn-clear { color: var(--red); background: rgba(255,69,58,0.18); border-radius: 10px; padding: 7px 12px; font-size: 15px; font-weight: 500; }

.typed { display: flex; gap: 8px; align-items: center; min-height: 44px; overflow-x: auto; scrollbar-width: none; }
.typed .t { font-size: 34px; font-weight: 300; font-variant-numeric: tabular-nums; white-space: nowrap; }
.typed .t.empty { color: #666; }
.chip { background: #333; border-radius: 16px; padding: 6px 10px; display: inline-flex; gap: 6px; align-items: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip button { color: #999; font-size: 15px; }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.keys button { height: 50px; border-radius: 12px; background: #3d3d3d; font-size: 26px; touch-action: manipulation; }
.keys button.del { background: #292929; }
.keys button.enter { background: var(--orange); font-size: 17px; font-weight: 700; }
.keys button:disabled { opacity: 0.5; }
.keys button:active { filter: brightness(1.4); }
.kinds { display: flex; gap: 8px; margin-top: 14px; }
.kinds button { flex: 1; min-height: 56px; border-radius: 14px; display: grid; place-content: center; text-align: center; }
.kinds b { font-size: 17px; }
.kinds small { font-size: 11px; opacity: 0.85; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--cell); border-radius: 22px; padding: 14px; text-align: left; display: grid; gap: 10px; }
.tile b { font-size: 17px; }
.tile small { display: block; font-size: 12px; color: var(--muted); min-height: 30px; }
.link-row { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; }
.link-row .what { flex: 1; }
.link-row small { display: block; color: var(--muted); font-size: 15px; }
.chev { color: #5a5a5e; font-size: 22px; }

/* Listas agrupadas */
.list-h { margin: 22px 16px 7px; font-size: 13px; color: var(--muted); text-transform: uppercase; }
.list { background: var(--cell); border-radius: 12px; overflow: hidden; }
.list > * + * { border-top: 0.5px solid var(--cell-line); }
.list-f { margin: 7px 16px 0; font-size: 13px; color: var(--muted); }
.cell { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 8px 16px; width: 100%; text-align: left; }
.cell .grow { flex: 1; min-width: 0; }
.cell .val { color: var(--muted); }
.cell.action { color: var(--orange); }
.cell.danger { color: var(--red); }
.cell small { display: block; font-size: 13px; color: var(--muted); }
.cell select { background: transparent; border: 0; color: var(--muted); text-align: right; font-size: 17px; max-width: 60%; -webkit-appearance: none; appearance: none; }
.cell input[type=text], .cell input[type=search] { background: transparent; border: 0; flex: 1; outline: none; font-size: 17px; }
.stepper { display: inline-flex; background: #333; border-radius: 9px; overflow: hidden; }
.stepper button { width: 46px; height: 32px; font-size: 20px; }
.stepper button + button { border-left: 0.5px solid #555; }
.seg { display: flex; background: #2c2c2e; border-radius: 9px; padding: 2px; gap: 2px; }
.seg button { flex: 1; height: 30px; border-radius: 7px; font-size: 13px; font-weight: 500; }
.seg button.on { background: #636366; }
.big-btn { width: 100%; height: 54px; border-radius: 14px; background: var(--orange); font-size: 17px; font-weight: 600; margin-top: 22px; }
.big-btn:disabled { opacity: 0.4; }
.check { color: var(--orange); width: 20px; }

/* Carta */
.cards { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.suits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.cards button, .suits button { height: 40px; border-radius: 8px; background: #333; font-size: 20px; font-weight: 500; }
.suits button.red { color: #ff453a; }
.cards button.on, .suits button.on { background: #fff; color: #000; }
.pick { display: flex; justify-content: space-between; align-items: baseline; }
.pick b { font-size: 34px; font-weight: 600; }
.pick span { color: var(--muted); font-size: 20px; }

/* Fecha y hora */
.preview { display: flex; gap: 6px; margin-top: 8px; }
.preview div { flex: 1; background: #2e2e2e; border-radius: 10px; padding: 8px 0; text-align: center; }
.preview b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.preview small { font-size: 11px; color: var(--muted); }
.mini { font-size: 15px; color: var(--muted); }
.order { display: flex; gap: 4px; }
.order button { width: 32px; height: 32px; border-radius: 8px; background: #333; color: #ddd; }
.order button.x { color: var(--red); }

/* Peek */
.peek-row { display: flex; align-items: center; gap: 8px; }
.peek-row .n { color: var(--muted); width: 50px; }
.peek-row .grow { flex: 1; }
.peek-row button { background: #333; border-radius: 8px; padding: 4px 10px; font-size: 22px; font-variant-numeric: tabular-nums; }
.peek-res b { font-size: 34px; font-variant-numeric: tabular-nums; display: block; }

/* Código del reloj */
.pair { font: 600 40px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 6px; text-align: center; padding: 8px 0; }

/* Instrucciones */
.doc { font-size: 15px; line-height: 1.45; -webkit-user-select: text; user-select: text; }
.doc h4 { font-size: 17px; margin: 18px 0 6px; }
.doc p, .doc li { color: #ddd; }
.doc ul { padding-left: 20px; }

/* MARK: Activación (pantalla de código de acceso) */
.gate { position: absolute; inset: 0; z-index: 30; background: #000; display: grid; place-items: start center; overflow-y: auto; padding: calc(var(--top) + 40px) 24px 40px; }
.gate-card { width: min(100%, 380px); display: grid; gap: 14px; }
.gate-logo { width: 72px; height: 72px; border-radius: 17px; justify-self: center; overflow: hidden; }
.gate-logo img { width: 100%; height: 100%; display: block; }
.gate h2 { margin: 0; text-align: center; font-size: 26px; }
.gate p, .gate li { color: #c7c7cc; font-size: 16px; line-height: 1.4; }
.gate ol { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.gate-field { display: flex; gap: 8px; }
.gate-input { flex: 1; min-width: 0; background: #1c1c1e; border: 1px solid #38383a; border-radius: 12px; padding: 14px; font: 600 19px ui-monospace, Menlo, monospace; letter-spacing: 1px; text-transform: uppercase; outline: none; -webkit-user-select: text; user-select: text; }
.gate-paste { background: #2c2c2e; border-radius: 12px; padding: 0 14px; color: var(--orange); }
.gate-button { height: 52px; border-radius: 14px; background: var(--orange); color: #000; font-weight: 700; font-size: 17px; }
.gate-button:disabled { opacity: 0.5; }
.gate-status { min-height: 22px; font-size: 15px; color: #c7c7cc; text-align: center; }
.gate-status.error { color: var(--red); }
.gate-status.warn { color: #ffd60a; }
.share-icon { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; }

/* Instrucciones y bienvenida */
.doc .lead { font-size: 17px; color: #fff; margin-top: 4px; }
.doc b { color: #fff; }
.welcome { position: absolute; inset: 0; z-index: 25; background: rgba(0,0,0,0.82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); display: grid; place-items: center; padding: 24px; }
.welcome-card { width: min(100%, 360px); background: #1c1c1e; border-radius: 26px; padding: 26px 22px 20px; display: grid; gap: 14px; text-align: center; }
.welcome-card h2 { margin: 0; font-size: 22px; }
.welcome-card p { margin: 0; color: #c7c7cc; font-size: 16px; line-height: 1.4; }
.welcome-card .tap { font-size: 40px; }
.welcome-card button { height: 50px; border-radius: 14px; font-weight: 600; font-size: 17px; }
.welcome-card .primary { background: var(--orange); color: #000; }
.welcome-card .secondary { color: var(--orange); }
