:root {
  --ink: #14160f;
  --olive: #5d6b3a;
  --olive-hi: #9fb35c;
  --sand: #efe6cf;
  --fire: #ff7a1a;
  --fire-hi: #ffc23d;
  --red: #e5302a;
  --hud-h: 58px;
  --stencil: "Black Ops One", Impact, sans-serif;
  --mono: "Share Tech Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--sand);
  font-family: var(--mono);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: none;
}
body { cursor: none; }
@media (hover: none) { body { cursor: auto; } }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: none; }
@media (hover: none) { button, a { cursor: pointer; } }

/* ---------- HUD ---------- */
.hud {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--hud-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  background: linear-gradient(180deg, rgba(10,11,7,.92), rgba(10,11,7,.55));
  border-bottom: 2px solid rgba(159,179,92,.35);
  backdrop-filter: blur(4px);
}
.hud-logo { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.tick { font-family: var(--stencil); font-size: 22px; color: var(--fire-hi); text-shadow: 0 0 12px rgba(255,122,26,.6); }
.hud-name { font-family: var(--stencil); font-size: 14px; letter-spacing: .12em; color: var(--sand); opacity: .8; }
.ca {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  max-width: 420px; min-width: 0;
  height: 36px; padding: 0 6px 0 10px;
  border: 1px solid rgba(159,179,92,.6);
  background: rgba(93,107,58,.18);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.ca-label { color: var(--olive-hi); font-size: 12px; }
.ca-val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.ca-copy { font-size: 11px; padding: 4px 8px; background: var(--olive); color: var(--ink); font-weight: 700; }
.ca.copied .ca-copy { background: var(--fire-hi); }
.hud-btns { display: flex; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 14px;
  font-family: var(--stencil); font-size: 14px; letter-spacing: .06em; white-space: nowrap;
  border: 1px solid rgba(239,230,207,.35);
  background: rgba(20,22,15,.6);
  transition: transform .12s, background .12s;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.btn:hover { transform: translateY(-1px); background: rgba(93,107,58,.5); }
.btn-buy { background: linear-gradient(180deg, var(--fire-hi), var(--fire)); color: #1a0d00; border-color: var(--fire-hi); }
.btn-buy:hover { background: linear-gradient(180deg, #ffd56a, #ff8e3a); }
.btn-x, .btn-mute { width: 36px; padding: 0; }

/* ---------- stage ---------- */
.stage { position: fixed; inset: 0; overflow: hidden; }
.level {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transform: scale(1.08);
  transition: opacity .35s ease, transform .9s cubic-bezier(.2,.7,.2,1), visibility 0s .35s;
}
.level.on { opacity: 1; visibility: visible; transform: scale(1); transition: opacity .25s ease, transform 1.2s cubic-bezier(.2,.7,.2,1); }
.level video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: contrast(1.06) saturate(.92); }
.level::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(0deg, rgba(10,11,7,.85) 0%, rgba(10,11,7,0) 38%), linear-gradient(180deg, rgba(10,11,7,.5) 0%, rgba(10,11,7,0) 22%);
}

/* captions: slam in, no scrolling text */
.cap { position: absolute; left: 5vw; bottom: 9vh; z-index: 2; max-width: min(760px, 88vw); }
.tag {
  display: inline-block; font-size: 13px; letter-spacing: .18em; color: var(--ink);
  background: var(--olive-hi); padding: 4px 10px; margin-bottom: 12px;
}
.cap h2 {
  font-family: var(--stencil); font-weight: 400; line-height: .92;
  font-size: clamp(40px, 6.5vw, 104px);
  color: var(--sand);
  text-shadow: 0 4px 0 rgba(0,0,0,.55), 0 0 40px rgba(255,122,26,.35);
}
.cap .sub { margin-top: 12px; font-size: clamp(15px, 1.6vw, 20px); color: var(--fire-hi); text-shadow: 0 2px 0 #000; }
.level .tag, .level h2, .level .sub { opacity: 0; }
.level.on .tag { animation: slamX .35s .25s cubic-bezier(.2,1.4,.4,1) forwards; }
.level.on h2 { animation: slam .45s .4s cubic-bezier(.2,1.6,.4,1) forwards; }
.level.on .sub { animation: type .4s .85s steps(8) forwards; }
@keyframes slam { 0% { opacity: 0; transform: scale(2.6) rotate(-4deg); filter: blur(6px); } 70% { opacity: 1; transform: scale(.94) rotate(1deg); filter: blur(0); } 100% { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes slamX { 0% { opacity: 0; transform: translateX(-60px); } 100% { opacity: 1; transform: none; } }
@keyframes type { 0% { opacity: 0; clip-path: inset(0 100% 0 0); } 1% { opacity: 1; } 100% { opacity: 1; clip-path: inset(0 0 0 0); } }

/* final briefing */
.level-final::after { background: rgba(10,11,7,.62); }
.brief {
  position: absolute; z-index: 2; left: 50%; top: calc(50% + var(--hud-h) / 2);
  transform: translate(-50%, -50%);
  width: min(880px, calc(100vw - 32px));
  padding: 28px clamp(18px, 3vw, 36px);
  background: rgba(16,18,11,.78);
  border: 1px solid rgba(159,179,92,.5);
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
}
.brief h2 { font-family: var(--stencil); font-weight: 400; font-size: clamp(32px, 5vw, 64px); line-height: 1; margin-bottom: 18px; color: var(--sand); }
.obj { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.obj li { display: flex; gap: 12px; padding: 12px; background: rgba(93,107,58,.18); border-left: 3px solid var(--fire); }
.obj b { font-family: var(--stencil); font-size: 26px; color: var(--fire-hi); line-height: 1; }
.obj span { font-size: 14px; line-height: 1.35; }
.obj em { display: block; font-style: normal; font-family: var(--stencil); font-size: 16px; letter-spacing: .06em; color: var(--olive-hi); margin-bottom: 2px; }
.brief-btns { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.btn.big { height: 50px; font-size: 18px; padding: 0 26px; }
.btn.ghost { background: transparent; }
.fine { margin-top: 14px; font-size: 11px; opacity: .55; }
.level-final .tag, .level-final h2, .level-final .obj li, .level-final .brief-btns { opacity: 0; }
.level-final.on .tag { animation: slamX .35s .2s forwards; }
.level-final.on h2 { animation: slam .45s .3s cubic-bezier(.2,1.6,.4,1) forwards; }
.level-final.on .obj li { animation: slamX .3s forwards; }
.level-final.on .obj li:nth-child(1) { animation-delay: .6s; }
.level-final.on .obj li:nth-child(2) { animation-delay: .75s; }
.level-final.on .obj li:nth-child(3) { animation-delay: .9s; }
.level-final.on .obj li:nth-child(4) { animation-delay: 1.05s; }
.level-final.on .brief-btns { animation: slam .4s 1.25s forwards; }

/* ---------- overlays ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 30; pointer-events: none; opacity: .14;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain .5s steps(4) infinite;
}
@keyframes grain { 0% { transform: translate(0,0); } 25% { transform: translate(-3%,2%); } 50% { transform: translate(2%,-3%); } 75% { transform: translate(-2%,-1%); } }
.vignette { position: fixed; inset: 0; z-index: 31; pointer-events: none; box-shadow: inset 0 0 18vmin rgba(0,0,0,.75); }
.flash { position: fixed; inset: 0; z-index: 40; pointer-events: none; background: #fff6dc; opacity: 0; }
.flash.go { animation: flash .45s ease-out; }
@keyframes flash { 0% { opacity: .95; } 100% { opacity: 0; } }
.stage.shake { animation: shake .5s cubic-bezier(.36,.07,.19,.97); }
@keyframes shake {
  10%, 90% { transform: translate(-3px, 2px) rotate(-.3deg); }
  20%, 80% { transform: translate(6px, -4px) rotate(.4deg); }
  30%, 50%, 70% { transform: translate(-10px, 6px) rotate(-.6deg); }
  40%, 60% { transform: translate(10px, -6px) rotate(.6deg); }
}
.stage.punch { animation: punch .18s ease-out; }
@keyframes punch { 0% { transform: scale(1.025); } 100% { transform: scale(1); } }

/* click explosions */
.fx { position: fixed; inset: 0; z-index: 35; pointer-events: none; }
.boom { position: absolute; width: 0; height: 0; }
.boom i { position: absolute; left: 0; top: 0; border-radius: 50%; transform: translate(-50%,-50%); }
.boom .core { width: 140px; height: 140px; background: radial-gradient(circle, #fff7d1 0%, var(--fire-hi) 25%, var(--fire) 50%, rgba(229,48,42,.6) 68%, transparent 72%); animation: core .5s ease-out forwards; }
.boom .ring { width: 40px; height: 40px; border: 3px solid rgba(255,214,120,.9); animation: ring .45s ease-out forwards; }
.boom .smoke { width: 120px; height: 120px; background: radial-gradient(circle, rgba(70,66,58,.7), transparent 70%); animation: smoke 1.1s ease-out forwards; }
.boom .spark { width: 6px; height: 6px; background: var(--fire-hi); box-shadow: 0 0 8px var(--fire); animation: spark .6s ease-out forwards; }
.boom .word {
  border-radius: 0; font-family: var(--stencil); font-size: 34px; color: var(--fire-hi); white-space: nowrap;
  -webkit-text-stroke: 2px #2a1200; text-shadow: 0 3px 0 #000; animation: word .7s ease-out forwards;
}
@keyframes core { 0% { transform: translate(-50%,-50%) scale(.1); opacity: 1; } 60% { opacity: 1; } 100% { transform: translate(-50%,-50%) scale(1.3); opacity: 0; } }
@keyframes ring { 0% { transform: translate(-50%,-50%) scale(.3); opacity: 1; } 100% { transform: translate(-50%,-50%) scale(6); opacity: 0; } }
@keyframes smoke { 0% { transform: translate(-50%,-50%) scale(.3); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(-50%,-90%) scale(2.2); opacity: 0; } }
@keyframes spark { 0% { transform: translate(-50%,-50%); opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))); opacity: 0; } }
@keyframes word { 0% { transform: translate(-50%,-50%) scale(.3) rotate(var(--r)); opacity: 0; } 25% { transform: translate(-50%,-90%) scale(1.15) rotate(var(--r)); opacity: 1; } 100% { transform: translate(-50%,-150%) scale(1) rotate(var(--r)); opacity: 0; } }

/* crosshair */
.xhair {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none;
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border: 2px solid rgba(255,194,61,.9); border-radius: 50%;
  box-shadow: 0 0 10px rgba(255,122,26,.5);
  transition: width .08s, height .08s, margin .08s;
}
.xhair::before, .xhair::after { content: ""; position: absolute; background: rgba(255,194,61,.9); }
.xhair::before { left: 50%; top: -10px; bottom: -10px; width: 2px; margin-left: -1px; }
.xhair::after { top: 50%; left: -10px; right: -10px; height: 2px; margin-top: -1px; }
.xhair.hot { width: 30px; height: 30px; margin: -15px 0 0 -15px; border-color: var(--red); }
@media (hover: none) { .xhair { display: none; } }

/* ammo progress */
.ammo { position: fixed; right: 16px; top: 50%; transform: translateY(-50%); z-index: 45; display: flex; flex-direction: column; gap: 8px; }
.ammo button { width: 14px; height: 34px; padding: 0; position: relative; }
.ammo button::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, #e8c46a 0 30%, #b88a2a 30% 100%);
  clip-path: polygon(50% 0, 100% 28%, 100% 100%, 0 100%, 0 28%);
  opacity: .3; transition: opacity .2s, transform .2s;
}
.ammo button.done::before { opacity: .65; }
.ammo button.cur::before { opacity: 1; transform: scale(1.25); filter: drop-shadow(0 0 6px var(--fire)); }

.kills { position: fixed; left: 16px; top: calc(var(--hud-h) + 12px); z-index: 45; font-size: 12px; letter-spacing: .14em; color: var(--sand); background: rgba(10,11,7,.6); padding: 6px 10px; border-left: 3px solid var(--red); }
.kills b { color: var(--fire-hi); font-size: 16px; margin-left: 6px; }
.kills.bump b { display: inline-block; animation: bump .25s; }
@keyframes bump { 50% { transform: scale(1.6); } }

.next { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 45; font-size: 12px; letter-spacing: .2em; opacity: 0; transition: opacity .4s; text-shadow: 0 2px 0 #000; }
.next.show { opacity: .85; }
.next span { display: inline-block; animation: bob 1s infinite; color: var(--fire-hi); }
@keyframes bob { 50% { transform: translateY(4px); } }

/* ---------- boot screen ---------- */
.boot { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--ink); overflow: hidden; }
.boot-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; filter: grayscale(.4) contrast(1.1); animation: drift 14s ease-in-out infinite alternate; }
@keyframes drift { to { transform: scale(1.08); } }
.boot::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,.25) 0 2px, transparent 2px 4px); pointer-events: none; }
.boot-in { position: relative; z-index: 2; text-align: center; padding: 16px; }
.boot-tag { font-size: 12px; letter-spacing: .3em; color: var(--olive-hi); margin-bottom: 18px; }
.boot h1 { font-family: var(--stencil); font-weight: 400; font-size: clamp(64px, 14vw, 170px); line-height: .82; color: var(--sand); text-shadow: 0 6px 0 rgba(0,0,0,.6); }
.boot h1 span { color: var(--fire-hi); text-shadow: 0 6px 0 rgba(0,0,0,.6), 0 0 50px rgba(255,122,26,.7); }
.start {
  margin-top: 30px; font-family: var(--stencil); font-size: clamp(20px, 3vw, 30px); letter-spacing: .14em;
  padding: 14px 34px; color: #1a0d00; background: linear-gradient(180deg, var(--fire-hi), var(--fire));
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  animation: blink 1.1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: .55; } }
.boot-hint { margin-top: 18px; font-size: 12px; opacity: .65; }
.boot.out { animation: bootOut .6s forwards; }
@keyframes bootOut { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.4); visibility: hidden; } }

/* ---------- mobile ---------- */
@media (max-width: 720px) {
  :root { --hud-h: 100px; }
  .hud { flex-wrap: wrap; height: var(--hud-h); padding: 8px 12px; gap: 8px; align-content: center; }
  .hud-name { display: none; }
  .ca { order: 3; margin-left: 0; flex: 1 1 100%; max-width: none; }
  .hud-btns { margin-left: auto; }
  .btn-buy { padding: 0 12px; }
  .cap { left: 16px; right: 16px; bottom: 10vh; }
  .ammo { right: 8px; gap: 6px; }
  .ammo button { width: 10px; height: 24px; }
  .kills { left: 12px; }
  .obj { grid-template-columns: 1fr; gap: 6px; }
  .obj li { padding: 8px 10px; }
  .obj b { font-size: 20px; }
  .brief { padding: 18px 16px; left: 16px; transform: translateY(-50%); width: calc(100vw - 46px); }
  .brief h2 { margin-bottom: 12px; }
  .btn.big { height: 44px; font-size: 15px; padding: 0 10px; flex: 1; }
  .fine { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .grain, .boot-bg, .start { animation: none; }
}
