/* Mandali student app · Market HUD, shloka card, boot, HUD backdrop (29 Nov 2026) */
.hd, .gc, .bt { --h-bg: #060A14; --h-p: #0A1120; --h-l: #1C2840; --h-t: #EEE9DC; --h-m: #8E98B0; --h-a: #E0A82E; --h-up: #2BB673; --h-dn: #E26D5A; }
.mxm { font-family: var(--mono, "JetBrains Mono", ui-monospace, monospace); font-variant-numeric: tabular-nums; }

/* ---- HUD card: a dark screen in both themes ---- */
.hd { position: relative; overflow: hidden; isolation: isolate; margin: 12px 0 14px; padding: 14px 14px 12px; border-radius: 20px; color: var(--h-t);
  background: radial-gradient(120% 80% at 0% 0%, rgba(224,168,46,.09), transparent 55%), radial-gradient(90% 70% at 100% 100%, rgba(43,182,115,.06), transparent 60%), var(--h-bg);
  border: 1px solid var(--h-l); box-shadow: 0 30px 60px -36px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.04); }
.hd::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .55;
  background-image: linear-gradient(rgba(224,168,46,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(224,168,46,.06) 1px, transparent 1px); background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 75%); }
/* HUD corner brackets */
.hd::after, .gc::after { content: ""; position: absolute; inset: 6px; pointer-events: none; border-radius: 14px;
  background: linear-gradient(var(--h-a), var(--h-a)) top left / 14px 1.5px, linear-gradient(var(--h-a), var(--h-a)) top left / 1.5px 14px,
              linear-gradient(var(--h-a), var(--h-a)) top right / 14px 1.5px, linear-gradient(var(--h-a), var(--h-a)) top right / 1.5px 14px,
              linear-gradient(var(--h-a), var(--h-a)) bottom left / 14px 1.5px, linear-gradient(var(--h-a), var(--h-a)) bottom left / 1.5px 14px,
              linear-gradient(var(--h-a), var(--h-a)) bottom right / 14px 1.5px, linear-gradient(var(--h-a), var(--h-a)) bottom right / 1.5px 14px;
  background-repeat: no-repeat; opacity: .55; }
.hd-scan { position: absolute; left: 0; right: 0; top: 0; height: 40%; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(224,168,46,.06), transparent); transform: translateY(-100%); animation: hdScan 6s linear infinite; }
@keyframes hdScan { to { transform: translateY(260%); } }
.hd .up { color: var(--h-up); } .hd .dn { color: var(--h-dn); } .hd .am { color: var(--h-a); }
.hd-h { display: flex; justify-content: space-between; align-items: center; font-size: 10.5px; letter-spacing: .12em; color: var(--h-m); }
.hd-h span:first-child { color: var(--h-a); display: inline-flex; align-items: center; gap: 7px; }
.hd-h i { width: 7px; height: 7px; border-radius: 50%; background: var(--h-m); }
.hd-h i.on { background: var(--h-up); animation: hdPing 1.6s ease-out infinite; }
@keyframes hdPing { 0% { box-shadow: 0 0 0 0 rgba(43,182,115,.7); } 100% { box-shadow: 0 0 0 9px rgba(43,182,115,0); } }
.hd-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 10px 0 14px; }
.hd-px span, .hd-exp span { display: block; font-size: 10.5px; letter-spacing: .12em; color: var(--h-m); }
.hd-px b { display: block; font-size: clamp(30px, 9vw, 42px); font-weight: 600; letter-spacing: -.01em; line-height: 1.1; text-shadow: 0 0 24px currentColor; }
.hd-px b.up { text-shadow: 0 0 22px rgba(43,182,115,.35); } .hd-px b.dn { text-shadow: 0 0 22px rgba(226,109,90,.35); }
.hd-sp { display: block; width: 160px; max-width: 46vw; height: 30px; margin-top: 4px; }
.hd-sp polyline { fill: none; stroke: var(--h-a); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-dasharray: 600; stroke-dashoffset: 600; }
.hd.in .hd-sp polyline { animation: hdDraw 1.4s cubic-bezier(.65,0,.35,1) .2s forwards; }
@keyframes hdDraw { to { stroke-dashoffset: 0; } }
.hd-exp { text-align: right; } .hd-exp b { display: block; font-size: 17px; } .hd-exp i { font-style: normal; font-size: 12px; color: var(--h-a); }

/* range gauge */
.hd-rg { margin: 4px 2px 0; }
.hd-track { position: relative; height: 12px; border-radius: 99px; background: linear-gradient(90deg, rgba(43,182,115,.25), rgba(255,255,255,.04) 40%, rgba(255,255,255,.04) 60%, rgba(226,109,90,.25)); border: 1px solid var(--h-l); }
.hd-band { position: absolute; top: -4px; bottom: -4px; border-radius: 6px; background: rgba(224,168,46,.14); border: 1px dashed rgba(224,168,46,.5); }
.hd-wall { position: absolute; top: -7px; bottom: -7px; width: 2px; transform: translateX(-1px); border-radius: 2px; }
.hd-wall.pw { background: var(--h-up); box-shadow: 0 0 10px var(--h-up); } .hd-wall.cw { background: var(--h-dn); box-shadow: 0 0 10px var(--h-dn); }
.hd-mp { position: absolute; top: -5px; width: 8px; height: 8px; transform: translateX(-4px) rotate(45deg); background: var(--h-a); }
.hd-spot { position: absolute; top: 50%; left: var(--x); transform: translate(-50%, -50%); }
.hd-spot i { display: block; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--h-a); box-shadow: 0 0 0 4px rgba(224,168,46,.25), 0 0 18px rgba(224,168,46,.8); }
.hd.in .hd-spot i { animation: hdSlide 1.1s cubic-bezier(.23,1,.32,1) .15s both; }
@keyframes hdSlide { from { transform: translateX(-60px) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.hd-lb { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 14px; font-size: 9.5px; letter-spacing: .06em; }
.hd-lb span { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; white-space: nowrap; min-width: 0; }
.hd-lb span:first-child { align-items: flex-start; text-align: left; } .hd-lb span:last-child { align-items: flex-end; text-align: right; }
.hd-lb span i { display: none; }
.hd-lb b { display: block; font-size: 13px; color: var(--h-t); font-variant-numeric: tabular-nums; }
.hd.still .hd-spot i, .hd.still .hd-sp polyline, .hd.still .hd-g .fg, .hd.still .hd-g .kn, .hd.still .hd-or span i { animation: none !important; }
.hd-line { margin: 10px 2px 4px; font-size: 14.5px; line-height: 1.55; color: #D7D2C6; }
.hd-line b { color: var(--h-a); font-family: var(--mono, monospace); font-weight: 600; }

/* gauges */
.hd-gs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 4px; }
.hd-g { background: rgba(255,255,255,.025); border: 1px solid var(--h-l); border-radius: 14px; padding: 8px 6px 8px; text-align: center; min-width: 0; }
.hd-g svg { display: block; width: 100%; max-width: 120px; margin: 0 auto; }
.hd-g .tr { fill: none; stroke: #1A2338; stroke-width: 7; stroke-linecap: round; }
.hd-g .z { fill: none; stroke-width: 7; opacity: .35; } .hd-g .z.up { stroke: var(--h-up); } .hd-g .z.dn { stroke: var(--h-dn); }
.hd-g .fg { fill: none; stroke: var(--h-a); stroke-width: 7; stroke-linecap: round; stroke-dashoffset: var(--off); filter: drop-shadow(0 0 4px rgba(224,168,46,.5)); }
.hd.in .hd-g .fg { animation: hdArc 1.1s cubic-bezier(.23,1,.32,1) .25s both; }
@keyframes hdArc { from { stroke-dashoffset: var(--c); } to { stroke-dashoffset: var(--off); } }
.hd-g .kn { fill: #fff; } .hd.in .hd-g .kn { animation: hdFade .4s ease 1.1s both; }
@keyframes hdFade { from { opacity: 0; } to { opacity: 1; } }
.hd-g b { display: block; font-size: 16px; margin-top: -4px; } .hd-g span { display: block; font: 600 9.5px var(--mono, monospace); letter-spacing: .1em; color: var(--h-m); margin-top: 2px; }
.hd-g i { display: block; font-style: normal; font-size: 11.5px; color: var(--h-a); margin-top: 2px; }

/* OI mini */
.hd-oi { margin-top: 12px; padding: 10px 8px 6px; border-top: 1px solid var(--h-l); }
.hd-oih { display: grid; grid-template-columns: 1fr 60px 1fr; font-size: 9.5px; letter-spacing: .08em; color: var(--h-m); margin-bottom: 4px; }
.hd-oih span:nth-child(2) { text-align: center; } .hd-oih span:last-child { text-align: right; }
.hd-or { display: grid; grid-template-columns: 1fr 60px 1fr; align-items: center; height: 17px; }
.hd-or b { text-align: center; font-size: 11.5px; font-weight: 500; color: var(--h-m); }
.hd-or.atm { background: rgba(224,168,46,.1); border-radius: 4px; } .hd-or.atm b { color: var(--h-a); font-weight: 700; }
.hd-or span { position: relative; height: 9px; }
.hd-or span i { position: absolute; top: 0; bottom: 0; width: calc(var(--w) * 100%); border-radius: 2px; }
.hd-or .l i { right: 0; background: linear-gradient(270deg, rgba(43,182,115,.9), rgba(43,182,115,.3)); transform-origin: right; }
.hd-or .r i { left: 0; background: linear-gradient(90deg, rgba(226,109,90,.9), rgba(226,109,90,.3)); transform-origin: left; }
.hd.in .hd-or span i { animation: hdGrow .7s cubic-bezier(.23,1,.32,1) both; animation-delay: calc(var(--i) * 45ms + .4s); }
@keyframes hdGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.hd-note { margin: 8px 2px 0; font-size: 11px; color: var(--h-m); }
.hd-skl { display: grid; gap: 8px; margin-top: 12px; } .hd-skl i { height: 46px; border-radius: 10px; background: linear-gradient(90deg, #0A1120, #121C33, #0A1120); background-size: 200% 100%; animation: hdSk 1.2s linear infinite; }
@keyframes hdSk { to { background-position: -200% 0; } }

/* ---- today's shloka card ---- */
.gc { position: relative; display: block; width: 100%; text-align: left; margin: 0 0 12px; padding: 16px 16px 14px; border-radius: 18px; cursor: pointer; overflow: hidden; isolation: isolate;
  color: var(--h-t); border: 1px solid rgba(224,168,46,.35); font: inherit; touch-action: manipulation;
  background: radial-gradient(100% 90% at 100% 0%, rgba(224,168,46,.18), transparent 60%), linear-gradient(160deg, #0E1730, #070B16); }
.gc-k { display: block; font-size: 10.5px; letter-spacing: .12em; color: var(--h-a); }
.gc-sa { display: block; margin: 8px 0 6px; font: 400 19px/1.55 "Tiro Devanagari Sanskrit", "Noto Serif Devanagari", serif; color: #F3D58A; }
.gc-m { display: block; font-size: 14.5px; line-height: 1.55; color: #D7D2C6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.gc-go { display: block; margin-top: 10px; font-size: 13px; color: var(--h-a); }
.gc:active { transform: scale(.985); }
@media (hover: hover) and (pointer: fine) { .gc:hover { border-color: rgba(224,168,46,.6); box-shadow: 0 18px 40px -24px rgba(224,168,46,.5); } }

/* ---- boot ---- */
.bt { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 45%, #0E1730 0%, #04070F 70%); transition: opacity .4s ease; }
.bt.out { opacity: 0; pointer-events: none; }
.bt-c { text-align: center; }
.bt-ring { position: relative; width: 120px; height: 120px; margin: 0 auto; }
.bt-ring img { position: absolute; inset: 30px; width: 60px; height: 60px; border-radius: 50%; animation: btIn .6s cubic-bezier(.23,1,.32,1) both; }
.bt-ring i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid transparent; border-top-color: #E0A82E; border-right-color: rgba(224,168,46,.3); animation: btSpin 1.1s linear infinite; }
.bt-ring i:nth-child(2) { inset: 10px; animation-duration: 1.6s; animation-direction: reverse; border-top-color: #2BB673; }
.bt-ring i:nth-child(3) { inset: 20px; animation-duration: .9s; border-top-color: rgba(238,233,220,.6); }
@keyframes btSpin { to { transform: rotate(360deg); } }
@keyframes btIn { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }
.bt-n { margin: 18px 0 8px; font: 600 22px/1 Fraunces, Georgia, serif; letter-spacing: .3em; color: #E0A82E; animation: btIn .5s ease .15s both; }
.bt-s { display: flex; gap: 14px; justify-content: center; font-size: 10.5px; letter-spacing: .12em; color: #8E98B0; }
.bt-s span { opacity: 0; animation: btIn .3s ease both; } .bt-s span::before { content: "✓ "; color: #2BB673; }
.bt-s span:nth-child(1) { animation-delay: .35s; } .bt-s span:nth-child(2) { animation-delay: .6s; } .bt-s span:nth-child(3) { animation-delay: .85s; }

/* ---- HUD backdrop for the whole student app (dark theme) ---- */
.fx-grid { position: fixed; inset: 0; overflow: hidden; z-index: -1; pointer-events: none; opacity: .5; }
.fx-grid::before { content: ""; position: absolute; inset: -60px;
  background-image: linear-gradient(rgba(224,168,46,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(224,168,46,.045) 1px, transparent 1px); background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%); mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
  animation: fxDrift 24s linear infinite; }
@keyframes fxDrift { to { transform: translate3d(48px, 48px, 0); } }
html[data-theme="light"] .fx-grid { opacity: .7; }
html[data-theme="light"] .fx-grid::before { background-image: linear-gradient(rgba(185,129,20,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(185,129,20,.06) 1px, transparent 1px); }

/* numbered section heads on Home */
.hm2 { counter-reset: hl; }
.hm2 .hl-h { counter-increment: hl; }
.hm2 .hl-h span::before { content: "0" counter(hl) " / "; color: var(--muted); opacity: .7; }

/* layout: HUD and shloka on wide screens */
@media (min-width: 1100px) { .hd { padding: 18px 20px 14px; } .hd-gs { gap: 12px; } }

@media (prefers-reduced-motion: reduce) {
  .hd-scan, .fx-grid::before, .hd-h i.on { animation: none; }
  .hd.in .hd-spot, .hd.in .hd-sp polyline, .hd.in .hd-g .fg, .hd.in .hd-or span i, .hd.in .hd-g .kn { animation: none; }
  .hd-sp polyline { stroke-dashoffset: 0; }
}

/* superior demand / supply zones on the Live levels track */
.hd-zone { position: absolute; top: -5px; bottom: -5px; min-width: 4px; border-radius: 4px; }
.hd-zone.dz { background: color-mix(in srgb, var(--h-up) 32%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--h-up) 70%, transparent) inset; }
.hd-zone.sz { background: color-mix(in srgb, var(--h-dn) 32%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--h-dn) 70%, transparent) inset; }
.hd-lb b.z2 { font-size: 11px; opacity: .8; }
.hd-lb b.z2::before { content: "– "; opacity: .6; }
