/* Multiplayer UI — layers on game-ui.css; keeps Gloomhunt theme, raises readability. */

:root {
  --mp-text-primary: #edf7ed;
  --mp-text-secondary: #b7d0ba;
  --mp-text-muted: #8aa890;
  --mp-surface: rgba(6, 18, 12, 0.94);
  --mp-surface-raised: rgba(10, 28, 16, 0.96);
  --mp-border: rgba(68, 204, 68, 0.32);
  --mp-accent: var(--gh-accent, #44cc44);
  --mp-touch-min: 48px;
}

/* —— Shared status / links —— */

.mp-status {
  margin: 0;
  width: 100%;
  text-align: center;
  font-size: clamp(0.85rem, 1.7vw, 0.98rem);
  line-height: 1.4;
  color: var(--mp-text-secondary);
  letter-spacing: 0.02em;
}

.mp-status--error {
  padding: 0.65rem 0.85rem;
  color: #ffc9c9;
  background: rgba(180, 40, 40, 0.28);
  border: 1px solid rgba(255, 120, 120, 0.5);
  border-radius: 6px;
}

/* Owned reconnect path — calm status, not an error dialog */
.mp-reconnect-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(20, 55, 28, 0.35), transparent 70%),
    rgba(2, 8, 5, 0.78);
  pointer-events: auto;
  animation: mp-reconnect-fade-in 180ms ease-out;
}

.mp-reconnect-overlay__panel {
  margin: 0 1rem;
  padding: clamp(1.15rem, 3.2vw, 1.55rem) clamp(1.2rem, 3.5vw, 1.85rem);
  text-align: center;
  color: var(--mp-text-primary);
  background: linear-gradient(165deg, rgba(12, 32, 18, 0.97), rgba(6, 16, 10, 0.98));
  border: 1px solid rgba(68, 204, 68, 0.42);
  border-radius: 10px;
  /* Phone: nearly full menu width. Desktop: status card, not a postage stamp. */
  width: min(22rem, 88vw);
  max-width: 90vw;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 0 28px rgba(68, 204, 68, 0.08);
}

.mp-reconnect-overlay__spinner {
  width: clamp(1.55rem, 4.2vw, 2rem);
  height: clamp(1.55rem, 4.2vw, 2rem);
  margin: 0 auto 0.9rem;
  border-radius: 50%;
  border: 2px solid rgba(68, 204, 68, 0.22);
  border-top-color: var(--mp-accent);
  border-right-color: rgba(68, 204, 68, 0.65);
  animation: mp-reconnect-spin 0.85s linear infinite;
}

.mp-reconnect-overlay__title {
  margin: 0;
  font-size: clamp(1.05rem, 3.4vw, 1.35rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mp-accent);
  text-shadow: 0 0 18px rgba(68, 204, 68, 0.25);
}

.mp-reconnect-overlay__hint {
  margin: 0.45rem 0 0;
  font-size: clamp(0.82rem, 2.4vw, 0.98rem);
  line-height: 1.35;
  color: var(--mp-text-secondary);
  letter-spacing: 0.02em;
}

.mp-reconnect-overlay__count {
  margin: 0.55rem 0 0;
  font-size: clamp(0.82rem, 2.2vw, 0.98rem);
  color: var(--mp-text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

@media (min-width: 900px) {
  .mp-reconnect-overlay__panel {
    width: min(26rem, 36vw);
    padding: 1.65rem 2rem 1.45rem;
  }

  .mp-reconnect-overlay__spinner {
    width: 2.1rem;
    height: 2.1rem;
    margin-bottom: 1rem;
  }

  .mp-reconnect-overlay__title {
    font-size: 1.4rem;
  }

  .mp-reconnect-overlay__hint {
    font-size: 1rem;
  }

  .mp-reconnect-overlay__count {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .mp-reconnect-overlay__panel {
    width: min(22rem, 92vw);
    margin: 0 0.75rem;
    padding: 1.25rem 1.15rem 1.15rem;
  }
}

@keyframes mp-reconnect-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes mp-reconnect-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mp-reconnect-overlay,
  .mp-reconnect-overlay__spinner {
    animation: none;
  }
}

.mp-menu-tagline,
.mp-lobby-status-line {
  color: var(--mp-text-secondary) !important;
  font-size: clamp(0.85rem, 1.8vw, 1rem) !important;
  letter-spacing: 0.06em !important;
}

/* —— MP entry (Play With Friends) —— */

#screen-mp-menu .menu-title {
  white-space: nowrap;
  font-size: clamp(0.95rem, 3.6vw, 2.1rem);
  letter-spacing: clamp(0.03em, 0.35vw, 0.08em);
}

.mp-menu-stack {
  justify-content: center;
  width: min(92vw, 640px);
  margin-inline: auto;
  gap: clamp(0.75rem, 2vh, 1.15rem);
}

.mp-menu-actions {
  width: 100%;
  max-width: none;
  gap: 0.85rem;
}

.mp-path-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  width: 100%;
}

.mp-path-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  width: 100%;
  padding: 1.1rem 1.15rem 1.15rem;
  border-radius: 10px;
  border: 1.5px solid var(--mp-border);
  background: var(--mp-surface);
  box-sizing: border-box;
}

.mp-path-card > .menu-btn {
  width: 100%;
}

#screen-mp-menu .mp-menu-actions .menu-btn--play {
  font-size: clamp(0.85rem, 1.8vw, 1.05rem);
  padding: 0.65em 1em;
  min-height: var(--mp-touch-min);
  animation: none;
}

.mp-path-card__title {
  margin: 0;
  font-family: var(--gh-font-display);
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mp-text-primary);
  text-align: center;
}

.mp-path-card__body {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--mp-text-secondary);
  letter-spacing: 0.01em;
  text-align: center;
}

.mp-menu-footer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  width: 100%;
}

.mp-menu-footer .menu-btn {
  width: 100%;
  min-height: var(--mp-touch-min);
  animation: none;
}

.mp-code-row {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  align-items: stretch;
}

.mp-code-row .mp-code-input {
  flex: 1 1 68%;
  min-width: 0;
  width: auto;
  min-height: var(--mp-touch-min);
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1.5px solid var(--mp-border);
  background: var(--mp-surface-raised);
  color: var(--mp-text-primary);
  font-family: var(--gh-font-display);
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-align: left;
  text-transform: uppercase;
  box-sizing: border-box;
}

.mp-code-row .mp-code-input:not(:placeholder-shown) {
  color: var(--mp-accent);
  text-shadow: 0 0 10px var(--gh-accent-glow);
}

.mp-code-row .mp-code-input::placeholder {
  color: var(--mp-text-muted);
  opacity: 1;
  letter-spacing: 0.04em;
  font-size: 0.88em;
  font-weight: 600;
  text-transform: none;
}

.mp-code-row .mp-code-input:focus {
  outline: none;
  border-color: var(--mp-accent);
  box-shadow: 0 0 12px var(--gh-accent-glow);
}

.mp-code-row .menu-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 5.5rem;
  min-height: var(--mp-touch-min);
  max-width: 34%;
}

@media (max-width: 420px) {
  .mp-code-row {
    flex-direction: column;
  }

  .mp-code-row .menu-btn {
    width: 100%;
    max-width: none;
  }
}

/* —— Lobby ——
   Same vertical centering as SP `.menu-stack` (plain center).
   `safe center` was wrong here: when Firefox thinks content slightly overflows,
   safe falls back to start and leaves a big empty gap under Leave Hunt. */

.mp-lobby-stack {
  justify-content: center;
  width: min(92vw, 560px);
  margin-inline: auto;
  gap: clamp(0.5rem, 1.5vh, 0.9rem);
  padding-inline: clamp(0.75rem, 3vw, 1.25rem);
  padding-bottom: max(var(--screen-pad-y, 1rem), var(--safe-bottom, 0px), env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#screen-mp-lobby .mp-lobby-stack {
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
}

.mp-lobby-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  text-align: center;
  gap: 0.35rem;
}

.mp-lobby-title {
  margin: 0 !important;
  font-size: clamp(1.6rem, 4.5vw, 2.4rem) !important;
  text-align: center !important;
}

.mp-lobby-status-line {
  margin: 0;
  text-align: center !important;
  line-height: 1.3;
}

.mp-lobby-fill__count {
  font-family: var(--gh-font-display);
  font-size: clamp(0.95rem, 2.3vw, 1.1rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--mp-accent);
  text-shadow: 0 0 10px var(--gh-accent-glow);
}

.mp-lobby-fill__label {
  margin-left: 0.35rem;
  font-size: clamp(0.78rem, 1.8vw, 0.9rem);
  color: var(--mp-text-secondary);
  letter-spacing: 0.03em;
}

.mp-lobby-fill__ready {
  display: block;
  font-family: var(--gh-font-display);
  font-size: clamp(0.82rem, 1.9vw, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mp-accent);
  text-shadow: 0 0 10px var(--gh-accent-glow);
}

.mp-lobby-fill__ready-count {
  margin-left: 0.15rem;
  font-size: clamp(0.78rem, 1.8vw, 0.9rem);
  color: var(--mp-text-secondary);
  letter-spacing: 0.03em;
}

.mp-lobby-hunt-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  width: min(100%, 16rem);
  padding: 0.4rem 0.85rem;
  border-radius: 10px;
  border: 1.5px solid var(--mp-border);
  background: var(--mp-surface);
  box-sizing: border-box;
  text-align: center;
}

.mp-lobby-hunt-summary__mode {
  font-family: var(--gh-font-display);
  font-size: clamp(0.92rem, 2.1vw, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mp-text-primary);
}

.mp-lobby-hunt-summary__rules {
  display: block;
  margin-top: 0.15rem;
  font-size: clamp(0.75rem, 1.6vw, 0.88rem);
  letter-spacing: 0.03em;
  color: var(--mp-text-secondary);
}

.mp-lobby-hunt-summary__rules[hidden] {
  display: none !important;
}

.mp-create-stack .mp-create-card {
  gap: 0.65rem;
}

.mp-create-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
  padding: 1.1rem 1.15rem 1.15rem;
  border-radius: 10px;
  border: 1.5px solid var(--mp-border);
  background: var(--mp-surface);
  box-sizing: border-box;
}

.mp-choice-block {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
}

.mp-choice-block__label {
  margin: 0;
  font-family: var(--gh-font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mp-text-secondary);
  text-align: center;
}

.mp-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  width: 100%;
}

.mp-choice-card {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  width: 100%;
  min-height: 5.5rem;
  padding: 0.85rem 0.9rem;
  border-radius: 10px;
  border: 1.5px solid var(--mp-border);
  background: var(--mp-surface-raised);
  color: var(--mp-text-secondary);
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.mp-choice-card__title {
  font-family: var(--gh-font-display);
  font-size: clamp(0.92rem, 2vw, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: inherit;
}

.mp-choice-card__body {
  font-size: 0.82rem;
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: var(--mp-text-muted);
}

.mp-choice-card.is-selected {
  border-color: var(--mp-accent);
  background: rgba(68, 204, 68, 0.12);
  color: var(--mp-text-primary);
  box-shadow: 0 0 12px rgba(68, 204, 68, 0.18);
}

.mp-choice-card.is-selected .mp-choice-card__body {
  color: var(--mp-text-secondary);
}

.mp-choice-card:disabled,
.mp-choice-chip:disabled {
  cursor: default;
  opacity: 0.7;
}

/* Secondary rules — compact chips (desktop still shows short hints) */
.mp-choice-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  width: 100%;
}

.mp-choice-chips--duration {
  grid-template-columns: repeat(4, 1fr);
}

.mp-choice-chips--duration .mp-choice-chip {
  min-height: 2.85rem;
  padding: 0.55rem 0.35rem;
}

.mp-choice-chip {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  width: 100%;
  min-height: 3.6rem;
  padding: 0.7rem 0.65rem;
  border-radius: 8px;
  border: 1.5px solid var(--mp-border);
  background: var(--mp-surface-raised);
  color: var(--mp-text-secondary);
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.mp-choice-chip__title {
  font-family: var(--gh-font-display);
  font-size: clamp(0.82rem, 1.8vw, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: inherit;
}

.mp-choice-chip__hint {
  font-size: 0.72rem;
  line-height: 1.25;
  letter-spacing: 0.01em;
  color: var(--mp-text-muted);
}

.mp-choice-chip.is-selected {
  border-color: var(--mp-accent);
  background: rgba(68, 204, 68, 0.14);
  color: var(--mp-text-primary);
  box-shadow: 0 0 10px rgba(68, 204, 68, 0.16);
}

.mp-choice-chip.is-selected .mp-choice-chip__hint {
  color: var(--mp-text-secondary);
}

.mp-create-ffa {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mp-create-ffa[hidden] {
  display: none !important;
}

#screen-mp-create .mp-menu-actions .menu-btn--play {
  font-size: clamp(0.85rem, 1.8vw, 1.05rem);
  padding: 0.65em 1em;
  min-height: var(--mp-touch-min);
  animation: none;
}

/* Mobile: Mode stacks; rules stay side-by-side chips; tighter spacing */
@media (max-width: 599px) {
  #screen-mp-create .mp-create-stack {
    gap: clamp(0.45rem, 1.4vh, 0.75rem);
  }

  #screen-mp-create .menu-title {
    font-size: clamp(1.15rem, 6vw, 1.55rem);
  }

  .mp-create-panel {
    gap: 0.65rem;
    padding: 0.85rem 0.9rem 0.95rem;
  }

  .mp-choice-block {
    gap: 0.3rem;
  }

  .mp-choice-block__label {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
  }

  .mp-choice-grid--mode {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .mp-choice-card {
    min-height: 0;
    padding: 0.75rem 0.85rem;
    gap: 0.2rem;
  }

  .mp-choice-card__title {
    font-size: 0.95rem;
  }

  .mp-choice-card__body {
    font-size: 0.8rem;
  }

  .mp-choice-chips--duration {
    grid-template-columns: repeat(2, 1fr);
  }

  .mp-choice-chips--duration .mp-choice-chip {
    min-height: 2.7rem;
  }

  .mp-choice-chips {
    gap: 0.4rem;
  }

  .mp-choice-chip {
    min-height: var(--mp-touch-min);
    padding: 0.55rem 0.5rem;
    gap: 0;
  }

  .mp-choice-chip__title {
    font-size: 0.8rem;
    letter-spacing: 0.05em;
  }

  /* Secondary rules: labels only — no helper wall */
  .mp-choice-chip__hint {
    display: none;
  }

  .mp-create-ffa {
    gap: 0.55rem;
  }

  #screen-mp-create .mp-menu-footer {
    gap: 0.45rem;
  }
}

.mp-lobby-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem 0.5rem;
  margin: 0.1rem 0 0;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--mp-text-secondary);
  text-align: center;
}

.mp-lobby-mode__label {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--mp-text-secondary);
}

.mp-mode-pill {
  appearance: none;
  border: 1px solid var(--mp-border);
  background: var(--mp-surface);
  color: var(--mp-text-secondary);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.mp-mode-pill.is-active {
  border-color: var(--mp-accent);
  color: var(--mp-text-primary);
  background: rgba(80, 140, 110, 0.35);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mp-mode-pill:disabled {
  cursor: default;
  opacity: 0.9;
}

.mp-ffa-options {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.mp-ffa-options[hidden] {
  display: none !important;
}


.mp-lobby-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(0.55rem, 1.6vh, 0.9rem);
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

.mp-room-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  border: 1.5px solid var(--mp-border);
  background: var(--mp-surface);
  box-sizing: border-box;
}

.mp-room-row__text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.mp-room-row__label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mp-text-secondary);
}

.mp-room-row__code {
  font-family: var(--gh-font-display);
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--mp-accent);
  text-shadow: 0 0 12px var(--gh-accent-glow);
  line-height: 1.1;
  user-select: all;
}

.mp-room-row__actions {
  display: flex;
  gap: 0.45rem;
  flex-shrink: 0;
}

.mp-room-btn {
  min-width: 4.75rem;
  min-height: var(--mp-touch-min);
  width: auto !important;
  padding-inline: 0.9rem !important;
  animation: none !important;
}

.mp-player-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  width: 100%;
}

.mp-player-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 0;
  padding: 0.45rem 0.4rem 0.4rem;
  border-radius: 8px;
  border: 1.5px dashed rgba(68, 204, 68, 0.35);
  background: var(--mp-surface);
  box-sizing: border-box;
  text-align: center;
}

.mp-player-slot--filled {
  border-style: solid;
  border-color: var(--mp-border);
  background: var(--mp-surface-raised);
}

.mp-player-slot--self {
  border-color: var(--mp-accent);
  box-shadow: 0 0 14px var(--gh-accent-glow);
}

.mp-player-slot--ready {
  border-color: rgba(120, 230, 140, 0.55);
}

.mp-player-slot--disconnected {
  opacity: 0.55;
}

.mp-player-slot__kick {
  position: absolute;
  bottom: 0.3rem;
  right: 0.3rem;
  margin-top: 0;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 120, 100, 0.45);
  background: rgba(40, 12, 10, 0.65);
  color: #ffb0a0;
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  line-height: 1.2;
}

.mp-player-slot__kick:hover,
.mp-player-slot__kick:focus-visible {
  border-color: rgba(255, 140, 120, 0.75);
  color: #ffd0c8;
  outline: none;
}

.mp-host-badge {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gh-gold, #e3a520);
  filter: drop-shadow(0 0 4px rgba(227, 165, 32, 0.45));
}

.mp-host-badge svg {
  width: 14px;
  height: 14px;
}

.mp-player-slot__avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  border: 1.5px solid var(--mp-border);
  background: radial-gradient(circle at 30% 25%, rgba(68, 204, 68, 0.22), rgba(8, 14, 10, 0.95));
  overflow: hidden;
  flex-shrink: 0;
}

.mp-player-slot__avatar--empty {
  border-style: dashed;
  border-color: rgba(68, 204, 68, 0.35);
  background: transparent;
}

.mp-player-slot__mark {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 58%;
  height: 58%;
  opacity: 0.35;
  pointer-events: none;
}

.mp-player-slot__monogram {
  position: relative;
  z-index: 1;
  font-family: var(--gh-font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--mp-accent);
  text-shadow: 0 0 8px var(--gh-accent-glow);
}

.mp-player-slot__plus {
  font-family: var(--gh-font-display);
  font-size: 1.1rem;
  color: var(--mp-text-secondary);
  line-height: 1;
}

.mp-player-slot__name {
  width: 100%;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--mp-text-primary);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-player-slot__name--muted {
  color: var(--mp-text-secondary);
  font-weight: 600;
}

.mp-player-slot__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mp-text-secondary);
  line-height: 1.15;
}

.mp-player-slot__status--ready {
  color: #9effb0;
}

.mp-player-slot__status--muted {
  color: var(--mp-text-muted);
}

.mp-ready-icon {
  display: block;
  width: 0.7rem;
  height: 0.7rem;
}

.mp-lobby-actions {
  width: 100%;
  gap: 0.7rem;
  margin-top: clamp(0.55rem, 1.8vh, 0.95rem);
  padding-bottom: 0.15rem;
}

.mp-lobby-actions .menu-btn {
  min-height: calc(var(--mp-touch-min) - 4px);
  animation: none;
}

#screen-mp-lobby .mp-lobby-actions .menu-btn--play {
  font-size: clamp(0.82rem, 1.8vw, 1rem);
  padding: 0.55em 1em;
}

.mp-player-slot:has(.mp-player-slot__kick) {
  padding-bottom: 1.35rem;
}

#mp-start:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  filter: grayscale(0.2);
  box-shadow: none;
  color: var(--mp-text-primary);
}

#mp-start:disabled:hover,
#mp-start:disabled:active {
  transform: none;
}

/* —— Lobby help —— */

.mp-how-stack {
  width: min(92vw, 560px);
  margin-inline: auto;
  max-width: none;
}

.mp-how-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mp-how-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.mp-how-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 0.95rem;
  border-radius: 10px;
  border: 1.5px solid var(--mp-border);
  background: var(--mp-surface);
}

.mp-how-step__n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid var(--mp-border);
  background: rgba(68, 204, 68, 0.12);
  color: var(--mp-accent);
  font-weight: 700;
}

.mp-how-step__copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.mp-how-step__copy strong {
  font-family: var(--gh-font-display);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mp-text-primary);
}

.mp-how-step__copy span {
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--mp-text-secondary);
  letter-spacing: 0.01em;
}

.mp-how-actions {
  width: 100%;
}

.mp-how-actions .menu-btn {
  width: 100%;
  min-height: var(--mp-touch-min);
  animation: none;
}

/* —— Arena chrome —— */

.mp-movement-root {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  background: #0a0e18;
}

/* Pause / settings / how-to must paint above the arena (root is z-index 5). */
#screen-layer.mp-over-arena {
  z-index: 30;
  pointer-events: auto;
}

.mp-movement-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.mp-movement-hud {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 8px 12px;
  font: 12px/1.5 ui-monospace, monospace;
  color: #c8e0d0;
  background: rgba(10, 14, 24, 0.82);
  border: 1px solid rgba(120, 150, 200, 0.2);
  border-radius: 6px;
  pointer-events: none;
  max-width: min(420px, calc(100vw - 24px));
}

/* Solo HudDOM sits above the MP canvas root during a live match.
   Pause uses the same #hud-btn-pause as solo (game-ui.css) — do not restyle/hide it. */
#hud-layer.mp-arena-active {
  z-index: 6;
}

/* Mid-match status (elim / spectate / downed) — HTML so it uses --hud-font-* like timer/kills. */
.mp-hud-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(0.2rem * var(--hud-scale, 1));
  margin-top: calc(0.35rem * var(--hud-scale, 1));
  max-width: min(92vw, calc(520px * var(--hud-scale, 1)));
  pointer-events: none;
  text-align: center;
  text-shadow:
    0 0 4px #000,
    0 1px 2px #000;
}

.mp-hud-status[hidden] {
  display: none !important;
}

.mp-hud-status__title {
  font-family: Rajdhani, ui-sans-serif, sans-serif;
  font-size: var(--hud-font-timer);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.04em;
  color: #ff6a6a;
}

.mp-hud-status--spectate .mp-hud-status__title {
  color: #ff8888;
}

.mp-hud-status--downed .mp-hud-status__title {
  color: #ffaa88;
  font-size: var(--hud-font-lg);
}

.mp-hud-status__body {
  font-family: Rajdhani, ui-sans-serif, sans-serif;
  font-size: var(--hud-font-lg);
  font-weight: 600;
  line-height: 1.15;
  color: #ffc8a0;
}

.mp-hud-status__meta {
  font-family: Rajdhani, ui-sans-serif, sans-serif;
  font-size: var(--hud-font-sm);
  font-weight: 600;
  line-height: 1.15;
  color: #c8e0ff;
}

.mp-hud-status__hint {
  font-family: Rajdhani, ui-sans-serif, sans-serif;
  font-size: var(--hud-font-md);
  font-weight: 700;
  line-height: 1.15;
  color: #9effb0;
}

.mp-hud-status--downed .mp-hud-status__hint {
  color: #c8e0ff;
  font-weight: 600;
  font-size: var(--hud-font-sm);
}

.mp-hud-status__body:empty,
.mp-hud-status__meta:empty,
.mp-hud-status__hint:empty {
  display: none;
}

/* Name tags + damage numbers above HudDOM; pointer-events none so sticks/buttons work. */
.mp-fx-overlay {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  display: block;
}

.mp-fx-overlay[hidden] {
  display: none !important;
}

.mp-movement-hud.mp-hud-debug-hidden {
  display: none;
}

.mp-movement-leave {
  /* Leave lives in the pause menu + end-of-match actions — not a permanent bar. */
  display: none !important;
}

.mp-pause-live-hint {
  margin: -0.35rem 0 0.75rem;
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(158, 255, 176, 0.7);
}

/* .pause-main { display:flex } would otherwise beat [hidden] and stack both views. */
#mp-pause-main-view.is-hidden,
#mp-pause-stats-view.is-hidden,
#mp-pause-main-view[hidden],
#mp-pause-stats-view[hidden] {
  display: none !important;
}

.mp-pause-stats {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-height: min(70vh, 560px);
  overflow: auto;
  gap: 0.65rem;
}

.mp-pause-stats .pause-title {
  margin-bottom: 0.25rem;
}

.mp-pause-stats-list {
  width: min(360px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mp-pause-stats-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(68, 204, 68, 0.22);
  border-radius: 6px;
  background: rgba(6, 14, 10, 0.55);
  color: #c8e0ff;
  font-family: ui-monospace, monospace;
  font-size: 0.9rem;
}

.mp-pause-stats-row--you {
  border-color: rgba(68, 204, 68, 0.65);
  color: #9effb0;
}

.mp-pause-stats-row--lead {
  border-color: rgba(255, 224, 138, 0.45);
  color: #ffe08a;
}

.mp-pause-stats-rank {
  min-width: 1.5rem;
  opacity: 0.8;
}

.mp-pause-stats-name {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-pause-stats-kills {
  font-weight: 700;
}

.mp-pause-stats-foot {
  display: none;
}

.mp-results-stack {
  gap: clamp(0.75rem, 2vh, 1.25rem);
  justify-content: center;
}

.mp-results-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: min(400px, 100%);
  gap: clamp(0.65rem, 1.8vh, 1.1rem);
}

.mp-results-title {
  margin: 0 !important;
}

.mp-results-title--win {
  color: #9effb0;
  text-shadow:
    0 0 20px rgba(68, 204, 68, 0.4),
    0 0 40px rgba(68, 204, 68, 0.15);
  animation: none;
}

.mp-results-title--draw {
  color: #ffe8a0;
  text-shadow:
    0 0 20px rgba(255, 232, 160, 0.35),
    0 0 40px rgba(255, 232, 160, 0.12);
  animation: none;
}

.mp-results-time {
  margin: 0;
  margin-bottom: clamp(0.35rem, 1.2vh, 0.85rem);
}

.mp-results-time__value {
  /* pause-time-number size; gold tint for match clock */
  color: #ffe8a0;
  text-shadow:
    0 0 24px rgba(255, 232, 160, 0.35),
    0 0 48px rgba(255, 232, 160, 0.12);
}

.mp-results-team {
  margin: 0;
  text-align: center;
  color: #c8e0ff;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
}

.mp-results-room {
  margin: 0;
  text-align: center;
  color: rgba(200, 224, 255, 0.65);
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
}

.mp-results-actions {
  margin-top: 0.15rem;
  width: 100%;
  max-width: min(400px, 100%);
}

/* Same footprint as pause Resume — not the oversized main-menu PLAY. */
.mp-results-actions .pause-resume-btn {
  width: 100%;
}

.mp-results-actions .menu-btn {
  width: 100%;
}

/* Hide legacy floating end buttons — results panel owns them. */
#mp-movement-end-actions {
  display: none !important;
}

.mp-movement-root.is-match-ended .mp-movement-leave {
  display: none !important;
}

.mp-movement-end-actions {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  width: min(420px, calc(100vw - 24px));
  pointer-events: auto;
}

/* display:flex above would otherwise override the hidden attribute. */
.mp-movement-end-actions[hidden] {
  display: none !important;
}

.mp-movement-end-actions .menu-btn {
  min-width: 8rem;
  min-height: 52px;
  flex: 1 1 auto;
}

.mp-movement-root.is-match-ended .mp-movement-canvas {
  pointer-events: none;
  cursor: default;
}

/* —— Responsive —— */

@media (max-width: 599px) {
  .mp-lobby-stack,
  .mp-menu-stack,
  .mp-how-stack {
    width: min(100vw - 1.5rem, 560px);
  }

  /* Keep two-up slots on phones so 6 hunters + Leave stay on-screen. */
  .mp-player-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .mp-player-slot {
    padding: 0.4rem 0.35rem 0.35rem;
  }

  .mp-player-slot__name {
    font-size: 0.72rem;
  }

  .mp-player-slot__status {
    font-size: 0.6rem;
  }

  .mp-host-badge {
    top: 0.25rem;
    right: 0.25rem;
  }

  .mp-room-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.5rem 0.7rem;
  }

  .mp-room-row__actions {
    width: 100%;
  }

  .mp-room-btn {
    flex: 1 1 auto;
    min-height: 2.75rem;
  }

  .mp-lobby-title {
    font-size: clamp(1.35rem, 6vw, 1.75rem) !important;
  }
}

@media (min-width: 900px) {
  .mp-menu-stack {
    width: min(72vw, 680px);
  }
}

@media (max-height: 780px) {
  .mp-lobby-panel,
  .mp-menu-actions {
    gap: 0.5rem;
  }

  .mp-lobby-title {
    font-size: clamp(1.3rem, 4vw, 1.7rem) !important;
  }

  .mp-lobby-stack {
    gap: clamp(0.4rem, 1.2vh, 0.7rem);
  }

  .mp-lobby-hunt-summary {
    padding: 0.4rem 0.8rem;
  }

  .mp-lobby-actions {
    gap: 0.6rem;
    margin-top: clamp(0.45rem, 1.4vh, 0.75rem);
  }

  .mp-lobby-actions .menu-btn {
    min-height: 2.65rem;
  }

  #screen-mp-lobby .mp-lobby-actions .menu-btn--play {
    padding: 0.5em 0.95em;
  }
}

/* True short viewports only (landscape phones) — match SP .pause-stack */
@media (max-height: 560px) {
  #screen-mp-lobby .mp-lobby-stack {
    justify-content: flex-start;
  }

  .mp-player-slot__avatar {
    width: 1.85rem;
    height: 1.85rem;
  }

  .mp-player-slot {
    gap: 0.12rem;
    padding: 0.32rem 0.3rem 0.28rem;
  }

  .mp-player-grid {
    gap: 0.3rem;
  }
}
