/* HOLY WAR (Noble × booter): the drop page. Uses the shared arcade system (os.css); this adds the
   audit terminal, the trailer cabinet, the decrypt grid and its HUD, the pop-up sprites and the clear screen. */

.holy-war { --hw-purple: #2a0f3d; --hw-grid: rgba(196, 68, 255, .35); }
.holy-war .gold { color: var(--gold); font-weight: 400; }
.holy-war [hidden] { display: none !important; }

/* ---------- hero ---------- */
.hw-hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(28px, 5vw, 72px);
  align-items: center; padding-top: clamp(28px, 5vw, 64px); padding-bottom: clamp(48px, 6vw, 80px); position: relative;
}
.hw-hero::before { /* the synthwave floor from the trailer */
  content: ''; position: absolute; inset: auto 0 0; height: 46%; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to top, transparent, var(--black) 92%),
    repeating-linear-gradient(90deg, var(--hw-grid) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(0deg, var(--hw-grid) 0 1px, transparent 1px 28px);
  transform: perspective(380px) rotateX(58deg); transform-origin: bottom; opacity: .55;
  mask-image: linear-gradient(to top, #000 10%, transparent 90%);
}
.hw-term { padding: 14px 16px 12px; margin-bottom: 28px; max-width: 460px; background: #070509; }
.hw-term-k { color: var(--gold); margin: 0 0 10px; }
.hw-audit { list-style: none; margin: 0; padding: 0; font: 400 15px/1.55 var(--f-hud); text-transform: uppercase; }
.hw-audit li, .hw-verdict, .hw-signals { display: flex; gap: 10px; align-items: baseline; animation: hw-type .16s steps(2) both; animation-delay: calc(.35s + var(--i) * .38s); }
.hw-audit span { color: var(--white); }
.hw-audit i { flex: 1; border-bottom: 2px dotted rgba(243, 240, 232, .3); transform: translateY(-4px); }
.hw-audit b { color: var(--fire); font-weight: 400; }
.hw-audit b.on { color: var(--gold); text-shadow: 0 0 10px rgba(255, 204, 51, .5); }
.hw-verdict { color: var(--fire); margin: 10px 0 0; font-size: 11px; }
.hw-signals { color: var(--sky); margin: 4px 0 0; font-size: 11px; }
@keyframes hw-type { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hw-audit li, .hw-verdict, .hw-signals { animation: none; } }

.hw-hero .title-xl { font-size: clamp(64px, 11vw, 156px); }
.hw-vs { margin: 14px 0 18px; font: 700 clamp(26px, 3.4vw, 42px)/1 var(--f-display); color: var(--white); display: flex; gap: .4em; align-items: center; flex-wrap: wrap; }
.hw-vs span { color: var(--gold); font-size: .8em; }
.hw-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 20px 0 26px; }
.hw-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

.hw-trailer { margin: 0; padding: 0; justify-self: center; width: min(100%, 460px); background: #000; }
.hw-trailer video { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; background: #000; }
.hw-trailer figcaption { position: absolute; left: 10px; top: 10px; padding: 4px 6px; background: rgba(5, 5, 5, .7); }
.hw-sound { position: absolute; right: 10px; bottom: 10px; }
.hw-sound[aria-pressed='true'] { --bg: var(--gold); }

.hw-ticker { background: var(--gold); }
.hw-ticker-track span { white-space: nowrap; }
.hw-ticker-track .hw-dot { color: var(--fire); }

/* ---------- the game ---------- */
.hw-how { max-width: 46ch; margin: 0; }
.hw-hud {
  position: sticky; top: calc(var(--hud-h) + 10px); z-index: 30;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px clamp(16px, 3vw, 40px);
  padding: 12px 18px; margin-bottom: 30px; background: rgba(5, 5, 5, .94);
}
.hw-hud > div { display: grid; gap: 4px; }
.hw-hud .hud-type { font-size: 10px; color: var(--muted); }
.hw-hud b { font: 400 18px/1 var(--f-hud); color: var(--white); }
#hw-combo { color: var(--gold); }
.hw-hud.bump b { animation: hw-bump .3s steps(3); }
@keyframes hw-bump { 50% { transform: translateY(-3px); color: var(--gold); } }
.hw-skip { margin-left: auto; }

.hw-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(22px, 3vw, 40px) clamp(16px, 2.4vw, 32px); }
.hw-card { --p: 0; display: grid; gap: 14px; }
.hw-frame { position: relative; aspect-ratio: 9 / 16; overflow: hidden; background: #000; border: var(--px) solid var(--white); box-shadow: var(--mis-box); cursor: default; }
.hw-card[data-state='open'] .hw-frame { cursor: zoom-in; }
.hw-poster, .hw-loop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hw-loop { opacity: 0; transition: opacity .3s steps(3); }
.hw-card[data-state='open'] .hw-loop { opacity: 1; }
/* locked: the signal is corrupted; holding the button brings it back (--p goes 0 → 1) */
.hw-card[data-state='locked'] .hw-poster {
  filter: grayscale(calc(1 - var(--p))) contrast(calc(1.6 - var(--p) * .6)) brightness(calc(.35 + var(--p) * .65)) blur(calc((1 - var(--p)) * 9px));
  transform: scale(calc(1.12 - var(--p) * .12));
}
.hw-lock {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 8px; text-align: center; pointer-events: none;
  opacity: calc(1 - var(--p) * 1.3);
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .55) 0 2px, transparent 2px 4px);
}
.hw-lock-k { font: 400 12px/1 var(--f-hud); text-transform: uppercase; letter-spacing: .1em; color: var(--fire); background: var(--black); padding: 6px 8px; box-shadow: -3px 0 0 var(--sky), 3px 0 0 var(--fire); animation: blink 1.4s steps(1) infinite; }
.hw-lock-n { font: 700 clamp(44px, 6vw, 72px)/1 var(--f-display); color: var(--white); text-shadow: var(--mis); }
.hw-card[data-state='open'] .hw-lock, .hw-card[data-state='open'] .hw-meter { display: none; }
.hw-card.charging .hw-frame { animation: hw-shake .12s steps(2) infinite; }
@keyframes hw-shake { 50% { transform: translate(2px, -1px); } }
.hw-card.charging .hw-lock { background: repeating-linear-gradient(0deg, rgba(47, 107, 255, .25) 0 2px, transparent 2px 5px); }
.hw-card[data-state='locked'] .hw-frame { cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.hw-ctl { position: absolute; left: 12px; right: 12px; bottom: 12px; display: grid; gap: 10px; justify-items: center; }
.hw-card[data-state='open'] .hw-ctl { display: none; }
.hw-meter { position: relative; width: 100%; height: 14px; background: var(--black); border: 2px solid var(--white); }
.hw-name-open { display: none; }
.hw-card[data-state='open'] .hw-name-open { display: inline; }
.hw-card[data-state='open'] .hw-name-lock { display: none; }
.hw-name-lock { color: var(--muted); }
.hw-meter i { position: absolute; inset: 0 auto 0 0; width: calc(var(--p) * 100%); background: var(--white); }
.hw-meter b { position: absolute; top: -2px; bottom: -2px; left: 72%; width: 16%; border: 2px solid var(--gold); box-shadow: 0 0 8px rgba(255, 204, 51, .6); }
.hw-card.gold .hw-meter i { background: var(--gold); }
.hw-card.gold .hw-frame { box-shadow: -5px -5px 0 var(--gold), 5px 5px 0 var(--fire); }
.hw-tag { position: absolute; left: 8px; top: 8px; padding: 4px 6px; font: 400 11px/1 var(--f-hud); background: var(--black); color: var(--gold); display: none; }
.hw-card[data-state='open'] .hw-tag { display: block; }
.hw-card.flash .hw-frame::after { content: ''; position: absolute; inset: 0; background: var(--white); animation: hw-flash .6s steps(4) forwards; }
@keyframes hw-flash { to { opacity: 0; } }

.hw-info { display: grid; gap: 6px; }
.hw-k { color: var(--muted); margin: 0; font-size: 11px; }
.hw-name { margin: 0; font: 700 clamp(22px, 2.2vw, 30px)/1 var(--f-display); color: var(--white); }
.hw-act { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.hw-hold { max-width: 100%; white-space: nowrap; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.hw-card.charging .hw-hold { --bg: var(--gold); transform: translateY(2px); }

/* score pops */
.hw-pop { position: fixed; z-index: 60; pointer-events: none; transform: translate(-50%, -50%); white-space: nowrap; font: 700 18px/1 var(--f-display); color: var(--gold); text-shadow: -2px 0 0 var(--sky), 2px 0 0 var(--fire); animation: hw-rise .95s steps(8) forwards; }
.hw-pop.big { font-size: 24px; }
@keyframes hw-rise { to { transform: translate(-50%, calc(-50% - 48px)); opacity: 0; } }

/* ---------- pop-up sprites (the same feel as the site's peeks, but these score) ---------- */
.hwp { position: fixed; z-index: 45; pointer-events: none; overflow: visible; clip-path: inset(-300px -400px 0 -400px); padding-top: 28px; box-sizing: content-box; }
.hwp.side { padding-top: 0; clip-path: none; }
.hwp.in-flow { position: absolute; }
.hwp canvas { position: absolute; left: 0; bottom: 0; width: 100%; height: auto; image-rendering: pixelated; pointer-events: auto; cursor: crosshair; touch-action: manipulation;
  transform: translateY(105%); transition: transform .26s cubic-bezier(.2, 1.5, .4, 1); }
.hwp.up canvas { transform: translateY(var(--rise, 45%)); }
.hwp.side canvas { transform: translateX(var(--from, -105%)) rotate(var(--tilt, 0deg)); transform-origin: bottom center; }
.hwp.side.up canvas { transform: translateX(var(--to, -30%)) rotate(var(--tilt, 0deg)); }
.hwp .say { position: absolute; top: calc(var(--rise, 0%) - 6px); left: 50%; transform: translate(-10%, -8px); padding: 7px 10px; background: var(--white); color: var(--black);
  font: 400 11px/1.1 var(--f-hud); text-transform: uppercase; white-space: nowrap; opacity: 0; transition: opacity .2s steps(2); box-shadow: -3px 0 0 var(--sky), 3px 0 0 var(--fire); }
.hwp.side .say { top: -10px; }
.hwp.talk .say { opacity: 1; }
.hwp.flipsay .say { left: auto; right: 50%; transform: translate(10%, -8px); }
.hw-halo {
  position: fixed; left: 0; z-index: 46; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; cursor: crosshair;
  animation: hw-drift 5.5s linear forwards;
}
.hw-halo::before { content: ''; position: absolute; inset: 10px 4px; border: 5px solid var(--gold); border-radius: 50%; box-shadow: 0 0 14px rgba(255, 204, 51, .8), -3px 0 0 var(--sky), 3px 0 0 var(--fire); animation: hw-bob .6s steps(2) infinite; }
.hw-halo.got::before { transform: scale(1.8); opacity: 0; transition: all .2s steps(3); }
@keyframes hw-drift { from { transform: translateX(var(--from)); } to { transform: translateX(var(--to)); } }
@keyframes hw-bob { 50% { translate: 0 -5px; } }

/* ---------- clear screen ---------- */
.hw-clear { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(5, 5, 5, .82); }
.hw-clear[hidden] { display: none; }
.hw-clear-in { width: min(560px, 100%); text-align: center; display: grid; gap: 14px; justify-items: center; padding: 28px 24px; }
.hw-clear-in .hud-type { color: var(--gold); margin: 0; }
.hw-rank { margin: 0; font: 700 120px/1 var(--f-display); color: var(--gold); text-shadow: -5px 0 0 var(--sky), 5px 0 0 var(--fire); animation: hw-stamp .5s steps(5); }
.hw-rank[data-rank='C'] { color: var(--white); }
@keyframes hw-stamp { from { transform: scale(2.4); opacity: 0; } }
.hw-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; width: 100%; margin: 0; }
.hw-stats div { border: 2px solid var(--line, #444); padding: 8px; }
.hw-stats dt { font: 400 10px/1 var(--f-hud); color: var(--muted); text-transform: uppercase; }
.hw-stats dd { margin: 6px 0 0; font: 400 16px/1 var(--f-hud); color: var(--white); }
.hw-clear .hw-cta { justify-content: center; }
.hw-bit { position: fixed; top: -12px; z-index: 95; width: 8px; height: 8px; pointer-events: none; animation: hw-fall 2s steps(14) forwards; }
@keyframes hw-fall { to { transform: translate(var(--dx), 105vh); } }

/* ---------- inspect ---------- */
.hw-inspect-d { padding: 0; border: var(--px) solid var(--white); background: var(--black); color: var(--bone); width: min(980px, calc(100vw - 32px)); max-height: calc(100svh - 32px); box-shadow: var(--mis-box); overflow: auto; }
.hw-inspect-d::backdrop { background: rgba(0, 0, 0, .85); }
.hw-ins { position: relative; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.hw-ins-media { background: #000; }
.hw-ins-media video { width: 100%; height: auto; aspect-ratio: 9 / 16; max-height: calc(100svh - 38px); object-fit: contain; }
.hw-ins-copy { padding: clamp(20px, 3vw, 36px); display: grid; align-content: start; gap: 14px; }
.hw-ins-copy .hud-type { margin: 0; color: var(--gold); }
.hw-ins-copy .muted { color: var(--muted); }
.hw-ins-text p { margin: 0 0 12px; }
.hw-ins-text p:first-child { color: var(--white); font-size: 19px; }
.hw-ins-close { position: absolute; right: 10px; top: 10px; }

/* ---------- players ---------- */
.hw-players { display: grid; grid-template-columns: 1fr auto 1fr; gap: 24px; align-items: center; margin: 36px 0 34px; }
.hw-player { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: end; cursor: pointer; }
.hw-player canvas { width: 132px; height: auto; image-rendering: pixelated; }
.hw-player figcaption { display: grid; gap: 8px; }
.hw-pname { font: 700 34px/1 var(--f-display); color: var(--white); text-shadow: var(--mis); }
.hw-links { display: flex; gap: 14px; font: 400 12px/1 var(--f-hud); text-transform: uppercase; }
.hw-links a { text-decoration: none; padding: 8px 0; }
.hw-links a:hover { color: var(--gold); }
.hw-x { margin: 0; font: 700 64px/1 var(--f-display); color: var(--gold); text-shadow: var(--mis); }
.hw-facts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin: 0; }
.hw-facts dt { font: 400 10px/1 var(--f-hud); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.hw-facts dd { margin: 8px 0 0; font: 400 15px/1.2 var(--f-hud); color: var(--white); text-transform: uppercase; }
.hw-copy { background: none; border: 0; padding: 0; min-height: 32px; font: inherit; color: var(--gold); text-transform: none; }
.hw-copy:hover { text-decoration: underline; }

.hw-outro { padding-top: 0; }
.hw-outro-in { text-align: center; display: grid; justify-items: center; gap: 18px; padding: clamp(32px, 6vw, 72px) 22px; }
.hw-outro-in .title-l { max-width: 16ch; }
.hw-outro-in .hud-type { margin: 0; }
.hw-outro .hw-cta { justify-content: center; margin-top: 10px; }

/* ---------- small screens ---------- */
@media (max-width: 960px) {
  .hw-hero { grid-template-columns: 1fr; }
  .hw-trailer { order: -1; width: min(100%, 420px, 58svh); }
  .hw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hw-players { grid-template-columns: 1fr; }
  .hw-x { text-align: center; font-size: 44px; }
  .hw-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hw-ins { grid-template-columns: 1fr; }
  .hw-ins-media video { max-height: 62svh; }
  .hw-term { display: none; } /* decorative; on phones the title comes straight after the trailer */
  .hw-hero { padding-top: 20px; gap: 28px; }
}
@media (max-width: 560px) {
  .hw-grid { gap: 26px 12px; }
  .hw-name { font-size: 20px; }
  .hw-act .btn { width: 100%; }
  .hw-hud { flex-wrap: nowrap; gap: 12px; padding: 8px 10px; top: calc(var(--hud-h) + 6px); }
  .hw-hud b { font-size: 14px; }
  .hw-hud .hw-hud-x { display: none; }
  .hw-hud .hw-skip { margin-left: auto; min-height: 36px; padding: 6px 8px; font-size: 10px; }
  .hw-hold { padding-inline: 10px; font-size: 11px; letter-spacing: .03em; }
  .hw-hold .hw-long { display: none; }
  .hwp .say { white-space: normal; width: max-content; max-width: min(220px, 62vw); line-height: 1.3; }
  .hw-player { grid-template-columns: 96px 1fr; }
  .hw-player canvas { width: 96px; }
  .hw-term { margin-bottom: 22px; }
  .hw-audit { font-size: 13px; }
  .hw-lock-k { font-size: 10px; }
  .hw-verse { display: none; }
  .hw-player { align-items: center; }
  .hw-players { margin: 28px 0 26px; gap: 14px; }
  .hw-hero .title-xl { font-size: clamp(58px, 17vw, 84px); }
}
@media (hover: none) { .btn--sm, .hw-act .btn, .hw-hud .hw-skip { min-height: 44px; } .hw-links a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; } .hw-copy { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { .hw-card.charging .hw-frame, .hw-lock-k { animation: none; } }
