:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --blue-950: #03102f;
  --blue-900: #061a48;
  --blue-800: #0b2f73;
  --blue-600: #1767df;
  --cyan: #23c6e8;
  --red: #ef3c3c;
  --white: #f8fbff;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

.target-game [hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: #02081c;
}

body {
  color: var(--white);
  overscroll-behavior: none;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid #7ee9ff;
  outline-offset: 3px;
}

.target-game {
  position: relative;
  display: flex;
  width: min(100%, 480px);
  min-height: 100svh;
  margin: 0 auto;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 20%, rgba(27, 104, 233, .45), transparent 35%),
    var(--blue-950);
  box-shadow: 0 0 80px rgba(0, 0, 0, .8);
}

.target-game__brand {
  z-index: 10;
  display: grid;
  min-height: calc(56px + var(--safe-top));
  padding: calc(8px + var(--safe-top)) 12px 8px;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
  color: #0b2f73;
  background: rgba(255, 255, 255, .98);
  border-bottom: 1px solid rgba(9, 42, 105, .1);
}

.target-game__back {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: white;
  font-size: 34px;
  line-height: 1;
  text-decoration: none;
  background: linear-gradient(145deg, #1767df, #0b2f73);
  border-radius: 14px;
}

.target-game__brand-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: .04em;
}

.target-game__brand-lockup > span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.target-game__brand-lockup strong {
  font-size: 16px;
  font-weight: 950;
}

.target-game__brand-lockup small {
  margin-top: 3px;
  color: #1767df;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .22em;
}

.target-game__brand-mark {
  position: relative;
  width: 23px;
  height: 17px;
  transform: skewX(-16deg);
  background: linear-gradient(180deg, #1767df 0 53%, #ef3c3c 53%);
  border-radius: 4px 11px 4px 11px;
}

.target-game__poc {
  padding: 6px 8px;
  color: #1767df;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .1em;
  background: #eaf2ff;
  border-radius: 8px;
}

.target-game__play {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.target-game__hud {
  z-index: 4;
  display: grid;
  min-height: 82px;
  padding: 10px 12px 8px;
  grid-template-columns: 62px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, rgba(3, 16, 47, .98), rgba(3, 16, 47, .78));
}

.target-game__timer {
  position: relative;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
}

.target-game__timer svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.target-game__timer circle {
  fill: rgba(6, 26, 72, .82);
  stroke: rgba(255, 255, 255, .25);
  stroke-width: 4;
}

.target-game__timer circle:last-child {
  fill: none;
  stroke: var(--cyan);
  stroke-dasharray: 125.664;
  stroke-dashoffset: 0;
  stroke-linecap: round;
  transition: stroke-dashoffset .25s linear, stroke .2s ease;
}

.target-game__timer strong {
  position: relative;
  margin-top: -4px;
  font-size: 22px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.target-game__timer span {
  position: absolute;
  bottom: 9px;
  font-size: 7px;
  font-weight: 950;
  letter-spacing: .09em;
}

.target-game__title-lockup {
  min-width: 0;
  text-align: center;
  transform: rotate(-1deg);
}

.target-game__title-lockup p {
  margin: 0;
  color: #dceaff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .07em;
}

.target-game__title-lockup .target-game__eyebrow {
  color: #57d9f4;
  font-size: 7px;
  letter-spacing: .18em;
}

.target-game__title-lockup h1 {
  margin: 1px 0 0;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(24px, 7.4vw, 34px);
  font-style: italic;
  line-height: .95;
  letter-spacing: .025em;
  text-shadow: 0 3px 0 #0e55bd, 0 6px 16px rgba(0, 0, 0, .5);
}

.target-game__score {
  display: flex;
  min-width: 70px;
  padding: 8px 7px;
  flex-direction: column;
  text-align: center;
  background: linear-gradient(145deg, rgba(255, 255, 255, .98) 0 40%, #0d3f99 40%);
  border: 2px solid rgba(255, 255, 255, .75);
  border-radius: 13px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .25);
}

.target-game__score span {
  margin-bottom: 5px;
  color: #0d3f99;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .07em;
}

.target-game__score strong {
  font-size: 17px;
  font-weight: 950;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.target-game__combo {
  position: absolute;
  z-index: 6;
  top: 92px;
  left: 50%;
  display: flex;
  padding: 7px 16px 8px;
  align-items: baseline;
  gap: 5px;
  transform: translateX(-50%) rotate(-2deg);
  color: #fff7ca;
  background: linear-gradient(135deg, rgba(83, 37, 0, .8), rgba(255, 173, 0, .18));
  border: 1px solid rgba(255, 219, 94, .6);
  border-radius: 999px;
  box-shadow: 0 0 22px rgba(255, 187, 34, .55);
  animation: target-combo-pop .25s ease-out both;
}

.target-game__combo span {
  color: #ffd959;
  font-size: 10px;
  font-weight: 950;
  font-style: italic;
}

.target-game__combo strong {
  font-size: 21px;
  font-weight: 950;
}

.target-game__stage {
  position: relative;
  min-height: 390px;
  flex: 1;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(2, 13, 41, .05) 35%, rgba(4, 22, 63, .35)),
    url("assets/arena-v01.webp") center center / cover no-repeat,
    linear-gradient(180deg, #061a48, #0d55aa);
  touch-action: none;
}

.target-game__stage::after {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 0;
  left: 0;
  height: 26%;
  content: "";
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(3, 16, 47, .5));
}

.target-game__canvas,
.target-game__canvas canvas {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.target-game__canvas canvas {
  touch-action: none;
}

.target-game__intro,
.target-game__result,
.target-game__fallback {
  position: absolute;
  z-index: 8;
  top: 50%;
  left: 50%;
  width: min(86%, 360px);
  padding: 24px 22px 22px;
  transform: translate(-50%, -50%);
  text-align: center;
  background: linear-gradient(150deg, rgba(8, 38, 94, .97), rgba(3, 15, 47, .97));
  border: 1px solid rgba(126, 233, 255, .48);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55), inset 0 1px rgba(255, 255, 255, .15);
  backdrop-filter: blur(12px);
}

.target-game__intro-kicker,
.target-game__result-kicker {
  display: inline-flex;
  padding: 5px 9px;
  color: #7ee9ff;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .12em;
  background: rgba(35, 198, 232, .12);
  border-radius: 999px;
}

.target-game__intro h2,
.target-game__result h2 {
  margin: 10px 0 6px;
  font-size: clamp(27px, 8vw, 38px);
  font-weight: 950;
  letter-spacing: -.04em;
}

.target-game__intro p {
  max-width: 30ch;
  margin: 0 auto;
  color: #dbe8ff;
  font-size: 13px;
  line-height: 1.45;
}

.target-game__gesture {
  position: relative;
  width: 80px;
  height: 98px;
  margin: 14px auto 10px;
}

.target-game__gesture-ball {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 24px;
  width: 34px;
  height: 34px;
  background:
    radial-gradient(circle at 36% 33%, #ff7a67 0 10%, transparent 11%),
    conic-gradient(from 15deg, #e83232, #154da6 24%, #e83232 45%, #154da6 72%, #e83232);
  border: 2px solid rgba(255, 255, 255, .8);
  border-radius: 50%;
  box-shadow: 0 7px 14px rgba(0, 0, 0, .4);
}

.target-game__gesture-line {
  position: absolute;
  top: 25px;
  left: 39px;
  width: 3px;
  height: 57px;
  transform-origin: top;
  background: repeating-linear-gradient(to bottom, #7ee9ff 0 7px, transparent 7px 12px);
  animation: target-gesture-line 1.2s ease-in-out infinite;
}

.target-game__gesture-arrow {
  position: absolute;
  bottom: -4px;
  left: 28px;
  color: #7ee9ff;
  font-size: 35px;
  line-height: 1;
  animation: target-gesture-arrow 1.2s ease-in-out infinite;
}

.target-game__primary {
  min-width: 190px;
  min-height: 48px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: .08em;
  cursor: pointer;
  background: linear-gradient(180deg, #2b83ff, #1355c5);
  border: 2px solid rgba(255, 255, 255, .8);
  border-radius: 15px;
  box-shadow: 0 8px 0 #082c79, 0 12px 25px rgba(0, 0, 0, .35);
}

.target-game__primary:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 #082c79, 0 7px 16px rgba(0, 0, 0, .3);
}

.target-game__final-score {
  display: flex;
  margin: 12px 0 14px;
  flex-direction: column;
  color: #ffd959;
  font-size: 52px;
  font-weight: 950;
  line-height: .9;
  text-shadow: 0 4px 0 #a86100;
}

.target-game__final-score small {
  margin-top: 8px;
  color: white;
  font-size: 9px;
  letter-spacing: .2em;
  text-shadow: none;
}

.target-game__result dl {
  display: grid;
  margin: 0 0 17px;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.target-game__result dl div {
  padding: 9px 4px;
  background: rgba(255, 255, 255, .07);
  border-radius: 10px;
}

.target-game__result dt {
  min-height: 24px;
  color: #abc4ef;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.2;
}

.target-game__result dd {
  margin: 3px 0 0;
  font-size: 16px;
  font-weight: 950;
}

.target-game__controls {
  z-index: 4;
  display: grid;
  min-height: 78px;
  padding: 7px 12px;
  grid-template-columns: minmax(0, 1.5fr) 68px 68px;
  align-items: stretch;
  gap: 8px;
  background: linear-gradient(180deg, #0a347e, #061a48);
  border-top: 1px solid rgba(126, 233, 255, .2);
}

.target-game__next {
  position: relative;
  display: grid;
  min-width: 0;
  padding: 7px 8px 7px 50px;
  align-content: center;
  background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(224, 236, 255, .96));
  border: 2px solid white;
  border-radius: 13px;
  box-shadow: 0 6px 0 rgba(2, 12, 38, .4);
}

.target-game__next span {
  color: #0b2f73;
  font-size: 7px;
  font-weight: 950;
  letter-spacing: .05em;
}

.target-game__next strong {
  margin-top: 2px;
  color: #0b2f73;
  font-size: 14px;
  font-weight: 950;
}

.target-game__next i {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 31px;
  height: 31px;
  transform: translateY(-50%);
  background: #1f78ff;
  border: 6px solid #d4e5ff;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px white, 0 3px 6px rgba(3, 25, 73, .25);
}

.target-game__power {
  position: relative;
  display: flex;
  padding: 5px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: linear-gradient(180deg, #2c79e9, #1349aa);
  border: 2px solid rgba(255, 255, 255, .72);
  border-radius: 13px;
  box-shadow: 0 6px 0 rgba(2, 12, 38, .42);
}

.target-game__power--aim {
  background: linear-gradient(180deg, #f14c45, #b51c21);
}

.target-game__power b {
  font-size: 23px;
  line-height: 1;
}

.target-game__power small {
  margin-top: 4px;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .05em;
}

.target-game__power-count {
  position: absolute;
  top: -7px;
  right: -5px;
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  font-size: 11px;
  font-weight: 950;
  background: #ef3c3c;
  border: 2px solid white;
  border-radius: 50%;
}

.target-game__power[disabled] {
  cursor: default;
  filter: grayscale(1);
  opacity: .45;
}

.target-game__power[data-active="true"] {
  box-shadow: 0 0 0 3px #7ee9ff, 0 0 20px #23c6e8;
}

.target-game__instruction {
  z-index: 4;
  display: flex;
  min-height: calc(48px + var(--safe-bottom));
  margin: 0;
  padding: 8px 13px calc(8px + var(--safe-bottom));
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  color: #e7f0ff;
  font-size: 10px;
  font-weight: 900;
  font-style: italic;
  line-height: 1.25;
  background: #03102f;
  border-top: 1px solid rgba(126, 233, 255, .2);
}

.target-game__instruction span {
  color: #7ee9ff;
  font-size: 22px;
}

.target-game__instruction strong {
  color: var(--cyan);
}

.target-game__status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.target-game[data-phase="playing"] .target-game__intro,
.target-game[data-phase="result"] .target-game__intro {
  display: none;
}

.target-game[data-phase="result"] .target-game__controls {
  pointer-events: none;
  filter: saturate(.5) brightness(.65);
}

.target-game[data-phase="idle"] .target-game__controls,
.target-game[data-phase="initializing"] .target-game__controls {
  pointer-events: none;
  filter: saturate(.4) brightness(.7);
}

@keyframes target-combo-pop {
  from { opacity: 0; transform: translateX(-50%) scale(.6) rotate(-2deg); }
}

@keyframes target-gesture-line {
  0%, 100% { transform: scaleY(.55); opacity: .45; }
  50% { transform: scaleY(1); opacity: 1; }
}

@keyframes target-gesture-arrow {
  0%, 100% { transform: translateY(-12px); opacity: .4; }
  50% { transform: translateY(4px); opacity: 1; }
}

@media (min-width: 760px) {
  body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    background:
      radial-gradient(circle at 50% 25%, rgba(24, 91, 208, .3), transparent 30%),
      #020817;
  }

  .target-game {
    min-height: min(920px, calc(100vh - 48px));
    border: 1px solid rgba(126, 233, 255, .2);
    border-radius: 32px;
  }
}

@media (max-height: 710px) {
  .target-game__brand {
    min-height: calc(48px + var(--safe-top));
  }

  .target-game__hud {
    min-height: 70px;
    padding-top: 6px;
    padding-bottom: 5px;
  }

  .target-game__timer {
    width: 52px;
    height: 52px;
  }

  .target-game__stage {
    min-height: 300px;
  }

  .target-game__controls {
    min-height: 68px;
  }

  .target-game__instruction {
    min-height: calc(40px + var(--safe-bottom));
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

.target-lab {
  position: fixed;
  z-index: 100;
  top: 14px;
  right: 14px;
  width: min(360px, calc(100vw - 28px));
  color: #eef6ff;
  font-size: 12px;
  background: rgba(3, 16, 47, .96);
  border: 1px solid rgba(126, 233, 255, .45);
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .55);
  backdrop-filter: blur(18px);
}

.target-lab details {
  overflow: hidden;
  border-radius: inherit;
}

.target-lab summary {
  display: flex;
  min-height: 46px;
  padding: 11px 14px;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
  background: linear-gradient(135deg, #0d3f99, #071d51);
}

.target-lab summary::-webkit-details-marker {
  display: none;
}

.target-lab summary span {
  padding: 4px 7px;
  color: #03102f;
  font-size: 9px;
  letter-spacing: .12em;
  background: #7ee9ff;
  border-radius: 6px;
}

.target-lab form {
  max-height: min(720px, calc(100vh - 90px));
  padding: 12px;
  overflow-y: auto;
}

.target-lab__presets,
.target-lab__actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.target-lab button {
  min-height: 34px;
  padding: 7px 8px;
  color: #eff6ff;
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
  background: #123b86;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 8px;
}

.target-lab__grid {
  display: grid;
  margin-top: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.target-lab__grid label {
  display: grid;
  gap: 4px;
  color: #abc4ef;
  font-size: 9px;
  font-weight: 800;
}

.target-lab input[type="number"],
.target-lab input[type="text"],
.target-lab select {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  color: white;
  background: #061a48;
  border: 1px solid #315a9d;
  border-radius: 8px;
}

.target-lab__toggles {
  display: flex;
  margin: 11px 0;
  flex-wrap: wrap;
  gap: 8px;
}

.target-lab__toggles label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
}

.target-lab__actions {
  grid-template-columns: 1fr 1.6fr 1fr;
}

.target-lab .target-lab__apply {
  color: #03102f;
  background: #7ee9ff;
  border-color: white;
}

.target-lab output {
  display: block;
  min-height: 18px;
  margin-top: 9px;
  color: #7ee9ff;
  font-size: 10px;
}

.target-lab__metrics {
  display: grid;
  margin: 8px 0 0;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.target-lab__metrics div {
  padding: 7px;
  background: rgba(255, 255, 255, .06);
  border-radius: 7px;
}

.target-lab__metrics dt {
  color: #abc4ef;
  font-size: 8px;
}

.target-lab__metrics dd {
  margin: 2px 0 0;
  font-weight: 900;
}

@media (max-width: 760px) {
  .target-lab {
    top: auto;
    right: 8px;
    bottom: calc(8px + var(--safe-bottom));
    left: 8px;
    width: auto;
  }

  .target-lab form {
    max-height: min(68vh, 600px);
  }
}
