/* =====================================================================
   SAT Display Board - styles
   White screen, SAT colours: gold #E4AF3D, cyan #39C4E3, ink #0F1E33
   ===================================================================== */
:root {
  --ink: #0F1E33;
  --ink-2: #4A5568;
  --muted: #5B6778;
  --faint: #8A94A3;
  --line: #E3E7ED;
  --line-2: #EDF0F4;
  --soft: #F4F6F9;
  --gold: #E4AF3D;
  --cyan: #39C4E3;
  --board-bg: #FFFFFF;
}

html, body { height: 100%; }
body { margin: 0; background: #FFFFFF; color: var(--ink); font-family: Inter, "IBM Plex Sans Arabic", system-ui, sans-serif; }
[lang="ar"] body, body[dir="rtl"], .ar { font-family: "IBM Plex Sans Arabic", Tahoma, sans-serif; }
.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- setup */
.setup-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px clamp(20px, 3vw, 56px); border-bottom: 4px solid var(--gold); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 20px; }
.brand img { height: 56px; width: auto; display: block; }
.brand .sep { width: 2px; height: 58px; background: var(--line); }
.brand h1 { margin: 0; font-family: "Space Grotesk", Inter, sans-serif; font-weight: 700; font-size: clamp(28px, 2.6vw, 44px); line-height: 1; }
.brand p { margin: 8px 0 0; color: var(--muted); font-size: clamp(15px, 1.1vw, 20px); }
.setup-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 520px); gap: 40px; padding: 32px clamp(20px, 3vw, 56px) 40px; }
@media (max-width: 1100px) { .setup-main { grid-template-columns: minmax(0, 1fr); } }
.step { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; font-size: clamp(22px, 1.6vw, 30px); font-weight: 700; }
.step span { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 19px; flex: none; }
.search { display: flex; align-items: center; gap: 12px; height: 58px; padding: 0 18px; border: 1.5px solid #C5CDD8; border-radius: 14px; }
.search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(57, 196, 227, .35); }
.search input { flex: 1; border: 0; outline: none; font-size: 20px; background: transparent; color: var(--ink); min-width: 0; }
.stations { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 22px; }
.pick { text-align: start; padding: 16px 20px; border-radius: 16px; background: #fff; border: 1.5px solid var(--line); display: flex; align-items: center; gap: 16px; min-height: 84px; cursor: pointer; color: var(--ink); width: 100%; }
.pick:hover { border-color: #C5CDD8; }
.pick:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.pick .radio { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 2px solid #C5CDD8; box-sizing: border-box; }
.pick.on { border: 3px solid var(--cyan); box-shadow: 0 6px 18px rgba(15, 30, 51, .08); }
.pick.on .radio { border: 8px solid var(--ink); }
.pick b { display: block; font-size: 21px; line-height: 1.2; }
.pick small { display: block; font-size: 15px; color: var(--muted); margin-top: 3px; }
.langs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.langs .pick { flex-direction: column; justify-content: center; text-align: center; min-height: 118px; gap: 4px; }
.langs .pick b { font-size: 32px; }
.summary { margin-top: 26px; border-radius: 20px; background: var(--soft); padding: 26px 28px; }
.summary .lbl { font-size: 16px; font-weight: 600; color: var(--muted); }
.summary .big { font-family: "Space Grotesk", Inter, sans-serif; font-size: clamp(26px, 2vw, 36px); font-weight: 700; margin-top: 10px; line-height: 1.15; }
.summary .sub { font-size: 19px; color: var(--ink-2); margin-top: 6px; }
.summary ul { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; font-size: 17px; color: var(--ink-2); }
.summary li::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); margin-inline-end: 12px; }
.remember { display: flex; align-items: center; gap: 12px; margin-top: 22px; font-size: 18px; }
.remember input { width: 24px; height: 24px; accent-color: var(--ink); }
.btn-start { margin-top: 20px; height: 80px; width: 100%; border: 0; border-radius: 18px; background: var(--ink); color: #fff; font-size: 26px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 14px; }
.btn-start:hover { background: #1b2f4d; }
.btn-start:disabled { background: #9AA4B2; }
.btn-start:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.autostart { margin-top: 14px; font-size: 16px; color: var(--muted); text-align: center; }
.empty-box { border: 1.5px dashed #C5CDD8; border-radius: 16px; padding: 28px; color: var(--muted); font-size: 18px; margin-top: 22px; }

/* ---------------------------------------------------------------- board */
body.board-page { background: #05090f; overflow: hidden; }
#stage { position: absolute; top: 50%; left: 50%; width: 1920px; height: 1080px; transform-origin: center; background: var(--board-bg); display: flex; flex-direction: column; overflow: hidden; }

.b-head { height: 124px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 56px; border-bottom: 4px solid var(--gold); }
.b-head .brand h1 { font-size: 46px; }
.b-head .brand p { font-size: 21px; }
.b-dates { text-align: center; }
.b-dates .g { font-size: 25px; font-weight: 600; }
.b-dates .h { font-size: 20px; color: var(--muted); margin-top: 6px; }
.b-clock { direction: ltr; display: flex; align-items: baseline; gap: 8px; }
.b-clock .hm { font-size: 76px; font-weight: 600; line-height: 1; font-family: "Space Grotesk", Inter, sans-serif; }
.b-clock .s { font-size: 28px; color: var(--faint); }
[dir="rtl"] .b-clock .hm { font-family: "IBM Plex Sans Arabic", sans-serif; }

.b-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 520px; gap: 36px; padding: 26px 48px 20px; }
.b-board { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; min-height: 0; }
.b-cols, .r { display: grid; grid-template-columns: 124px minmax(0, 1fr) 96px 120px 134px 196px; align-items: center; padding: 0 28px; }
.b-cols { height: 52px; flex: none; background: var(--soft); font-size: 18px; font-weight: 600; color: var(--muted); }
.b-rows { flex: 1; min-height: 0; display: grid; grid-template-rows: repeat(var(--rows, 9), minmax(0, 1fr)); }
.r { border-top: 1px solid var(--line-2); min-height: 0; transition: background-color .6s; }
.r:nth-child(even) { background: #FAFBFC; }
.r-time { font-size: 38px; font-weight: 600; line-height: 1; }
.r-time s { display: block; font-size: 17px; color: var(--faint); font-weight: 500; margin-top: 4px; }
.r-dest { min-width: 0; padding-inline-end: 20px; }
.r-city { font-size: 32px; font-weight: 700; line-height: 1.12; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-via { display: flex; align-items: center; flex-wrap: nowrap; overflow: hidden; margin-top: 6px; font-size: 16px; color: var(--muted); white-space: nowrap; }
.r-via .l { font-weight: 600; color: var(--faint); margin-inline-end: 10px; font-size: 14px; letter-spacing: .02em; }
.r-via .dot { width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--cyan); box-sizing: border-box; margin-inline-end: 6px; flex: none; }
.r-via .ln { width: 14px; height: 2px; background: #CFD6DF; margin: 0 6px; flex: none; }
.r-via .more { margin-inline-start: 8px; padding: 1px 9px; border-radius: 20px; background: #EEF1F5; font-size: 14px; font-weight: 600; color: var(--ink-2); flex: none; }
.r-code { font-size: 22px; color: var(--ink-2); }
.cls { display: inline-block; padding: 4px 14px; border-radius: 8px; font-size: 17px; font-weight: 700; border: 1.5px solid #C5CDD8; color: var(--ink-2); }
.cls.vip { background: var(--ink); color: #fff; border-color: var(--ink); }
.r-arr { font-size: 24px; font-weight: 500; direction: ltr; }
[dir="rtl"] .r-arr { text-align: right; }
.r-arr small { font-size: 15px; color: var(--faint); margin-left: 6px; }
.st { display: inline-flex; align-items: center; gap: 9px; padding: 7px 16px; border-radius: 30px; font-size: 19px; font-weight: 700; white-space: nowrap; background: #DDF4FA; color: #0B5E73; }
.st::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.st.boarding { background: #FBEBC6; color: #7A4A00; }
.st.boarding::before, .st.departing::before { animation: blink 1s infinite; }
.st.departing { background: #FFE1CC; color: #8A3300; }
.st.changed { background: #E8E4FB; color: #4B2DA8; }
.st.cancel { background: #FDE2E2; color: #A11D1D; }
.r.is-cancel .r-city, .r.is-cancel .r-time { color: var(--faint); text-decoration: line-through; text-decoration-thickness: 2px; }
.r.flash { animation: flash 1.2s ease-in-out 6; }
.b-empty { grid-row: 1 / -1; display: flex; align-items: center; justify-content: center; font-size: 30px; color: var(--muted); }

.b-foot { height: 44px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-top: 1px solid var(--line); background: var(--soft); font-size: 16px; color: var(--muted); }
.dots { display: flex; gap: 8px; align-items: center; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: #C5CDD8; }
.dots i.on { background: var(--ink); width: 26px; border-radius: 6px; }
.conn { display: inline-flex; align-items: center; gap: 8px; }
.conn::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #2FA36B; }
.conn.off { color: #A11D1D; font-weight: 600; }
.conn.off::before { background: #D33; }

.b-side { display: flex; flex-direction: column; gap: 22px; min-height: 0; }
.bcard { border: 1px solid var(--line); border-radius: 20px; padding: 24px 30px; }
.bcard-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.bcard-h b { font-size: 23px; }
.bcard-h span { font-size: 15px; color: var(--faint); }
.wx-now { display: flex; align-items: center; gap: 24px; margin-top: 14px; }
.wx-now svg { width: 96px; height: 96px; flex: none; }
.wx-temp { font-size: 80px; font-weight: 600; line-height: 1; direction: ltr; unicode-bidi: isolate; }
.wx-cond { font-size: 23px; color: var(--ink-2); margin-top: 6px; }
.wx-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.wx-grid div { background: var(--soft); border-radius: 12px; padding: 10px 14px; }
.wx-grid small { display: block; font-size: 15px; color: var(--muted); }
.wx-grid b { display: block; font-size: 22px; margin-top: 2px; font-weight: 600; }
.pr-card { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.prayers { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.pr { display: flex; justify-content: space-between; align-items: center; height: 50px; padding: 0 18px; border-radius: 12px; font-size: 24px; background: var(--soft); }
.pr b { font-weight: 600; }
.pr.sun { background: transparent; color: var(--faint); font-size: 21px; height: 40px; }
.pr.next { background: var(--cyan); color: var(--ink); font-weight: 700; }
.pr-count { margin-top: auto; padding-top: 12px; text-align: center; font-size: 19px; color: var(--muted); }
.pr-count b { display: block; font-size: 38px; color: var(--ink); font-weight: 600; direction: ltr; line-height: 1.2; }

.b-ticker { height: 64px; flex: none; display: flex; align-items: center; gap: 28px; padding: 0 48px; background: var(--ink); color: #fff; font-size: 21px; overflow: hidden; }
.b-ticker .tag { flex: none; padding: 5px 16px; border-radius: 8px; background: var(--gold); color: var(--ink); font-weight: 700; font-size: 18px; }
.b-ticker .tk { flex: 1; overflow: hidden; white-space: nowrap; }
.b-ticker .tk > div { display: inline-block; padding-inline-start: 100%; animation: tick 70s linear infinite; }
[dir="rtl"] .b-ticker .tk > div { animation-name: tick-rtl; }
.b-ticker .tk span { margin-inline-end: 90px; }

/* notifications */
#toasts { position: absolute; top: 150px; inset-inline-end: 600px; width: 620px; display: flex; flex-direction: column; gap: 14px; z-index: 10; pointer-events: none; }
.toast-n { display: flex; gap: 18px; align-items: flex-start; padding: 20px 24px; border-radius: 18px; background: #fff; border: 1px solid var(--line); border-inline-start: 10px solid var(--gold); box-shadow: 0 18px 40px rgba(15, 30, 51, .22); animation: toast-in .45s ease-out both; }
.toast-n.cancel { border-inline-start-color: #D33; }
.toast-n.changed { border-inline-start-color: #6A4BD6; }
.toast-n.added { border-inline-start-color: var(--cyan); }
.toast-n svg { width: 34px; height: 34px; flex: none; margin-top: 2px; }
.toast-n b { display: block; font-size: 24px; }
.toast-n p { margin: 6px 0 0; font-size: 20px; color: var(--ink-2); }
.toast-n.out { animation: toast-out .4s ease-in both; }

#settings { position: absolute; bottom: 80px; inset-inline-start: 18px; width: 52px; height: 52px; border-radius: 50%; background: rgba(15, 30, 51, .8); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .3s; z-index: 11; }
body.mouse #settings { opacity: 1; }
body.board-page:not(.mouse) { cursor: none; }

@keyframes blink { 50% { opacity: .15; } }
@keyframes flash { 50% { background-color: #FFF3D1; } }
@keyframes tick { to { transform: translateX(-100%); } }
@keyframes tick-rtl { to { transform: translateX(100%); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-16px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .r.flash, .st::before, .b-ticker .tk > div { animation: none !important; } }

/* ---------------------------------------------------------------- promo (data refresh) */
.promo { position: absolute; top: 128px; bottom: 64px; left: 0; right: 0; z-index: 9; background: #fff; display: grid; grid-template-columns: 880px minmax(0, 1fr); align-items: center; gap: 40px; padding: 0 96px 40px 72px; opacity: 0; transition: opacity .6s; }
.promo[hidden] { display: none; }
.promo.on { opacity: 1; }
[dir="rtl"] .promo { padding: 0 72px 40px 96px; }
.promo-art svg { width: 100%; height: auto; display: block; }
[dir="rtl"] .promo-art svg { transform: scaleX(-1); }
.promo-art.has-img { height: 600px; border-radius: 28px; background-size: cover; background-position: center; }
.promo-art.has-img svg { display: none; }
.promo-bus { animation: bus-bob 1.6s ease-in-out infinite; }
.promo-road { animation: road 1s linear infinite; }
.promo-route-run { stroke-dasharray: 490; stroke-dashoffset: 490; animation: route 4s ease-in-out infinite; }
.promo-status { display: inline-flex; align-items: center; gap: 14px; padding: 12px 22px; border-radius: 40px; background: #FBEBC6; color: #7A4A00; font-size: 24px; font-weight: 700; }
.promo-spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(122, 74, 0, .25); border-top-color: #7A4A00; animation: spin 1s linear infinite; }
.promo-slides { position: relative; min-height: 330px; margin-top: 40px; }
.promo-slide { position: absolute; inset: 0; opacity: 0; transform: translateY(16px); transition: opacity .7s, transform .7s; }
.promo-slide.on { opacity: 1; transform: none; }
.promo-slide h2 { margin: 0; font-family: "Space Grotesk", Inter, sans-serif; font-size: 76px; line-height: 1.05; font-weight: 700; color: var(--ink); }
[dir="rtl"] .promo-slide h2 { font-family: "IBM Plex Sans Arabic", sans-serif; line-height: 1.25; }
.promo-slide p { margin: 26px 0 0; font-size: 34px; line-height: 1.4; color: var(--ink-2); max-width: 820px; }
.promo-dots { display: flex; gap: 10px; margin-top: 18px; }
.promo-dots i { width: 12px; height: 12px; border-radius: 50%; background: #C5CDD8; transition: width .3s; }
.promo-dots i.on { width: 36px; border-radius: 8px; background: var(--cyan); }
.promo-note { margin: 34px 0 0; font-size: 22px; color: var(--muted); }
.promo-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: #EEF1F5; overflow: hidden; }
.promo-bar i { position: absolute; top: 0; bottom: 0; width: 30%; background: linear-gradient(90deg, var(--cyan), var(--gold)); animation: bar 2.2s ease-in-out infinite; }
.sync-chip { display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px; border-radius: 20px; background: #FBEBC6; color: #7A4A00; font-weight: 600; }
.sync-chip::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(122, 74, 0, .3); border-top-color: #7A4A00; animation: spin 1s linear infinite; }
.sync-chip[hidden] { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bus-bob { 50% { transform: translateY(-5px); } }
@keyframes road { to { stroke-dashoffset: -64; } }
@keyframes route { 0% { stroke-dashoffset: 490; } 60%, 100% { stroke-dashoffset: 0; } }
@keyframes bar { 0% { left: -30%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .promo-bus, .promo-road, .promo-route-run, .promo-spin, .promo-bar i, .sync-chip::before { animation: none !important; } .promo-route-run { stroke-dashoffset: 0; } }

.logo-link { display: block; border-radius: 10px; }
.logo-link:focus-visible { outline: 3px solid var(--cyan); outline-offset: 4px; }
body.board-page.mouse .logo-link { cursor: pointer; }
