/* Widowmaker — Le Dernier Bal
   Palette: midnight blue, cobalt, rose gold on bone white. High-fashion serif, hairline rules. */

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('../fonts/cormorant-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('../fonts/cormorant-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('../fonts/cormorant-500i.woff2') format('woff2');
  font-weight: 500; font-style: italic; font-display: swap;
}

:root {
  --midnight: #060a16;
  --midnight-2: #0b1226;
  --cobalt: #4f6fd8;
  --cobalt-deep: #2b3f8f;
  --rosegold: #d8a47c;
  --rosegold-dim: rgba(216, 164, 124, 0.55);
  --bone: #f2ece1;
  --bone-dim: rgba(242, 236, 225, 0.6);
  --venom: #8ee06a;
  --serif: 'Cormorant Garamond', Didot, 'Bodoni MT', 'Playfair Display', Georgia, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--midnight); }
body { font-family: var(--serif); color: var(--bone); -webkit-user-select: none; user-select: none; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.hidden { display: none !important; }

.rule { width: 220px; height: 1px; margin: 14px auto;
  background: linear-gradient(90deg, transparent, var(--rosegold), transparent); }
.rule.thin { width: 100%; margin: 6px 0; opacity: 0.6; }

/* ---------- screens ---------- */
.screen {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, rgba(11,18,38,0.35), rgba(6,10,22,0.88) 75%);
  transition: opacity 0.9s ease;
}
.screen.fading { opacity: 0; pointer-events: none; }
.title-inner { text-align: center; padding: 24px; max-width: 92vw; }
.pretitle {
  font-style: italic; letter-spacing: 0.45em; font-size: clamp(12px, 1.6vw, 16px);
  color: var(--rosegold); text-transform: lowercase;
}
h1 {
  font-weight: 500; font-size: clamp(44px, 9vw, 110px); letter-spacing: 0.22em;
  margin: 10px 0 4px; text-indent: 0.22em;
  background: linear-gradient(180deg, var(--bone) 30%, var(--cobalt) 130%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  text-shadow: 0 0 60px rgba(79, 111, 216, 0.35);
}
h2 { font-weight: 500; font-size: clamp(30px, 5.5vw, 62px); letter-spacing: 0.12em; margin: 8px 0; }
.subtitle { font-style: italic; font-size: clamp(15px, 2.2vw, 22px); color: var(--bone-dim); letter-spacing: 0.14em; }
.tagline { margin: 22px 0 30px; font-size: clamp(16px, 2.4vw, 24px); font-style: italic; color: var(--rosegold); letter-spacing: 0.12em; }

.btn {
  font-family: var(--serif); font-size: clamp(16px, 2.2vw, 22px); letter-spacing: 0.28em;
  text-transform: uppercase; text-indent: 0.28em;
  color: var(--bone); background: transparent;
  border: 1px solid var(--rosegold-dim); padding: 14px 44px; cursor: pointer;
  transition: all 0.4s ease;
}
.btn:hover, .btn:focus-visible {
  border-color: var(--rosegold); color: var(--rosegold);
  box-shadow: 0 0 30px rgba(216, 164, 124, 0.25), inset 0 0 20px rgba(216, 164, 124, 0.06);
  outline: none;
}
.controls-hint { margin-top: 34px; font-size: clamp(11px, 1.5vw, 15px); color: var(--bone-dim);
  letter-spacing: 0.08em; line-height: 2.1; }
.controls-hint .sep { color: var(--rosegold-dim); margin: 0 8px; }

#go-breakdown { margin: 18px auto 26px; font-size: clamp(15px, 2vw, 20px); color: var(--bone-dim);
  line-height: 2; letter-spacing: 0.08em; }
#go-breakdown .b-score { color: var(--rosegold); font-size: 1.5em; letter-spacing: 0.2em; }
#go-breakdown .smirk { font-style: italic; color: var(--cobalt); }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 20; pointer-events: none; }

#contracts {
  position: absolute; top: 22px; left: 24px; width: min(280px, 42vw);
  background: rgba(6, 10, 22, 0.55); border: 1px solid rgba(216, 164, 124, 0.22);
  padding: 12px 16px; backdrop-filter: blur(3px);
}
.contracts-head { letter-spacing: 0.4em; font-size: 13px; color: var(--rosegold); text-indent: 0.4em; }
#contract-list { list-style: none; margin-top: 6px; }
#contract-list li { font-size: 15px; letter-spacing: 0.06em; padding: 3px 0; color: var(--bone-dim);
  transition: color 0.5s; display: flex; gap: 8px; align-items: baseline; }
#contract-list li .tick { color: var(--rosegold-dim); font-style: italic; min-width: 14px; }
#contract-list li.done { color: var(--rosegold); }
#contract-list li.done .tick { color: var(--rosegold); }
#contract-list li .prog { font-size: 12px; color: var(--cobalt); margin-left: auto; }

#score-box { position: absolute; top: 22px; right: 24px; text-align: right; }
.score-label { letter-spacing: 0.4em; font-size: 11px; color: var(--rosegold-dim); }
#score { font-size: 34px; letter-spacing: 0.12em; color: var(--bone); line-height: 1.1; }

#vitals { position: absolute; left: 24px; bottom: 26px; width: min(220px, 30vw); }
.vital-label { letter-spacing: 0.35em; font-size: 11px; color: var(--rosegold-dim); margin-bottom: 5px; }
.bar { height: 2px; background: rgba(242, 236, 225, 0.15); }
#hp-fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--cobalt), var(--rosegold));
  transition: width 0.3s ease; }

#ammo-box { position: absolute; right: 24px; bottom: 26px; text-align: right; }
.ammo-label { letter-spacing: 0.35em; font-size: 11px; color: var(--rosegold-dim); margin-top: 5px; }
#ammo-pips { display: flex; gap: 5px; justify-content: flex-end; }
#ammo-pips .pip { width: 3px; height: 18px; background: var(--bone); opacity: 0.85;
  transform: skewX(-12deg); transition: opacity 0.2s, background 0.2s; }
#ammo-pips .pip.spent { opacity: 0.15; background: var(--rosegold); }

#abilities { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 18px; }
.ability { position: relative; width: 74px; text-align: center; padding: 8px 4px 6px;
  border: 1px solid rgba(216, 164, 124, 0.25); background: rgba(6, 10, 22, 0.5); }
.ability .key { display: block; font-size: 17px; color: var(--bone); letter-spacing: 0.1em; }
.ability .ab-name { display: block; font-size: 10.5px; letter-spacing: 0.14em; color: var(--bone-dim); }
.ability .ab-name em { font-style: normal; color: var(--rosegold); }
.ability .cd { position: absolute; inset: 0; background: rgba(6, 10, 22, 0.78);
  transform-origin: bottom; transform: scaleY(0); }
.ability.ready { border-color: var(--rosegold); box-shadow: 0 0 14px rgba(216, 164, 124, 0.2); }
.ability.ready .key { color: var(--rosegold); }
.ability.active { border-color: var(--cobalt); box-shadow: 0 0 18px rgba(79, 111, 216, 0.45); }

/* crosshair */
#crosshair { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
#crosshair .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--bone);
  box-shadow: 0 0 6px rgba(242, 236, 225, 0.8); }
#hitmarker { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px;
  transform: translate(-50%, -50%) rotate(45deg); opacity: 0; pointer-events: none; }
#hitmarker::before, #hitmarker::after { content: ''; position: absolute; background: var(--rosegold); }
#hitmarker::before { left: 0; top: 50%; width: 100%; height: 1px; }
#hitmarker::after { top: 0; left: 50%; height: 100%; width: 1px; }
#hitmarker.head::before, #hitmarker.head::after { background: #ff5f4a; }
#hitmarker.show { animation: hitpop 0.35s ease-out; }
@keyframes hitpop { 0% { opacity: 1; transform: translate(-50%,-50%) rotate(45deg) scale(0.6); }
  100% { opacity: 0; transform: translate(-50%,-50%) rotate(45deg) scale(1.5); } }

#grapple-hint { position: absolute; left: 50%; top: 58%; transform: translateX(-50%);
  letter-spacing: 0.3em; font-size: 14px; color: var(--rosegold); text-indent: 0.3em;
  animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* enemy markers */
#markers { position: absolute; inset: 0; overflow: hidden; }
.marker { position: absolute; transform: translate(-50%, -100%); font-size: 22px;
  color: #ffd34d; text-shadow: 0 0 8px rgba(0,0,0,0.8); transition: color 0.3s; font-family: var(--serif); }
.marker.alert { color: #ff5f4a; }
.marker.vip { color: var(--rosegold); font-size: 15px; letter-spacing: 0.2em; font-style: italic; }

/* popups + toast */
#popups { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); text-align: center; }
.popup { font-size: 19px; letter-spacing: 0.2em; color: var(--bone); animation: rise 1.4s ease-out forwards; }
.popup .pts { color: var(--rosegold); }
.popup.head { color: #ff8d7a; }
@keyframes rise { 0% { opacity: 0; transform: translateY(12px); }
  15% { opacity: 1; transform: translateY(0); } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-18px); } }

#toast { position: absolute; left: 50%; top: 14%; transform: translateX(-50%); text-align: center;
  font-size: clamp(17px, 2.4vw, 24px); letter-spacing: 0.18em; color: var(--rosegold); font-style: italic;
  animation: toastin 4s ease forwards; white-space: nowrap; }
@keyframes toastin { 0% { opacity: 0; transform: translate(-50%, -8px); }
  10% { opacity: 1; transform: translate(-50%, 0); } 80% { opacity: 1; } 100% { opacity: 0; } }

#alert-vignette { position: absolute; inset: 0; opacity: 0; transition: opacity 0.6s;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(160, 30, 30, 0.28) 100%); }
#alert-vignette.on { opacity: 1; animation: alertpulse 1.4s ease-in-out infinite; }
@keyframes alertpulse { 50% { opacity: 0.55; } }
#infra-vignette { position: absolute; inset: 0; opacity: 0; transition: opacity 0.8s;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(79, 111, 216, 0.3) 100%); }
#infra-vignette.on { opacity: 1; }

/* ---------- scope ---------- */
#scope { position: fixed; inset: 0; z-index: 25; pointer-events: none; }
.scope-mask { position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 31vmin, rgba(2, 3, 8, 0.985) 32.5vmin); }
.scope-ring { position: absolute; left: 50%; top: 50%; width: 63vmin; height: 63vmin;
  transform: translate(-50%, -50%); border-radius: 50%;
  border: 1px solid rgba(216, 164, 124, 0.5);
  box-shadow: 0 0 40px rgba(79, 111, 216, 0.25), inset 0 0 60px rgba(79, 111, 216, 0.12); }
#scope-svg { position: absolute; left: 50%; top: 50%; width: 62vmin; height: 62vmin; transform: translate(-50%,-50%); }
#scope-svg .hair { stroke: rgba(242, 236, 225, 0.75); stroke-width: 0.12; }
#scope-svg .dotc { fill: var(--rosegold); }
#scope-svg .charge { fill: none; stroke: var(--cobalt); stroke-width: 0.7;
  stroke-dasharray: 292; stroke-dashoffset: 292; transform: rotate(-90deg); transform-origin: 50% 50%;
  filter: drop-shadow(0 0 2px var(--cobalt)); }
#scope-svg .charge.full { stroke: var(--rosegold); filter: drop-shadow(0 0 3px var(--rosegold)); }
#charge-label { position: absolute; left: 50%; top: calc(50% + 36vmin); transform: translateX(-50%);
  letter-spacing: 0.35em; font-size: 13px; color: var(--cobalt); text-indent: 0.35em; }
#charge-label span { color: var(--bone); }
#breath-label { position: absolute; left: 50%; top: calc(50% - 40vmin); transform: translateX(-50%);
  letter-spacing: 0.35em; font-size: 12px; color: var(--rosegold); font-style: italic; text-indent: 0.35em; }

/* ---------- touch ---------- */
#touch { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
#stick-zone { position: absolute; left: 0; bottom: 0; width: 45%; height: 55%; pointer-events: auto; }
#stick-base { position: absolute; left: 60px; bottom: 90px; width: 110px; height: 110px;
  border-radius: 50%; border: 1px solid rgba(216, 164, 124, 0.4); background: rgba(6, 10, 22, 0.35); }
#stick-nub { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; border-radius: 50%;
  transform: translate(-50%, -50%); background: rgba(216, 164, 124, 0.35);
  border: 1px solid var(--rosegold-dim); }
#touch-buttons { position: absolute; right: 14px; bottom: 80px; display: flex; flex-direction: column;
  gap: 10px; pointer-events: auto; align-items: flex-end; }
.tbtn { font-family: var(--serif); min-width: 96px; min-height: 48px; letter-spacing: 0.18em;
  font-size: 14px; color: var(--bone); background: rgba(6, 10, 22, 0.55);
  border: 1px solid rgba(216, 164, 124, 0.4); border-radius: 4px; touch-action: none; }
.tbtn.big { min-width: 110px; min-height: 64px; font-size: 17px; border-color: var(--rosegold); }
.tbtn:active { background: rgba(216, 164, 124, 0.3); }

#fade { position: fixed; inset: 0; z-index: 50; background: #02030a; opacity: 0;
  pointer-events: none; transition: opacity 0.7s ease; }
#fade.on { opacity: 1; pointer-events: auto; }

/* ---------- narrow viewports ---------- */
@media (max-width: 700px) {
  #contracts { top: 10px; left: 10px; padding: 8px 10px; width: min(230px, 58vw); }
  .contracts-head { font-size: 11px; }
  #contract-list li { font-size: 12.5px; }
  #score-box { top: 10px; right: 12px; }
  #score { font-size: 24px; }
  #abilities { display: none; } /* touch buttons cover these actions */
  #toast { top: 24%; white-space: normal; width: 88vw; }
  #vitals { left: 12px; bottom: 12px; width: 120px; }
  #ammo-box { right: 12px; bottom: 12px; }
  #ammo-pips .pip { height: 13px; }
  #stick-base { left: 30px; bottom: 70px; }
  #touch-buttons { bottom: 60px; right: 10px; }
}
