/* The HUD inside the memory sky (ui/islands/ui/deep-hud.js): the glass of the islands, darker and quieter for a black scene.
   Everything is under z-index 20 and ignores the pointer, except the reading panel's scroll. */
#deep{position:fixed;inset:0;z-index:13;pointer-events:none;color:#e8edf5;font:500 13px var(--sans);text-shadow:0 1px 3px rgba(0,0,0,.7)}
#deep[hidden]{display:none}
#deep [hidden]{display:none!important} /* !important: .dm-tray and .dm-hints set display:flex at the same specificity, later */
body:has(#deep:not([hidden])) #rideCard{display:none} /* the ride's keys (land, jaws, fireball) mean nothing here and sit under the card */
body.deep-crossing #rideCard{display:none!important} /* hide daytime controls as soon as the portal rush begins */
#deep .dm-card,#deep .dm-read,#deep .dm-tray{background:rgba(10,13,22,.52);backdrop-filter:blur(12px) saturate(1.1);-webkit-backdrop-filter:blur(12px) saturate(1.1);border:1px solid rgba(190,205,235,.14);border-radius:14px;box-shadow:0 12px 36px rgba(0,0,0,.35)}

/* labels: one pooled span each, placed by transform every frame; the opacity carries the distance */
#deep .dm-labels{position:absolute;inset:0;overflow:hidden}
#deep .dm{position:absolute;left:0;top:0;white-space:nowrap;font:600 10px/1 var(--sans);letter-spacing:.14em;text-transform:uppercase;color:rgba(214,226,246,.86);text-shadow:0 0 6px rgba(0,0,0,.95),0 1px 2px rgba(0,0,0,.9);will-change:transform,opacity}
#deep .dm.gal{font-size:10.5px;color:rgba(219,230,247,.82);letter-spacing:.2em}
#deep .dm.here{font-size:11px;color:#fff;letter-spacing:.22em}
#deep .dm.topic{font-size:10.5px;font-weight:500;letter-spacing:.1em;color:rgba(200,214,238,.74)}
#deep .dm.lesson{color:#FFC46B;letter-spacing:.04em;text-transform:none;font-weight:500}
#deep .dm.lessons{color:#FFC46B;font-size:12px;letter-spacing:.2em}
#deep .dm.new{font-size:12px;color:#fff;letter-spacing:.14em;padding:4px 9px;border:1px solid rgba(159,191,255,.7);border-radius:999px;background:rgba(10,18,40,.72)}
#deep .dm.event{font-size:11.5px;color:#fff6dc;letter-spacing:.15em;padding:4px 10px;border:1px solid rgba(155,225,255,.78);border-radius:999px;background:linear-gradient(135deg,rgba(12,26,48,.78),rgba(34,26,14,.72));box-shadow:0 0 14px rgba(155,225,255,.32),inset 0 0 8px rgba(255,224,150,.18)}
#deep .dm.herald{font-size:10.5px;color:#d6f1ff;letter-spacing:.18em;padding:3px 9px;border:1px solid rgba(155,225,255,.55);border-radius:999px;background:rgba(10,20,38,.62);box-shadow:0 0 12px rgba(155,225,255,.35);animation:dmPulse 1.4s ease-in-out infinite}
#deep .dm.door{color:#BFE3F2;letter-spacing:.2em}
#deep .dm.find{color:#F2D38A;letter-spacing:.12em;text-transform:none;font-weight:500;font-style:italic}
#deep .dm-map{position:absolute;right:18px;bottom:18px;width:168px;height:168px;border-radius:50%;border:1px solid rgba(190,205,235,.2);box-shadow:0 6px 24px rgba(0,0,0,.35)}
#deep .dm-finds{position:absolute;right:18px;top:14px;margin:0;font:600 10.5px var(--sans);letter-spacing:.14em;text-transform:uppercase;color:rgba(242,211,138,.7)}

/* the card: where the rider is, bottom left */
#deep .dm-card{position:absolute;left:18px;bottom:18px;max-width:min(34ch,calc(100vw - 36px));padding:12px 15px;line-height:1.4;animation:dmIn .4s ease both}
#deep .dm-card:empty{display:none}
#deep .dm-card b,#deep .dm-card strong{color:#fff;font-weight:600}
#deep .dm-card p{margin:0}#deep .dm-card p+p{margin-top:6px}
#deep .dm-card small,#deep .dm-card .muted{color:rgba(200,214,238,.62)}
#deep .dm-fare{color:#FFC46B}

/* the reading panel: a lesson or a topic, readable while gliding; the only part that takes the pointer (scroll) */
#deep .dm-read{position:absolute;right:18px;top:50%;transform:translateY(-50%);width:38ch;max-width:calc(100vw - 36px);max-height:min(70vh,560px);overflow-y:auto;padding:16px 18px;pointer-events:auto;animation:dmIn .4s ease both;scrollbar-width:thin;scrollbar-color:rgba(190,205,235,.3) transparent}
#deep .dm-kind{margin:0 0 6px;font:600 10.5px var(--sans);letter-spacing:.14em;text-transform:uppercase;color:#FFC46B}
#deep .dm-title{margin:0 0 8px;font:600 16px/1.3 var(--sans);color:#fff}
#deep .dm-title:empty{display:none}
#deep .dm-body{line-height:1.55;color:rgba(228,236,250,.92);overflow-wrap:anywhere;white-space:pre-wrap}

/* the arrival line: top centre, in for a moment, out by itself (the HUD drops .on after about 6 s) */
#deep .dm-arrive{position:absolute;left:50%;top:calc(11% + 16px);transform:translateX(-50%);margin:0;padding:6px 16px;border-radius:999px;background:rgba(10,13,22,.45);border:1px solid rgba(190,205,235,.12);font:600 11.5px var(--sans);letter-spacing:.12em;text-transform:uppercase;color:#dbe6f7;white-space:nowrap;opacity:0}
#deep .dm-arrive.on{animation:dmArrive 6s ease both}

/* the carried tray: the names of what he took, top left */
#deep .dm-tray{position:absolute;left:18px;top:18px;display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;max-width:min(46ch,calc(100vw - 36px));padding:7px 12px;font-size:11.5px}
#deep .dm-tray-h{font:600 10px var(--sans);letter-spacing:.14em;text-transform:uppercase;color:rgba(200,214,238,.6)}
#deep .dm-chip{color:#dbe6f7}
#deep .dm-chip.lesson{color:#FFC46B}

/* key hints: one quiet line along the bottom */
#deep .dm-hints{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);margin:0;display:flex;flex-wrap:wrap;justify-content:center;gap:2px 8px;max-width:calc(100vw - 36px);font-size:11px;color:rgba(200,214,238,.58)}
#deep .dm-hints kbd{font:inherit;font-weight:700;padding:0 5px;border-radius:4px;background:rgba(190,205,235,.14);color:rgba(228,236,250,.85)}
#deep .dm-hints span{margin-right:6px}

@keyframes dmIn{from{opacity:0;transform:translateY(6px)}}
#deep .dm-read{animation-name:dmInRead}
@keyframes dmInRead{from{opacity:0;transform:translateY(calc(-50% + 6px))}}
@keyframes dmArrive{0%{opacity:0;transform:translate(-50%,-6px)}8%,82%{opacity:1;transform:translate(-50%,0)}100%{opacity:0;transform:translate(-50%,0)}}
@keyframes dmPulse{0%,100%{border-color:rgba(155,225,255,.35);box-shadow:0 0 6px rgba(155,225,255,.2)}50%{border-color:rgba(255,228,168,.85);box-shadow:0 0 18px rgba(155,225,255,.55)}}
@media (max-width:640px){#deep .dm-read{top:auto;bottom:70px;transform:none;animation-name:dmIn;max-height:40vh}#deep .dm-card{bottom:auto;top:60px}}
@media (prefers-reduced-motion:reduce){#deep .dm-card,#deep .dm-read,#deep .dm.herald{animation:none}#deep .dm-arrive.on{animation:none;opacity:1}}
/* the film (scene/deep.js): the entry's title, its opacity written each frame; the clean frame (K) keeps only the names, the ride's own HUD goes too */
#deep .dm-film{position:absolute;left:50%;top:44%;transform:translate(-50%,-50%);text-align:center;white-space:nowrap}
#deep .dm-film b{display:block;font:600 clamp(40px,7vw,96px)/1 var(--serif);letter-spacing:.26em;text-indent:.26em;text-transform:uppercase;color:#f2f6ff;text-shadow:0 0 28px rgba(150,185,255,.55),0 2px 10px rgba(0,0,0,.9)}
#deep .dm-film span{display:block;margin:18px auto 0;padding-top:14px;width:max-content;font:600 13px var(--sans);letter-spacing:.22em;text-indent:.22em;text-transform:uppercase;color:#cfdcf5;background:linear-gradient(90deg,transparent,#9fbfff 30%,#9fbfff 70%,transparent) top/100% 1px no-repeat}
#deep.clean>:not(.dm-film){display:none!important}
body.deep-clean #ride{opacity:0}
/* the calm (scene/deep.js, DEEP.calm s without input): the hints, the card, the tray, the count and the ride's HUD fade slowly and come back
   quickly; the names, the arrival line and an open reading panel stay. Under the film's bars (body.deep-film) they are gone at once:
   nothing is written over the bars (the arrival line sits below them, scene/deep.js keeps the names between them) */
#deep>:is(.dm-hints,.dm-card,.dm-tray,.dm-finds,.dm-map),body:has(#deep:not([hidden])) #ride{transition:opacity .3s ease}
#deep.calm>:is(.dm-hints,.dm-card,.dm-tray,.dm-finds,.dm-map),body.deep-calm #ride{opacity:0;transition-duration:1.2s}
body.deep-film #deep>:is(.dm-hints,.dm-card,.dm-tray,.dm-finds,.dm-map),body.deep-film #ride{opacity:0;transition:none}
/* while the entry's title is up nothing else is written over the sky: the labels, the HUD and the ride's HUD wait for it */
#deep:has(.dm-film:not([hidden]))>:not(.dm-film),body:has(#deep .dm-film:not([hidden])) #ride{opacity:0}
/* the daytime ride's HUD in black space: no fire gauge or growth (fire never runs out here, the dragon does not grow); health only while it is below full or a blow lands
   (--hp 1 → 0, anything under .975 → 1); the sight dim unless fire is held (.fire, deep-hud.js). The radar (U) and the key line are quiet by default. */
body:has(#deep:not([hidden])) :is(#rideEmber,#rideGrowth){display:none!important}
body:has(#deep:not([hidden])) #rideHealth{opacity:calc((1 - var(--hp,1))*40);transition:opacity .6s ease}
body:has(#deep:not([hidden])) #ride.hurt #rideHealth{opacity:1}
body:has(#deep:not([hidden])) :is(#rideAim,#rideNose){opacity:.22;transition:opacity .25s ease}
body:has(#deep.fire) :is(#rideAim,#rideNose),body #ride.breath :is(#rideAim,#rideNose){opacity:1}
#deep .dm-map{display:none}#deep.map-on .dm-map{display:block}
#deep .dm-hints.gone{opacity:0;transition:opacity 1.6s ease}
