@import url("assets/fonts.css");

/* Paleta y tipografia heredadas de parques-orlando-2026_4.html, adaptadas a
   pantalla de telefono: mas contraste, targets grandes y modo oscuro. */

:root {
  --paper: #e4e5db;
  --card: #f1f2ea;
  --card-2: #eaebe1;
  --ink: #14212a;
  --ink-2: #4b5d66;
  --ink-3: #7c8a90;
  --rule: #c5c6b6;
  --rule-soft: #d5d6c8;

  --disney: #2b5f9e;
  --universal: #166050;
  --clear: #2c7a4b;
  --block: #a5322a;
  --alert: #b5761a;
  --secret: #6b3f8f;

  --r: 4px;
  --r-lg: 10px;
  --fd: "Bricolage Grotesque", system-ui, -apple-system, sans-serif;
  --fb: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --fm: "DM Mono", ui-monospace, "SF Mono", Consolas, monospace;

  --tap: 44px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --bar-h: 58px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #10171d;
    --card: #182229;
    --card-2: #1e2a32;
    --ink: #e8eae2;
    --ink-2: #a3b1b8;
    --ink-3: #7b8990;
    --rule: #2d3c45;
    --rule-soft: #243139;

    --disney: #7cb0ea;
    --universal: #4fb99a;
    --clear: #5cc487;
    --block: #ef7f74;
    --alert: #e0a349;
    --secret: #b48ad6;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--fb);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

h1, h2, h3, h4 { font-family: var(--fd); font-weight: 800; line-height: 1.08; letter-spacing: -0.02em; }
/* Casi todos los enlaces son filas o botones: el subrayado sólo estorba.
   Se reserva para los enlaces que sí van dentro de un texto. */
a { color: inherit; text-decoration: none; }
.kv a, .doc-body a, .note a { text-decoration: underline; text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.mono { font-family: var(--fm); }
.eyebrow {
  font-family: var(--fm);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- layout ---------- */

#app { display: flex; flex-direction: column; min-height: 100dvh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: calc(var(--safe-t) + 8px) 14px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar h1 { font-size: 19px; flex: 1; min-width: 0; }
.topbar .sub { display: block; font: 400 11px/1.3 var(--fm); color: var(--ink-3); letter-spacing: 0.04em; }

.icon-btn {
  width: var(--tap);
  height: var(--tap);
  flex: 0 0 var(--tap);
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  background: var(--card);
  border-radius: var(--r);
  cursor: pointer;
}
.icon-btn:active { background: var(--card-2); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

main {
  flex: 1;
  padding: 14px 14px calc(var(--bar-h) + var(--safe-b) + 22px);
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--paper);
  border-top: 1px solid var(--rule);
  padding-bottom: var(--safe-b);
}
.tabbar a {
  min-height: var(--bar-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--ink-3);
  font: 500 10.5px/1 var(--fb);
  letter-spacing: 0.02em;
}
.tabbar a svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a[aria-current="page"] { color: var(--ink); }
.tabbar a[aria-current="page"] svg { stroke-width: 2.3; }

/* ---------- piezas ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 14px;
  margin-bottom: 12px;
}
.card > h2, .card > h3 { font-size: 17px; margin-bottom: 8px; }
.card p + p { margin-top: 8px; }

.section-h {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 20px 2px 10px;
}
.section-h h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; }
.section-h .count { font: 400 12px var(--fm); color: var(--ink-3); }
main > .section-h:first-child { margin-top: 4px; }

.rows { border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; background: var(--card); margin-bottom: 12px; }
.row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  min-height: var(--tap);
  border-bottom: 1px solid var(--rule-soft);
  width: 100%;
  text-align: left;
  background: none;
  border-left: 0; border-right: 0; border-top: 0;
  cursor: pointer;
}
.row:last-child { border-bottom: 0; }
.row:active { background: var(--card-2); }
.row-main { flex: 1; min-width: 0; }
.row-main strong { display: block; font-weight: 600; }
.row-main small { display: block; color: var(--ink-2); font-size: 13px; }
.row .chev { color: var(--ink-3); flex: 0 0 auto; }

.tag {
  display: inline-block;
  font: 500 11px/1.4 var(--fm);
  padding: 2px 7px;
  border: 1px solid var(--rule);
  border-radius: 99px;
  color: var(--ink-2);
  background: var(--card-2);
  white-space: nowrap;
}
.tag.ok { color: var(--clear); border-color: color-mix(in srgb, var(--clear) 45%, transparent); }
.tag.no { color: var(--block); border-color: color-mix(in srgb, var(--block) 45%, transparent); }
.tag.warn { color: var(--alert); border-color: color-mix(in srgb, var(--alert) 45%, transparent); }
.tag.disney { color: var(--disney); border-color: color-mix(in srgb, var(--disney) 45%, transparent); }
.tag.universal { color: var(--universal); border-color: color-mix(in srgb, var(--universal) 45%, transparent); }
.tag.secret { color: var(--secret); border-color: color-mix(in srgb, var(--secret) 45%, transparent); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }

.chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid var(--rule);
  background: var(--card);
  border-radius: 99px;
  font: 500 13.5px var(--fb);
  cursor: pointer;
  white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.field {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--rule);
  background: var(--card);
  border-radius: var(--r);
  padding: 0 10px;
  min-height: var(--tap);
}
.field label { font: 500 11px var(--fm); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.field input, .field select {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  padding: 10px 0;
  font-size: 16px; /* 16px evita el zoom automatico de iOS/Android al enfocar */
}
.field input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

.btn {
  min-height: var(--tap);
  padding: 10px 16px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r);
  font-weight: 600;
  cursor: pointer;
}
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--rule); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

.copy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--fm);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.06em;
  border: 1px dashed var(--rule);
  background: var(--card-2);
  border-radius: var(--r);
  padding: 9px 12px;
  min-height: var(--tap);
  cursor: pointer;
}
.copy svg { width: 15px; height: 15px; stroke: var(--ink-3); fill: none; stroke-width: 1.8; }
.copy.done { border-style: solid; border-color: var(--clear); color: var(--clear); }

.kv { display: grid; grid-template-columns: minmax(96px, 34%) 1fr; gap: 6px 12px; font-size: 14.5px; }
.kv dt { color: var(--ink-3); font: 500 11.5px/1.5 var(--fm); text-transform: uppercase; letter-spacing: 0.06em; padding-top: 2px; }
.kv dd { color: var(--ink); }

.note { font-size: 13.5px; color: var(--ink-2); }
.muted { color: var(--ink-3); }
.empty { text-align: center; color: var(--ink-3); padding: 40px 20px; font-size: 14.5px; }

.banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--alert);
  background: var(--card);
  border-radius: var(--r);
  padding: 10px 12px;
  font-size: 13.5px;
  margin-bottom: 12px;
}
.banner.secret { border-left-color: var(--secret); }
.banner.bad { border-left-color: var(--block); }

/* ---------- hoy ---------- */

.hero { border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--card); padding: 16px; margin-bottom: 12px; }
.hero .date { font: 500 12px var(--fm); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.hero h2 { font-size: clamp(26px, 8vw, 34px); margin: 6px 0 4px; }
.hero .sub { color: var(--ink-2); font-size: 14.5px; }
.hero .facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.wx { display: flex; align-items: center; gap: 14px; }
.wx .temp { font-family: var(--fd); font-size: 38px; font-weight: 800; line-height: 1; }
.wx .wx-main { flex: 1; min-width: 0; }
.wx .wx-desc { font-weight: 600; }
.wx-hours { display: flex; gap: 10px; overflow-x: auto; margin-top: 12px; padding-bottom: 4px; scrollbar-width: none; }
.wx-hours::-webkit-scrollbar { display: none; }
.wx-hour { flex: 0 0 auto; text-align: center; font-size: 12px; color: var(--ink-2); min-width: 46px; }
.wx-hour b { display: block; font: 500 13px var(--fm); color: var(--ink); }
.wx-hour .rain { color: var(--disney); font-size: 11px; }

.waits { display: flex; flex-direction: column; gap: 1px; }
.wait { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rule-soft); }
.wait:last-child { border-bottom: 0; }
.wait .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.wait .m { font: 500 15px var(--fm); }
.wait.closed .m, .wait.closed .n { color: var(--ink-3); }

/* ---------- dia ---------- */

.day-block { margin-top: 16px; }
.day-block > h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); margin-bottom: 8px; }
.day-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.day-list li { padding-left: 16px; position: relative; font-size: 14.5px; }
.day-list li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3); }

.attr-line { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.attr-line .name { font-weight: 600; font-size: 14.5px; }
.show-line { display: flex; flex-direction: column; gap: 2px; }
.show-line .times { font: 400 12.5px var(--fm); color: var(--ink-2); }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: var(--rule); }
.tl-item { position: relative; margin-bottom: 10px; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -21px; top: 16px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink-3);
}
.tl-item.is-today::before { background: var(--block); border-color: var(--block); }
.tl-item.is-past { opacity: 0.62; }
.tl-item.k-cruise::before { border-color: var(--secret); }
.tl-item.k-park::before { border-color: var(--disney); }

/* ---------- parques ---------- */

.attr {
  border: 1px solid var(--rule);
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 11px 13px;
  margin-bottom: 8px;
}
.attr.ok { border-left: 3px solid var(--clear); }
.attr.no { border-left: 3px solid var(--block); opacity: 0.75; }
.attr-head { display: flex; gap: 10px; align-items: flex-start; }
.attr-head h4 { flex: 1; font-size: 15.5px; font-family: var(--fb); font-weight: 600; letter-spacing: 0; }
.attr .desc { font-size: 13.5px; color: var(--ink-2); margin-top: 6px; }
.attr .verdict { font: 500 12.5px var(--fm); margin-top: 6px; }
.attr .verdict.ok { color: var(--clear); }
.attr .verdict.no { color: var(--block); }
.h-chip { font: 500 12.5px var(--fm); white-space: nowrap; }

.stars { color: var(--alert); font-size: 13px; letter-spacing: 0.05em; }

/* ---------- documentos ---------- */

.doc-body {
  white-space: pre-wrap;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-2);
  max-height: 60vh;
  overflow: auto;
  border-top: 1px solid var(--rule-soft);
  margin-top: 10px;
  padding-top: 10px;
  overflow-wrap: anywhere;
}
.pages { display: grid; gap: 10px; }
.pages img { width: 100%; border: 1px solid var(--rule); border-radius: var(--r); background: #fff; }

/* tablas y bloques anchos nunca desbordan la pagina */
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- login ---------- */

#login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px calc(16px + env(safe-area-inset-left, 0px));
}
#login .box { width: 100%; max-width: 340px; }
#login .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
#login .brand img { width: 52px; height: 52px; border-radius: 12px; }
#login h1 { font-size: 25px; }
#login .field { margin-bottom: 10px; }
#login .btn { width: 100%; margin-top: 6px; }
#login .err { color: var(--block); font-size: 13.5px; margin-top: 10px; min-height: 20px; }

/* ---------- estado de datos ---------- */

.sync {
  font: 400 11px var(--fm);
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 5px;
}
.sync .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--clear); flex: 0 0 auto; }
.sync.stale .dot { background: var(--alert); }
.sync.offline .dot { background: var(--block); }

.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--rule);
  border-top-color: var(--ink-2);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- hoja modal ---------- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--ink) 45%, transparent);
  display: flex;
  align-items: flex-end;
}
.sheet-in {
  background: var(--paper);
  width: 100%;
  max-height: 82dvh;
  overflow: auto;
  border-radius: 16px 16px 0 0;
  padding: 8px 14px calc(20px + var(--safe-b));
  border-top: 1px solid var(--rule);
}
.sheet-grab { width: 38px; height: 4px; border-radius: 99px; background: var(--rule); margin: 6px auto 12px; }
