/* ===== Layout z menu lobby (header + footer) na podstronach ===== */
body.app-with-lobby-nav {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  height: auto;
}
body.app-with-lobby-nav main {
  flex: 1;
}

/* ===== Menu jako stała nakładka – muzyka gra bez przerwy ===== */
.lobby-header-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  pointer-events: auto;
}
.lobby-content {
  flex: 1;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-top: 0;
  min-height: 100vh;
}
body.app-with-lobby-nav .lobby-content {
  padding-top: 165px;
}
.lobby-content > main {
  flex: 1;
  min-height: 0;
}

/* ===== Lobby — główne lobby gry po zalogowaniu ===== */
/* Układ w poziomie, mobilny, karty jak kafelki */

:root {
  --lobby-red: #c43d3d;
  --lobby-red-soft: rgba(196, 61, 61, 0.35);
  --lobby-red-mist: rgba(180, 50, 50, 0.25);
  --lobby-red-aurora: rgba(220, 80, 80, 0.15);
  --lobby-bg: #070A12;
  --lobby-card-border: rgba(255, 255, 255, 0.12);
  --lobby-card-hover: rgba(196, 61, 61, 0.2);
}

.lobby-body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--lobby-bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.lobby-body.lobby-body--scrollable {
  overflow: auto;
}

/* ===== Mgła — pełna szerokość ekranu (w lobby-main) ===== */
.lobby-cards-mist {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  width: 100%;
  height: 600px;
  transform: translateY(-50%) scale(1.5);
  transform-origin: center center;
  pointer-events: none;
  z-index: 0;
}

.lobby-cards {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
  gap: 20px;
}

/* Mgła organiczna — wiele nakładających się „chmur” jak w Gwent, bez kształtu jaja */
.lobby-cards-mist__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  animation-duration: 6s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

/* Rozmieszczenie blobów — symetryczne w poziomie (10↔90, 22↔78, 35↔65, 50 środek) */
.lobby-cards-mist__blob--1 {
  width: 45%;
  height: 50%;
  top: 25%;
  left: 10%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(180, 50, 50, 0.45) 0%, rgba(140, 35, 35, 0.2) 50%, transparent 75%);
  animation: lobby-mist-drift-1 7s ease-in-out infinite;
}
.lobby-cards-mist__blob--2 {
  width: 55%;
  height: 55%;
  top: 20%;
  left: 35%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(190, 55, 55, 0.5) 0%, rgba(150, 40, 40, 0.22) 45%, transparent 72%);
  animation: lobby-mist-drift-2 8s ease-in-out infinite;
  animation-delay: -1s;
}
.lobby-cards-mist__blob--3 {
  width: 40%;
  height: 45%;
  top: 35%;
  left: 65%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(170, 45, 45, 0.4) 0%, rgba(130, 35, 35, 0.18) 55%, transparent 78%);
  animation: lobby-mist-drift-3 6.5s ease-in-out infinite;
  animation-delay: -2.5s;
}
.lobby-cards-mist__blob--4 {
  width: 50%;
  height: 48%;
  top: 30%;
  left: 78%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(175, 48, 48, 0.38) 0%, rgba(135, 38, 38, 0.16) 50%, transparent 75%);
  animation: lobby-mist-drift-4 7.5s ease-in-out infinite;
  animation-delay: -4s;
}
.lobby-cards-mist__blob--5 {
  width: 38%;
  height: 42%;
  top: 45%;
  left: 22%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(165, 42, 42, 0.35) 0%, transparent 70%);
  animation: lobby-mist-drift-5 5.5s ease-in-out infinite;
  animation-delay: -0.5s;
}
.lobby-cards-mist__blob--6 {
  width: 42%;
  height: 40%;
  top: 50%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(185, 52, 52, 0.4) 0%, rgba(145, 38, 38, 0.15) 55%, transparent 80%);
  animation: lobby-mist-drift-6 6s ease-in-out infinite;
  animation-delay: -3s;
}
.lobby-cards-mist__blob--7 {
  width: 35%;
  height: 38%;
  top: 40%;
  left: 90%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(160, 40, 40, 0.32) 0%, transparent 68%);
  animation: lobby-mist-drift-7 5s ease-in-out infinite;
  animation-delay: -2s;
}

/* Dryf + powiększanie/pomniejszanie — elementy mgły „oddychają” losowo */
@keyframes lobby-mist-drift-1 {
  0% { transform: translateX(-50%) translate(0, 0) scale(0.92); opacity: 0.85; }
  25% { transform: translateX(-50%) translate(2%, -1%) scale(1.12); opacity: 1; }
  50% { transform: translateX(-50%) translate(-1%, 2%) scale(0.88); opacity: 0.9; }
  75% { transform: translateX(-50%) translate(3%, 1%) scale(1.08); opacity: 1; }
  100% { transform: translateX(-50%) translate(0, 0) scale(0.92); opacity: 0.85; }
}
@keyframes lobby-mist-drift-2 {
  0% { transform: translateX(-50%) translate(0, 0) scale(1.05); opacity: 0.9; }
  20% { transform: translateX(-50%) translate(-2%, 2%) scale(0.9); opacity: 0.95; }
  45% { transform: translateX(-50%) translate(1%, -1%) scale(1.15); opacity: 1; }
  70% { transform: translateX(-50%) translate(-1%, -2%) scale(0.85); opacity: 0.88; }
  100% { transform: translateX(-50%) translate(0, 0) scale(1.05); opacity: 0.9; }
}
@keyframes lobby-mist-drift-3 {
  0% { transform: translateX(-50%) translate(0, 0) scale(0.9); opacity: 0.82; }
  33% { transform: translateX(-50%) translate(2%, 2%) scale(1.1); opacity: 1; }
  66% { transform: translateX(-50%) translate(-2%, -1%) scale(0.82); opacity: 0.86; }
  100% { transform: translateX(-50%) translate(0, 0) scale(0.9); opacity: 0.82; }
}
@keyframes lobby-mist-drift-4 {
  0% { transform: translateX(-50%) translate(0, 0) scale(1.02); opacity: 0.85; }
  40% { transform: translateX(-50%) translate(-3%, -1%) scale(0.88); opacity: 0.92; }
  60% { transform: translateX(-50%) translate(1%, 2%) scale(1.12); opacity: 1; }
  85% { transform: translateX(-50%) translate(-2%, 1%) scale(0.95); opacity: 0.88; }
  100% { transform: translateX(-50%) translate(0, 0) scale(1.02); opacity: 0.85; }
}
@keyframes lobby-mist-drift-5 {
  0% { transform: translateX(-50%) translate(0, 0) scale(1.08); opacity: 0.78; }
  30% { transform: translateX(-50%) translate(-1%, -2%) scale(0.9); opacity: 0.95; }
  55% { transform: translateX(-50%) translate(2%, 1%) scale(1.18); opacity: 1; }
  80% { transform: translateX(-50%) translate(-1%, 1%) scale(0.92); opacity: 0.85; }
  100% { transform: translateX(-50%) translate(0, 0) scale(1.08); opacity: 0.78; }
}
@keyframes lobby-mist-drift-6 {
  0% { transform: translateX(-50%) translate(0, 0) scale(0.95); opacity: 0.88; }
  25% { transform: translateX(-50%) translate(2%, 2%) scale(1.1); opacity: 1; }
  50% { transform: translateX(-50%) translate(-1%, -1%) scale(0.88); opacity: 0.9; }
  75% { transform: translateX(-50%) translate(1%, -2%) scale(1.05); opacity: 1; }
  100% { transform: translateX(-50%) translate(0, 0) scale(0.95); opacity: 0.88; }
}
@keyframes lobby-mist-drift-7 {
  0% { transform: translateX(-50%) translate(0, 0) scale(0.88); opacity: 0.8; }
  35% { transform: translateX(-50%) translate(1%, -1%) scale(1.12); opacity: 0.98; }
  65% { transform: translateX(-50%) translate(-2%, 2%) scale(0.85); opacity: 0.84; }
  90% { transform: translateX(-50%) translate(1%, 1%) scale(1.02); opacity: 0.92; }
  100% { transform: translateX(-50%) translate(0, 0) scale(0.88); opacity: 0.8; }
}

/* ===== Header — większe menu, bardziej widoczny awatar ===== */
.lobby-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 48px;
  gap: 20px;
  flex-shrink: 0;
  background: rgba(7, 10, 18, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lobby-header__left,
.lobby-header__right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Przycisk głośnika – przypięty do menu górnego (nie scroluje ze stroną) */
.lobby-music-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: 40px;
}
.lobby-music-bar__btn {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}
.lobby-music-bar__btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
}
.lobby-music-bar__btn--muted {
  color: rgba(255, 255, 255, 0.6);
}
.lobby-music-bar__icon {
  width: 24px;
  height: 24px;
}

/* Gracz: większy awatar + ramka + nazwa + tytuł */
.lobby-player {
  display: flex;
  align-items: center;
  gap: 28px;
}

.lobby-player__avatar-wrap {
  position: relative;
  width: 115px;
  height: 115px;
  flex-shrink: 0;
  overflow: visible;
  margin: 25px;
}

.lobby-player__avatar {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  background: #1a1a2e;
  display: block;
}

/* Ramka avatara — nakładka, drewniane elementy zasłaniają krawędzie avka */
.lobby-player__frame-img {
  position: absolute;
  inset: -23px;
  width: calc(100% + 46px);
  height: calc(100% + 46px);
  object-fit: contain;
  pointer-events: none;
  z-index: 1;
}

.lobby-player__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lobby-player__name {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.02em;
}

.lobby-player__title {
  font-size: 14px;
  color: var(--muted);
}

/* Ikona panelu admina — widoczna tylko dla adminów (70×70, pełny rozmiar, bez zaokrąglenia) */
.lobby-admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}
.lobby-admin-btn:hover,
.lobby-admin-btn:focus,
.lobby-admin-btn:active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.lobby-admin-btn__icon {
  width: 70px;
  height: 70px;
  display: block;
  object-fit: contain;
  filter: saturate(0.45);
  transition: filter 0.2s;
}
.lobby-admin-btn:hover .lobby-admin-btn__icon,
.lobby-admin-btn:focus .lobby-admin-btn__icon,
.lobby-admin-btn:active .lobby-admin-btn__icon {
  filter: saturate(1);
}

/* Przycisk powrotu do lobby — duży, widoczny tylko poza lobby */
.lobby-back-btn {
  padding: 16px 28px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

/* Waluty + sklep — większe */
.lobby-currencies {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lobby-currency {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.lobby-currency__icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: block;
}

.lobby-currency__icon--gold {
  background: linear-gradient(135deg, #d4a84b, #b8860b);
  box-shadow: 0 0 8px rgba(212, 168, 75, 0.4);
}

.lobby-currency__icon--chest {
  background: linear-gradient(135deg, #8b7355, #5c4033);
  box-shadow: 0 0 6px rgba(139, 115, 85, 0.3);
}

.lobby-currency__icon--orens {
  background: linear-gradient(135deg, #7dd3fc, #0ea5e9);
  box-shadow: 0 0 8px rgba(14, 165, 233, 0.4);
}

.lobby-currency__value {
  font-weight: 700;
  font-size: 16px;
  min-width: 1.5em;
}

.lobby-shop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 76px;
  height: 76px;
  background: linear-gradient(180deg, rgba(212, 168, 75, 0.2), rgba(184, 134, 11, 0.1));
  border: 2px solid rgba(212, 168, 75, 0.4);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, box-shadow 0.2s;
}

.lobby-shop:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(212, 168, 75, 0.3);
}

.lobby-shop__icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #d4a84b, #b8860b);
  border-radius: 8px;
  display: block;
}

.lobby-shop__label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

/* ===== Main: karty menu ===== */
.lobby-main {
  position: relative;
  flex: 1;
  width: 100%;
  min-width: 0;
  display: flex;
  z-index: 5;
  min-height: 0;
  overflow: hidden;
}

.lobby-main__left {
  width: 0;
  min-width: 0;
}

@media (min-width: 900px) {
  .lobby-main__left {
    width: 200px;
    min-width: 200px;
  }
}

.lobby-main__center {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 40px;
}

/* Karty menu — 4 karty w jednej linii */

/* Karty: min. wysokość 400px, proporcja 744×1039, responsywne */
/* Tła 744×1039px: ustaw na .lobby-card lub .lobby-card__placeholder:
   background-image: url(...); background-size: cover; background-position: center; */
.lobby-card {
  position: relative;
  flex: 0 0 auto;
  min-height: 400px;
  height: 400px;
  width: 286px; /* 400 * 744/1039 */
  border-radius: 14px;
  border: none;
  background: linear-gradient(180deg, #0f1419, #0a0e14);
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s, filter 0.25s;
  display: flex;
  flex-direction: column;
  filter: saturate(0.8);
}

@media (min-width: 900px) {
  .lobby-card {
    height: 450px;
    width: 322px;
  }
}

@media (min-width: 1200px) {
  .lobby-card {
    height: 500px;
    width: 358px;
  }
}

@media (min-width: 1600px) {
  .lobby-card {
    height: 550px;
    width: 394px;
  }
}

@media (max-width: 800px) {
  .lobby-card {
    height: 400px;
    width: 286px;
  }
}

@media (max-width: 700px) {
  .lobby-cards {
    flex-wrap: wrap;
  }
  .lobby-card {
    min-height: 400px;
    height: 400px;
    width: 286px;
  }
}

@media (min-width: 900px) {
  .lobby-main__center {
    padding: 50px 120px;
  }
  .lobby-cards {
    gap: 28px;
  }
}

@media (min-width: 1200px) {
  .lobby-main__center {
    padding: 60px 160px;
  }
  .lobby-cards {
    gap: 32px;
  }
}

@media (min-width: 1600px) {
  .lobby-main__center {
    padding: 80px 200px;
  }
  .lobby-cards {
    gap: 36px;
  }
}

.lobby-card:hover:not(.lobby-card--disabled) {
  transform: scale(1.06);
  box-shadow: 0 0 40px rgba(196, 61, 61, 0.5), 0 0 80px rgba(196, 61, 61, 0.3), 0 0 120px rgba(196, 61, 61, 0.2);
  filter: saturate(1) brightness(1.12);
}

.lobby-card--disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Mgła wylatująca z karty przy hover */
.lobby-card__mist {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 60% at 50% 100%,
    transparent 40%,
    var(--lobby-red-mist) 70%,
    transparent 100%
  );
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.lobby-card:hover .lobby-card__mist {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: lobby-card-mist-flow 3s ease-out infinite;
}

@keyframes lobby-card-mist-flow {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Obszar na tło karty — obrazek wypełnia całą kartę, napisy na dole bez ramki */
.lobby-card__placeholder {
  position: absolute;
  inset: 0;
  background: #0d1117;
  overflow: hidden;
}

.lobby-card__placeholder img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.lobby-card__placeholder--pvp {
  background: linear-gradient(180deg, #1a1625, #0d1117);
}

.lobby-card__placeholder--pve {
  background: linear-gradient(180deg, #0f1a1f, #0d1117);
}

.lobby-card__placeholder--przygoda {
  background: linear-gradient(180deg, #0d1614, #0d1117);
}

.lobby-card__placeholder--talia {
  background: linear-gradient(180deg, #0d1419, #0d1117);
}

/* 3. karta — efekt czarnobiały */
.lobby-card__placeholder--grayscale img {
  filter: grayscale(100%);
}

/* Na dole tylko napisy, bez ramki — tekst nałożony na obrazek */
.lobby-card__content {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  padding: 14px 16px;
  background: transparent;
  border: none;
  margin: 0;
  text-align: center;
}

.lobby-card__title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9), 0 2px 8px rgba(0,0,0,0.7);
}

.lobby-card__desc {
  margin: 0;
  font-size: 16px;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 2px rgba(0,0,0,0.9);
}

/* ===== Footer: ikony ===== */
.lobby-footer {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 48px;
  gap: 20px;
  flex-shrink: 0;
  background: rgba(7, 10, 18, 0.8);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.lobby-footer__left,
.lobby-footer__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lobby-footer__gap {
  width: 24px;
  flex-shrink: 0;
}

.lobby-footer__btn {
  position: relative;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.lobby-footer__btn:hover,
.lobby-footer__btn:focus,
.lobby-footer__btn:active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  transform: scale(1.05);
}

button.lobby-footer__btn {
  appearance: none;
  font: inherit;
}

.lobby-footer__icon {
  width: 70px;
  height: 70px;
  display: block;
  object-fit: contain;
  filter: saturate(0.45);
  transition: filter 0.2s;
}
.lobby-footer__btn:hover .lobby-footer__icon,
.lobby-footer__btn:focus .lobby-footer__icon,
.lobby-footer__btn:active .lobby-footer__icon {
  filter: saturate(1);
}

/* Badge przy ikonach (zadania, przyjaciele) */
.lobby-footer__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--ok);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lobby-footer__badge--2digit {
  min-width: 24px;
  padding: 0 5px;
}

/* Lightbox play modes */
.lobby-play-modes {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lobby-play-modes .btn {
  padding: 14px 20px;
  text-align: center;
  text-decoration: none;
}
