.hud-v2-shell {
  min-height: 100svh;
  padding:
    calc(14px + env(safe-area-inset-top))
    calc(14px + env(safe-area-inset-right))
    calc(14px + env(safe-area-inset-bottom))
    calc(14px + env(safe-area-inset-left));
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% -8%, rgba(0, 255, 213, 0.24), transparent 34%),
    radial-gradient(circle at 90% 70%, rgba(0, 170, 255, 0.14), transparent 34%),
    linear-gradient(180deg, #010304 0%, #05070a 52%, #081114 100%);
}

.hud-v2 {
  width: min(100%, 560px);
  min-height: calc(100svh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  border: 1px solid rgba(0, 255, 213, 0.30);
  border-radius: 30px;
  padding: 18px;
  display: grid;
  grid-template-rows: auto auto auto auto auto auto;
  gap: 14px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(0, 255, 213, 0.10), rgba(0, 255, 213, 0.025)),
    rgba(0, 0, 0, 0.36);
  box-shadow:
    0 0 42px rgba(0, 255, 213, 0.22),
    inset 0 0 44px rgba(0, 255, 213, 0.045);
}

.hud-v2::before {
  content: "";
  position: absolute;
  inset: -30%;
  background:
    linear-gradient(rgba(0, 255, 213, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 213, 0.045) 1px, transparent 1px);
  background-size: 34px 34px;
  transform: perspective(900px) rotateX(56deg) translateY(18%);
  transform-origin: center bottom;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, transparent, black 14%, black 74%, transparent);
}

.hud-v2 > * {
  position: relative;
  z-index: 2;
}

.hud-v2-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.hud-v2-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.hud-v2-logo {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #001412;
  background: linear-gradient(180deg, #00ffd5, #6ffff0);
  box-shadow: 0 0 28px rgba(0, 255, 213, 0.46);
  font-size: 17px;
  font-weight: 1000;
  letter-spacing: 0.06em;
}

.hud-v2-kicker {
  margin: 0 0 4px;
  color: #00ffd5;
  font-size: 11px;
  letter-spacing: 0.22em;
  font-weight: 1000;
}

.hud-v2 h1 {
  margin: 0;
  color: #ecfffb;
  font-size: clamp(30px, 8.4vw, 48px);
  line-height: 0.88;
  letter-spacing: -0.07em;
  text-shadow: 0 0 26px rgba(0, 255, 213, 0.18);
}

.hud-v2-live {
  min-width: 76px;
  min-height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(236, 255, 251, 0.86);
  background: rgba(82, 255, 154, 0.09);
  border: 1px solid rgba(82, 255, 154, 0.32);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0.12em;
}

.hud-v2-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #52ff9a;
  box-shadow: 0 0 16px rgba(82, 255, 154, 0.85);
  animation: gzPulse 1.2s ease-in-out infinite;
}

.hud-v2-hero {
  display: grid;
  gap: 12px;
}

.hud-v2-player-panel {
  border: 1px solid rgba(0, 255, 213, 0.28);
  border-radius: 22px;
  padding: 14px;
  background:
    linear-gradient(90deg, rgba(0, 255, 213, 0.13), rgba(0, 170, 255, 0.045)),
    rgba(255, 255, 255, 0.035);
}

.hud-v2-label,
.hud-v2-card span {
  display: block;
  margin: 0;
  color: rgba(236, 255, 251, 0.52);
  font-size: 10px;
  letter-spacing: 0.20em;
  font-weight: 1000;
}

.hud-v2-player-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.hud-v2-player-row strong {
  color: #ecfffb;
  font-size: 38px;
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.hud-v2-player-row span {
  color: #00ffd5;
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 1000;
  padding-bottom: 4px;
  text-align: right;
}

.hud-v2-core {
  min-height: 190px;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 28px;
  border: 1px solid rgba(0, 255, 213, 0.22);
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 255, 213, 0.20), transparent 44%),
    rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.hud-v2-ring {
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(0, 255, 213, 0.23);
  box-shadow: 0 0 32px rgba(0, 255, 213, 0.16);
}

.hud-v2-ring-a {
  width: 210px;
  height: 210px;
  animation: gzRotate 8s linear infinite;
}

.hud-v2-ring-b {
  width: 138px;
  height: 138px;
  border-color: rgba(0, 170, 255, 0.25);
  animation: gzRotateReverse 6s linear infinite;
}

.hud-v2-controller-core {
  width: 230px;
  height: 112px;
  border-radius: 52px;
  display: grid;
  grid-template-columns: 70px 1fr 70px;
  align-items: center;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(236, 255, 251, 0.14), rgba(236, 255, 251, 0.035)),
    rgba(0, 0, 0, 0.58);
  border: 1px solid rgba(236, 255, 251, 0.14);
  box-shadow:
    0 0 34px rgba(0, 255, 213, 0.20),
    inset 0 0 24px rgba(255, 255, 255, 0.05);
}

.hud-v2-pad-left {
  width: 54px;
  height: 54px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}

.hud-v2-pad-left span {
  background: rgba(236, 255, 251, 0.76);
  border-radius: 5px;
}

.hud-v2-pad-left span:nth-child(1) {
  grid-column: 2;
  grid-row: 1;
}

.hud-v2-pad-left span:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
}

.hud-v2-pad-left span:nth-child(3) {
  grid-column: 2;
  grid-row: 2;
}

.hud-v2-pad-left span:nth-child(4) {
  grid-column: 3;
  grid-row: 2;
}

.hud-v2-pad-center {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  justify-self: center;
  background: #00ffd5;
  box-shadow: 0 0 22px rgba(0, 255, 213, 0.75);
}

.hud-v2-pad-right {
  width: 58px;
  height: 58px;
  position: relative;
}

.hud-v2-pad-right span {
  width: 18px;
  height: 18px;
  position: absolute;
  border-radius: 999px;
  background: #ff7a18;
  box-shadow: 0 0 15px rgba(255, 122, 24, 0.5);
}

.hud-v2-pad-right span:nth-child(1) {
  top: 0;
  left: 20px;
}

.hud-v2-pad-right span:nth-child(2) {
  top: 20px;
  right: 0;
}

.hud-v2-pad-right span:nth-child(3) {
  bottom: 0;
  left: 20px;
}

.hud-v2-pad-right span:nth-child(4) {
  top: 20px;
  left: 0;
}

.hud-v2-subtitle {
  margin: 0;
  color: rgba(236, 255, 251, 0.76);
  font-size: 16px;
  line-height: 1.28;
  font-weight: 750;
}

.hud-v2-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.hud-v2-card {
  min-height: 84px;
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 20px;
  padding: 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025)),
    rgba(0, 0, 0, 0.20);
  box-shadow: inset 0 0 24px rgba(0, 255, 213, 0.025);
}

.hud-v2-card-wide {
  grid-column: span 2;
}

.hud-v2-card strong {
  display: block;
  margin-top: 8px;
  color: #ecfffb;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.hud-v2-good {
  color: #52ff9a !important;
}

.hud-v2-meter {
  height: 8px;
  margin-top: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(236, 255, 251, 0.09);
  border: 1px solid rgba(0, 255, 213, 0.20);
}

.hud-v2-meter i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #00ffd5, #52ff9a);
  box-shadow: 0 0 18px rgba(0, 255, 213, 0.58);
}

.hud-v2-module-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.hud-v2-module {
  min-height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 8px;
  background: rgba(0, 255, 213, 0.07);
  border: 1px solid rgba(0, 255, 213, 0.18);
}

.hud-v2-module b {
  color: #ecfffb;
  font-size: 14px;
  letter-spacing: 0.12em;
}

.hud-v2-module span {
  color: rgba(236, 255, 251, 0.52);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.hud-v2-button {
  min-height: 62px;
  border-radius: 22px;
  font-size: 15px;
}

.hud-v2-footnote {
  margin: -4px 0 0;
  color: rgba(236, 255, 251, 0.42);
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
  font-weight: 700;
}

body.controller-started .hud-v2 {
  border-color: rgba(82, 255, 154, 0.48);
  box-shadow:
    0 0 52px rgba(82, 255, 154, 0.25),
    inset 0 0 44px rgba(0, 255, 213, 0.055);
}

body.controller-started .hud-v2-core {
  border-color: rgba(82, 255, 154, 0.42);
}

body.controller-started .hud-v2-live {
  background: rgba(82, 255, 154, 0.16);
}

body.controller-started .hud-v2-button {
  background: linear-gradient(90deg, #52ff9a, #00ffd5);
}

@keyframes gzPulse {
  0%, 100% {
    opacity: 0.55;
    transform: scale(0.9);
  }

  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

@keyframes gzRotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes gzRotateReverse {
  from {
    transform: rotate(360deg);
  }

  to {
    transform: rotate(0deg);
  }
}

@media (max-width: 390px), (max-height: 780px) {
  .hud-v2-shell {
    padding:
      calc(10px + env(safe-area-inset-top))
      calc(10px + env(safe-area-inset-right))
      calc(10px + env(safe-area-inset-bottom))
      calc(10px + env(safe-area-inset-left));
  }

  .hud-v2 {
    min-height: calc(100svh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    border-radius: 26px;
    padding: 14px;
    gap: 10px;
  }

  .hud-v2-logo {
    width: 46px;
    height: 46px;
    border-radius: 16px;
  }

  .hud-v2 h1 {
    font-size: clamp(26px, 7.5vw, 38px);
  }

  .hud-v2-live {
    min-width: 66px;
    min-height: 32px;
    font-size: 10px;
  }

  .hud-v2-player-panel {
    padding: 12px;
  }

  .hud-v2-player-row strong {
    font-size: 32px;
  }

  .hud-v2-core {
    min-height: 150px;
  }

  .hud-v2-ring-a {
    width: 166px;
    height: 166px;
  }

  .hud-v2-ring-b {
    width: 108px;
    height: 108px;
  }

  .hud-v2-controller-core {
    width: 190px;
    height: 92px;
    grid-template-columns: 56px 1fr 56px;
    padding: 13px;
  }

  .hud-v2-pad-left {
    width: 44px;
    height: 44px;
  }

  .hud-v2-pad-right {
    width: 46px;
    height: 46px;
  }

  .hud-v2-pad-right span {
    width: 15px;
    height: 15px;
  }

  .hud-v2-pad-right span:nth-child(1) {
    left: 16px;
  }

  .hud-v2-pad-right span:nth-child(2) {
    top: 16px;
  }

  .hud-v2-pad-right span:nth-child(3) {
    left: 16px;
  }

  .hud-v2-pad-right span:nth-child(4) {
    top: 16px;
  }

  .hud-v2-subtitle {
    font-size: 14px;
  }

  .hud-v2-card {
    min-height: 72px;
    border-radius: 17px;
    padding: 11px;
  }

  .hud-v2-card strong {
    font-size: 19px;
  }

  .hud-v2-module {
    min-height: 46px;
    border-radius: 15px;
  }

  .hud-v2-button {
    min-height: 56px;
    border-radius: 19px;
    font-size: 14px;
  }
}

@media (max-height: 700px) {
  .hud-v2 {
    gap: 8px;
  }

  .hud-v2-core {
    min-height: 128px;
  }

  .hud-v2-stats {
    gap: 8px;
  }

  .hud-v2-card {
    min-height: 64px;
  }

  .hud-v2-module-strip {
    display: none;
  }

  .hud-v2-footnote {
    display: none;
  }
}
