/* Overclocked — Act III deep-time gauges (js/hud/deepgauges.js). Class prefix: dg-.
 * Lives on the NIGHT palette (css/act3.css re-defines the tokens under [data-act='3']) — tokens only.
 * Width budget 400–452px · height budget ≈ 255px. Perpetual animations only run in Act III. */

.dg, .dg-date {
  --dg-glow: var(--glow, color-mix(in srgb, var(--accent) 45%, transparent));
  --dg-star: var(--star, var(--ink));
  font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--ink);
}

/* ================================================================ 1. date pill (over the scene) */
.dg-date {
  position: absolute; top: 12px; left: 12px; z-index: 6;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  pointer-events: none; max-width: calc(100% - 24px);
}
.dg-pill {
  display: inline-flex; align-items: center;
  font-size: 23px; line-height: 1; font-weight: 700; letter-spacing: -.02em;
  color: var(--bg); background: var(--ink); border-radius: 6px; padding: 6px 11px 6px 10px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 30%, transparent), 0 6px 26px -6px var(--dg-glow);
  pointer-events: auto;
}
.dg-odo {
  display: inline-flex; white-space: pre;
  /* drum window: glyphs fade at the rim while they roll */
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 16%, #000 84%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 16%, #000 84%, transparent 100%);
}
.dg-slot { position: relative; display: inline-block; width: 1ch; height: 1.34em; overflow: hidden; flex: none; }
.dg-slot.is-dying { overflow: hidden; }
.dg-glyph {
  position: absolute; left: 0; right: 0; top: 0; height: 100%;
  display: flex; align-items: center; justify-content: center; will-change: transform;
}
.dg-date-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dg-since {
  font-size: 11px; line-height: 14px; color: var(--ink-2); white-space: nowrap;
  text-shadow: 0 0 6px var(--bg), 0 0 2px var(--bg);
}
.dg-tag {
  font-size: 8.5px; line-height: 1; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 70%, transparent); border-radius: 3px;
  padding: 3px 5px 2px; background: color-mix(in srgb, var(--bg) 72%, transparent);
  box-shadow: 0 0 10px -2px var(--dg-glow); pointer-events: auto; cursor: help;
}

/* ================================================================ gauges column */
.dg { display: flex; flex-direction: column; gap: 7px; font-size: 11px; line-height: 14px; min-width: 0; }
.dg-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.dg-lbl { font-size: 9.5px; line-height: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.dg-lbl-sub { letter-spacing: .02em; text-transform: none; opacity: .8; }

/* ---------------------------------------------------------------- 2. headline ticker */
.dg-head {
  display: flex; align-items: baseline; gap: 7px; min-width: 0; white-space: nowrap; overflow: hidden;
  font-size: 12px; line-height: 16px; padding: 3px 0 2px;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.dg-head-dot {
  flex: none; align-self: center; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--dg-glow);
}
.dg-head-front { flex: none; color: var(--accent); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 10.5px; }
.dg-head-sep { flex: none; color: var(--muted); }
.dg-head-evwrap { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; overflow: hidden; }
.dg-head-ev { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.dg-caret {
  flex: none; display: inline-block; width: .55em; height: 1.05em; margin-left: 2px; align-self: center;
  background: var(--accent); opacity: 0; transform: translateY(1px);
}
.dg-head.is-typing .dg-head-ev { text-overflow: clip; }
.dg-head.is-typing .dg-caret { opacity: 1; }

/* ---------------------------------------------------------------- 3. Kardashev meter */
.dg-k { --k: 0; display: flex; flex-direction: column; gap: 2px; }
.dg-k-val { font-size: 14.5px; line-height: 14px; font-weight: 700; color: var(--accent); white-space: nowrap; text-shadow: 0 0 12px var(--dg-glow); }
.dg-k-bar { position: relative; height: 12px; margin: 1px 0 0; }
.dg-k-track {
  position: absolute; left: 0; right: 0; top: 3px; bottom: 3px; border-radius: 3px;
  background: radial-gradient(circle, color-mix(in srgb, var(--muted) 75%, transparent) 0 .9px, transparent 1.2px) 0 50% / 5px 6px repeat-x;
  box-shadow: inset 0 0 0 1px var(--rule);
}
.dg-k-fill {
  position: absolute; left: 0; top: 3px; bottom: 3px; width: calc(var(--k) * 100%); border-radius: 3px; overflow: hidden;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent-soft) 35%, transparent), var(--accent-soft) 45%, var(--accent));
  box-shadow: 0 0 12px -2px var(--dg-glow);
}
.dg-k-sheen {
  position: absolute; top: 0; bottom: 0; left: 0; width: 60px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--dg-star) 55%, transparent), transparent);
  transform: translateX(-80px); opacity: .7;
}
.dg-k-tick { position: absolute; top: 4px; width: 1px; height: 4px; margin-left: -.5px; background: color-mix(in srgb, var(--muted) 60%, transparent); }
.dg-k-tick.is-major { top: 0; height: 12px; background: var(--muted); }
.dg-k-tick.is-first { margin-left: 0; }
.dg-k-tick.is-last { margin-left: -1px; }
.dg-k-now {
  position: absolute; top: 3.5px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%;
  background: var(--bg); box-shadow: 0 0 0 1.2px var(--ink-2);
}
.dg-k-mark {
  position: absolute; top: -3px; left: calc(var(--k) * 100%); width: 2px; height: 18px; margin-left: -1px; border-radius: 1px;
  background: var(--ink); box-shadow: 0 0 8px 1px var(--dg-glow), 0 0 2px var(--dg-star);
}
.dg-k-mark::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--bg), 0 0 14px 3px var(--dg-glow);
}
.dg-k-labels { position: relative; height: 10px; }
.dg-k-lab { position: absolute; top: -1px; font-size: 9px; line-height: 11px; color: var(--muted); white-space: nowrap; transition: color .6s var(--ease); }
.dg-k-lab.is-start { padding-left: 4px; }
.dg-k-lab.is-mid { transform: translateX(-50%); }
.dg-k-lab.is-end { transform: translateX(-100%); padding-right: 3px; }
.dg-k-lab.is-now { color: var(--ink-2); }
.dg-k-lab.is-reached { color: var(--ink); }
.dg-k-lab.is-hit { animation: dg-level 1.4s var(--ease); }

/* ---------------------------------------------------------------- 4. tiles */
.dg-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px 6px; }
.dg-tile {
  position: relative; min-width: 0; overflow: hidden;
  padding: 4px 7px 5px; border-radius: 5px;
  background: var(--bg-sunk); box-shadow: inset 0 0 0 1px var(--rule);
}
.dg-t-top { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; min-width: 0; }
.dg-t-lbl { font-size: 9px; line-height: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.dg-t-note { font-size: 8.5px; line-height: 11px; color: var(--muted); opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dg-t-val { display: flex; align-items: baseline; gap: 3px; margin-top: 1px; min-width: 0; white-space: nowrap; overflow: hidden; }
.dg-t-n { font-size: 16px; line-height: 19px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.dg-t-unit { font-size: 10px; color: var(--ink-2); }
.dg-t-dag { display: none; font-family: var(--serif); font-size: 15px; line-height: 16px; color: var(--muted); }
.dg-sup { font-size: .62em; line-height: 0; vertical-align: .72em; margin-left: .06em; letter-spacing: 0; }
.dg-t-bar { position: relative; display: block; height: 2px; margin-top: 3px; border-radius: 1px; background: var(--rule); overflow: hidden; }
.dg-t-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--f) * 100%); border-radius: 1px; background: var(--accent); box-shadow: 0 0 6px var(--dg-glow); }
.dg-t-bar { --f: 0; }
.dg-t-cap { min-width: 0; margin-left: 3px; font-size: 8.5px; line-height: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dg-t-cap:empty { display: none; }
.dg-tile.is-zero .dg-t-n { color: var(--muted); font-weight: 400; }
.dg-tile.is-zero .dg-t-dag { display: inline; }
.dg-tile.is-race { background: transparent; box-shadow: inset 0 0 0 1px var(--rule); }
.dg-tile.is-race .dg-t-top { opacity: .85; }
/* race: the humans gauge is a flatline */
.dg-tile.is-zero .dg-t-bar { background: repeating-linear-gradient(90deg, var(--muted) 0 3px, transparent 3px 6px); opacity: .45; }
.dg-tile.is-zero .dg-t-bar i { display: none; }

/* ---------------------------------------------------------------- 5. thought clock */
.dg-tc {
  --dg-period: 2s;
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 4px 9px 4px 7px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--rule); overflow: hidden;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%);
}
.dg-tc-pulse { position: relative; flex: none; width: 24px; height: 24px; }
.dg-tc-dot, .dg-tc-ring { position: absolute; left: 50%; top: 50%; border-radius: 50%; }
.dg-tc-dot { width: 8px; height: 8px; margin: -4px 0 0 -4px; background: var(--accent); box-shadow: 0 0 10px 2px var(--dg-glow); }
.dg-tc-ring { width: 24px; height: 24px; margin: -12px 0 0 -12px; box-shadow: inset 0 0 0 1.2px var(--accent); opacity: 0; transform: scale(.3); }
.dg-tc-txt { min-width: 0; flex: 1 1 auto; }
.dg-tc-main { display: flex; align-items: baseline; flex-wrap: nowrap; min-width: 0; white-space: nowrap; overflow: hidden; font-size: 11px; line-height: 16px; color: var(--ink-2); }
.dg-tc-lead { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dg-tc-x { flex: none; margin-left: 1ch; font-size: 14.5px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.dg-tc-cap { font-size: 9px; line-height: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dg-c { font-family: var(--serif); font-size: 13px; color: var(--accent); font-style: italic; }

/* ---------------------------------------------------------------- 6. log-time ruler */
.dg-ruler { position: relative; height: 35px; padding: 0 8px 0 4px; }
.dg-r-track { --x: 0; position: relative; height: 100%; }
.dg-r-axis {
  position: absolute; left: 0; right: 0; top: 18px; height: 1px;
  background: repeating-linear-gradient(90deg, var(--muted) 0 1px, transparent 1px 4px); opacity: .7;
}
.dg-r-fill {
  position: absolute; left: 0; top: 17.5px; height: 2px; width: calc(var(--x) * 100%); border-radius: 1px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent-soft) 40%, transparent), var(--accent));
  box-shadow: 0 0 8px var(--dg-glow);
}
.dg-r-tick { position: absolute; top: 16px; width: 1px; height: 5px; margin-left: -.5px; background: color-mix(in srgb, var(--muted) 70%, transparent); }
.dg-r-tick.is-major.is-a { top: 11px; height: 8px; }
.dg-r-tick.is-major.is-b { top: 18px; height: 8px; }
.dg-r-lab { position: absolute; z-index: 2; font-size: 9px; line-height: 11px; color: var(--muted); white-space: nowrap; transform: translateX(-50%); text-shadow: 0 0 3px var(--bg), 0 0 1px var(--bg); pointer-events: none; }
.dg-r-lab.is-a { top: 0; }
.dg-r-lab.is-b { top: 24px; }
.dg-r-lab.is-end { transform: translateX(-100%); }
.dg-r-dots { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.dg-r-dot {
  position: absolute; top: 18.5px; width: 16px; height: 16px; margin: -8px 0 0 -8px; padding: 0;
  border: 0; background: none; cursor: pointer; pointer-events: auto; display: grid; place-items: center;
}
.dg-r-dot i {
  display: block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--bg); box-shadow: inset 0 0 0 1.3px var(--muted);
  transition: transform .35s var(--ease), background-color .35s var(--ease), box-shadow .35s var(--ease);
}
.dg-r-dot.is-past i { background: var(--accent-soft); box-shadow: inset 0 0 0 1.3px var(--accent-soft); }
.dg-r-dot.is-active i { background: var(--accent); box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.3px var(--accent), 0 0 12px 2px var(--dg-glow); transform: scale(1.15); }
.dg-r-dot:hover i { transform: scale(1.45); box-shadow: inset 0 0 0 1.3px var(--ink); }
.dg-r-dot.is-active:hover i { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.3px var(--ink), 0 0 12px 2px var(--dg-glow); }
.dg-r-dot:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 0; border-radius: 50%; }
.dg-r-dot.is-hit::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%;
  box-shadow: 0 0 0 1.5px var(--accent); pointer-events: none; opacity: 0;
}
.dg-r-mark {
  position: absolute; z-index: 1; top: 12px; left: calc(var(--x) * 100%); width: 2px; height: 12px; margin-left: -1px; border-radius: 1px;
  background: var(--ink); box-shadow: 0 0 8px 1px var(--dg-glow); pointer-events: none;
}
.dg-r-mark::before {
  content: ''; position: absolute; left: 50%; top: -3px; margin-left: -4px;
  border: 4px solid transparent; border-top: 5px solid var(--ink); border-bottom: 0;
}

/* ================================================================ motion (Act III only) */
:root[data-act='3'] .dg-head-dot { animation: dg-beacon 2.4s var(--ease) infinite; }
:root[data-act='3'] .dg-head.is-typing .dg-caret { animation: none; }
:root[data-act='3'] .dg-head:not(.is-typing) .dg-caret { animation: dg-caret 1.1s steps(1) 3 forwards; }
:root[data-act='3'] .dg-k-sheen { animation: dg-sheen 3.6s cubic-bezier(.45, 0, .25, 1) infinite; }
:root[data-act='3'] .dg-k-mark::after { animation: dg-glowpulse 2.2s ease-in-out infinite; }
:root[data-act='3'] .dg-tc-dot { animation: dg-blink var(--dg-period) ease-in-out infinite; }
:root[data-act='3'] .dg-tc-ring { animation: dg-ring var(--dg-period) cubic-bezier(.2, .6, .3, 1) infinite; }
:root[data-act='3'] .dg-tc-ring.is-b { animation-delay: calc(var(--dg-period) * -.5); }
:root[data-act='3'] .dg-r-dot.is-hit::after { animation: dg-ripple .9s var(--ease); }
:root[data-act='3'] .dg-r-mark { animation: dg-markglow 2.2s ease-in-out infinite; }

/* entrance: each time the deep-time dashboard appears, the gauges rise in, staggered */
:root[data-act='3'] .dg > * { animation: dg-in .75s var(--ease) backwards; animation-delay: calc(var(--dg-i, 0) * 70ms + 180ms); }
:root[data-act='3'] .dg-tile { animation: dg-in .6s var(--ease) backwards; animation-delay: calc(var(--dg-j, 0) * 45ms + 360ms); }
:root[data-act='3'] .dg-date { animation: dg-in-left .8s var(--ease) backwards .1s; }
@keyframes dg-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes dg-in-left { from { opacity: 0; transform: translateX(-10px); } }
@keyframes dg-sheen { 0% { transform: translateX(-80px); } 55%, 100% { transform: translateX(460px); } }
@keyframes dg-glowpulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--bg), 0 0 10px 2px var(--dg-glow); }
  50% { box-shadow: 0 0 0 2px var(--bg), 0 0 20px 6px var(--dg-glow); }
}
@keyframes dg-markglow { 0%, 100% { opacity: 1; } 50% { opacity: .72; } }
@keyframes dg-beacon {
  0% { box-shadow: 0 0 0 0 var(--dg-glow); }
  70%, 100% { box-shadow: 0 0 0 7px transparent; }
}
@keyframes dg-caret { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 0; } }
@keyframes dg-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  12% { opacity: 1; transform: scale(1.35); }
  50% { opacity: .35; transform: scale(.8); }
}
@keyframes dg-ring {
  0% { opacity: .9; transform: scale(.3); }
  80% { opacity: 0; transform: scale(1.25); }
  100% { opacity: 0; transform: scale(1.25); }
}
@keyframes dg-ripple {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(3.4); }
}
@keyframes dg-level {
  0% { color: var(--ink); text-shadow: 0 0 0 transparent; }
  15% { color: var(--accent); text-shadow: 0 0 10px var(--dg-glow); }
  100% { color: var(--ink); text-shadow: 0 0 0 transparent; }
}

/* ================================================================ narrow HUD (400px column) */
@media (max-width: 1100px) {
  .dg-pill { font-size: 21px; }
  .dg-t-n { font-size: 14.5px; }
  .dg-tile { padding: 5px 6px 6px; }
  .dg-t-note { font-size: 8px; }
  .dg-tc-main { font-size: 10.5px; }
  .dg-tc-x { font-size: 13.5px; }
}
/* short viewports: give the scene room */
@media (max-height: 620px) {
  .dg { gap: 7px; }
  .dg-tc-cap { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .dg *, .dg *::before, .dg *::after, .dg-date * { animation: none !important; transition: none !important; }
  .dg-tc-ring { opacity: 0; }
  .dg-k-sheen { display: none; }
}
