* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--paper); font-family: var(--sans); overflow: hidden; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: var(--aqua); }
#view { position: fixed; inset: 0; }
#view canvas { display: block; touch-action: none; }

/* loader */
#loader { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; gap: 22px; background: radial-gradient(120% 90% at 50% 40%, #0b3550 0%, var(--deep) 55%, #021827 100%); transition: opacity .9s ease; }
#loader.off { opacity: 0; pointer-events: none; }
.ld-logo img { width: 180px; height: auto; display: block; }
.ld-bar { width: 220px; height: 2px; background: rgba(255,255,255,.15); overflow: hidden; }
.ld-bar i { display: block; height: 100%; width: 0; background: var(--aqua); transition: width .3s ease; }
.ld-txt { font: 300 13px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.7); }

/* top bar: official overlay style (dark fade over the image) */
.top { position: fixed; z-index: 10; inset: 0 0 auto 0; display: flex; align-items: center; gap: 18px; padding: max(14px, env(safe-area-inset-top)) 20px 30px; background: linear-gradient(180deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,.2) 60%, transparent 100%); pointer-events: none; }
.top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand .lg-trs { height: 52px; width: auto; }
.brand .lg-am { height: 52px; width: auto; }
.brand .sep { width: 1px; height: 38px; background: rgba(255,255,255,.35); }
.title { display: flex; flex-direction: column; gap: 4px; margin-inline-start: 8px; }
.title .k { font: 500 11px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.title .t { font: 400 26px/1 var(--serif); letter-spacing: .01em; }
.actions { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }
.pill { padding: 9px 16px; border: 1px solid rgba(255,255,255,.45); border-radius: 999px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; backdrop-filter: blur(8px); background: rgba(30,40,47,.25); transition: background .2s, border-color .2s; }
.pill:hover, .pill.on { background: var(--aqua-700); border-color: var(--aqua); }
.pill[lang="ar"] { text-transform: none; letter-spacing: 0; font-family: var(--ar-sans); }
.icon { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,.45); display: grid; place-items: center; background: rgba(30,40,47,.25); backdrop-filter: blur(8px); }
.icon svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 1.6; }

/* panel */
.panel { position: fixed; z-index: 12; top: 104px; bottom: 20px; inset-inline-end: 20px; width: 384px; display: flex; flex-direction: column; background: rgba(30,40,47,.78); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); border: 1px solid rgba(255,255,255,.1); border-radius: 6px; overflow: hidden; transition: transform .45s cubic-bezier(.2,.7,.2,1), opacity .45s; }
.panel.hide { transform: translateX(calc(100% + 30px)); opacity: 0; }
html[dir="rtl"] .panel.hide { transform: translateX(calc(-100% - 30px)); }
.tabs { display: flex; border-bottom: 1px solid rgba(255,255,255,.1); }
.tabs button { flex: 1; padding: 15px 4px 13px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.6); border-bottom: 2px solid transparent; }
html[dir="rtl"] .tabs button { letter-spacing: 0; font-size: 14px; }
.tabs button.on { color: #fff; border-bottom-color: var(--aqua); }
.grip { display: none; }
.tab { display: none; overflow-y: auto; padding: 16px 16px 22px; flex: 1; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.tab.on { display: block; }
.tab h4 { margin: 22px 0 8px; font: 500 11px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.note { font-size: 12.5px; line-height: 1.55; color: rgba(255,255,255,.66); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 14px; }
.seg button { height: 46px; border: 1px solid rgba(255,255,255,.18); border-radius: 4px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.seg button img { height: 30px; display: none; }
.seg button.on { background: rgba(113,191,183,.16); border-color: var(--aqua); }
.seg button[data-d="amaala"].on { background: rgba(193,166,129,.16); border-color: var(--amaala-gold); }

.list { display: grid; gap: 8px; }
.card { display: grid; grid-template-columns: 92px 1fr; gap: 12px; align-items: center; padding: 6px; border-radius: 4px; text-align: start; border: 1px solid transparent; transition: background .2s, border-color .2s; }
.card:hover, .card.on { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); }
.card .ph { width: 92px; height: 64px; border-radius: 3px; background: #10202b center/cover no-repeat; position: relative; display: grid; place-items: center; }
.card .ph .ph-size { color: rgba(255,255,255,.55); }
.card b { display: block; font: 400 17px/1.15 var(--serif); }
.card small { display: block; margin-top: 4px; font-size: 12px; color: rgba(255,255,255,.62); line-height: 1.35; }
.card .st { display: inline-block; margin-top: 5px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--aqua); }
.card .st.ann { color: var(--gold); }
.group-h { margin: 14px 2px 2px; font: 500 11px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.5); }

.detail .hero { position: relative; margin: -16px -16px 0; aspect-ratio: 16 / 10; background: #10202b center/cover no-repeat; }
.detail .hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(#0000 35%, rgba(0,0,0,.75)); }
.detail .hero img.logo { position: absolute; z-index: 1; inset-inline-start: 16px; bottom: 14px; max-height: 54px; max-width: 58%; }
.detail .hero .ph-size { position: absolute; z-index: 1; inset-inline-end: 8px; top: 8px; color: rgba(255,255,255,.6); }
.detail .back { margin: 12px 0 2px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--aqua); }
.detail h2 { margin: 8px 0 2px; font: 400 28px/1.08 var(--serif); }
.detail .ar { font: 500 19px/1.4 var(--ar-serif); color: rgba(255,255,255,.8); direction: rtl; }
.detail .loc { margin-top: 6px; font-size: 13px; color: rgba(255,255,255,.7); }
.detail dl { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: rgba(255,255,255,.08); margin: 14px 0; border: 1px solid rgba(255,255,255,.08); }
.detail dl div { background: rgba(30,40,47,.92); padding: 10px 12px; }
.detail dt { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.detail dd { margin: 5px 0 0; font: 400 19px/1.1 var(--serif); }
.detail p { font-size: 14px; line-height: 1.6; color: rgba(255,255,255,.86); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chips span { font-size: 11.5px; padding: 5px 9px; border-radius: 999px; border: 1px solid rgba(113,191,183,.45); color: #d8f2ef; }
.detail .row { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border-radius: 3px; background: var(--aqua-700); color: #fff; text-decoration: none; font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; }
.btn.ghost { background: transparent; border: 1px solid rgba(255,255,255,.35); }
.cred { font-size: 11px; color: rgba(255,255,255,.45); margin-top: 12px; }

.clock { display: flex; align-items: baseline; gap: 12px; margin: 6px 0 12px; }
.clock b { font: 300 46px/1 var(--serif); }
.clock span { font-size: 12.5px; color: rgba(255,255,255,.7); line-height: 1.5; }
input[type=range] { width: 100%; accent-color: var(--aqua); }
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.presets button { padding: 10px 6px; border: 1px solid rgba(255,255,255,.18); border-radius: 3px; font-size: 12px; }
.presets button:hover { border-color: var(--aqua); }
.tog { display: flex; gap: 10px; align-items: center; padding: 8px 2px; font-size: 13.5px; }
.tog input { accent-color: var(--aqua); width: 17px; height: 17px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.08); margin: 14px 0; }
.facts div { background: rgba(30,40,47,.92); padding: 10px 12px; }
.facts dt { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.facts dd { margin: 4px 0 0; font: 400 20px/1.1 var(--serif); }

/* pins */
#pins { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.pin { position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; display: flex; align-items: center; gap: 7px; white-space: nowrap; transform: translate(-7px, -7px); will-change: transform; }
.pin i { width: 14px; height: 14px; border-radius: 50%; background: var(--aqua); box-shadow: 0 0 0 3px rgba(113,191,183,.3), 0 0 0 7px rgba(113,191,183,.12); flex: none; }
.pin.ann i { background: var(--gold); box-shadow: 0 0 0 3px rgba(184,156,103,.3); }
.pin.am i { background: var(--amaala-gold); box-shadow: 0 0 0 3px rgba(193,166,129,.3); }
.pin span { font: 500 12.5px/1 var(--sans); letter-spacing: .04em; padding: 6px 9px; border-radius: 3px; background: rgba(30,40,47,.72); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.12); }
.pin.place i { width: 8px; height: 8px; background: #fff; box-shadow: none; }
.pin.place { transform: translate(-4px, -4px); }
.pin.place span { font: 400 15px/1 var(--serif); letter-spacing: .02em; background: none; border: 0; backdrop-filter: none; text-shadow: 0 1px 8px rgba(0,0,0,.8), 0 0 2px rgba(0,0,0,.6); padding: 0; }
.pin.on i { background: #fff; }
.pin.on span { border-color: var(--aqua); }
.pin.hidden { display: none; }

/* tour caption */
.caption { position: fixed; z-index: 9; inset-inline-start: 34px; bottom: 54px; max-width: min(640px, 60vw); pointer-events: none; text-shadow: 0 2px 18px rgba(0,0,0,.55); }
.caption::before { content: ''; position: fixed; z-index: -1; left: 0; right: 0; bottom: 0; height: 46vh; background: linear-gradient(0deg, rgba(2,20,33,.72) 0%, rgba(2,20,33,.35) 45%, rgba(2,20,33,0) 100%); pointer-events: none; }
.caption .ck { display: block; font: 500 12px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.caption .ct { display: block; margin-top: 10px; font: 300 clamp(34px, 4.6vw, 64px)/1.02 var(--serif); }
.caption .cs { display: block; margin-top: 12px; font-size: 16px; line-height: 1.5; color: rgba(255,255,255,.88); max-width: 520px; }
.caption.show .ct, .caption.show .ck, .caption.show .cs { animation: rise 1.1s cubic-bezier(.2,.7,.2,1) both; }
.caption.show .cs { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hint { position: fixed; z-index: 9; left: 50%; bottom: 22px; transform: translateX(-50%); padding: 10px 18px; border-radius: 999px; background: rgba(30,40,47,.6); backdrop-filter: blur(8px); font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; animation: pulse 2.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.credit { position: fixed; z-index: 4; inset-inline-start: 12px; bottom: 8px; font-size: 10px; color: rgba(255,255,255,.6); text-shadow: 0 1px 3px #000; pointer-events: none; }
body.kiosk .panel, body.kiosk .actions #btnLang { display: none; }

/* tablets: narrower panel */
@media (max-width: 1100px) { .panel { width: 340px; } .title .t { font-size: 22px; } }
/* phones and portrait tablets under 760 px: bottom sheet with the tab strip at the bottom */
@media (max-width: 760px) {
  .top { padding: max(10px, env(safe-area-inset-top)) 12px 26px; gap: 10px; }
  .brand .lg-trs, .brand .lg-am { height: 40px; }
  .brand .sep { height: 28px; }
  .title { display: none; }
  .pill { padding: 8px 12px; font-size: 12px; }
  .panel { top: auto; inset-inline: 0; bottom: 0; width: auto; height: 46vh; border-radius: 14px 14px 0 0; flex-direction: column-reverse; padding-bottom: env(safe-area-inset-bottom); }
  .panel.min { height: 64px; }
  .panel.min .tab { display: none; }
  .tabs { border-bottom: 0; border-top: 1px solid rgba(255,255,255,.1); }
  .tabs button { padding: 18px 4px 16px; }
  .grip { display: block; position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: rgba(255,255,255,.3); }
  .panel.hide { transform: translateY(110%); }
  .caption { inset-inline-start: 16px; bottom: calc(46vh + 16px); max-width: 88vw; }
  body.kiosk .caption { bottom: 46px; }
  .caption .ct { font-size: 34px; }
  .caption .cs { font-size: 14px; }
  .credit { bottom: calc(46vh + 4px); }
  .panel.min ~ .credit { bottom: 70px; }
}
[hidden] { display: none !important; }
body.film .panel, body.film .actions, body.film #pins, body.film .hint, body.film #loader { display: none !important; }
body.film .top { background: linear-gradient(180deg, rgba(0,0,0,.35), transparent); }
