:root {
  color-scheme: dark;
  --bg: #070908;
  --panel: rgba(13, 18, 14, 0.82);
  --panel-strong: rgba(20, 31, 22, 0.94);
  --line: rgba(161, 255, 122, 0.2);
  --text: #f4f8ec;
  --muted: #a8b39f;
  --green: #92ff68;
  --green-deep: #244d25;
  --amber: #ffb43d;
  --red: #ff5f46;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 50% 12%, rgba(146, 255, 104, 0.22), transparent 34rem),
    radial-gradient(circle at 12% 84%, rgba(255, 180, 61, 0.14), transparent 25rem),
    linear-gradient(135deg, #050605, #101610 52%, #050605);
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: url("./assets/briefing-concept.png");
  background-size: cover;
  background-position: center;
  opacity: 0.19;
  filter: saturate(0.8) contrast(1.08);
  content: "";
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(146, 255, 104, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(146, 255, 104, 0.035) 1px, transparent 1px),
    radial-gradient(circle, transparent 58%, rgba(0, 0, 0, 0.46));
  background-size: 34px 34px, 34px 34px, 100% 100%;
  content: "";
  pointer-events: none;
}

.shell {
  display: grid;
  min-height: 100svh;
  padding: clamp(18px, 5vw, 48px);
  place-items: center;
}

.briefing {
  position: relative;
  width: min(100%, 480px);
  min-height: min(760px, calc(100svh - 36px));
  padding: clamp(18px, 5.4vw, 36px);
  overflow: hidden;
  border: 1px solid rgba(146, 255, 104, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(155deg, rgba(16, 24, 17, 0.94), rgba(5, 8, 7, 0.84)),
    var(--panel);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.briefing::before {
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(255, 180, 61, 0.18);
  content: "";
  pointer-events: none;
}

.scanline {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(146, 255, 104, 0.16), transparent);
  animation: scan 4.8s linear infinite;
  opacity: 0.55;
  pointer-events: none;
}

.pulse-ring {
  position: absolute;
  top: 34%;
  left: 50%;
  width: 240px;
  aspect-ratio: 1;
  border: 1px solid rgba(146, 255, 104, 0.12);
  border-radius: 999px;
  opacity: 0.55;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.pulse-ring::before,
.pulse-ring::after {
  position: absolute;
  inset: 20%;
  border: 1px solid rgba(255, 180, 61, 0.1);
  border-radius: inherit;
  content: "";
}

.pulse-ring::after {
  inset: 38%;
  border-color: rgba(146, 255, 104, 0.18);
}

.intel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.callsign,
.timer {
  margin: 0;
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(146, 255, 104, 0.26);
  border-radius: 4px;
  color: var(--text);
  background: rgba(6, 11, 7, 0.64);
  cursor: pointer;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sound-toggle[aria-pressed="true"] {
  color: #071007;
  background: linear-gradient(135deg, var(--green), #d6ff63);
  box-shadow: 0 0 26px rgba(146, 255, 104, 0.28);
}

.speaker {
  position: relative;
  width: 14px;
  height: 14px;
}

.speaker::before {
  position: absolute;
  top: 3px;
  left: 0;
  width: 6px;
  height: 8px;
  background: currentColor;
  clip-path: polygon(0 24%, 42% 24%, 100% 0, 100% 100%, 42% 76%, 0 76%);
  content: "";
}

.speaker::after {
  position: absolute;
  top: 2px;
  left: 8px;
  width: 7px;
  height: 10px;
  border: 2px solid currentColor;
  border-left: 0;
  border-radius: 0 999px 999px 0;
  content: "";
}

.callsign {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ping {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 18px var(--green);
}

.hero-copy {
  position: relative;
  margin-top: clamp(42px, 8svh, 90px);
}

.overline {
  margin: 0 0 10px;
  color: var(--amber);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 8ch;
  margin: 0;
  font-size: clamp(3.4rem, 17vw, 5.9rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.86;
  text-wrap: balance;
  text-shadow: 0 0 28px rgba(146, 255, 104, 0.34);
}

.challenge {
  max-width: 30rem;
  margin: 20px 0 0;
  color: #d7dfcf;
  font-size: clamp(1rem, 3.8vw, 1.14rem);
  line-height: 1.55;
}

.status-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: clamp(24px, 5svh, 54px);
}

.status-grid div {
  min-width: 0;
  padding: 13px 10px;
  border: 1px solid var(--line);
  background: rgba(7, 12, 8, 0.74);
}

.status-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.status-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: clamp(1rem, 4.4vw, 1.35rem);
  line-height: 1;
}

.hype-meter {
  position: relative;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  align-items: end;
  gap: 5px;
  height: 38px;
  margin-top: 16px;
  padding: 9px 12px;
  border: 1px solid rgba(146, 255, 104, 0.15);
  background: linear-gradient(90deg, rgba(146, 255, 104, 0.08), rgba(255, 180, 61, 0.06));
}

.hype-meter span {
  display: block;
  height: calc(22px * var(--level));
  min-height: 5px;
  background: linear-gradient(180deg, #e8ff7e, var(--green));
  box-shadow: 0 0 14px rgba(146, 255, 104, 0.24);
  transform-origin: bottom;
}

.actions {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 18px;
}

.btn {
  min-height: 56px;
  border: 0;
  border-radius: 6px;
  color: #071007;
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
  transition: transform 170ms ease, box-shadow 170ms ease, background 170ms ease;
  touch-action: manipulation;
}

.btn:focus-visible {
  outline: 3px solid white;
  outline-offset: 3px;
}

.btn.ready {
  background: linear-gradient(135deg, var(--green), #e8ff7e);
  box-shadow: 0 18px 44px rgba(146, 255, 104, 0.22);
}

.btn.not-ready {
  color: #220b05;
  background: linear-gradient(135deg, var(--amber), #ff684c);
}

.btn:hover {
  transform: translateY(-2px);
}

.response {
  position: relative;
  min-height: 106px;
  margin-top: 16px;
  padding: 16px;
  border-left: 4px solid var(--amber);
  background: var(--panel-strong);
}

.response-title {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 950;
  text-transform: uppercase;
}

.response p:last-child {
  margin: 0;
  color: #dfe8d5;
  line-height: 1.5;
}

.briefing.ready-mode {
  border-color: rgba(146, 255, 104, 0.64);
}

.briefing.dodge-mode {
  animation: warning 420ms ease;
}

.briefing.hype-mode {
  border-color: rgba(146, 255, 104, 0.72);
  box-shadow: var(--shadow), 0 0 52px rgba(146, 255, 104, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.briefing.hype-mode .pulse-ring {
  animation: radarPulse 1.88s ease-out infinite;
}

.briefing.hype-mode .ping {
  animation: pingBeat 470ms ease-in-out infinite alternate;
}

.briefing.hype-mode .hype-meter span {
  animation: meterDance 470ms ease-in-out infinite alternate;
  animation-delay: calc(var(--level) * -620ms);
}

.briefing.hype-mode h1 {
  animation: titleGlow 940ms ease-in-out infinite alternate;
}

@keyframes scan {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(100%);
  }
}

@keyframes warning {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

@keyframes radarPulse {
  0% {
    opacity: 0.62;
    transform: translate(-50%, -50%) scale(0.72);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.28);
  }
}

@keyframes pingBeat {
  from {
    transform: scale(0.86);
    box-shadow: 0 0 12px var(--green);
  }
  to {
    transform: scale(1.18);
    box-shadow: 0 0 26px var(--green), 0 0 42px rgba(255, 180, 61, 0.28);
  }
}

@keyframes meterDance {
  from {
    transform: scaleY(0.45);
    filter: saturate(0.8);
  }
  to {
    transform: scaleY(1.22);
    filter: saturate(1.35);
  }
}

@keyframes titleGlow {
  from {
    text-shadow: 0 0 18px rgba(146, 255, 104, 0.22);
  }
  to {
    text-shadow: 0 0 34px rgba(146, 255, 104, 0.48), 0 0 54px rgba(255, 180, 61, 0.18);
  }
}

@media (min-width: 680px) {
  .briefing {
    min-height: 720px;
  }

  .actions {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

@media (max-width: 430px) {
  .intel {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .timer {
    grid-column: 1 / -1;
  }

  h1 {
    font-size: clamp(3.1rem, 15.2vw, 4.2rem);
  }

  .challenge {
    font-size: 0.98rem;
  }

  .status-grid div {
    padding: 11px 9px;
  }

  .response {
    min-height: 94px;
  }
}

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