:root {
  --black: #070707;
  --red: #e10600;
  --cream: #f4f2eb;
  --muted: #a59f99;
  --line: rgba(244, 242, 235, .17);
}

* { box-sizing: border-box; }
html { background: var(--black); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 35%, rgba(225, 6, 0, .19), transparent 34%),
    var(--black);
  color: var(--cream);
  font-family: "Inter", sans-serif;
  overflow-x: hidden;
}
button, a { font: inherit; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
[hidden] { display: none !important; }

.grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitchTiles'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.game-header {
  height: 82px;
  padding: 12px clamp(18px, 4vw, 60px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.game-brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 15px; }
.game-brand video { width: 50px; height: 50px; object-fit: cover; border-radius: 4px; }
.exit-link, .range-controls { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.exit-link:hover { color: var(--red); }

.game-shell {
  width: min(1500px, 100%);
  min-height: calc(100vh - 150px);
  margin: auto;
  padding: clamp(30px, 5vw, 76px) clamp(18px, 4vw, 60px);
  display: grid;
  grid-template-columns: minmax(250px, .68fr) minmax(500px, 1.32fr);
  gap: clamp(28px, 5vw, 80px);
  align-items: center;
}
.kicker { margin: 0 0 16px; color: var(--red); font-weight: 800; font-size: 11px; letter-spacing: .2em; }
h1, h2 { font-family: "Anton", sans-serif; font-weight: 400; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(74px, 9vw, 154px); line-height: .76; letter-spacing: -.035em; }
h1 span { color: var(--red); }
.game-subtitle { max-width: 470px; margin: 34px 0; color: var(--muted); line-height: 1.65; font-size: 14px; }
.prize-chip { display: flex; align-items: center; gap: 13px; margin: -14px 0 26px; }
.prize-chip > span {
  display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto;
  border: 2px solid #ffcf45; border-radius: 50%; color: #ffcf45;
  font: 400 23px/1 "Anton"; box-shadow: 0 0 24px rgba(255, 207, 69, .18);
}
.prize-chip strong, .prize-chip small { display: block; }
.prize-chip strong { font-size: 10px; letter-spacing: .13em; }
.prize-chip small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.game-stats { display: grid; grid-template-columns: repeat(2, minmax(95px, 1fr)); border: 1px solid var(--line); }
.game-stats div { padding: 14px; border: 1px solid var(--line); }
.game-stats span { display: block; color: var(--muted); font-size: 9px; letter-spacing: .14em; font-weight: 800; }
.game-stats strong { display: block; margin-top: 5px; font-family: "Anton"; font-size: 28px; font-weight: 400; }

.range-wrap { min-width: 0; }
.range {
  position: relative;
  min-height: min(65vh, 650px);
  overflow: hidden;
  border: 1px solid rgba(244, 242, 235, .28);
  background:
    linear-gradient(180deg, rgba(0,0,0,.15), rgba(0,0,0,.73)),
    url("assets/images/targetpractice4.PNG") center / cover;
  isolation: isolate;
  cursor: crosshair;
  touch-action: manipulation;
  box-shadow: 0 30px 100px rgba(0,0,0,.5);
}
.range:focus-visible { outline: 2px solid var(--cream); outline-offset: 4px; }
.range.game-live, .range.game-live .target { cursor: none; }
.range-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .18;
  background-image: linear-gradient(var(--cream) 1px, transparent 1px), linear-gradient(90deg, var(--cream) 1px, transparent 1px);
  background-size: 11% 14%;
}
.range-label { position: absolute; top: 15px; left: 17px; z-index: 1; color: rgba(255,255,255,.55); font-size: 9px; font-weight: 800; letter-spacing: .2em; }
.prize-meter {
  position: absolute; top: 14px; right: 16px; z-index: 5; width: min(190px, 42%); height: 22px;
  overflow: hidden; border: 1px solid rgba(255, 207, 69, .55); background: rgba(0,0,0,.72);
}
.prize-meter span { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #8d4c00, #ffcf45); transition: width .25s ease; }
.prize-meter b { position: relative; display: grid; place-items: center; height: 100%; font-size: 8px; letter-spacing: .1em; text-shadow: 1px 1px #000; }
.game-screen {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
  background: rgba(5, 5, 5, .77);
  backdrop-filter: blur(5px);
  cursor: default;
}
.game-screen > p:first-child { margin: 0; color: var(--red); font-size: 10px; font-weight: 800; letter-spacing: .2em; }
.game-screen h2 { margin: 6px 0; font-size: clamp(80px, 10vw, 150px); line-height: 1; }
.instructions { max-width: 420px; margin: 4px 0 25px; color: #c5bfba; font-size: 13px; line-height: 1.55; }
.primary-button {
  min-width: 180px;
  min-height: 54px;
  padding: 0 26px;
  border: 0;
  background: var(--red);
  color: white;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .18s, background .18s;
}
.primary-button:hover { transform: translateY(-3px); background: #ff1710; }
.results { display: flex; gap: 25px; margin: 4px 0 12px; font-size: 10px; color: var(--muted); letter-spacing: .1em; }
.results b { color: var(--cream); }
.rank-status { min-height: 22px; margin: -13px 0 8px; color: var(--cream); font-size: 10px; font-weight: 800; letter-spacing: .07em; }
.rank-status a { color: #ffcf45; text-decoration: underline; text-underline-offset: 3px; }
.reward-status { min-height: 31px; margin: -12px 0 14px; font-size: 11px; font-weight: 800; color: #ffcf45; letter-spacing: .05em; }
.reward-status a { text-decoration: underline; text-underline-offset: 3px; }
.countdown { position: absolute; inset: 0; z-index: 12; display: grid; place-items: center; pointer-events: none; font: 400 clamp(110px, 20vw, 240px)/1 "Anton"; text-shadow: 0 5px 30px #000; }
.callout { position: absolute; left: 50%; top: 12%; z-index: 6; transform: translateX(-50%); color: white; font: 400 38px/1 "Anton"; text-shadow: 3px 3px 0 #000; pointer-events: none; opacity: 0; }
.callout.show { animation: callout .45s ease; }
@keyframes callout { 0% { opacity: 0; transform: translate(-50%, 12px) scale(.8); } 28% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -12px); } }
.crosshair {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 20;
  width: 44px;
  height: 44px;
  border: 2px solid rgba(255, 255, 255, .95);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 4px #000);
  transition: opacity .1s ease;
}
.crosshair.visible { opacity: 1; }
.crosshair::before, .crosshair::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: var(--red);
  box-shadow: 0 0 5px rgba(225, 6, 0, .9);
  transform: translate(-50%, -50%);
}
.crosshair::before { width: 58px; height: 2px; }
.crosshair::after { width: 2px; height: 58px; }
.crosshair i {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 0 3px var(--red), 0 0 10px var(--red);
  transform: translate(-50%, -50%);
}
.crosshair.fire { animation: crosshair-fire .16s ease; }
@keyframes crosshair-fire { 45% { transform: translate(-50%, -50%) scale(.72); border-color: #ffcf45; } }

.target {
  position: absolute;
  width: clamp(68px, 10vw, 106px);
  aspect-ratio: 1;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 0;
  border: 2px solid rgba(255,255,255,.85);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(225,6,0,.78), rgba(0,0,0,.8) 64%, #000 65%);
  color: transparent;
  cursor: crosshair;
  transform: scale(0) rotate(-10deg);
  animation: target-in .16s cubic-bezier(.2, 1.45, .5, 1) forwards;
  box-shadow: 0 0 0 8px rgba(225,6,0,.16), 0 0 38px rgba(225,6,0,.75), 0 9px 30px rgba(0,0,0,.7);
}
.target::before { content: ""; position: absolute; inset: -18%; background: url("assets/images/tp4-skull-target.png") center / contain no-repeat; filter: drop-shadow(0 0 5px #e10600); pointer-events: none; }
.target::after { content: ""; position: absolute; inset: -10px; border: 1px solid rgba(255,255,255,.4); border-radius: 50%; animation: target-pulse .65s ease-in-out infinite alternate; }
.target.gold { border-color: #ffe18b; background: radial-gradient(circle, rgba(255,193,37,.88), rgba(76,31,0,.86) 64%, #140900 65%); box-shadow: 0 0 0 8px rgba(255,193,37,.18), 0 0 48px rgba(255,193,37,.9), 0 9px 30px #000; }
.target.gold::before { filter: sepia(1) saturate(3) brightness(1.35) drop-shadow(0 0 7px #ffd45d); }
.target.gold::after { border-color: #ffd45d; }
.target.hit { animation: target-hit .2s ease forwards; pointer-events: none; }
@keyframes target-in { to { transform: scale(1) rotate(0); } }
@keyframes target-hit { to { opacity: 0; transform: scale(1.55) rotate(15deg); filter: saturate(2); } }
@keyframes target-pulse { to { transform: scale(1.12); opacity: .25; } }
.range.flash { animation: range-flash .12s; }
@keyframes range-flash { 50% { filter: brightness(1.7); } }
.range.shake { animation: range-shake .22s linear; }
@keyframes range-shake { 20% { transform: translate(-4px, 2px); } 40% { transform: translate(4px, -2px); } 60% { transform: translate(-3px, -1px); } 80% { transform: translate(3px, 1px); } }
.hit-particle { position: absolute; z-index: 8; width: 6px; height: 18px; background: var(--red); pointer-events: none; animation: particle-out .48s ease-out forwards; }
.hit-particle.gold { background: #ffd45d; box-shadow: 0 0 8px #ffd45d; }
@keyframes particle-out { to { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(180deg) scale(.2); } }
.point-pop { position: absolute; z-index: 9; color: white; font: 400 25px/1 "Anton"; text-shadow: 2px 2px #000; pointer-events: none; animation: point-pop .65s ease-out forwards; }
.point-pop.gold { color: #ffd45d; font-size: 32px; }
@keyframes point-pop { to { opacity: 0; transform: translateY(-55px) scale(1.25); } }
.prize-burst { animation: prize-burst .6s ease !important; }
@keyframes prize-burst { 35% { box-shadow: inset 0 0 100px #ffcf45, 0 0 90px #ffcf45; } }

.range-controls { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.range-controls button { padding: 12px 0; border: 0; background: none; cursor: pointer; color: var(--cream); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

.leaderboard-section { width: min(1380px, calc(100% - clamp(36px, 8vw, 120px))); margin: 20px auto clamp(70px, 9vw, 130px); }
.leaderboard-heading { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: end; margin-bottom: 34px; }
.leaderboard-heading h2 { margin: 0; font-size: clamp(64px, 8vw, 120px); line-height: .78; letter-spacing: -.03em; }
.leaderboard-heading h2 span { color: var(--red); }
.leaderboard-copy { max-width: 500px; justify-self: end; }
.leaderboard-copy > p:first-child { margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.leaderboard-challenge { margin: 0; color: #ffcf45; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.leaderboard-card { border: 1px solid var(--line); background: rgba(10,10,10,.82); box-shadow: 0 28px 80px rgba(0,0,0,.36); }
.leaderboard-labels, .leaderboard-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) minmax(90px, .55fr) minmax(80px, .45fr) minmax(120px, .65fr);
  align-items: center;
  gap: 18px;
}
.leaderboard-labels { padding: 13px clamp(14px, 3vw, 34px); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.leaderboard-labels span:last-child { text-align: right; }
.leaderboard-list { margin: 0; padding: 0; list-style: none; counter-reset: leaderboard; }
.leaderboard-row { position: relative; min-height: 72px; padding: 12px clamp(14px, 3vw, 34px); border-bottom: 1px solid var(--line); counter-increment: leaderboard; transition: background .2s, transform .2s; }
.leaderboard-row:hover { background: rgba(225,6,0,.07); transform: translateX(3px); }
.leaderboard-row.current-player { background: linear-gradient(90deg, rgba(255,207,69,.13), transparent); box-shadow: inset 3px 0 #ffcf45; }
.leaderboard-player { min-width: 0; display: flex; align-items: center; gap: 17px; }
.leaderboard-rank { width: 38px; color: var(--muted); font: 400 25px/1 "Anton"; }
.leaderboard-row:nth-child(1) .leaderboard-rank { color: #ffcf45; }
.leaderboard-row:nth-child(2) .leaderboard-rank { color: #d9d9d9; }
.leaderboard-row:nth-child(3) .leaderboard-rank { color: #bd7441; }
.leaderboard-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 800; text-transform: uppercase; }
.you-badge { margin-left: 8px; padding: 3px 6px; background: #ffcf45; color: #080808; font-size: 7px; letter-spacing: .08em; }
.leaderboard-stat { color: #c8c2bd; font: 400 21px/1 "Anton"; }
.leaderboard-score { color: var(--cream); text-align: right; font: 400 clamp(26px, 3vw, 39px)/1 "Anton"; }
.leaderboard-empty { padding: 45px 20px; color: var(--muted); text-align: center; font-size: 12px; }
.leaderboard-footer { display: flex; justify-content: space-between; gap: 20px; padding: 16px clamp(14px, 3vw, 34px); color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.leaderboard-footer a { color: #ffcf45; }
.leaderboard-footer a:hover { color: white; }
footer { min-height: 68px; padding: 18px clamp(18px, 4vw, 60px); display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
footer div { display: flex; gap: 24px; }
footer a:hover { color: var(--red); }

@media (max-width: 900px) {
  .game-shell { grid-template-columns: 1fr; align-items: start; }
  .game-copy { display: grid; grid-template-columns: 1fr 1fr; column-gap: 25px; }
  .kicker, .game-subtitle, .prize-chip { grid-column: 1; }
  h1 { grid-column: 1; font-size: clamp(68px, 15vw, 115px); }
  .game-stats { grid-column: 2; grid-row: 2 / span 3; align-self: end; }
  .range { min-height: min(58vh, 580px); }
}
@media (max-width: 580px) {
  .game-header { height: 68px; }
  .game-brand video { width: 40px; height: 40px; }
  .game-brand span { display: none; }
  .game-shell { padding-top: 24px; gap: 24px; }
  .game-copy { display: block; }
  h1 { font-size: clamp(66px, 22vw, 100px); }
  .game-subtitle { margin: 22px 0; }
  .prize-chip { margin: -8px 0 20px; }
  .game-stats { grid-template-columns: repeat(4, 1fr); }
  .game-stats div { padding: 9px 7px; text-align: center; }
  .game-stats strong { font-size: 22px; }
  .range { min-height: 52vh; }
  .range-controls span { display: none; }
  .leaderboard-section { width: calc(100% - 36px); margin-top: 10px; }
  .leaderboard-heading { grid-template-columns: 1fr; gap: 22px; }
  .leaderboard-copy { justify-self: start; }
  .leaderboard-labels { grid-template-columns: 1fr auto; }
  .leaderboard-labels span:nth-child(2), .leaderboard-labels span:nth-child(3) { display: none; }
  .leaderboard-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .leaderboard-row > .leaderboard-stat { display: none; }
  .leaderboard-player { gap: 9px; }
  .leaderboard-rank { width: 28px; font-size: 21px; }
  .leaderboard-score { font-size: 27px; }
  .leaderboard-footer { flex-direction: column; }
  footer { align-items: flex-start; gap: 16px; }
  footer div { flex-direction: column; gap: 8px; text-align: right; }
}
@media (hover: none), (pointer: coarse) {
  .crosshair { display: none; }
  .range.game-live, .range.game-live .target { cursor: pointer; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
