.page {
  --hud-pink: var(--color-neon-pink);
  --hud-cyan: var(--color-neon-cyan);
  --hud-gold: var(--color-neon-gold);
  --hud-panel: rgb(0 0 0 / 0.45);

  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  color: #fff;
  background: transparent;
}

.layout {
  position: relative;
  z-index: 12;
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 32px 40px;
  box-sizing: border-box;
  overflow: hidden;
}

.mainRow {
  position: relative;
  z-index: 12;
  display: flex;
  flex: 1;
  align-items: stretch;
  gap: clamp(18px, 4vw, 43px);
  min-height: 0;
}

.leftPanel {
  width: 410px;
  min-width: 410px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.titleBlock {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 24px;
  margin-left: 24px;
}

.gameTitle {
  margin: 0;
  font-family: 'Orbitron', var(--font-family-display);
  font-weight: 900;
  font-size: clamp(25px, 4vw, 42px);
  line-height: 1.02;
  letter-spacing: 0.08em;
  color: #fff;
  text-shadow: 0 0 25px rgb(255 78 203 / 0.9);
}

.backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgb(255 78 203 / 0.16), transparent 55%),
    radial-gradient(ellipse 70% 45% at 50% 100%, rgb(0 200 255 / 0.14), transparent 62%),
    linear-gradient(180deg, rgb(7 7 20 / 0.94), rgb(8 6 22 / 0.88) 48%, rgb(14 8 28 / 0.96));
}

.gameSubtitle {
  margin: 0;
  font-family: 'Exo 2', var(--font-family-ui);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.47em;
  text-transform: uppercase;
  color: var(--hud-pink);
}

.menuWrap {
  position: relative;
}

.menu {
  display: flex;
  flex-direction: column;
}

.menuTriangle {
  position: absolute;
  left: -27px;
  z-index: 2;
  width: 0;
  height: 0;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-left: 20px solid var(--hud-pink);
  transform: translateY(-50%);
  filter: drop-shadow(0 0 14px rgb(255 78 203 / 0.9));
  transition: top 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.menuItem {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 0;
  margin-bottom: 10px;
  padding: 20px 25px 20px 18px;
  border: 2px solid rgb(255 78 203 / 0.15);
  background: rgb(0 0 0 / 0.65);
  text-align: left;
  color: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.menuItemSelected {
  border-color: rgb(255 78 203 / 0.5);
  background: rgb(255 78 203 / 0.15);
}

.menuItemFlash {
  background: rgb(255 78 203 / 0.32);
}

.menuBadge {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', var(--font-family-display);
  font-size: 25px;
  font-weight: 700;
}

.badgeStart {
  background: rgb(255 78 203 / 0.2);
  color: var(--hud-pink);
  border: 2px solid rgb(255 78 203 / 0.35);
}

.badgeLeaderboard {
  background: rgb(255 210 0 / 0.15);
  color: var(--hud-gold);
  border: 2px solid rgb(255 210 0 / 0.35);
}

.badgeCredits {
  background: rgb(0 200 255 / 0.17);
  color: var(--hud-cyan);
  border: 2px solid rgb(0 200 255 / 0.35);
}

.menuBadge svg {
  width: 24px;
  height: 24px;
}

.menuText {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  margin-left: 18px;
  margin-right: 14px;
}

.menuLabel {
  font-family: 'Orbitron', var(--font-family-display);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
}

.menuItemSelected .menuLabel {
  color: var(--hud-pink);
}

.menuSubLabel {
  font-family: 'Exo 2', var(--font-family-ui);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: rgb(255 255 255 / 0.62);
}

.menuHint {
  font-family: 'Exo 2', var(--font-family-ui);
  font-size: 18px;
  letter-spacing: 0.14em;
  color: rgb(255 255 255 / 0.36);
}

.menuItemSelected .menuHint {
  color: rgb(255 255 255 / 0.6);
}

.navHint {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 7px;
}

.keyBadge {
  padding: 4px 13px;
  border-radius: 5px;
  border: 2px solid rgb(255 255 255 / 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Exo 2', var(--font-family-ui);
  font-size: 20px;
  color: rgb(255 255 255 / 0.66);
}

.navHintText {
  font-family: 'Exo 2', var(--font-family-ui);
  font-size: 18px;
  letter-spacing: 0.11em;
  color: rgb(255 255 255 / 0.46);
}

.eqRow {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 43px;
}

.eqBar {
  width: 11px;
  border-radius: 3px 3px 0 0;
  height: var(--eq-low);
  animation: eqBounce var(--eq-duration) ease-in-out var(--eq-delay) infinite alternate;
}

.eqBar:nth-child(7n + 1) {
  background: #ff4ecb;
}

.eqBar:nth-child(7n + 2) {
  background: #ff8b3d;
}

.eqBar:nth-child(7n + 3) {
  background: #ffd200;
}

.eqBar:nth-child(7n + 4) {
  background: #5fef9c;
}

.eqBar:nth-child(7n + 5) {
  background: #00c8ff;
}

.eqBar:nth-child(7n + 6) {
  background: #8e5cff;
}

.eqBar:nth-child(7n + 7) {
  background: #ff4ecb;
}

.centerPanel {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  align-items: flex-end;
  justify-content: center;
}

.poseBadge {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 5px 14px;
  border: 2px solid rgb(0 200 255 / 0.22);
  border-radius: 5px;
  background: rgb(0 0 0 / 0.65);
}

.poseDot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--hud-cyan);
  animation: posePulse 0.95s ease-in-out infinite;
}

.poseLabel {
  font-family: 'Exo 2', var(--font-family-ui);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.31em;
  text-transform: uppercase;
  color: var(--hud-cyan);
}

.avatarCanvas {
  display: block;
  width: min(360px, 35vw);
  max-width: 360px;
  height: auto;
  margin-bottom: 7px;
}

.rightPanel {
  width: 274px;
  min-width: 274px;
  display: flex;
  justify-content: flex-end;
}

.scoreCard {
  position: relative;
  width: 100%;
  align-self: flex-start;
  padding: 22px 25px;
  border-radius: 7px;
  border: 2px solid rgb(0 200 255 / 0.22);
  background: rgb(0 0 0 / 0.65);
  text-align: right;
  overflow: hidden;
}

.scoreCard::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00c8ff, transparent);
  animation: scoreScan 2.5s linear infinite;
}

.scoreEyebrow {
  margin: 0;
  font-family: 'Exo 2', var(--font-family-ui);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.54em;
  text-transform: uppercase;
  color: var(--hud-cyan);
}

.scoreTitle {
  margin: 11px 0 7px;
  font-family: 'Orbitron', var(--font-family-display);
  font-size: 16px;
  letter-spacing: 0.36em;
  color: rgb(255 255 255 / 0.38);
}

.scoreValue {
  margin: 0;
  font-family: 'Orbitron', var(--font-family-display);
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: #fff;
  text-shadow: 0 0 22px rgb(0 200 255 / 0.85);
}

.scorePlayer {
  margin: 11px 0 0;
  font-family: 'Exo 2', var(--font-family-ui);
  font-size: 18px;
  font-weight: 700;
  color: var(--hud-gold);
}

.corner {
  position: absolute;
  width: 40px;
  height: 40px;
  border-style: solid;
  border-color: var(--hud-pink);
  opacity: 0.55;
  pointer-events: none;
  z-index: 20;
}

.cornerTopLeft {
  top: 25px;
  left: 25px;
  border-width: 4px 0 0 4px;
}

.cornerTopRight {
  top: 25px;
  right: 25px;
  border-width: 4px 4px 0 0;
}

.cornerBottomLeft {
  bottom: 25px;
  left: 25px;
  border-width: 0 0 4px 4px;
}

.cornerBottomRight {
  right: 25px;
  bottom: 25px;
  border-width: 0 4px 4px 0;
}

.floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30vh;
  perspective: 300px;
  perspective-origin: 50% 0%;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.scanlines {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgb(0 0 0 / 0.045) 3px,
    rgb(0 0 0 / 0.045) 4px
  );
}

.floorInner {
  position: absolute;
  bottom: 0;
  left: -50%;
  right: -50%;
  height: 100%;
  pointer-events: none;
  transform: rotateX(35deg);
  transform-origin: bottom center;
  background-color: rgb(20 10 38 / 0.84);
  background-image:
    linear-gradient(90deg, rgb(255 78 203 / 0.25) 1px, transparent 1px),
    linear-gradient(0deg, rgb(255 78 203 / 0.25) 1px, transparent 1px);
  background-size: 8vw 8vw;
  overflow: hidden;
}

.floorInner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 4;
  background: linear-gradient(90deg, transparent, #ff4ecb, #00c8ff, #ff4ecb, transparent);
  box-shadow:
    0 0 18px 4px rgb(255 78 203 / 0.6),
    0 0 40px 8px rgb(255 78 203 / 0.25);
}

.floorInner::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(
    to top,
    transparent 0%,
    transparent 42%,
    rgb(18 8 32 / 0.55) 78%,
    rgb(18 8 32 / 0.92) 100%
  );
}

.floorGlow {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 70% 45% at 50% 100%, rgb(217 70 239 / 0.35), transparent 62%),
    radial-gradient(ellipse 50% 35% at 50% 88%, rgb(34 211 238 / 0.12), transparent 55%);
  pointer-events: none;
}

.floorTiles {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  gap: 4px;
  padding: 3% 2% 0;
  box-sizing: border-box;
  opacity: 0.95;
}

.floorTile {
  min-width: 0;
  min-height: 0;
  border-radius: 2px;
  border: 1px solid rgb(34 211 238 / 0.28);
  background: rgb(40 20 70 / 0.72);
  box-shadow:
    0 0 10px rgb(34 211 238 / 0.1),
    inset 0 1px 0 rgb(255 255 255 / 0.06);
  position: relative;
  will-change: opacity;
  animation: homeTileGlow 1.8s ease-in-out infinite;
}

@keyframes homeTileGlow {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes eqBounce {
  from {
    height: var(--eq-low);
  }
  to {
    height: var(--eq-high);
  }
}

@keyframes scoreScan {
  from {
    left: -100%;
  }
  to {
    left: 100%;
  }
}

@keyframes posePulse {
  0%,
  100% {
    transform: scale(0.8);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}

@media (max-width: 960px) {
  .mainRow {
    gap: 22px;
  }

  .leftPanel {
    width: 378px;
    min-width: 378px;
  }

  .rightPanel {
    width: 252px;
    min-width: 252px;
  }
}

@media (max-width: 760px) {
  .page {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .layout {
    height: 100%;
    min-height: 0;
    padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
  }

  .floor {
    height: 48vh;
  }

  .floorInner {
    left: -40%;
    right: -40%;
    transform: rotateX(28deg);
    background-size: 12vw 12vw;
  }

  .floorTiles {
    padding: 2% 1.5% 0;
  }

  .mainRow {
    height: 100%;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 12px;
    overflow: hidden;
  }

  .leftPanel {
    width: 100%;
    min-width: 0;
    flex: 1;
    min-height: 0;
    gap: 14px;
  }

  .titleBlock {
    padding-top: 50px;
    text-align: center;
  }

  .gameTitle {
    font-size: clamp(24px, 8.8vw, 34px);
    letter-spacing: 0.07em;
    line-height: 1.04;
  }

  .menuWrap {
    width: min(560px, 100%);
    margin: 0 auto;
  }

  .menuTriangle {
    display: none;
    left: -18px;
    border-top-width: 10px;
    border-bottom-width: 10px;
    border-left-width: 15px;
  }

  .menuItem {
    margin-bottom: 8px;
    padding: 14px 14px 14px 12px;
    transition: none;
  }

  .menuItemSelected,
  .menuItemFlash {
    border-color: rgb(255 78 203 / 0.15);
    background: rgb(0 0 0 / 0.45);
  }

  .menuItemSelected .menuLabel {
    color: #fff;
  }

  .menuBadge {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    font-size: 20px;
  }

  .menuText {
    margin-left: 12px;
    margin-right: 8px;
  }

  .menuLabel {
    font-size: 19px;
    letter-spacing: 0.13em;
  }

  .menuSubLabel {
    font-size: 14px;
    letter-spacing: 0.1em;
  }

  .centerPanel,
  .rightPanel,
  .navHint {
    display: none;
  }
}

@media (max-width: 640px), (max-height: 700px) {
  .layout {
    justify-content: center;
    padding: 24px 18px max(18px, env(safe-area-inset-bottom, 0px));
  }

  .mainRow {
    justify-content: center;
  }

  .leftPanel {
    width: min(520px, 100%);
    gap: 14px;
  }


  .gameTitle {
    font-size: clamp(23px, 8.8vw, 40px);
  }

  .menuTriangle {
    left: -16px;
    border-top-width: 10px;
    border-bottom-width: 10px;
    border-left-width: 15px;
  }

  .menuItem {
    margin-bottom: 8px;
    padding: 16px 16px 16px 14px;
    transition: none;
  }


  .menuBadge {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    font-size: 20px;
  }

  .menuText {
    margin-left: 14px;
    margin-right: 0;
  }

  .menuLabel {
    font-size: clamp(18px, 6vw, 24px);
    letter-spacing: 0.12em;
  }

  .menuSubLabel {
    font-size: clamp(14px, 4.2vw, 18px);
    letter-spacing: 0.08em;
  }
}

@media (max-width: 480px) {
  .centerPanel,
  .rightPanel,
  .floor,
  .scanlines,
  .corner,
  .menuTriangle,
  .navHint {
    display: none;
  }

  .menuItemSelected,
  .menuItemFlash {
    border-color: rgb(255 78 203 / 0.15);
    background: rgb(0 0 0 / 0.45);
  }

  .menuItemSelected .menuLabel {
    color: #fff;
  }
}

@media (prefers-reduced-motion: reduce) {
  .eqBar,
  .floorTile,
  .scoreCard::after,
  .poseDot {
    animation: none;
  }

  .menuTriangle {
    transition: none;
  }
}
