/* Confidentech village (prefix ctv-): the world's speed badge and a knock on the tracked car, the app's alert
   feed at the top of the screen, and the three numbers. The badge and the feed copy the world's own look
   (.ct-hud, .ct-sh__feed in worlds/confidentech/world.css). */
.vil--confidentech .vil__shade { height: 48%; }
/* The car in the tracking view: centred, at 50 % of the height (portrait) or 56 % (landscape), about 11.8 %
   (portrait) or 15 % (landscape) of the height long; the badge rides 44 px above its nose, as in the world. */
.ctv-over { position: absolute; inset: 0; pointer-events: none; --cy: 50%; --len: 11.8%; }
@media (orientation: landscape) { .ctv-over { --cy: 56%; --len: 15%; } }
.ctv-hud { position: absolute; top: calc(var(--cy) - var(--len) / 2 - 44px); left: 50%; margin: 0; display: inline-flex; align-items: baseline; gap: 4px; padding: 6px 12px 7px; border-radius: 999px; background: #1a1a1a; box-shadow: inset 0 0 0 1.5px #2962ff, 0 6px 14px -6px rgb(0 0 0 / 0.7); color: #fff; direction: ltr; opacity: 0; transform: translate3d(-50%, 10px, 0); will-change: transform, opacity; }
.ctv-hud b { min-width: 1.3em; text-align: end; font-size: 1.0625rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.ctv-hud span { font-size: 0.6875rem; font-weight: 500; line-height: 1; color: rgb(255 255 255 / 0.72); }
.ctv-knock { position: absolute; top: var(--cy); left: 50%; width: 120px; height: 120px; border-radius: 50%; box-shadow: inset 0 0 0 2px #ff7a6e, 0 0 0 1px rgb(255 122 110 / 0.35); opacity: 0; transform: translate3d(-50%, -50%, 0) scale(0.7); will-change: transform, opacity; }

/* The feed: the trip's four alerts on a rail (beat 2). A row is a state chip on the rail and a card beside it.
   Until its moment of the trip a row is only a small dot on the rail; then the chip takes its colour and icon and
   the card comes in (timed, class is-in; js/villages/confidentech.js lets them in one at a time). The rail's fill
   is the trip so far (scaleY, set from the scroll). Colours are the app's own alert colours. */
.ctv-feed { --row: 46px; --chip: 30px; --gap: 8px; position: absolute; top: calc(72px + env(safe-area-inset-top, 0px)); inset-inline: 0; width: min(calc(100% - 2 * var(--pad)), 336px); margin: 0 auto; padding: 0; list-style: none; display: grid; gap: var(--gap); opacity: 0; visibility: hidden; transition: opacity 0.25s linear, visibility 0s 0.25s; }
.ctv-feed.is-open { opacity: 1; visibility: visible; transition: opacity 0.35s linear, visibility 0s; }
.ctv-feed.is-out { opacity: 0; visibility: hidden; transition: opacity 0.25s linear, visibility 0s 0.25s; }
.ctv-rail { position: absolute; inset-block: calc(var(--row) / 2); inset-inline-start: calc(var(--chip) / 2 - 1px); width: 2px; border-radius: 2px; background: rgb(255 255 255 / 0.16); }
.ctv-rail i { position: absolute; inset: 0; border-radius: 2px; background: #7fa6ff; transform: scaleY(0); transform-origin: 50% 0; will-change: transform; }
.ctv-feed li { --c: #7fa6ff; position: relative; height: var(--row); display: grid; grid-template-columns: var(--chip) minmax(0, 1fr); align-items: center; gap: 10px; }
.ctv-feed .is-ok { --c: #6fdd85; }
.ctv-feed .is-crit { --c: #ff7a6e; }
.ctv-feed .is-cut { --c: #f6ada4; }
/* The chip: a dot on the rail, then the alert's colour and icon. */
.ctv-fi { position: relative; display: grid; place-items: center; width: var(--chip); height: var(--chip); border-radius: 50%; background: #3a3b42; color: #141416; box-shadow: 0 0 0 3px #141416; transform: scale(0.3); transition: transform 0.45s var(--ease-out), background-color 0.25s linear; }
.ctv-ic { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity 0.2s linear; }
.ctv-feed li.is-in .ctv-fi { background: var(--c); transform: none; }
.ctv-feed li.is-in .ctv-ic { opacity: 1; transition-delay: 0.12s; }
/* One ring as the alert lands. */
.ctv-fi::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 2px var(--c); opacity: 0; }
.ctv-feed li.is-in .ctv-fi::after { animation: ctv-ping 0.9s var(--ease-out) 0.1s 1 both; }
@keyframes ctv-ping { from { opacity: 0.7; transform: scale(1); } to { opacity: 0; transform: scale(2.1); } }
/* The card. */
.ctv-fc { box-sizing: border-box; height: 100%; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding-inline: 14px; border-radius: 13px; background: #1f1f23; color: #fff; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.1), 0 14px 26px -16px rgb(0 0 0 / 0.85); opacity: 0; transform: translate3d(0, -8px, 0) scale(0.97); transform-origin: 0 50%; transition: opacity 0.16s linear, transform 0.16s linear; }
[dir='rtl'] .ctv-fc { transform-origin: 100% 50%; }
.ctv-feed li.is-in .ctv-fc { opacity: 1; transform: none; transition: opacity 0.28s linear 0.06s, transform 0.55s var(--ease-out) 0.06s; }
.ctv-fc b { font-size: 0.9375rem; font-weight: 680; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctv-fc small { font-size: 0.8125rem; font-weight: 600; line-height: 1.2; white-space: nowrap; color: var(--c); font-variant-numeric: tabular-nums; }
/* Put away at once (the sheet has gone): no transition may run into another section. */
.ctv-feed.is-cut, .ctv-feed.is-cut * { transition: none !important; animation: none !important; }
@media (max-width: 899px) and (max-height: 760px) { .ctv-feed { --row: 40px; --chip: 26px; --gap: 5px; top: calc(62px + env(safe-area-inset-top, 0px)); } .ctv-ic { width: 15px; height: 15px; } .ctv-fc b { font-size: 0.875rem; } }
@media (min-width: 900px) {
  .ctv-feed { --row: 52px; --chip: 32px; --gap: 10px; top: 96px; inset-inline: auto var(--pad); width: 360px; margin: 0; }
  .ctv-fc b { font-size: 1rem; }
  .ctv-fc small { font-size: 0.875rem; }
}
@media (prefers-reduced-motion: reduce) { .ctv-feed, .ctv-feed * { transition: none !important; animation: none !important; } }

/* Beat 3: the numbers. */
.ctv-nums { list-style: none; margin: 6px 0 0; padding: 12px 0 0; width: 100%; max-width: 30rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; border-block-start: 1px solid var(--hair); }
.ctv-nums li { display: grid; gap: 2px; align-content: start; }
.ctv-nums b { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
html[lang='fa'] .ctv-nums b { letter-spacing: 0; line-height: 1.25; }
.ctv-nums span { font-size: 0.8125rem; line-height: 1.3; color: var(--mute); }
