.game-build-signal-bar {
  --signal-stage-art: none;
  --pulse-x: 50%;
  --signal-score-width: 0%;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.portal-page.is-game-focus .mini-game-card:has(.game-build-signal-bar) {
  --game-card-play-min-height: 452px;
  --game-card-play-max-height: 780px;
  --game-stage-play-min-height: 300px;
}

.game-build-signal-bar .game-hud {
  gap: 6px;
  padding: 8px;
  border-bottom: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 38%),
    linear-gradient(180deg, #f0444d 0%, #c41723 58%, #8f111a 100%);
  box-shadow: inset 0 -4px 0 rgba(77, 5, 10, 0.22);
}

.game-build-signal-bar .game-hud-item {
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(6, 45, 40, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 3px 0 rgba(73, 6, 11, 0.18);
}

.game-build-signal-bar .game-hud-label {
  color: #fff3a0;
  font-size: 9px;
  line-height: 1;
}

.game-build-signal-bar .game-hud-value {
  color: #ffffff;
  font-size: 18px;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.22);
}

.game-build-signal-bar .game-stage {
  min-height: 300px;
  display: grid;
  place-items: center;
  padding: 24px 14px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 212, 90, 0.24), transparent 22%),
    linear-gradient(180deg, rgba(0, 40, 32, 0.04), rgba(0, 25, 28, 0.16)),
    var(--signal-stage-art) center / cover no-repeat,
    linear-gradient(160deg, #063f3b, #ffd45a);
}

.game-build-signal-bar .game-stage::before {
  z-index: 0;
  inset: auto 14% 26px;
  height: 28px;
  border-radius: 999px;
  background: rgba(2, 23, 25, 0.34);
  filter: blur(18px);
}

.game-build-signal-bar .game-stage::after {
  z-index: 1;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 34px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 56%, rgba(2, 23, 25, 0.16));
}

.portal-page.is-game-focus .game-build-signal-bar:not(.is-countdown):not(.is-playing):not(.is-completing):not(.is-finished) .game-stage {
  min-height: clamp(364px, 50svh, 420px);
}

@supports (height: 100dvh) {
  .portal-page.is-game-focus .game-build-signal-bar:not(.is-countdown):not(.is-playing):not(.is-completing):not(.is-finished) .game-stage {
    min-height: clamp(364px, 50dvh, 420px);
  }
}

.portal-page.is-game-focus .game-build-signal-bar.is-countdown .game-stage,
.portal-page.is-game-focus .game-build-signal-bar.is-playing .game-stage,
.portal-page.is-game-focus .game-build-signal-bar.is-completing .game-stage {
  min-height: var(--game-stage-play-min-height);
  height: clamp(318px, calc(100svh - 236px), 560px);
}

@supports (height: 100dvh) {
  .portal-page.is-game-focus .game-build-signal-bar.is-countdown .game-stage,
  .portal-page.is-game-focus .game-build-signal-bar.is-playing .game-stage,
  .portal-page.is-game-focus .game-build-signal-bar.is-completing .game-stage {
    height: clamp(318px, calc(100dvh - 236px), 560px);
  }
}

@supports selector(:has(*)) {
  .portal-page.is-game-focus .game-build-signal-bar.is-countdown .game-stage,
  .portal-page.is-game-focus .game-build-signal-bar.is-playing .game-stage,
  .portal-page.is-game-focus .game-build-signal-bar.is-completing .game-stage {
    height: clamp(318px, calc(100dvh - 236px), 560px);
    min-height: var(--game-stage-play-min-height);
  }
}

.game-build-signal-bar.is-playing .game-stage {
  touch-action: manipulation;
}

.game-build-signal-bar.is-finished .game-stage {
  min-height: 0;
  height: auto;
  padding: 0;
  background: #ffffff;
}

.game-build-signal-bar.is-finished .game-overlay {
  position: static;
  display: block;
  padding: 12px 16px;
  background: #ffffff;
  backdrop-filter: none;
}

.game-build-signal-bar.is-finished .game-overlay-panel {
  width: 100%;
  padding: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.signal-console {
  position: relative;
  z-index: 2;
  width: min(326px, 100%);
  min-height: 258px;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 24px 20px;
  border: 2px solid rgba(255, 216, 91, 0.86);
  border-radius: 22px;
  color: #ffffff;
  background:
    radial-gradient(circle at 50% 0%, rgba(94, 255, 220, 0.34), transparent 42%),
    linear-gradient(180deg, rgba(8, 104, 88, 0.86), rgba(5, 47, 45, 0.92));
  box-shadow:
    0 24px 40px rgba(3, 20, 25, 0.38),
    0 0 28px rgba(40, 230, 161, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
  cursor: pointer;
}

.signal-meter {
  position: relative;
  height: 42px;
  border-radius: 999px;
  background: rgba(2, 23, 25, 0.55);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.signal-zone {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 38%;
  width: 24%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd45a, #27f0a7);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.18),
    0 0 24px rgba(39, 240, 167, 0.62);
}

.signal-pulse {
  position: absolute;
  top: -5px;
  left: var(--pulse-x);
  width: 14px;
  height: 52px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.86), 0 0 30px rgba(39, 240, 167, 0.5);
  transform: translateX(-50%);
}

.signal-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  height: 92px;
}

.signal-bars i {
  width: 28px;
  border-radius: 12px 12px 4px 4px;
  background: linear-gradient(180deg, #fff6a7, #28e6a1);
  box-shadow: 0 0 20px rgba(40, 230, 161, 0.2);
}

.signal-bars i:nth-child(1) { height: 34px; }
.signal-bars i:nth-child(2) { height: 48px; }
.signal-bars i:nth-child(3) { height: 64px; }
.signal-bars i:nth-child(4) { height: 78px; }
.signal-bars i:nth-child(5) { height: 92px; }

.signal-console::after {
  content: "";
  position: absolute;
  right: 20px;
  bottom: 16px;
  left: 20px;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(2, 23, 25, 0.46);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.signal-console::before {
  content: "";
  position: absolute;
  bottom: 16px;
  left: 20px;
  z-index: 1;
  width: var(--signal-score-width);
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff424d, #ffd45a, #28e6a1);
}

.signal-action {
  color: #fff3a0;
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

.game-build-signal-bar.is-hit .signal-console {
  box-shadow: 0 20px 34px rgba(3, 20, 25, 0.34), 0 0 34px rgba(40, 230, 161, 0.5);
}

.game-build-signal-bar.is-miss .signal-console {
  box-shadow: 0 20px 34px rgba(3, 20, 25, 0.34), 0 0 28px rgba(255, 64, 76, 0.42);
}

.game-build-signal-bar .game-overlay {
  background: rgba(235, 255, 248, 0.68);
  backdrop-filter: none;
}

.game-build-signal-bar .game-overlay-panel {
  width: min(284px, 100%);
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 30px rgba(4, 51, 47, 0.22), 0 0 0 6px rgba(255, 255, 255, 0.24);
  text-align: center;
}

.signal-ready-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 18px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(180deg, #2fe7a7, #0f8c69);
  font-size: 12px;
  font-weight: 900;
}

.signal-ready-art {
  position: relative;
  width: 128px;
  height: 90px;
  margin: 10px auto;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background:
    radial-gradient(circle at 82% 16%, #fff6a7 0 4px, transparent 5px),
    radial-gradient(circle at 82% 16%, transparent 0 10px, rgba(255, 246, 167, 0.74) 11px 12px, transparent 13px 21px, rgba(255, 246, 167, 0.38) 22px 23px, transparent 24px),
    radial-gradient(circle at 21% 79%, rgba(39, 240, 167, 0.42) 0 5px, transparent 6px),
    radial-gradient(circle at 50% 58%, rgba(94, 255, 220, 0.24), transparent 50%);
  filter: drop-shadow(0 12px 18px rgba(4, 51, 47, 0.22));
}

.signal-ready-art::before {
  position: absolute;
  top: 3px;
  left: 27px;
  width: 72px;
  height: 84px;
  border: 2px solid rgba(255, 216, 91, 0.86);
  border-radius: 20px;
  background:
    linear-gradient(90deg, transparent 0 34%, rgba(255, 255, 255, 0.64) 34% 66%, transparent 66%) center 7px / 22px 3px no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 34%),
    linear-gradient(180deg, #0f8c7c 0%, #07564f 58%, #032a2e 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.28),
    inset 0 -10px 18px rgba(2, 23, 25, 0.32),
    0 10px 16px rgba(2, 23, 25, 0.2);
  content: "";
}

.signal-ready-art::after {
  position: absolute;
  top: 16px;
  left: 38px;
  width: 50px;
  height: 61px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, #fff6a7, #28e6a1) left 7px bottom 9px / 7px 16px no-repeat,
    linear-gradient(180deg, #fff6a7, #28e6a1) left 18px bottom 9px / 7px 25px no-repeat,
    linear-gradient(180deg, #fff6a7, #28e6a1) left 29px bottom 9px / 7px 34px no-repeat,
    linear-gradient(180deg, #fff6a7, #28e6a1) left 40px bottom 9px / 7px 43px no-repeat,
    radial-gradient(circle at 50% 19%, #fff6a7 0 3px, transparent 4px),
    radial-gradient(circle at 50% 19%, transparent 0 9px, rgba(255, 246, 167, 0.62) 10px 11px, transparent 12px 18px, rgba(255, 246, 167, 0.34) 19px 20px, transparent 21px),
    linear-gradient(180deg, rgba(3, 42, 46, 0.18), rgba(2, 23, 25, 0.54));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    0 0 18px rgba(39, 240, 167, 0.2);
  content: "";
}

@media (max-width: 340px), (max-height: 620px) {
  .portal-page.is-game-focus .game-build-signal-bar:not(.is-countdown):not(.is-playing):not(.is-completing):not(.is-finished) .game-stage {
    min-height: 352px !important;
  }

  .game-build-signal-bar .game-stage {
    padding: 16px 12px;
  }

  .signal-console {
    min-height: 224px;
    gap: 14px;
    padding: 18px 16px;
    border-radius: 20px;
  }

  .signal-meter {
    height: 36px;
  }

  .signal-pulse {
    height: 46px;
  }

  .signal-bars {
    gap: 6px;
    height: 74px;
  }

  .signal-bars i {
    width: 22px;
  }

  .signal-bars i:nth-child(1) { height: 28px; }
  .signal-bars i:nth-child(2) { height: 40px; }
  .signal-bars i:nth-child(3) { height: 52px; }
  .signal-bars i:nth-child(4) { height: 64px; }
  .signal-bars i:nth-child(5) { height: 74px; }
}
