.menuPage {
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

.particlesCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.menuHeader {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
}

.menuBrand {
  display: flex;
  align-items: center;
}

.brandMark {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--green-dim);
  box-shadow: 0 0 20px rgba(61, 232, 138, 0.35);
}

.brandMark .iconFallback {
  font-size: 1.4rem;
  filter: drop-shadow(0 0 10px rgba(61, 232, 138, .6));
}

/* ---- Icon fallback/swap system ----
   .iconImg is hidden until it successfully loads (see js/icons.js),
   so a missing artist asset never flashes a broken-image icon —
   it just silently stays on the emoji fallback. */
.iconImg {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.iconImg.loaded {
  display: block;
}

.iconFallback.hidden {
  display: none;
}

.userBar {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  border-radius: 999px;
  transition: background .15s;
}

.userBar:hover {
  background: rgba(255,255,255,.04);
}

.langRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  gap: 12px;
}

.langRowLabel {
  font-size: .9rem;
}

.langSwitch {
  display: inline-flex;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 3px;
  gap: 3px;
}

.langBtn {
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  font-size: .75rem;
  letter-spacing: .04em;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.langBtn:hover {
  color: #fff;
}

.langBtn.active {
  background: var(--green-dim);
  color: var(--green);
  box-shadow: 0 0 0 1px var(--panel-border) inset;
}

.settingsHint {
  margin: 0 0 4px;
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.4;
}

.settingsHint a {
  color: var(--green);
}

.phraseWheelSettings {
  padding: 10px 0 14px;
  border-top: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
  margin: 4px 0 10px;
}

.phraseWheelSlots {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
}

.phraseWheelSlotRow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.phraseWheelSlotNum {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--green-dim);
  color: var(--green);
  font-weight: 700;
  font-size: .78rem;
}

.phraseWheelSlotRow select {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: .84rem;
}

.coinPill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 209, 102, 0.35);
  background: rgba(255, 209, 102, 0.1);
  font-size: .85rem;
  color: var(--muted);
}

.coinPill strong {
  font-family: var(--font-display);
  color: var(--yellow);
  font-size: 1rem;
}

.userChip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: rgba(0, 0, 0, 0.35);
}

.userAvatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-dim);
  font-size: 1.2rem;
  overflow: hidden;
}

.userAvatarImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.userName {
  font-weight: 700;
  font-size: .9rem;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menuLayout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 640px) minmax(0, 260px);
  justify-content: center;
  align-items: start;
  gap: 28px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.sidePanel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 96px;
  padding: 16px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(8, 12, 18, 0.6);
  backdrop-filter: blur(12px);
}

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

.sidePanelIcon {
  position: relative;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.sidePanelTitle {
  font-family: var(--font-display);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--muted);
}

.sidePanelBadge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--red, #f25f4c);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(242,95,76,.5);
}

.sidePanelBody {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 40px;
}

.sidePanelEmpty {
  padding: 10px 2px;
  font-size: .78rem;
  color: var(--muted);
}

.sidePanelRow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
}

.sidePanelRow:hover { background: rgba(255,255,255,.04); }

.sidePanelAvatarWrap { position: relative; flex-shrink: 0; }

.sidePanelAvatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-dim);
  font-size: 1rem;
  overflow: hidden;
}

.sidePanelAvatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.sidePanelDot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  border: 2px solid #080c12;
}

.sidePanelDot.on {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.sidePanelInfo {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidePanelName {
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidePanelMeta {
  font-size: .7rem;
  color: var(--muted);
}

.sidePanelRank {
  width: 20px;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: .78rem;
  color: var(--muted);
  text-align: center;
}

.sidePanelRow.rank-1 .sidePanelRank { color: var(--yellow); }
.sidePanelRow.rank-2 .sidePanelRank { color: #cfd8e6; }
.sidePanelRow.rank-3 .sidePanelRank { color: #d99a5c; }

.sidePanelFoot {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: .74rem;
  font-weight: 600;
  text-align: center;
}

/* ---- Decorative HUD corners (purely visual, no data) ---- */
.hudCorner {
  position: fixed;
  z-index: 3;
  width: 46px;
  height: 46px;
  pointer-events: none;
  opacity: .35;
}

.hudCorner::before,
.hudCorner::after {
  content: "";
  position: absolute;
  background: var(--green);
  box-shadow: 0 0 8px rgba(61, 232, 138, .6);
}

.hudCorner::before { width: 100%; height: 2px; }
.hudCorner::after { width: 2px; height: 100%; }

.hudCorner--tl { top: 18px; left: 18px; }
.hudCorner--tl::before, .hudCorner--tl::after { top: 0; left: 0; }

.hudCorner--tr { top: 18px; right: 18px; }
.hudCorner--tr::before { top: 0; right: 0; }
.hudCorner--tr::after { top: 0; right: 0; }

.hudCorner--bl { bottom: 18px; left: 18px; }
.hudCorner--bl::before { bottom: 0; left: 0; }
.hudCorner--bl::after { bottom: 0; left: 0; }

.hudCorner--br { bottom: 18px; right: 18px; }
.hudCorner--br::before { bottom: 0; right: 0; }
.hudCorner--br::after { bottom: 0; right: 0; }

@media (max-width: 1180px) {
  .menuLayout {
    grid-template-columns: 1fr;
  }
  .sidePanel {
    display: none;
  }
}

@media (max-width: 640px) {
  .hudCorner {
    display: none;
  }
}

.menuMain {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 140px);
  padding: 20px;
}

.menuTitleBlock {
  text-align: center;
  margin-bottom: 40px;
}

.menuKicker {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: .7rem;
  letter-spacing: .25em;
  color: var(--green);
}

.menuTitle {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 10vw, 5.5rem);
  font-weight: 900;
  line-height: .95;
  letter-spacing: .04em;
  text-shadow: 0 0 40px rgba(61, 232, 138, 0.25);
}

.menuTitle span {
  display: block;
  color: var(--green);
  text-shadow: 0 0 30px rgba(61, 232, 138, 0.55);
}

.menuTagline {
  margin: 12px 0 20px;
  color: var(--muted);
  font-size: .95rem;
}

.onlineBadge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.4);
  font-size: .82rem;
  color: var(--muted);
}

.onlineBadge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  50% { opacity: .45; }
}

.chestBanner {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 580px;
  padding: 14px 18px;
  margin-bottom: 16px;
  border-radius: 14px;
  border: 1px solid #ffd166;
  background: linear-gradient(90deg, rgba(255,209,102,.12), rgba(255,209,102,.03));
  color: var(--text);
  cursor: pointer;
  text-align: left;
  animation: chestGlow 2.4s ease infinite;
}

@keyframes chestGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(255,209,102,.15); }
  50% { box-shadow: 0 0 22px rgba(255,209,102,.4); }
}

.chestIcon { font-size: 1.8rem; flex-shrink: 0; }

.chestText {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chestText strong { font-size: .9rem; color: #ffd166; }
.chestText span { font-size: .78rem; color: var(--muted); }

.chestArrow { font-size: 1.2rem; color: #ffd166; flex-shrink: 0; }

.menuGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 145px));
  gap: 14px;
  max-width: 610px;
  width: 100%;
}

.menuBtn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 96px;
  padding: 16px 10px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(8, 12, 18, 0.75);
  backdrop-filter: blur(12px);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, border-color .2s, background .2s;
}

.menuBtnBadge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--red, #f25f4c);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(242,95,76,.5);
}

.menuBtn:hover {
  transform: translateY(-4px) scale(1.03);
  border-color: var(--green);
  box-shadow: 0 0 28px rgba(61, 232, 138, 0.25), inset 0 0 20px rgba(61, 232, 138, 0.05);
  background: rgba(61, 232, 138, 0.08);
}

.menuBtn.playBtn {
  grid-column: span 4;
  min-height: 72px;
  flex-direction: row;
  background: linear-gradient(135deg, rgba(61, 232, 138, 0.2), rgba(61, 232, 138, 0.05));
  border-color: rgba(61, 232, 138, 0.5);
}

.menuBtn.playBtn:hover {
  box-shadow: 0 0 40px rgba(61, 232, 138, 0.4);
}

.menuBtnIcon {
  position: relative;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  line-height: 1;
}

.chestIcon {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
}

.playOptions {
  display: grid;
  gap: 10px;
  margin: 4px 0 4px;
}

.playOption {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(8, 12, 18, 0.6);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: transform .15s, box-shadow .15s, border-color .15s, background .15s;
}

.playOption:hover {
  transform: translateY(-2px);
  border-color: var(--green);
  box-shadow: 0 0 22px rgba(61, 232, 138, 0.22);
  background: rgba(61, 232, 138, 0.08);
}

.playOptionIcon {
  position: relative;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
}

.playOptionText {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.playOptionText strong {
  font-family: var(--font-display);
  font-size: .88rem;
  letter-spacing: .04em;
}

.playOptionText span {
  font-size: .78rem;
  color: var(--muted);
}

.menuBtnLabel {
  font-family: var(--font-display);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.menuFooter {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 16px;
  color: var(--muted);
  font-size: .75rem;
  letter-spacing: .1em;
}

.cascade {
  opacity: 0;
  animation: cascadeIn .6s ease forwards;
  animation-delay: calc(var(--i, 0) * 0.08s);
}

@keyframes cascadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modalOverlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.modalOverlay.hidden { display: none; }

.modalBox {
  width: min(420px, 100%);
  padding: 28px;
}

.modalBox h2 {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: .1em;
}

.modalActions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modalActions .btn { flex: 1; }

.authBlock {
  display: grid;
  gap: 10px;
  margin: 14px 0 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.authHint {
  margin: 0;
  font-size: .75rem;
  color: var(--muted);
  line-height: 1.35;
}

@media (max-width: 520px) {
  .menuGrid {
    grid-template-columns: 1fr 1fr;
  }
  .menuBtn.playBtn {
    grid-column: span 2;
  }
  .menuHeader {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}
