/* Fuente propia (opcional): copia tu archivo a public/fonts/horario.ttf (y, si tiene, horario-bold.ttf). Si no existen, se usa la fuente del sistema. */
@font-face { font-family: 'HorarioFuente'; src: url('../fonts/horario.ttf') format('truetype'); font-weight: normal; font-style: normal; }
@font-face { font-family: 'HorarioFuente'; src: url('../fonts/horario-bold.ttf') format('truetype'); font-weight: bold; font-style: normal; }

/* Horario visual — CSS sencillo, con prefijos -webkit- para Safari de iOS 12. Unidad base: rem = alto/50 (la fija JS). */
html { font-size: 14px; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; background: #f4f7fb; color: #26324a;
  font-family: "HorarioFuente", -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
* { -webkit-box-sizing: border-box; box-sizing: border-box; }
button, input, select, textarea { font-family: inherit; }

#app { position: fixed; top: 0; left: 0; right: 0; bottom: 0; display: -webkit-box; display: -webkit-flex; display: flex;
  padding: constant(safe-area-inset-top) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#main { position: relative; -webkit-flex: 1 1 0; flex: 1 1 0; min-width: 0; padding: .8rem 1.4rem .6rem;
  background: -webkit-linear-gradient(top, var(--acc-bg, rgba(125,138,163,.1)) 0%, #f4f7fb 62%); background: linear-gradient(to bottom, var(--acc-bg, rgba(125,138,163,.1)) 0%, #f4f7fb 62%);
  -webkit-transition: background .8s ease; transition: background .8s ease; }
#content { height: 100%; display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column;
  opacity: 1; -webkit-transition: opacity .28s ease; transition: opacity .28s ease; }
#content.fading { opacity: 0; }
body.noanim #content { -webkit-transition: none; transition: none; }

#titleRow { text-align: center; min-height: 3.6rem; }
#actName { margin: 0; display: inline-block; position: relative; padding-bottom: .55rem; font-size: 3.1rem; line-height: 1.1; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: #1f2a44; }
#actName::after { content: ''; position: absolute; left: 12%; right: 12%; bottom: 0; height: .45rem; border-radius: .3rem; background: var(--acc, #7d8aa3); }
#subtitle { font-size: 1.7rem; color: #5b6b86; margin-top: .3rem; }

#stage { -webkit-flex: 1 1 0; flex: 1 1 0; min-height: 0; display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center; }
#pbox { position: relative; z-index: 0; }
#pbox::before { content: ''; position: absolute; z-index: -1; left: -14%; top: -14%; width: 128%; height: 128%; border-radius: 50%;
  background: -webkit-radial-gradient(center, circle closest-side, var(--acc-soft, rgba(125,138,163,.22)) 55%, rgba(255,255,255,0) 100%);
  background: radial-gradient(circle closest-side, var(--acc-soft, rgba(125,138,163,.22)) 55%, rgba(255,255,255,0) 100%); }
#pimg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: block;
  -webkit-filter: drop-shadow(0 .3rem .7rem rgba(40,60,100,.28)); filter: drop-shadow(0 .3rem .7rem rgba(40,60,100,.28)); -o-object-fit: contain; object-fit: contain; }
/* Capa de cobertura: va de translateY(-100%) a 0 (se mueve por JS según la hora real). */
#coverClip { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; }
#cover { position: absolute; top: 0; left: 0; width: 100%; height: calc(100% + 1.3rem);
  -webkit-transform: translateY(-100%); transform: translateY(-100%); will-change: transform; }
#marks { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; }
.mark { position: absolute; left: 0; right: 0; height: 0; }
.mark-line { position: absolute; left: 0; right: 0; top: -.07rem; height: 0; border-top: .14rem dashed rgba(255,255,255,.55);
  -webkit-filter: drop-shadow(0 0 .12rem rgba(30,40,60,.45)); filter: drop-shadow(0 0 .12rem rgba(30,40,60,.45)); }
.mark-dot { position: absolute; right: .8rem; top: -.65rem; width: 1.3rem; height: 1.3rem; border-radius: 50%;
  background: rgba(255,255,255,.45); border: .15rem solid rgba(125,138,163,.6); }
.mark.passed .mark-line { border-top-color: rgba(62,194,122,.7); }
.mark.passed .mark-dot { background: rgba(62,194,122,.9); border-color: rgba(255,255,255,.9); }
.mark.hit .mark-dot { -webkit-animation: hvpulse 1.1s ease-out 2; animation: hvpulse 1.1s ease-out 2; }
.mark.hit .mark-line { -webkit-animation: hvflash 1.1s ease-out 2; animation: hvflash 1.1s ease-out 2; }
@-webkit-keyframes hvpulse { 0% { -webkit-transform: scale(1); } 50% { -webkit-transform: scale(2.1); } 100% { -webkit-transform: scale(1); } }
@keyframes hvpulse { 0% { transform: scale(1); } 50% { transform: scale(2.1); } 100% { transform: scale(1); } }
@-webkit-keyframes hvflash { 0% { opacity: 1; } 50% { opacity: .35; } 100% { opacity: 1; } }
@keyframes hvflash { 0% { opacity: 1; } 50% { opacity: .35; } 100% { opacity: 1; } }

.secondary { display: -webkit-flex; display: flex; -webkit-justify-content: center; justify-content: center; -webkit-align-items: flex-start; align-items: flex-start;
  overflow: hidden; padding-top: .6rem; }
.secondary.n0 { display: none; }
.sec-item { text-align: center; margin: 0 .5rem; min-width: 0; max-width: 11rem; background: rgba(255,255,255,.8); border-radius: 1.2rem; padding: .45rem .6rem .35rem; box-shadow: 0 .15rem .6rem rgba(40,60,100,.12); }
.sec-item img { width: 4.6rem; height: 4.6rem; display: block; margin: 0 auto; border-radius: 1rem; }
.sec-item span { display: block; font-size: 1.4rem; font-weight: 600; margin-top: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.secondary.n5 .sec-item img, .secondary.n6 .sec-item img, .secondary.n7 .sec-item img { width: 4.4rem; height: 4.4rem; }
.secondary.n5 .sec-item, .secondary.n6 .sec-item, .secondary.n7 .sec-item { margin: 0 .4rem; max-width: 8.5rem; }

#info { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: space-between; justify-content: space-between; padding-top: .3rem; min-height: 4.4rem; }
#times { -webkit-flex: 1 1 0; flex: 1 1 0; white-space: nowrap; font-size: 1.8rem; font-weight: 600; color: #5b6b86; }
#counterWrap { -webkit-flex: 2 1 0; flex: 2 1 0; text-align: center; font-size: 2rem; color: #5b6b86; font-weight: 600; }
#counter { font-size: 3.6rem; font-weight: 800; color: #26324a; font-variant-numeric: tabular-nums; }
#nextCard { -webkit-flex: 1 1 0; flex: 1 1 0; display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: flex-end; justify-content: flex-end; }
#nextCard img { width: 3.6rem; height: 3.6rem; border-radius: .7rem; margin: 0 .6rem; background: #fff; }
.next-label { font-size: 1.5rem; color: #5b6b86; font-weight: 700; text-transform: uppercase; }
.next-name { font-size: 1.8rem; font-weight: 700; }
.next-time { font-size: 1.4rem; color: #5b6b86; margin-left: .5rem; }

#pbar { height: .9rem; border-radius: .5rem; background: #dfe7f2; margin-top: .6rem; overflow: hidden; }
#pbarFill { height: 100%; width: 100%; background: #7d8aa3; -webkit-transform-origin: 0 50%; transform-origin: 0 50%;
  -webkit-transform: scaleX(0); transform: scaleX(0); }

/* Columna lateral */
#side { width: 24%; -webkit-flex: 0 0 24%; flex: 0 0 24%; display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column;
  background: #e9eff8; border-left: .1rem solid #d8e1ef; }
#dayHead { padding: 1.1rem 1.2rem .7rem; text-align: center; }
#dayName { font-size: 2.6rem; font-weight: 800; color: #1f2a44; line-height: 1.1; text-transform: capitalize; }
#dayDate { font-size: 1.4rem; color: #6b7893; font-weight: 600; margin-top: .15rem; }
#sideScroll { -webkit-flex: 1 1 0; flex: 1 1 0; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: .4rem .9rem .9rem; }
.side-item { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; background: #fff; border-radius: 1.2rem;
  border: .3rem solid transparent; box-shadow: inset .5rem 0 0 var(--ic, #d5ddeb); padding: .5rem .7rem .5rem 1.1rem; margin-bottom: .7rem; position: relative; }
.side-item img { width: 4.2rem; height: 4.2rem; border-radius: .8rem; -webkit-flex: 0 0 auto; flex: 0 0 auto; }
.side-text { margin-left: .7rem; min-width: 0; -webkit-flex: 1 1 0; flex: 1 1 0; }
.side-name { font-size: 1.6rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-time { font-size: 1.3rem; color: #5b6b86; }
.side-check { display: none; -webkit-flex: 0 0 auto; flex: 0 0 auto; margin-left: .4rem; width: 2rem; height: 2rem; border-radius: 50%;
  background: #3ec27a; color: #fff; font-size: 1.4rem; line-height: 2rem; text-align: center; font-weight: 800; }
.side-item.done { opacity: .5; background: #eef2f8; }
.side-item.done .side-check { display: block; }
.side-item.current { border-color: var(--ic, #f08c1a); background: #fff; -webkit-transform: scale(1.03); transform: scale(1.03); box-shadow: inset .5rem 0 0 var(--ic, #f08c1a), 0 .3rem 1rem rgba(40,60,100,.2); }
.side-item.hidden { display: none; }
.side-empty { text-align: center; color: #5b6b86; padding: 2rem 0; font-size: 1.5rem; }

#gear { position: absolute; left: .8rem; bottom: .6rem; width: 4rem; height: 4rem; border: 0; border-radius: 50%; background: transparent;
  font-size: 2.2rem; color: #26324a; opacity: .4; padding: 0; }
#warn { position: absolute; left: 5rem; bottom: .9rem; width: 3rem; height: 3rem; border: 0; border-radius: 50%; background: #f08c1a; color: #fff; font-weight: 800; font-size: 1.8rem; padding: 0; opacity: .85; }

#boot { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: #f4f7fb; z-index: 5; text-align: center; padding-top: 30%; font-size: 2rem; color: #5b6b86; }

/* ---------- Modales ---------- */
#modalRoot { position: relative; z-index: 100; }
.modal-back { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(20,30,50,.55); z-index: 100; display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center; }
.modal-box { background: #fff; border-radius: 1.6rem; padding: 1.6rem 2rem; width: 38rem; max-width: 94%; max-height: 92%; overflow: hidden; text-align: center; font-size: 1.6rem; }
.modal-box.wide { width: 70rem; text-align: left; }
.modal-box h2 { margin: 0 0 1rem; font-size: 2.2rem; }
.modal-actions { margin-top: 1rem; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 3rem; -webkit-transform: translateX(-50%); transform: translateX(-50%); background: #26324a; color: #fff; padding: 1rem 1.6rem; border-radius: 1rem; z-index: 200; font-size: 1.6rem; max-width: 80%; }
.toast.ok { background: #1f7a4d; } .toast.warn { background: #b45f06; }

.gate-expr { font-size: 3rem; font-weight: 800; margin: .8rem 0; }
.gate-msg { color: #5b6b86; min-height: 2.2rem; font-size: 1.4rem; }
.gate-disp { font-size: 3.6rem; font-weight: 800; border-bottom: .3rem solid #dfe7f2; min-height: 5rem; margin: .6rem 3rem; }
.keypad { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: .6rem -.3rem 0; }
.key { width: 31%; margin: 1%; height: 5.6rem; font-size: 2.6rem; font-weight: 700; border: 0; border-radius: 1.2rem; background: #e6edf7; color: #26324a; }
.key:active { background: #cfdbee; }
.key.ok { background: #3d8bd9; color: #fff; } .key.alt { background: #f3d9d9; }

.picker-scroll { max-height: 55vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.picker-grid { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; }
.picker-item { width: 22%; margin: 1.5%; padding: .5rem; border: .25rem solid #dfe7f2; border-radius: 1rem; background: #fff; font-size: 1.2rem; }
.picker-item.sel { border-color: #f08c1a; }
.picker-item img { width: 100%; display: block; }

@media (prefers-reduced-motion: reduce) {
  #content { -webkit-transition: none; transition: none; }
  .mark.hit .mark-dot, .mark.hit .mark-line { -webkit-animation: none; animation: none; }
}
