:root {
  color-scheme: dark;
  --bg: #06080b;
  --card: rgba(10, 15, 20, 0.78);
  --card-strong: #0e141b;
  --line: rgba(200, 230, 255, 0.22);
  --text: #eef4fb;
  --muted: #b4c0cd;
  --accent: #c3ff62;
  --accent-strong: #ffffff;
  --shadow: rgba(0, 0, 0, 0.55);
  --font-ui: "Bebas Neue", "Arial Narrow", "Arial Black", Impact, sans-serif;
  --font-menu-logo: "Pixelify Sans", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  width: 100%;
  max-width: 100%;
  height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
}

p {
  margin-top: 0;
}

#cubey-canvas {
  width: 147px;
  height: 147px;
  display: block;
  margin: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: 4px solid #0a0f14;
  background: #638596;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.2),
    0 10px 22px rgba(0, 0, 0, 0.4);
}

.hud-cluster {
  position: fixed;
  top: 14px;
  left: 16px;
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
  max-width: calc(100vw - 24px);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.hud-cluster.is-dragging {
  cursor: grabbing;
}

.hud {
  position: relative;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.hud-mute-aside {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.mute-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(8, 12, 18, 0.92);
  color: var(--accent);
  cursor: pointer;
  font-family: var(--font-ui);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  transition:
    border-color 120ms ease,
    background-color 120ms ease,
    color 120ms ease;
}

.mute-button:hover {
  border-color: var(--accent);
  background: rgba(18, 28, 38, 0.95);
  color: var(--accent-strong);
}

.mute-button:active {
  transform: translateY(1px);
}

.mute-button[aria-pressed="true"] {
  border-color: rgba(255, 120, 120, 0.55);
  background: rgba(40, 14, 18, 0.92);
  color: #ff9a9a;
}

.mute-button--icon {
  min-width: 40px;
  min-height: 40px;
  padding: 6px;
}

.mute-button--icon-menu {
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
}

.speaker-icon {
  position: relative;
  display: block;
  flex-shrink: 0;
  width: 32px;
  height: 22px;
  pointer-events: none;
  filter: brightness(0) invert(1);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  transform: scale(1);
  transform-origin: center;
}

.speaker-icon::before,
.speaker-icon::after {
  position: absolute;
  width: 2px;
  height: 2px;
  content: "";
  background: transparent;
}

.speaker-icon::before {
  top: 2px;
  left: 4px;
  box-shadow:
    10px 0 0 #000000, 12px 0 0 #000000, 14px 0 0 #000000,
    8px 2px 0 #000000, 10px 2px 0 #ffcf56, 12px 2px 0 #ffcf56, 14px 2px 0 #000000,
    0 4px 0 #000000, 2px 4px 0 #000000, 4px 4px 0 #000000, 6px 4px 0 #000000, 8px 4px 0 #000000, 10px 4px 0 #ffcf56, 12px 4px 0 #ffcf56, 14px 4px 0 #000000,
    0 6px 0 #000000, 2px 6px 0 #ffcf56, 4px 6px 0 #ffcf56, 6px 6px 0 #ffcf56, 8px 6px 0 #ffcf56, 10px 6px 0 #ffcf56, 12px 6px 0 #ffcf56, 14px 6px 0 #000000,
    0 8px 0 #000000, 2px 8px 0 #ffcf56, 4px 8px 0 #ffcf56, 6px 8px 0 #ffcf56, 8px 8px 0 #ffcf56, 10px 8px 0 #ffcf56, 12px 8px 0 #ffcf56, 14px 8px 0 #000000,
    0 10px 0 #000000, 2px 10px 0 #ffcf56, 4px 10px 0 #ffcf56, 6px 10px 0 #ffcf56, 8px 10px 0 #ffcf56, 10px 10px 0 #ffcf56, 12px 10px 0 #ffcf56, 14px 10px 0 #000000,
    0 12px 0 #000000, 2px 12px 0 #000000, 4px 12px 0 #000000, 6px 12px 0 #000000, 8px 12px 0 #000000, 10px 12px 0 #ffcf56, 12px 12px 0 #ffcf56, 14px 12px 0 #000000,
    8px 14px 0 #000000, 10px 14px 0 #ffcf56, 12px 14px 0 #ffcf56, 14px 14px 0 #000000,
    10px 16px 0 #000000, 12px 16px 0 #000000, 14px 16px 0 #000000;
}

.speaker-icon::after {
  top: 6px;
  left: 22px;
  display: none;
  background: #000000;
  box-shadow:
    8px 0 0 #000000,
    2px 2px 0 #000000, 6px 2px 0 #000000,
    4px 4px 0 #000000,
    2px 6px 0 #000000, 6px 6px 0 #000000,
    0 8px 0 #000000, 8px 8px 0 #000000;
}

.speaker-icon__svg {
  display: none;
}

.mute-button[aria-pressed="true"] .speaker-icon::before {
  left: 0;
}

.mute-button[aria-pressed="true"] .speaker-icon::after {
  display: block;
}

.life-hearts {
  display: flex;
  align-items: center;
  gap: 6px;
}

.life-badge,
.coin-badge,
.time-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
}

.life-badge {
  border: 1px solid rgba(255, 79, 109, 0.45);
  background: rgba(255, 79, 109, 0.12);
}

.pixel-heart {
  position: relative;
  width: 18px;
  height: 16px;
  filter: drop-shadow(2px 2px 0 #000000);
}

.pixel-heart::before {
  position: absolute;
  inset: 0;
  content: "";
  background: #ff4f6d;
  clip-path: polygon(
    11% 6%,
    33% 6%,
    33% 17%,
    50% 17%,
    50% 6%,
    72% 6%,
    72% 17%,
    89% 17%,
    89% 50%,
    78% 50%,
    78% 67%,
    61% 67%,
    61% 83%,
    50% 83%,
    50% 94%,
    39% 94%,
    39% 83%,
    22% 83%,
    22% 67%,
    11% 67%,
    11% 50%,
    0 50%,
    0 17%,
    11% 17%
  );
}

.pixel-heart.is-empty {
  opacity: 0.28;
  filter: grayscale(1) drop-shadow(2px 2px 0 #000000);
}

.coin-badge {
  gap: 7px;
  border: 1px solid rgba(255, 207, 86, 0.45);
  background: rgba(255, 207, 86, 0.12);
  color: #ffcf56;
}

.time-badge {
  gap: 7px;
  border: 1px solid rgba(136, 227, 255, 0.5);
  background: rgba(136, 227, 255, 0.14);
  color: #88e3ff;
}

.time-icon {
  position: relative;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  box-shadow: 2px 2px 0 #000000;
}

.time-icon::before {
  position: absolute;
  left: 50%;
  top: 2px;
  width: 2px;
  height: 5px;
  content: "";
  background: currentColor;
  transform: translateX(-50%);
}

.time-icon::after {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 2px;
  content: "";
  background: currentColor;
  transform: translateY(-50%);
}

.coin-icon {
  width: 16px;
  height: 16px;
  background: #ffcf56;
  box-shadow:
    inset -3px -3px 0 #d4872a,
    inset 3px 3px 0 #fff2a6,
    2px 2px 0 #000000;
}

.map-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  border: 0;
  background: #050505;
  cursor: grab;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
}

.map-canvas.is-dragging {
  cursor: grabbing;
}

.powerup-bar {
  position: fixed;
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
  left: 50%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  max-width: min(420px, calc(100vw - 24px));
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  transform: translateX(-50%);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.powerup-bar.is-dragging {
  cursor: grabbing;
}

.powerup-bar-title {
  flex: 0 0 auto;
  width: fit-content;
  margin: 0;
  color: var(--accent);
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.powerup-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 10px;
}

.powerup-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 92px;
  padding: 10px 12px 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(8, 12, 18, 0.92);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transition:
    border-color 120ms ease,
    background-color 120ms ease,
    opacity 120ms ease;
}

.powerup-btn::after {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 3;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(6, 10, 14, 0.97);
  color: var(--text);
  content: attr(data-tooltip);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: none;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.powerup-btn:hover::after,
.powerup-btn:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.powerup-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(18, 28, 38, 0.95);
}

.powerup-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.powerup-btn:disabled {
  cursor: not-allowed;
}

.powerup-btn:disabled > * {
  opacity: 0.38;
}

.powerup-heart-icon {
  position: relative;
  width: 16px;
  height: 14px;
  margin-bottom: 1px;
  filter: drop-shadow(2px 2px 0 #000000);
}

.powerup-heart-icon::before {
  position: absolute;
  inset: 0;
  content: "";
  background: #ff4f6d;
  clip-path: polygon(
    11% 6%,
    33% 6%,
    33% 17%,
    50% 17%,
    50% 6%,
    72% 6%,
    72% 17%,
    89% 17%,
    89% 50%,
    78% 50%,
    78% 67%,
    61% 67%,
    61% 83%,
    50% 83%,
    50% 94%,
    39% 94%,
    39% 83%,
    22% 83%,
    22% 67%,
    11% 67%,
    11% 50%,
    0 50%,
    0 17%,
    11% 17%
  );
}

.powerup-btn-label {
  font-size: 0.92rem;
  line-height: 1;
  color: var(--accent-strong);
}

.powerup-btn-cost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid rgba(255, 207, 86, 0.45);
  background: rgba(255, 207, 86, 0.14);
  color: #ffcf56;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.powerup-btn-cost::before {
  display: block;
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  content: "";
  background: #ffcf56;
  box-shadow:
    inset -2px -2px 0 #d4872a,
    inset 2px 2px 0 #fff2a6;
}

.target-label {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.target-card {
  position: fixed;
  top: 50vh;
  left: 75vw;
  z-index: 2;
  width: 172px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(8px);
  cursor: grab;
  user-select: none;
  touch-action: none;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
}

.panel-tooltip {
  position: fixed;
  z-index: 20;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(6, 10, 14, 0.97);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: none;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.panel-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.target-card.is-dragging {
  cursor: grabbing;
}

.level-transition {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  background:
    radial-gradient(circle at center, rgba(195, 255, 98, 0.2), transparent 20rem),
    rgba(5, 8, 12, 0.82);
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transform: scale(1.04);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.level-transition.is-visible {
  opacity: 1;
  transform: scale(1);
}

.level-transition p,
.level-transition strong {
  display: block;
  margin: 0;
  text-align: center;
  text-transform: uppercase;
}

.level-transition p:empty {
  display: none;
}

.level-transition p {
  color: var(--accent);
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.level-transition strong {
  margin-top: 0;
  font-size: clamp(3.2rem, 13vw, 8rem);
  line-height: 0.78;
  letter-spacing: 0.03em;
  text-shadow:
    5px 5px 0 #000000,
    -2px -2px 0 rgba(182, 255, 87, 0.35);
}

.main-menu {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding:
    max(16px, env(safe-area-inset-top, 16px))
    max(16px, env(safe-area-inset-right, 16px))
    max(16px, env(safe-area-inset-bottom, 16px))
    max(16px, env(safe-area-inset-left, 16px));
  background:
    radial-gradient(circle at 20% 12%, rgba(195, 255, 98, 0.16), transparent 18rem),
    radial-gradient(circle at 76% 84%, rgba(106, 188, 255, 0.14), transparent 18rem),
    linear-gradient(180deg, rgba(12, 20, 30, 0.8), rgba(6, 8, 12, 0.9));
  background-size: auto, auto, auto;
  opacity: 1;
  transition:
    opacity 260ms ease,
    transform 260ms ease;
}

.main-menu.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.04);
}

.main-menu__shell {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: 16px;
  width: min(1120px, 100%);
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  max-height: min(92dvh, 900px);
}

.menu-leaderboard {
  flex: 0 0 min(340px, 36vw);
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 38%),
    rgba(10, 16, 24, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.menu-leaderboard__title {
  margin: 0;
  padding: 14px 16px 8px;
  font-family: var(--font-ui);
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
  text-align: center;
}

.menu-leaderboard__scroll {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 8px 12px;
  min-height: 0;
  min-width: 0;
}

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

#leaderboard-pin.leaderboard-pin__solo {
  position: sticky;
  top: 0;
  z-index: 3;
  flex-shrink: 0;
  margin: 0 0 4px;
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
}

#leaderboard-scroll:has(#leaderboard-pin:not([hidden])) table#leaderboard-list {
  margin-top: 0;
}

.menu-leaderboard__table col.lb-col-rank {
  width: 42px;
}

.menu-leaderboard__table col.lb-col-lvl {
  width: 15%;
}

.menu-leaderboard__table col.lb-col-time {
  width: 26%;
}

.leaderboard-pin__name-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.leaderboard-pin__tag-view {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  word-break: break-word;
  text-align: center;
}

.leaderboard-pin__tag-input:not([hidden]) {
  display: block;
  flex: 0 1 7rem;

  max-width: 100%;

  text-align: center;
}

.leaderboard-pin__tag-input {
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(6, 10, 15, 0.95);
  color: var(--text);
  font: inherit;
  font-family: var(--font-menu-logo), system-ui, sans-serif;
}

.leaderboard-pin__pen {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 2px;
  border: none;
  border-radius: 2px;
  background: transparent;
  color: rgba(200, 230, 255, 0.65);
  cursor: pointer;
}

.leaderboard-pin__pen:hover,
.leaderboard-pin__pen:focus-visible {
  color: var(--accent);
}

.leaderboard-pin__pen:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

.leaderboard-pin__rank-txt {
  font-variant-numeric: tabular-nums;
}

.menu-leaderboard__status {
  margin: 0;


  padding: 12px 8px;



  color: var(--muted);

  font-family: var(--font-menu-logo), system-ui, sans-serif;

  font-size: 0.92rem;



  text-align: center;



}

.menu-leaderboard__table {


  width: 100%;
  max-width: 100%;
  border-collapse: collapse;


  margin-top: 4px;

  table-layout: fixed;

  font-family: var(--font-menu-logo), system-ui, sans-serif;

  font-size: 0.85rem;

  color: var(--text);



}

.menu-leaderboard__table thead th {


  position: sticky;


  top: 0;



  z-index: 2;


  padding: 8px 6px;


  text-align: center;


  border-bottom: 1px solid var(--line);


  background: rgba(14, 20, 28, 0.98);

  font-family: var(--font-ui);

  letter-spacing: 0.06em;



  font-size: 0.74rem;



  font-weight: 400;



}


.menu-leaderboard__table td {
  padding: 6px 6px;


  text-align: center;


  vertical-align: middle;


  border-bottom: 1px solid rgba(200, 230, 255, 0.12);

}

.menu-leaderboard__table tr.lb-row--you td {
  border-top: 2px solid var(--accent);

  border-bottom: 2px solid var(--accent);

  background: rgba(195, 255, 98, 0.08);
}

.menu-leaderboard__table tr.lb-row--you td:first-child {
  border-left: 2px solid var(--accent);
}

.menu-leaderboard__table tr.lb-row--you td:last-child {
  border-right: 2px solid var(--accent);
}


.lb-rank {
  width: 42px;



  font-variant-numeric: tabular-nums;

  text-align: center;

}

.lb-name {


  overflow: hidden;



  word-break: break-word;

  text-align: center;

}



.lb-time {




  white-space: nowrap;


  font-variant-numeric: tabular-nums;

  text-align: center;

}


@media (max-width: 960px) {
  .main-menu__shell {
    flex-direction: column;

    align-items: center;

    max-height: none;

  }

  .menu-leaderboard {
    flex: 1 1 auto;

    width: min(500px, 100%);
    max-width: 100%;

    max-height: min(48dvh, 420px);

  }

}

.menu-card {
  position: relative;
  width: min(500px, 100%);
  max-width: 100%;
  height: min(760px, calc(100dvh - max(32px, env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px))));
  min-height: min(600px, calc(100dvh - max(32px, env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px))));
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 40%),
    rgba(10, 16, 24, 0.9);
  text-align: center;
  backdrop-filter: blur(8px);
  box-shadow:
    0 20px 44px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.menu-card::before,
.menu-card::after {
  position: absolute;
  width: 28px;
  height: 28px;
  content: "";
  display: none;
  image-rendering: pixelated;
}

.menu-card::before {
  top: -18px;
  left: -18px;
}

.menu-card::after {
  right: -18px;
  bottom: -18px;
}

.menu-title-block {
  position: absolute;
  top: 22px;
  left: 18px;
  right: 18px;
  z-index: 2;
  container-type: inline-size;
  container-name: menu-title;
}

.menu-kicker {
  display: none;
  margin: 0 0 10px;
  color: var(--accent);
  font-family: var(--font-ui);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 #000000;
}

.menu-logo {
  margin: 0;
  color: var(--text);
  font-family: var(--font-menu-logo);
  font-size: clamp(1.75rem, 13cqw, 4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  -webkit-text-stroke: 0;
  text-shadow:
    2px 2px 0 #0b0b0b,
    4px 4px 0 #000000,
    0 0 18px rgba(195, 255, 98, 0.22);
  width: 100%;
  text-wrap: balance;
}

.menu-scene {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  background: #638596;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.menu-copy {
  max-width: 100%;
  width: 100%;
  margin: 0.55em auto 0;
  padding-inline: 2px;
  box-sizing: border-box;
  color: #d1dae4;
  font-family: var(--font-ui);
  font-size: clamp(0.78rem, 4.25cqw, 1.22rem);
  font-weight: 400;
  line-height: 1.28;
  letter-spacing: 0.03em;
  text-shadow: 1px 1px 0 #000000;
  text-wrap: balance;
}

.menu-record {
  display: block;
  margin: 0.56em 0 0;
  padding-inline: 2px;
}

.menu-record-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.menu-record-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(136, 227, 255, 0.5);
  background: rgba(136, 227, 255, 0.14);
  color: #88e3ff;
  font-family: var(--font-ui);
  font-size: clamp(0.72rem, 3.9cqw, 1.05rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 #000000;
}

.menu-record-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(8, 12, 18, 0.9);
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.34);
}

.menu-record-clear:hover {
  border-color: #ff6f6f;
  background: rgba(45, 12, 14, 0.9);
}

.menu-record-clear:active {
  transform: translateY(1px);
}

.menu-music-row {
  display: flex;
  justify-content: center;
  margin: 0.5em 0 0;
  padding-inline: 2px;
}

.pixel-trash-icon {
  position: relative;
  display: block;
  width: 14px;
  height: 14px;
  background: #cfd9e4;
  box-shadow:
    inset 0 -2px 0 #8b9aae,
    2px 2px 0 #000000;
}

.pixel-trash-icon::before {
  position: absolute;
  left: -1px;
  top: -4px;
  width: 16px;
  height: 3px;
  content: "";
  background: #cfd9e4;
  box-shadow: inset 0 -1px 0 #8b9aae;
}

.pixel-trash-icon::after {
  position: absolute;
  left: 5px;
  top: -6px;
  width: 4px;
  height: 2px;
  content: "";
  background: #cfd9e4;
}

.menu-actions {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  width: min(340px, calc(100% - 40px));
  transform: translateX(-50%);
}

.menu-button {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.42);
  padding: 18px 20px;
  min-height: 56px;
  background: rgba(8, 12, 18, 0.9);
  color: #f1f6ff;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 1.18rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.45);
  transition: background-color 120ms ease;
}

.menu-button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #151a10;
}

.menu-button:active {
  transform: translateY(1px);
}

body.menu-open .hud-cluster,
body.menu-open .target-card,
body.menu-open .powerup-bar {
  opacity: 0;
  pointer-events: none;
}

@keyframes menuFloat {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-8px);
  }
}

@keyframes logoPulse {
  50% {
    text-shadow:
      0 4px 0 #0b0b0b,
      3px 8px 0 #000000,
      0 0 24px rgba(106, 188, 255, 0.3);
  }
}

@keyframes powerupFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-3px);
  }
}

@media (max-width: 760px) {
  .hud-cluster {
    top: max(8px, env(safe-area-inset-top, 0px));
    left: 8px;
    gap: 6px;
    max-width: calc(100vw - 16px);
  }

  .hud {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 6px 8px;
    font-size: 0.82rem;
  }

  .hud-mute-aside {
    padding: 4px 6px;
  }

  .mute-button--icon {
    min-width: 34px;
    min-height: 34px;
  }

  .speaker-icon {
    transform: scale(0.86);
  }

  .life-badge,
  .coin-badge,
  .time-badge {
    min-height: 24px;
    padding: 3px 6px;
  }

  .pixel-heart {
    width: 15px;
    height: 13px;
  }

  .target-card {
    top: auto;
    right: 8px;
    bottom: calc(122px + env(safe-area-inset-bottom, 0px));
    left: auto;
    width: 142px;
    padding: 10px;
  }

  .powerup-bar {
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    gap: 8px;
    padding: 8px 10px;
    max-width: calc(100vw - 16px);
  }

  .powerup-btn {
    min-width: 0;
    flex: 1 1 88px;
    padding: 8px 8px 6px;
  }

  .powerup-btn-label {
    font-size: 0.82rem;
  }

  #cubey-canvas {
    width: 112px;
    height: 112px;
  }

  .menu-card {
    max-width: 100%;
    min-height: min(560px, calc(100dvh - 48px));
    height: min(720px, calc(100dvh - 32px));
  }

  .menu-actions {
    width: min(320px, calc(100% - 28px));
    bottom: 18px;
    gap: 12px;
  }

  .menu-button {
    font-size: 1.05rem;
    padding: 16px 18px;
    min-height: 52px;
  }

  .menu-scene {
    border-width: 0;
  }
}

@media (max-width: 560px) {
  .hud-cluster {
    align-items: center;
    flex-direction: column;
    width: calc(100vw - 12px);
    left: 6px;
    right: 6px;
  }

  .hud {
    width: 100%;
    justify-content: space-evenly;
    gap: 6px;
  }

  .hud-mute-aside {
    width: fit-content;
  }

  .target-card {
    width: 120px;
    padding: 8px;
    bottom: calc(112px + env(safe-area-inset-bottom, 0px));
  }

  .target-label {
    margin-bottom: 8px;
    font-size: 0.82rem;
  }

  #cubey-canvas {
    width: 96px;
    height: 96px;
  }

  .powerup-bar {
    left: 6px;
    right: 6px;
    bottom: max(6px, env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: none;
    transform: none;
  }

  .powerup-items {
    width: 100%;
    gap: 6px;
  }

  .powerup-btn {
    flex: 1 1 calc(33.333% - 6px);
    min-height: 56px;
    padding: 7px 6px 6px;
  }

  .powerup-btn::after {
    display: none;
  }

  .menu-card {
    width: min(420px, 100%);
    max-width: 100%;
    box-sizing: border-box;
    height: auto;
    min-height: 0;
    max-height: calc(100dvh - max(24px, env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px)));
    aspect-ratio: 360 / 520;
  }

  .menu-title-block {
    top: 16px;
    left: 12px;
    right: 12px;
  }

  .menu-actions {
    width: calc(100% - 20px);
    bottom: 12px;
    gap: 10px;
  }

  .menu-button {
    min-height: 48px;
    padding: 12px 14px;
    font-size: 0.94rem;
  }
}

@media (max-width: 760px) {
  .hud-cluster {
    left: 6px;
    right: 6px;
    top: max(6px, env(safe-area-inset-top, 0px));
    width: auto;
    max-width: none;
    flex-direction: row;
    justify-content: space-between;
    align-items: stretch;
    gap: 4px;
  }

  .hud {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 4px;
    min-height: 36px;
    padding: 4px 6px;
    font-size: 0.74rem;
  }

  .life-badge,
  .coin-badge,
  .time-badge {
    min-height: 22px;
    padding: 2px 5px;
    gap: 4px;
  }

  .life-hearts {
    gap: 4px;
  }

  .pixel-heart {
    width: 13px;
    height: 12px;
  }

  .hud-mute-aside {
    flex: 0 0 auto;
    padding: 2px 4px;
  }

  .mute-button--icon {
    min-width: 30px;
    min-height: 30px;
    padding: 4px;
  }

  .speaker-icon {
    transform: scale(0.74);
  }

  .target-card {
    top: calc(48px + env(safe-area-inset-top, 0px));
    right: 6px;
    left: auto;
    bottom: auto;
    width: 120px;
    padding: 8px;
  }

  .target-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.82rem;
  }

  #cubey-canvas {
    width: 96px;
    height: 96px;
  }

  .powerup-bar {
    left: 0;
    right: 0;
    bottom: 56px;
    width: 100%;
    max-width: none;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    gap: 6px;
    transform: none;
    border: 0;
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
  }

  .powerup-bar-title {
    display: none;
  }

  .powerup-items {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
  }

  .powerup-btn {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    padding: 6px 6px 5px;
  }

  .powerup-btn-label {
    font-size: 0.76rem;
  }

  .powerup-btn-cost {
    padding: 1px 6px;
    font-size: 0.68rem;
  }
}
