/* ==========================================================
   NAV.CSS — NAWIGACJA, ELEMENTY WSPÓLNE I STYLE PODSTRON

   ŁADOWANIE:
   1. boardsvg.css  (:root oraz style bazowe)
   2. log.css       (na razie bez refaktoryzacji)
   3. nav.css       (ten plik)
   4. desktop.css / mobile.css (wariant urządzenia)

   SEKCJE (zachowana kolejność dla kompatybilności kaskady):
   - Dashboard / starsze komponenty
   - Header, footer, zakładki i powiadomienia
   - Ranking
   - Profile-admin (niezmieniony)
   - Profil użytkownika (.profile-home)
   - Aktualny header i jego wariant mobilny
   - HOME (.home-main)

   Wspólne kolory i typografia: :root w boardsvg.css.
   Nie przenosimy selektorów między blokami bez testów widoku.
========================================================== */

/* Styl przycisku A2HS */
#a2hs-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    padding: 12px 18px;
    border: none;
    border-radius: 8px;
    background-color: var(--ui-blue);
    color: white;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer;
}
#a2hs-btn:hover { background-color: var(--ui-blue-hover); }

/* Chrome Android: odnośnik otwarcia istniejącej PWA (bez własnego okna). */
#chess-open-pwa-link {
    display: none;
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1100;
    padding: 12px 18px;
    border-radius: 8px;
    background: var(--ui-blue-hover);
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
#chess-open-pwa-link:hover { background: #1d4ed8; }
/* Na desktop ukryj*/
body.device-desktop #a2hs-btn { display: none !important; }

.dashboard {
    flex: 1;
	padding-top: 30px;
    box-sizing: border-box;
    color: var(--light);
padding-bottom: calc(70px + env(safe-area-inset-bottom));
}

.dashboard-info { color: var(--light); padding: 10px; }

.dashboard-hero {
    width: 100%;
    max-width: 1920px;
    margin: 20px auto 40px;
    text-align: center;
}

.dashboard-image {
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    object-fit: cover;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 50px;
    justify-items: center;
    width: 100%;
    flex: 1;
}
.dashboard-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.feature-item {
    display: flex;
    align-items: center;   /* KLUCZ — wyrównanie pionowe */
    gap: 10px;
}

.feature-item i {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

.feature-item span {
    flex: 1;
    line-height: 1.4;
}
.card {
    background: radial-gradient(circle at 20% 20%, #363f4b 10%, var(--legacy-card-to) 70%);
    color: var(--light);
    width: 220px;
    height: 220px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.card i { font-size: 42px; margin-bottom: 10px; color: var(--ui-blue); }
.card h3 { font-size: 1.2rem; margin: 0; }

@media (max-width: 600px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .card { width: 80%; height: 220px; }
    .card i { font-size: 48px; }
    .card h3 { font-size: 1.2rem; }
}

@media (min-width: 800px) {
    .card { width: 220px; height: 220px; }
    .card i { font-size: 48px; }
    .card h3 { font-size: 1.2rem; }
}
/* end index */
.nav-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding-top: env(safe-area-inset-top);
  background: radial-gradient(circle at 20% 20%, #363f4b 10%, var(--nav-to) 70%);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  color: var(--light);
  font-family: "Roboto", sans-serif;
  z-index: 1000;
}

.nav-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 10px;
  gap: 20px;
}

.nav-links, .footer-links {
  display: flex;
  gap: 15px;
  flex-grow: 1;
}

.nav-links a, .footer-links a {
  color: var(--light);
  text-decoration: none;
  border-radius: 3px;
  align-items: center;
  gap: 6px;
}
#login-link {
    color: var(--light);
    text-decoration: none;
}
.nav-links a.active, .footer-links a.active,
.nav-links a:hover, .footer-links a:hover {
  background: radial-gradient(circle at 20% 20%, #363f4b 10%, var(--nav-to-hover) 70%);
}

.menu-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--light);
}

/* USER & POWIADOMIENIA */
.nav-user {
  position: relative; /* ważne dla absolutnego pozycjonowania dropdown */
  display: flex;
  align-items: center;
  gap: 15px;
}

#notification-container {
  position: relative;
}
.lang-flag {
  object-fit: cover;
  border-radius: 2px;
  vertical-align: middle;
  transition: transform 0.15s ease;
}

.lang-flag:hover {
  transform: scale(1.1);
}
#fen-notification {
  color: var(--light);
  font-size: 18px;
  position: relative;
  cursor: pointer;
}

#fen-count {
  position: absolute;
  top: -6px;
  right: -8px;
  background: red;
  color: var(--light);
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: bold;
}

/* USER DROPDOWN */
.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: radial-gradient(circle at 20% 20%, #363f4b 10%, var(--nav-to) 70%);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  overflow: hidden;
  min-width: 140px;
  display: none; /* domyślnie ukryte */
  z-index: 1001;
}

.user-dropdown.open {
  display: block;
}

.user-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  color: var(--light);
  text-decoration: none;
  font-size: 15px;
}

.user-dropdown a:hover {
  background: radial-gradient(circle at 20% 20%, #363f4b 10%, var(--nav-to-hover) 70%);
}

.user-trigger {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  /* większy odstęp między ikonami */
  color: var(--light);
  font-size: 15px;
  user-select: none;
}

/* MENU MOBILNE */
.nav-dropdown {
  display: none;
}
.dropdown-menu {
    position: absolute;
    top: 100%;
    background: radial-gradient(circle at 20% 20%, #363f4b 10%, var(--nav-to) 70%);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    overflow: hidden;
    min-width: 160px;
    display: none;
    /* domyślnie ukryte */
    z-index: 1001;
}

.dropdown-menu.open {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 15px;
    color: var(--light);
    text-decoration: none;
}

.dropdown-menu a:hover {
    background: radial-gradient(circle at 20% 20%, #363f4b 10%, var(--nav-to-hover) 70%);
}
.mobile-submenu {
    display: none;
    flex-direction: column;
    background: radial-gradient(circle at 20% 20%, #363f4b 10%, var(--nav-to) 70%);
    border-left: 2px solid #444;
}

.mobile-submenu.open {
    display: flex;
}

.mobile-submenu a {
    padding: 8px 20px;
    border-top: 1px solid #444;
    color: #ddd;
    font-size: 14px;
}

.mobile-submenu a:hover {
    background: radial-gradient(circle at 20% 20%, #363f4b 10%, var(--nav-to-hover) 70%);
}
/* ............................*/

/* foldery z analizą partii */
.folder-dropdown {
  list-style: none;
  margin: 0;
  padding-left: 20px;
  display: none; /* domyślnie ukryte podkatalogi */
}

.folder-dropdown.open {
  display: block; /* pokazuj rozwinięte listy */
  padding-left: 40px;
}

.folder-item {
  margin: 8px 0;
  cursor: pointer;
  position: relative;
}

.folder-label {
  max-width: 400px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #3a3a4d;
  color: var(--light);
  padding: 6px 12px;
  border-radius: 4px;
  user-select: none;
}

.folder-label i.fa-folder {
  margin-right: 8px;
}

.folder-label button {
  background: #b33a3a;
  border: none;
  color: var(--light);
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
}

.folder-label button:hover {
  background: var(--danger);
}
.folder-arrow {
  transition: transform 0.3s ease;
  margin-left: 8px;
  font-size: 0.75em;
  user-select: none;
}

.folder-arrow.open {
  transform: rotate(-180deg);
}
.confirm-wrapper button {
  background: #3a3a4d;
  border: 1px solid #888;
  color: var(--light);
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 12px;
  margin-left: 5px;
  cursor: pointer;
}

.confirm-wrapper button.confirm-btn {
  width: 80px;
  background: var(--success);
  border-color: var(--success);
}

.confirm-wrapper button.confirm-btn:hover {
  background: #45a049;
}

.confirm-wrapper button.cancel-btn {
  background: #b33a3a;
  border-color: #b33a3a;
}

.confirm-wrapper button.cancel-btn:hover {
  background: var(--danger);
}
#savedFilesList li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}

#fileActions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#fileActions button,
#fileActions select {
  padding: 6px 12px;
  font-size: 14px;
}
.folder-file-actions {
  display: none;
}
.error-box {
  color: #fdd;
  padding: 10px 15px;
  margin-bottom: 10px;
  border-radius: 4px;
  font-weight: bold;
}
        #success-action {
            margin-top: 10px;
            padding: 10px;
            border: 1px solid green;
            background-color: #d4edda;
            color: #155724;
            display: none;
            border-radius: 4px;
            font-weight: 500;
        }
        #folderError {
            margin-top: 10px;
        }
/* Tabela */
table {
  border-collapse: separate;
  border-spacing: 4px 4px;
  /* 4px poziomo i 4px pionowo */
  width: 95%;
  max-width: 800px;
  font-family: "Roboto", sans-serif;
  margin-top: 10px;
}

th,
td {
  padding: 8px 12px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  text-align: center;
  background-color: #3a3a4d;
  /* tło potrzebne przy odstępach */
}

th {
  font-weight: 400;
}

tr:nth-child(even) td {
  background-color: #796969;
}

tr:hover td {
  background-color: #7070b1;
}

/* 1 i 2 kolumna wyrównana do lewej */
th:nth-child(1),
th:nth-child(2),
td:nth-child(1),
td:nth-child(2) {
  text-align: left;
}
.donate-row {
    cursor: pointer;
    transition: 0.2s;
}

.donate-row:hover {
    background: rgba(0, 255, 100, 0.05);
}

/* opcjonalnie mocniejsze zaznaczenie tekstu */
.donate-row.active td {
    color: green;
}

.fire-cell {
  color: #ff5252;
  /* jaśniejszy czerwony */
  font-weight: 400;
  text-shadow: 0 0 6px rgba(255, 82, 82, 0.6);
}
/* STOPKA */
.device-desktop .footer {
  position: relative;
  width: 100%;
  background: radial-gradient(circle at 20% 20%, #363f4b 10%, var(--nav-to) 70%);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  text-align: center;
  bottom: 0;
  color: var(--light, #FCF9EE);
}
.footer-links {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
}


.right-links {
  margin-left: auto;
}
.device-desktop .icon-link { display: none; }
/* kolory ikon w footer */
.footer .icon-link:nth-child(1) { color: #ff4b4b; }
.footer .icon-link:nth-child(2) { color: #4aff4a; }
.footer .icon-link:nth-child(3) { color: #4a9bff; }
.footer .icon-link:nth-child(4) { color: #ffe44a; }

/* cykl powtarzamy dla więcej niż 4 ikon */
.footer .icon-link:nth-child(4n/**/+1) { color: #ff4b4b; }
.footer .icon-link:nth-child(4n/**/+2) { color: #4aff4a; }
.footer .icon-link:nth-child(4n/**/+3) { color: #4a9bff; }
.footer .icon-link:nth-child(4n/**/+4) { color: #ffe44a; }
/*..................*/
.tab-buttons {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 6px 12px;
    color: var(--light);
    cursor: pointer;
    font-size: 14px;
}

.tab-btn.active {
    background: radial-gradient(circle at 20% 20%, #363f4b 10%, var(--nav-to-hover) 70%);
}

.tab-content {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    color: var(--light);
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.tab-panel {
    display: none;
}

.tab-panel:not(.hidden) {
    display: block;
    
}
.hidden {
  display: none;
}

#startup-loader {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 999999; /* ponad wszystkim */
  pointer-events: none; /* nie blokuje interakcji */
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: #e0e0e0;  /* jasny szaro-biały */
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  box-shadow: 0 0 10px rgba(255,255,255,0.3);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
/*NOWE*/
.modal {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    padding: 24px;
    box-sizing: border-box;
    overflow-y: auto;
    z-index: 1100;
    pointer-events: auto;
    justify-content: center;
    align-items: center;
    background: rgba(8, 11, 15, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    background: radial-gradient(circle at 20% 20%, #363f4b 10%, var(--legacy-card-to) 70%);
    color: #f5f5f5;
    padding: 25px 30px;
    border-radius: 15px;
    width: min(100%, 450px);
    max-width: 450px;
    max-height: min(90dvh, 800px);
    box-sizing: border-box;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    font-family: "Arial", "Helvetica", sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    pointer-events: auto;
}
/* Ustawienia planszy */
.option-labels button.settings-icon {
    width: 32px;
    height: 32px;
    margin: 5px 5px 0 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    font-size: 1rem;
    letter-spacing: normal;
}

.option-labels button.settings-icon:hover,
.option-labels button.settings-icon:focus-visible {
    color: var(--text-primary);
    background: var(--surface-tint-strong);
    transform: none;
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.option-labels button.settings-icon::after {
    right: 0;
    left: auto;
    transform: none;
}

.option-labels button.settings-icon:hover::after,
.option-labels button.settings-icon.show-tooltip::after {
    transform: translateY(-4px);
}

#settingsModal {
    top: 0;
    height: 100dvh;
    padding: 24px;
    box-sizing: border-box;
    align-items: center;
    overflow: auto;
    z-index: 1100;
    pointer-events: auto;
    background: rgba(8, 11, 15, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#settingsModal .settings-panel {
    width: min(100%, 480px);
    max-width: none;
    max-height: min(90dvh, 640px);
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    background:
        radial-gradient(circle at top right, rgba(194, 127, 65, 0.2), transparent 42%),
        linear-gradient(145deg, #252c35, #191d23);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
    font-family: inherit;
}

.settings-header {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 36px;
    gap: 14px;
    align-items: start;
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-symbol {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: #f1b36f;
    background: rgba(194, 127, 65, 0.15);
}

.settings-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.125rem;
    line-height: 1.3;
}

.settings-header p {
    margin: 5px 0 0;
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.45;
}

.settings-close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    font-size: 1rem;
    letter-spacing: normal;
}

.settings-close:hover,
.settings-close:focus-visible {
    color: var(--light);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    transform: none;
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.settings-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 160px;
    gap: 20px;
    align-items: center;
    margin: 20px 24px 24px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
}

.settings-control label {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.settings-label {
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 600;
}

.settings-description {
    color: var(--text-muted);
    font-size: 0.8125rem;
    line-height: 1.4;
}

#chessboard-layout {
    width: 100%;
    min-height: 42px;
    padding: 0 36px 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    color: var(--text-primary);
    background-color: #20262e;
    font: inherit;
    font-size: 0.875rem;
    cursor: pointer;
}

#chessboard-layout:hover {
    border-color: rgba(241, 179, 111, 0.65);
}

#chessboard-layout:focus-visible {
    border-color: var(--accent);
    outline: 2px solid rgba(0, 225, 255, 0.28);
    outline-offset: 2px;
}
@media (max-width: 520px), (max-height: 480px) {
    #settingsModal {
        padding: 12px;
    }

    .settings-header {
        grid-template-columns: 38px minmax(0, 1fr) 34px;
        gap: 10px;
        padding: 16px;
    }

    .settings-symbol {
        width: 38px;
        height: 38px;
    }

    .settings-control {
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 14px 16px 16px;
        padding: 14px;
    }
}
/* ...................... */
/* Naprawa: @media (max-width: 768px) był błędnie zagnieżdżony wewnątrz
   @media (max-width: 830px), co jest nieprawidłową składnią CSS i powodowało
   niespójne działanie reguł .modal na ekranach 768–830px. Rozdzielone na
   dwa niezależne bloki @media poniżej. */
@media (max-width: 830px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
  }

  .nav-user {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .nav-dropdown {
    display: flex;
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background: radial-gradient(circle at 20% 20%, #363f4b 10%, var(--nav-to) 70%);
    border-top: 1px solid #444;
  }

  .nav-dropdown.open {
    max-height: 100%;
  }

  .nav-dropdown a {
    padding: 10px 15px;
    border-top: 1px solid #444;
    color: var(--light);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .nav-dropdown a:hover {
    background: radial-gradient(circle at 20% 20%, #363f4b 10%, var(--nav-to-hover) 70%);
  }

  .dropdown-menu {
    position: relative;

  }
}
@media (max-width: 768px) {
    .modal {
        width: 100%;
        max-width: none;
        padding: 12px;
    }
}


.history-back {
  margin-left: 16px;
  /* odstęp od lewej */
  padding: 12px;
  /* POWIĘKSZA OBSZAR DOTYKU */
  font-size: 22px;
  cursor: pointer;

  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.history-back i {
  pointer-events: none;
  /* klik idzie w span */
}
/* =========================
   COOKIE BANNER
========================= */

.cookie-banner {
    /* Kolory inspirowane identyfikacją Chess Fun */
    position: fixed;
    right: 20px;
    bottom: 20px;
    left: 20px;
    z-index: 1000;

    width: min(1120px, calc(100% - 40px));
    margin-inline: auto;
    padding: 1px;

    border-radius: 22px;

    background:
        linear-gradient(
            135deg,
            var(--cookie-gold-light) 0%,
            rgba(91, 142, 159, 0.85) 48%,
            var(--cookie-gold-dark) 100%
        );

    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.55),
        0 0 35px rgba(217, 169, 79, 0.08);

    animation: cookie-banner-show 0.35s ease both;
}

.cookie-banner[hidden] {
    display: none !important;
}

.cookie-banner__content {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 20px;
    align-items: center;

    padding: 20px 22px;
    border: 1px solid rgba(255, 255, 255, 0.035);
    border-radius: 21px;

    background:
        linear-gradient(
            135deg,
            rgba(23, 36, 45, 0.98),
            rgba(12, 20, 27, 0.98)
        );

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.cookie-banner__icon {
    display: grid;
    place-items: center;

    width: 52px;
    height: 52px;

    border: 1px solid rgba(217, 169, 79, 0.38);
    border-radius: 16px;

    color: var(--cookie-gold-light);

    background:
        linear-gradient(
            145deg,
            rgba(217, 169, 79, 0.17),
            rgba(91, 142, 159, 0.1)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 8px 22px rgba(0, 0, 0, 0.2);

    font-size: 23px;
}

.cookie-banner__text {
    min-width: 0;
}

.cookie-banner__title {
    margin: 0 0 7px;

    color: var(--cookie-text);

    font-size: 19px;
    font-weight: 800;
    line-height: 1.25;
}

.cookie-banner__description {
    margin: 0;

    color: var(--cookie-text-muted);

    font-size: 14px;
    line-height: 1.6;
}

.cookie-banner__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    margin-top: 8px;

    color: var(--cookie-gold-light);

    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
    text-underline-offset: 4px;

    transition:
        color 0.2s ease,
        text-decoration-color 0.2s ease;
}

.cookie-banner__link::after {
    content: "→";

    transition: transform 0.2s ease;
}

.cookie-banner__link:hover {
    color: var(--cookie-text);
    text-decoration: underline;
}

.cookie-banner__link:hover::after {
    transform: translateX(3px);
}

.cookie-banner__link:focus-visible {
    border-radius: 4px;
    outline: 3px solid var(--cookie-blue-light);
    outline-offset: 4px;
}

.cookie-banner__button {
    min-height: 46px;
    padding: 11px 24px;

    border: 1px solid var(--cookie-gold-light);
    border-radius: 999px;

    color: #171108;

    background:
        linear-gradient(
            180deg,
            var(--cookie-gold-light),
            var(--cookie-gold)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 8px 20px rgba(0, 0, 0, 0.22);

    font: inherit;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.cookie-banner__button:hover {
    border-color: #ffe39b;

    background:
        linear-gradient(
            180deg,
            #f8d47f,
            var(--cookie-gold-light)
        );

    transform: translateY(-2px);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 12px 28px rgba(217, 169, 79, 0.2);
}

.cookie-banner__button:active {
    transform: translateY(0);
}

.cookie-banner__button:focus-visible {
    outline: 3px solid var(--cookie-blue-light);
    outline-offset: 4px;
}

/* Pojawienie się bannera */
@keyframes cookie-banner-show {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Tablet */
@media (max-width: 768px) {
    .cookie-banner {
        right: 14px;
        bottom: 14px;
        left: 14px;

        width: auto;
    }

    .cookie-banner__content {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 14px 16px;

        padding: 18px;
    }

    .cookie-banner__icon {
        width: 46px;
        height: 46px;

        border-radius: 14px;

        font-size: 20px;
    }

    .cookie-banner__button {
        grid-column: 1 / -1;

        width: 100%;
    }
}

/* Telefon */
@media (max-width: 480px) {
    .cookie-banner {
        right: 10px;
        bottom: 10px;
        left: 10px;
    }

    .cookie-banner__content {
        grid-template-columns: 1fr;
        gap: 13px;

        padding: 16px;

        text-align: left;
    }

    .cookie-banner__icon {
        width: 42px;
        height: 42px;
    }

    .cookie-banner__title {
        font-size: 18px;
    }

    .cookie-banner__description,
    .cookie-banner__link {
        font-size: 13px;
    }
}

/* Ograniczenie animacji zgodnie z ustawieniami systemu */
@media (prefers-reduced-motion: reduce) {
    .cookie-banner {
        animation: none;
    }

    .cookie-banner__button,
    .cookie-banner__link::after {
        transition: none;
    }
}
#guest-view {
    position: fixed;
    inset: 0; /* top:0 right:0 bottom:0 left:0 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    color: var(--light);
    z-index: 999;
}
  /* Alerty logowania i rejestracji */
  #authToast {
    --toast-color: var(--danger, #d44747);
    position: fixed;
    z-index: 2147483647;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    overflow: hidden;
    color: var(--light);
    border: 1px solid var(--toast-color);
    border-left: 5px solid var(--toast-color);
    background: linear-gradient(135deg, #303946 0%, #1b2029 100%);
    box-shadow: 0 24px 65px rgba(0,0,0,.65), 0 0 24px rgba(0,0,0,.2);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: normal;
  }

  #authToast.success {
    --toast-color: var(--success, #4caf50);
  }

  #authToast.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  #authToastIcon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 13px;
    color: var(--toast-color);
    background: rgba(255,255,255,.09);
    border: 1px solid var(--toast-color);
  }

  #authToastText {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 600;
  }

  /* PRZYCISK X — idealne wyśrodkowanie */
  #authToastClose,
  #authToastClose:hover,
  #authToastClose:focus {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 10px;
    background: rgba(255,255,255,.08);
    box-shadow: none;
    color: var(--light);
    font-size: 0 !important;
    line-height: 0;
    letter-spacing: normal;
    cursor: pointer;
  }

  /* Rysowanie symetrycznego X */
  #authToastClose::before,
  #authToastClose::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: var(--light);
    pointer-events: none;
  }

  #authToastClose::before {
    transform: translate(-50%, -50%) rotate(45deg);
  }

  #authToastClose::after {
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  #authToastClose:hover {
    background: rgba(255,255,255,.18);
  }

  #authToastClose:focus-visible {
    outline: 2px solid var(--accent, #00e1ff);
    outline-offset: 2px;
  }

  /* Pasek odliczający czas */
  #authToast::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 4px;
    background: var(--toast-color);
    transform-origin: left;
  }

  #authToast.show::after {
    animation: authToastCountdown 6s linear forwards;
  }

  @keyframes authToastCountdown {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
  }

  /* DESKTOP */
  @media (min-width: 768px) {
    #authToast {
      top: max(92px, calc(env(safe-area-inset-top, 0px) + 24px));
      left: 50%;
      width: min(570px, calc(100vw - 48px));
      min-height: 96px;
      gap: 18px;
      padding: 22px 66px 23px 22px;
      border-radius: 20px;
      font-size: 18px;
      line-height: 1.5;
      transform: translate(-50%, -20px) scale(.97);
    }

    #authToast.show {
      transform: translate(-50%, 0) scale(1);
    }

    #authToastIcon {
      width: 52px;
      height: 52px;
      font-size: 25px;
    }
  }

  /* MOBILE */
  @media (max-width: 767px) {
    #authToast {
      top: auto;
      bottom: max( 18px, calc(env(safe-area-inset-bottom, 0px) + 12px));
      left: 50%;
      width: min(440px, calc(100vw - 24px));
      min-height: 72px;
      gap: 12px;
      padding: 13px 53px 15px 14px;
      border-radius: 16px;
      font-size: 14px;
      line-height: 1.45;
      transform: translate(-50%, 18px) scale(.97);
    }

     #authToast {
  /* Przesunięcie nad klawiaturę */
  margin-bottom: var(--keyboard-offset, 0px);
}

    #authToast.show {
      transform: translate(-50%, 0) scale(1);
    }

    #authToastIcon {
      width: 38px;
      height: 38px;
      font-size: 19px;
    }

    #authToastClose,
    #authToastClose:hover,
    #authToastClose:focus {
      width: 32px;
      height: 32px;
      right: 10px;
    }

    #authToastClose::before,
    #authToastClose::after {
      width: 14px;
    }
  }

  /* Ograniczenie animacji */
  @media (prefers-reduced-motion: reduce) {
    #authToast {
      transition: none;
    }

    #authToast.show::after {
      animation: none;
    }
  }

/* Alert domyślnie ukryty */
#authToast {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Alert widoczny po wywołaniu JS */
#authToast.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ====== RANKING: wszystkie style przeniesione z ranking.php ====== */
.ranking-page .dashboard {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding:20px 20px;
    box-sizing: border-box;
    color: var(--light);
    width: 100%;
 padding-bottom: calc(70px + env(safe-area-inset-bottom));
}
.ranking-page .username-ranks {
    cursor: pointer;
    color: var(--light);
}
/* Układ rankingu — responsywny, bez zmian w pobieraniu danych */
.ranking-layout { width: min(100%, 820px); display: flex; flex-direction: column; gap: 20px; }
.ranking-header { text-align: center; }
.ranking-header h2 { margin: 0 0 8px; }
.ranking-description { margin: 0 auto; max-width: 62ch; opacity: .75; line-height: 1.55; }
.ranking-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ranking-my-place, .ranking-countdown {
    box-sizing: border-box; min-width: 0; padding: 16px; text-align: center;
    border: 1px solid rgba(150,150,150,.22); border-radius: 14px;
    background: rgba(130,130,130,.065); overflow-wrap: anywhere;
}
.ranking-my-place:empty { display: none; }
.ranking-summary:has(.ranking-my-place:empty) { grid-template-columns: 1fr; }
.ranking-month-winner { width:100%; box-sizing:border-box; overflow-x:auto; }
.ranking-month-winner:empty { display:none; }
@media (max-width:560px) {
    .ranking-layout { gap: 14px; }
    .ranking-summary { grid-template-columns:1fr; }
    .ranking-my-place, .ranking-countdown { padding:12px; }
}
/* Kolejne wiersze rankingu pojawiają się płynnie po pobraniu danych. */
#rankingTable tr.ranking-row-enter {
    opacity: 0;
    animation: rankingRowEnter 380ms ease-out forwards;
}
@keyframes rankingRowEnter {
    from { opacity: 0; }
    to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    #rankingTable tr.ranking-row-enter { animation: none; opacity: 1; }
}
/* Widoczność kontrolowana przez kod JavaScript */
.ranking-page .ranking-hidden-trigger { display: none; }
.ranking-page #rankingMainTable { display: none; }
.ranking-page #fireResetCountdown { display: none; }
.ranking-page .ranking-fire-icon { color: #ff5252; }
.ranking-page .ranking-month-winner { overflow-x: auto; }

body .ranking-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid rgba(160, 165, 185, .22);
    border-radius: 16px;
    background: rgba(130, 130, 150, .045);
}

body #rankingMainTable {
    width: 100%;
    max-width: none;
    margin: 0;
    border-collapse: collapse;
    border-spacing: 0;
    font-family: "Roboto", sans-serif;
    table-layout: auto;
}

body #rankingMainTable th,
body #rankingMainTable td {
    box-sizing: border-box;
    padding: 13px 12px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    color: inherit;
    text-align: center;
    vertical-align: middle;
}

body #rankingMainTable thead th {
    font-weight: 600;
    background: rgba(130, 130, 150, .16);
    white-space: nowrap;
    border-bottom: 1px solid rgba(160, 165, 185, .22);
}

body #rankingMainTable tbody td {
    border-top: 1px solid rgba(160, 165, 185, .12);
}

body #rankingMainTable tbody tr:nth-child(even) td {
    background: rgba(130, 130, 150, .045);
}

body #rankingMainTable tbody tr:hover td {
    background: rgba(130, 130, 150, .14);
}

/* Kolumna z nazwą gracza czytelna, niezależnie od starych nth-child. */
body #rankingMainTable th:nth-child(2),
body #rankingMainTable td:nth-child(2) {
    text-align: left;
}

body #rankingMainTable td.username-ranks { cursor: pointer; }

/* Best Player: również bez starych zaokrąglonych kafelków w każdej komórce. */
body .ranking-month-winner table {
    width: 100%;
    max-width: none;
    margin: 0;
    border-collapse: collapse;
    border-spacing: 0;
}
body .ranking-month-winner th,
body .ranking-month-winner td {
    box-shadow: none;
    border-radius: 0;
    padding: 12px;
    text-align: center;
    background: transparent;
    border-bottom: 1px solid rgba(160, 165, 185, .12);
}
body .ranking-month-winner thead th {
    background: rgba(130, 130, 150, .12);
    font-weight: 600;
}
body .ranking-month-winner tbody tr:nth-child(even) td {
    background: rgba(130, 130, 150, .045);
}
body .ranking-month-winner tbody tr:hover td {
    background: rgba(130, 130, 150, .14);
}

@media (max-width: 560px) {
    body #rankingMainTable th,
    body #rankingMainTable td {
        padding: 10px 7px;
        font-size: 13px;
    }
    body .ranking-month-winner th,
    body .ranking-month-winner td {
        padding: 10px 7px;
        font-size: 13px;
    }
}


/* Dodatkowe elementy rankingu */
.ranking-page .rank-gold { color: gold; }
.ranking-page .rank-silver { color: silver; }
.ranking-page .rank-bronze { color: #cd7f32; }
.ranking-page .ranking-medal-wrap { margin-top: 10px; }
.ranking-page .ranking-medal-image { width: 170px; height: 170px; display: block; margin: 10px auto 0; }
.ranking-page .ranking-not-top { color: #ff5555; font-weight: bold; }
.ranking-page .ranking-winner-table { width: 100%; margin-bottom: 20px; }
.ranking-page .ranking-winner-title { text-align: center; font-size: 16px; }
.ranking-page .ranking-winner-row { background: rgba(255,215,0,.08); }

/* Miejsca w rankingu: stałe położenie numeru, rezerwacja przestrzeni na koronę */
body #rankingMainTable th:first-child,
body #rankingMainTable td.ranking-place-cell {
    width: 112px;
    min-width: 112px;
    text-align: center;
    white-space: nowrap;
}
body #rankingMainTable .ranking-place-cell {
    font-variant-numeric: tabular-nums;
}
body #rankingMainTable .ranking-place-number {
    display: inline-block;
    width: 3ch;
    text-align: right;
    vertical-align: middle;
}
body #rankingMainTable .ranking-place-crown {
    display: inline-flex;
    width: 25px;
    margin-left: 7px;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}
body #rankingMainTable .ranking-place-crown .rank-gold,
body .ranking-month-winner .rank-gold { color: #ffd700; }
body #rankingMainTable .ranking-place-crown .rank-silver { color: #c0c0c0; }
body #rankingMainTable .ranking-place-crown .rank-bronze { color: #cd7f32; }
/* Zapobiega pojawianiu się wewnętrznego pionowego paska przy animacji. */
body .ranking-table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
}
/* Utrzymuje szerokość strony również wtedy, gdy pojawia się pionowy pasek przewijania. */
html:has(body.ranking-page) { scrollbar-gutter: stable; }
@media (max-width: 560px) {
    body #rankingMainTable th:first-child,
    body #rankingMainTable td.ranking-place-cell {
        width: 78px;
        min-width: 78px;
    }
    body #rankingMainTable .ranking-place-crown { width: 18px; margin-left: 3px; }
}

/* Ranking: Best Player obok mojej pozycji, Fire reset nad tabelą */
.ranking-page .ranking-summary > .ranking-month-winner {
    min-width: 0;
    width: 100%;
    border: 1px solid rgba(150,150,150,.22);
    border-radius: 14px;
    background: rgba(130,130,130,.065);
    overflow: hidden;
}
.ranking-page .ranking-summary > .ranking-month-winner:empty { display: none; }
.ranking-page .ranking-summary:has(> .ranking-month-winner:empty) { grid-template-columns: 1fr; }
.ranking-page .ranking-summary > .ranking-month-winner .ranking-winner-table {
    width: 100%;
    table-layout: auto;
    margin: 0;
}
.ranking-page .ranking-summary > .ranking-month-winner th,
.ranking-page .ranking-summary > .ranking-month-winner td {
    padding: 10px 6px;
    font-size: 13px;
    overflow-wrap: anywhere;
}
.ranking-page .ranking-countdown {
    width: 100%;
    text-align: center;
    padding: 12px 16px;
    margin: 0;
}
@media (max-width: 560px) {
    .ranking-page .ranking-summary { grid-template-columns: 1fr; }
}


/* ===== RANKING: czytelna typografia i elastyczny układ (2026) ===== */
.ranking-page .ranking-layout {
    width: min(100%, 1120px);
    max-width: 100%;
    gap: clamp(16px, 2vw, 28px);
    min-width: 0;
}
.ranking-page .ranking-header h2 {
    color: #f8fafc;
    font-size: clamp(1.55rem, 1.1rem + 1.2vw, 2.25rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .01em;
}
.ranking-page .ranking-description {
    color: #d0d7e2;
    opacity: 1;
    font-size: clamp(.9rem, .82rem + .25vw, 1.05rem);
    line-height: 1.6;
}
.ranking-page .ranking-summary { gap: clamp(12px, 1.6vw, 22px); align-items: stretch; }
.ranking-page .ranking-my-place,
.ranking-page .ranking-summary > .ranking-month-winner {
    background: linear-gradient(150deg, rgba(48,58,73,.96), rgba(29,34,44,.96));
    border: 1px solid rgba(215,225,240,.2);
    border-radius: 18px;
    box-shadow: 0 12px 26px rgba(0,0,0,.16);
    color: #f5f7fb;
}
.ranking-page .ranking-my-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: clamp(.95rem, .85rem + .28vw, 1.15rem);
    line-height: 1.5;
    padding: clamp(16px, 2.5vw, 30px);
}
.ranking-page .ranking-summary > .ranking-month-winner .ranking-winner-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    color: #f6f7fb;
}
/* Pełna szerokość nagłówka Best Player, niezależnie od starej reguły th */
body.ranking-page .ranking-month-winner .ranking-winner-table thead th.ranking-winner-title {
    padding: clamp(16px, 2vw, 25px) 12px;
    color: #ffdd8c;
    background: linear-gradient(105deg, rgba(180,117,36,.28), rgba(248,194,89,.12));
    font-family: "Roboto", Arial, sans-serif;
    font-size: clamp(1.15rem, .95rem + .8vw, 1.65rem);
    font-weight: 800;
    letter-spacing: .025em;
    line-height: 1.35;
    text-align: center;
    text-shadow: 0 1px 1px rgba(0,0,0,.5);
    overflow-wrap: normal;
}
body.ranking-page .ranking-month-winner .ranking-winner-table thead tr:nth-child(2) th {
    color: #e3e9f2;
    font-size: clamp(.82rem, .74rem + .25vw, 1rem);
    font-weight: 700;
    white-space: nowrap;
    background: rgba(255,255,255,.045);
}
body.ranking-page .ranking-month-winner .ranking-winner-table tbody td {
    color: var(--light);
    font-size: clamp(.92rem, .81rem + .35vw, 1.12rem);
    font-weight: 600;
    line-height: 1.45;
}
body.ranking-page #rankingMainTable thead th {
    color: #eaf0f8;
    font-weight: 700;
    font-size: clamp(.82rem, .75rem + .3vw, 1rem);
}
body.ranking-page #rankingMainTable tbody td {
    color: #f4f6fa;
    font-size: clamp(.88rem, .78rem + .35vw, 1.06rem);
    line-height: 1.45;
}
.ranking-page .ranking-countdown {
    color: #f4f6fa;
    font-size: clamp(.9rem, .82rem + .3vw, 1.05rem);
    font-weight: 600;
}
@media (max-width: 760px) {
    .ranking-page .dashboard { padding-inline: 14px; }
    .ranking-page .ranking-summary { grid-template-columns: 1fr; }
    .ranking-page .ranking-my-place { padding: 17px 14px; }
    body.ranking-page .ranking-month-winner .ranking-winner-table thead th.ranking-winner-title { padding: 16px 8px; }
}
@media (max-width: 420px) {
    .ranking-page .dashboard { padding-inline: 8px; }
    .ranking-page .ranking-layout { gap: 12px; }
    body.ranking-page .ranking-month-winner .ranking-winner-table th,
    body.ranking-page .ranking-month-winner .ranking-winner-table td { padding: 10px 5px; }
    body.ranking-page #rankingMainTable th,
    body.ranking-page #rankingMainTable td { padding: 11px 5px; }
    body.ranking-page #rankingMainTable th:first-child,
    body.ranking-page #rankingMainTable td.ranking-place-cell { width: 65px; min-width: 65px; }
    body.ranking-page #rankingMainTable .ranking-place-crown { margin-left: 2px; width: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .ranking-page #rankingTable tr.ranking-row-enter { animation: none; opacity: 1; }
}
/* ==========================================================
   PROFILE-ADMIN — KOD ZACHOWANY BEZ ZMIAN
========================================================== */
.admin-panel {
    color: #fff;
    padding: 15px;
    border-radius: 8px;
    margin: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.admin-panel .admin-title {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.admin-panel .admin-status {
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.admin-panel .admin-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-panel .admin-menu li {
    margin-bottom: 8px;
}

.admin-panel .admin-menu li a {
    color: red;
    text-decoration: none;
    padding: 5px 10px;
    display: inline-block;
    border-radius: 4px;
    transition: background 0.2s;
}

.admin-panel .admin-menu li a:hover {
    background-color: #55556e;
}
/* ========================================================
   PROFILE — NOWY UKŁAD JAK NA INDEX
   Reguły .admin-panel powyżej pozostawiono bez zmian.
   Usunięto przestarzałe style kart osiągnięć profilu.
======================================================== */

/* Starsze wspólne klasy zachowane dla innych podstron. */
.box {
    margin: 20px auto;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    font-family: Arial, sans-serif;
}

.player-name {
    font-weight: bold;
    font-size: 1.2em;
    margin-bottom: 5px;
}

.player-country {
    display: flex;
    align-items: center;
    font-size: 1em;
    margin-bottom: 10px;
}

.player-country img {
    height: 20px;
    margin-right: 8px;
}

.ratings {
    display: flex;
    gap: 10px;
    font-weight: 500;
}

.rating {
    padding: 5px 10px;
    border-radius: 5px;
}

/* =========================
   GRID
========================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px; /* zwiększony odstęp między kartami */
    justify-items: center;
    width: 100%;
}
/* =========================
   KARTA
========================= */
.stats-card {
    background: radial-gradient(circle at 20% 20%, #363f4b 10%, var(--legacy-card-to) 70%);
    color: var(--light);
    width: 350px;
    min-height: 260px;
    padding: 16px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

/* =========================
   PROGRESS RING
========================= */
.progress-ring {
    position: relative;
    margin: 8px 0;
    width: 120px;
    height: 120px;
}

.progress-ring svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    transform: rotate(-90deg);
}

/* tło ringa */
.ring-bg {
    fill: none;
    stroke: #2e2e2e;
    stroke-width: 10;
}

/* progress */
.ring-progress {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;

    vector-effect: non-scaling-stroke;

    stroke-dasharray: 327;
    stroke-dashoffset: 327;

    transition: stroke-dashoffset 0.6s ease, stroke 0.4s ease;
}

/* procent w środku */
.progress-text {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 22px;
    font-weight: bold;
    pointer-events: none;
}

/* =========================
   SZCZEGÓŁY
========================= */
.stats-details {
    font-size: 14px;
    line-height: 1.4;
}

/* =========================
   MOBILE
========================= */
@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stats-card {
        max-width: 90%;
        min-height: 200px;
    }

    .progress-text {
        font-size: 20px;
    }
}

/* =========================
   DESKTOP
========================= */
@media (max-width: 800px) {
    .stats-card {
        max-width: 200px;
        min-height: 260px;
    }

    .progress-ring {
        width: 120px;
        height: 120px;
    }

    .progress-text {
        font-size: 22px;
    }
}

.ring-good {
    stroke: green; /* zielony */
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 327;
    stroke-dashoffset: 327;
    transition: stroke-dashoffset 0.6s ease;
}

.ring-bad {
    stroke: var(--ring-bad); /* czerwony */
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 327;
    stroke-dashoffset: 327;
    transition: stroke-dashoffset 0.6s ease;
}

/* =========================
   UKRYTE FORMULARZE (COLLAPSE)
========================= */
.settings-section {
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 10px 15px;
    margin-bottom: 15px;
    transition: max-height 0.4s ease, padding 0.4s ease;
    overflow: hidden;
    max-height: 0; /* początkowo schowane */
    width: 90%;
    max-width: 500px;
}

.settings-section.active {
    max-height: 1000px; /* duża wartość, aby zawartość się rozwinęła */
    padding: 15px;
}

/* Przycisk trigger */
.settings-toggle-btn {
    background-color: var(--ui-blue);
    color: #fff;
    border: none;
    padding: 8px 14px;
    cursor: pointer;
    margin-bottom: 5px;
    transition: background-color 0.2s;
}

.settings-toggle-btn:hover {
    background-color: var(--ui-blue-hover);
}

/* Formy w sekcjach */
.settings-section form {
    margin-top: 10px;
}

.settings-section input {
    width: 100%;
    padding: 6px 0px;
    margin: 5px 0 12px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.settings-section button {
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 5px;
    border: none;
    color: white;
    background-color: var(--ui-blue);
    transition: background-color 0.2s;
}

.settings-section button:hover {
    background-color: var(--ui-blue-hover);
}

/* Ostrzeżenia / komunikaty */
.settings-section .msg {
    margin-top: 5px;
    font-size: 0.9em;
    color: red;
}

/* ========================================================
   PROFIL — SEKCJE W STYLU HOME (bez zmian profile-admin)
   Odseparowane przez .profile-home od innych podstron.
======================================================== */

.profile-container.profile-home {
    width: min(var(--page-max-width), calc(100% - var(--page-gutter)));
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
    margin: 20px auto 42px;
    padding: 0;
    color: var(--light, #f8eacf);
    font-family: var(--font-family-system, system-ui, sans-serif);
}

.profile-home .profile-info,
.profile-home #user-info,
.profile-home #info-wrapper {
    width: 100%;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
}

.profile-home .profile-info > h2 {
    margin: 0 0 20px;
    color: var(--tx);
    font-size: clamp(21px, 2.2vw, 28px);
    font-weight: 800;
    line-height: 1.35;
}

.profile-home #info-wrapper {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 26px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

/* Taki sam typ panelu jak .home-training */
.profile-home .profile-section {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 26px;
    border: 1px solid rgba(248, 234, 207, .16);
    border-radius: 20px;

    box-shadow: 0 8px 28px rgba(0, 0, 0, .12);
}

/* DANE KONTA — pola jak .home-own-rating i .bubble */
.profile-home .basic-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    gap: 12px;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    color: inherit;
    background: transparent;
}

.profile-home .profile-detail {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    min-height: 65px;
    box-sizing: border-box;
    padding: 12px 16px;
    border: 2px solid var(--gold-tx, #584017);
    border-radius: 14px;
    background: var(--tx, #f8eacf);
    color: var(--gold-tx, #584017);
    overflow-wrap: anywhere;
}

.profile-home .profile-detail > strong {
    font-size: 13px;
    font-weight: 700;
    color: var(--home-text-muted);
}

.profile-home .profile-detail > span {
    font-size: 17px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--gold-tx, #584017);
}

.profile-home .profile-detail #nav-country {
    display: inline;
    margin: 0;
    font-size: 17px;
}

/* EDYCJA DANYCH — przycisk jak na HOME */
.profile-home #edit-button,
.profile-home .tab-buttons .tab-btn,
.profile-home .settings-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    box-sizing: border-box;
    padding: 10px 18px;
    border: 2px solid var(--gold-tx, #584017);
    border-radius: 14px;
    background: var(--tx, #f8eacf);
    color: var(--gold-tx, #584017);
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.4;
    letter-spacing: normal;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s ease, box-shadow .2s ease;
}

.profile-home #edit-button {
    margin: 20px 0 0;
}

.profile-home #edit-button:hover,
.profile-home .settings-toggle-btn:hover,
.profile-home .tab-buttons .tab-btn:hover {
    background: #fff0d5;
    color: var(--gold-tx);
    box-shadow: 0 6px 18px rgba(0,0,0,.16);
    transform: none;
}

.profile-home #edit-button:focus-visible,
.profile-home .settings-toggle-btn:focus-visible,
.profile-home .tab-buttons .tab-btn:focus-visible {
    outline: 3px solid var(--home-gold-bright);
    outline-offset: 3px;
}

/* ZAKŁADKI — wygląd jak elementy HOME */
.profile-home .tab-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 20px;
}

.profile-home .tab-buttons .tab-btn.active {
    background: var(--home-gold-bright);
    border-color: var(--home-gold-bright);
    color: var(--home-bg);
    box-shadow: none;
}

.profile-home .tab-content {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--tx);
    font-family: inherit;
}

.profile-home .tab-panel {
    min-width: 0;
}

/* Formularze — niezależne sekcje, bez wpływu na ich JS */
.profile-home .settings-toggle-btn {
    margin: 0 0 10px;
}

.profile-home .settings-section {
    width: min(100%, 680px);
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
    padding: 0 18px;
    margin: 0 0 16px;
    border: 1px solid rgba(248, 234, 207, .16);
    border-radius: 14px;
    background: rgba(11, 20, 36, .25);
    color: var(--tx);
}

.profile-home .settings-section.active {
    max-height: 1600px;
    padding: 18px;
}

.profile-home .settings-section label,
.profile-home .settings-section p {
    color: var(--tx);
    line-height: 1.5;
}

.profile-home .settings-section input,
.profile-home .settings-section select {
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid rgba(248, 234, 207, .28);
    border-radius: 10px;
    background: var(--home-bg);
    color: var(--tx);
    font: inherit;
}

.profile-home .settings-section input:focus-visible,
.profile-home .settings-section select:focus-visible {
    outline: 2px solid var(--home-gold-bright);
    outline-offset: 2px;
}

.profile-home .settings-section button {
    border: 2px solid var(--gold-tx, #584017);
    border-radius: 10px;
    padding: 10px 16px;
    background: var(--tx, #f8eacf);
    color: var(--gold-tx, #584017);
    font: inherit;
    font-size: 14px;
    font-weight: 800;
}

.profile-home .settings-section button:hover {
    background: #fff0d5;
    color: var(--gold-tx);
}

.profile-home .settings-section #confirmDeleteBox button[type="submit"] {
    background: #a52020;
    border-color: #a52020;
    color: #fff;
}

.profile-home .settings-section .msg {
    overflow-wrap: anywhere;
}

/* OSIĄGNIĘCIA — lista sekcji zamiast starych kart */
.profile-home .profile-achievements {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0;
}

.profile-home .profile-achievement {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    min-width: 0;
    padding: 18px 0;
    border-bottom: 1px solid rgba(248, 234, 207, .16);
    background: transparent;
}

.profile-home .profile-achievement:first-child { padding-top: 0; }
.profile-home .profile-achievement:last-child { padding-bottom: 0; border-bottom: 0; }

.profile-home .profile-achievement > i {
    display: grid;
    place-items: center;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border: 2px solid var(--gold-tx);
    border-radius: 14px;
    background: var(--tx);
    color: #b7791f;
    font-size: 25px;
}

.profile-home .profile-achievement-fire > i { color: var(--home-danger); }

.profile-home .profile-achievement-text { min-width: 0; }
.profile-home .profile-achievement-text h3 {
    margin: 0 0 7px;
    color: var(--tx);
    font-size: 18px;
}

.profile-home .profile-achievement-text p {
    margin: 5px 0;
    color: #cbd5e1;
    line-height: 1.5;
}

.profile-home .profile-achievement-text strong {
    color: var(--home-gold-bright);
    font-variant-numeric: tabular-nums;
}

.profile-home .profile-achievement-fire #task_fire {
    color: #ff6969;
    font-size: 26px;
}

/* HISTORIA WPŁAT — pozostaje tabela, dopasowana do sekcji HOME */
.profile-home .profile-donations h3 {
    margin: 0 0 16px;
    color: var(--tx);
    font-size: 18px;
}

.profile-home .profile-donations-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.profile-home .profile-donations table {
    width: 100%;
    max-width: none;
    margin: 0;
    border-collapse: collapse;
    border-spacing: 0;
    color: var(--tx);
    font-family: inherit;
}

.profile-home .profile-donations th,
.profile-home .profile-donations td {
    padding: 12px;
    border: 0;
    border-bottom: 1px solid var(--home-panel-border);
    border-radius: 0;
    background: transparent;
    color: var(--tx);
    box-shadow: none;
    text-align: left;
    overflow-wrap: anywhere;
}

.profile-home .profile-donations th { background: rgba(248,234,207,.08); font-weight: 700; }
.profile-home .profile-donations tr:nth-child(even) td { background: rgba(248,234,207,.04); }
.profile-home .profile-donations tr:hover td { background: rgba(248,234,207,.10); }

@media (max-width: 640px) {
    .profile-container.profile-home {
        width: calc(100% - 24px);
        margin: 16px auto 30px;
    }

    .profile-home .profile-section {
        padding: 18px;
        border-radius: 16px;
    }

    .profile-home .basic-info {
        grid-template-columns: minmax(0, 1fr);
    }

    .profile-home .tab-buttons .tab-btn {
        flex: 1 1 auto;
        padding-inline: 12px;
    }

    .profile-home .settings-section {
        width: 100%;
    }

    .profile-home .profile-achievement > i {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .profile-home #edit-button,
    .profile-home .tab-buttons .tab-btn,
    .profile-home .settings-toggle-btn {
        transition: none;
    }
}

/* ==========================================================
   PROFILE — WYSZUKIWANIE UŻYTKOWNIKÓW
   Styl zgodny z jasnymi polami HOME; tylko sekcja .user-search
========================================================== */
.user-search {
    position: relative;
    z-index: 30;
    width: min(680px, calc(100% - 40px));
    min-width: 0;
    margin: 20px auto 24px;
    font-family: var(--font-family-system, system-ui, sans-serif);
}

.user-search #user-search-input {
    display: block;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 13px 16px;
    border: 2px solid var(--gold-tx, #584017);
    border-radius: 14px;
    background: var(--tx, #f8eacf);
    color: var(--gold-tx, #584017);
    font: inherit;
    font-size: 16px;
    font-weight: 650;
    line-height: 1.4;
    outline: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .14);
}

.user-search #user-search-input::placeholder {
    color: var(--home-text-muted, #665044);
    opacity: .85;
}

.user-search #user-search-input:focus-visible {
    border-color: var(--home-gold, #b19015);
    box-shadow: 0 0 0 3px rgba(177, 144, 21, .23);
}

.user-search .search-results {
    position: absolute;
    top: calc(100% + 7px);
    left: 0;
    right: 0;
    z-index: 100;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: none;
    max-height: 280px;
    margin: 0;
    padding: 6px;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid var(--home-panel-border, rgba(248, 234, 207, .15));
    border-radius: 14px;
    background: var(--home-panel-bg, #182742);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .3);
}

.user-search .search-results:empty {
    display: none;
}

.user-search .search-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-sizing: border-box;
    min-width: 0;
    margin: 0;
    padding: 11px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--tx, #f8eacf);
    background: transparent;
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.user-search .search-item-name {
    font-weight: 800;
}

.user-search .search-item-details {
    color: #cbd5e1;
    font-size: 12px;
}

.user-search .search-item:hover,
.user-search .search-item.active {
    border-color: var(--gold-tx, #584017);
    background: var(--tx, #f8eacf);
    color: var(--gold-tx, #584017);
}

.user-search .search-item:hover .search-item-details,
.user-search .search-item.active .search-item-details {
    color: var(--home-text-muted, #665044);
}

.user-search .search-item-empty,
.user-search .search-item-empty:hover {
    border-color: transparent;
    background: transparent;
    color: var(--tx, #f8eacf);
    cursor: default;
}

@media (max-width: 600px) {
    .user-search {
        width: calc(100% - 24px);
        margin: 12px auto 20px;
    }

    .user-search .search-results {
        max-height: min(280px, 42dvh);
    }
}

/* ==========================================================
   HEADER — OBOWIĄZUJĄCE REGUŁY NAWIGACJI
   Zachowana kolejność nadpisywania historycznych stylów.
========================================================== */

.nav-menu {
  position: fixed; /* zachowujemy dotychczasowe pozycjonowanie header.php */
  top: 0;
  left: 0;
  z-index: 1200;
  width: 100%;
  min-height: 56px;
  padding-top: env(safe-area-inset-top, 0px);
  border: 0;
  border-radius: 0;
  background: var(--nav-bar);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .24);
  color: var(--nav-text);
  font-family: var(--font-family-system);
font-size: 16px;
font-weight: 700;
line-height: 1.45;
letter-spacing: normal;
}

.nav-menu,
.nav-menu * {
  box-sizing: border-box;
}

.nav-menu .nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  width: 100%;
  max-width: 1920px;
  height: 56px;
  margin: 0 auto;
  padding: 0 18px;
}

/* Linki głównego menu — bez zmiany struktury .nav-links */
.nav-menu .nav-links {
  display: flex;
  flex: 1 1 auto;
  align-items: stretch;
  gap: 20px;
  min-width: 0;
  height: 100%;
}


/* MENU DESKTOP */
.nav-menu .nav-links > a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 56px;
  padding: 0 5px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--footer-text);
    font-family: var(--font-family-system);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: normal;
  text-decoration: none;
  white-space: nowrap;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

/* HOVER - ZMIANA TYLKO KOLORU TEKSTU */
.nav-menu .nav-links > a:hover,
.nav-menu .nav-links > a:focus-visible {
  color: var(--tx);
  background: transparent;
}

/* AKTYWNA ZAKŁADKA */
.nav-menu .nav-links > a[aria-current="page"] {
  color: var(--tx);
  background: transparent;
  border-bottom-color: var(--home-gold);
}


.nav-menu .nav-user {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  font-weight: 800;
}
.nav-menu .nav-user,
.nav-menu .nav-user a,
.nav-menu .nav-user button,
.nav-menu .nav-user .user-trigger {
    font-family: var(--font-family-system);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: normal;
}
/* PL / EN — przełącznik języka w stylistyce change-lang */
.nav-menu .change-lang {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 20px;
  background: var(--nav-card);
  white-space: nowrap;
}

.nav-menu .change-lang a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 2px 9px;
  border-radius: 16px;
  background: transparent;
  color: var(--nav-muted);
  line-height: 1.45;
  text-decoration: none;
}

.nav-menu .change-lang a:hover,
.nav-menu .change-lang a[aria-current="true"] {
  background: var(--nav-card-hover);
  color: var(--nav-text);
}

/* Podświetlenie bieżącego języka, jeśli <html lang="pl/en"> jest ustawiane przez PHP. */
html:lang(pl) .nav-menu .change-lang a[hreflang="pl"],
html:lang(en) .nav-menu .change-lang a[hreflang="en"] {
  background: var(--nav-card-hover);
  color: var(--nav-text);
}

.nav-menu #login-link,
.nav-menu .user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border-radius: 20px;
  background: var(--nav-card);
  color: var(--nav-text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
  text-decoration: none;
  white-space: nowrap;
}

.nav-menu #login-link:hover,
.nav-menu .user-trigger:hover {
  background: var(--nav-card-hover);
}

.nav-menu .user-trigger {
  cursor: pointer;
  user-select: none;
}

.nav-menu #username {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.nav-menu .premium-icon { color: var(--nav-gold) !important; }

/* Dropdown konta: nadal otwierany przez istniejące JS / klasę .open. */
.nav-menu .user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1201;
  display: none;
  min-width: 200px;
  padding: 8px;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: var(--nav-card);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .34);
}

.nav-menu .user-dropdown.open { display: grid; }

.nav-menu .user-dropdown a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--nav-text);
  text-decoration: none;
}

.nav-menu .user-dropdown a:hover {
  background: var(--nav-card-hover);
}

/* Barwy ikon z nowego stylu (zastępują stare kolory inline). 
.nav-menu .nav-links i,
.nav-menu .nav-user i,
.nav-menu .nav-dropdown i {
  color: var(--nav-gold) !important;
}
*/
.nav-menu .menu-toggle {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 36px;
  border-radius: 10px;
  background: var(--nav-card);
  color: var(--nav-gold);
  font-size: 20px;
  cursor: pointer;
}

.nav-menu .menu-toggle i { color: var(--nav-gold) !important; }

/* Poza mobilnym breakpointem menu pozostaje zamknięte. */
.nav-menu .nav-dropdown { display: none; }

@media (max-width: 1040px) and (min-width: 901px) {
  .nav-menu .nav-top { gap: 12px; }
  .nav-menu .nav-links { gap: 12px; }
  .nav-menu .nav-links > a { font-size: 13px; }
}

@media (max-width: 900px) {
  .nav-menu .nav-top {
    gap: 10px;
    padding: 0 12px;
  }

.nav-menu .nav-links { display: none; }

.nav-menu .menu-toggle { display: inline-flex; }

.nav-menu .nav-user {
    flex-direction: row;
    align-items: center;
    gap: 7px;
  }

  .nav-menu .nav-dropdown {
    display: none;
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
    max-height: none;
    padding: 8px 12px 14px;
    overflow: visible;
    border-top: 1px solid rgba(255, 255, 255, .08);
    background: var(--nav-bar);
    transition: none;
  }

  .nav-menu .nav-dropdown.open {
    display: grid;
    max-height: calc(100vh - 56px);
    max-height: calc(100dvh - 56px - env(safe-area-inset-top, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .nav-menu .nav-dropdown > a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 9px 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--nav-text);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
  }

  .nav-menu .nav-dropdown > a:hover,
  .nav-menu .nav-dropdown > a.active,
  .nav-menu .nav-dropdown > a[aria-current="page"] {
    background: var(--nav-card);
    color: var(--nav-gold);
  }
}

@media (max-width: 420px) {
  .nav-menu .nav-top { gap: 6px; padding: 0 8px; }
  .nav-menu .nav-user { gap: 4px; }
  .nav-menu .change-lang a { padding: 2px 7px; }
  .nav-menu .user-trigger,
  .nav-menu #login-link { padding: 6px 8px; font-size: 13px; }
  .nav-menu #username { max-width: 110px; }
}

.nav-menu a:focus-visible,
.nav-menu .menu-toggle:focus-visible,
.nav-menu .user-trigger:focus-visible {
  outline: 3px solid var(--nav-gold);
  outline-offset: 2px;
}


/* =========================
   FOOTER — NOWE KOLORY
========================= */

/* Teksty i linki */
.footer .copyright,
.footer .footer-links a,
.footer #app-version {
    color: var(--footer-text);
}

/* Hover linków */
.footer .footer-links a:hover,
.footer .footer-links a.active {
    color: var(--tx);
    background: transparent;
}

/* Ikony społecznościowe i mobilne */
.footer .icon-link:nth-child(n) {
    color: var(--footer-text);
}

.footer .icon-link:nth-child(n):hover {
    color: var(--tx);
}

/* =========================================
   INDEX — HOME (panel zalogowanego użytkownika)
   .main, .dashboard, .card i nav.js bez zmian
========================================= */

.home-left {
    width: 100%;
    min-width: 0;
}

.home-main {
    width: min(var(--page-max-width), calc(100% - var(--page-gutter)));
    min-width: 0;
    margin-inline: auto;
    font-family: var(--font-family-system, system-ui, sans-serif);
}

/* Jeden wspólny panel: król, rekordy i skuteczność */
.home-main .home-training {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "coach"
        "action"
        "ring";
    gap: 22px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 26px;
    border: 1px solid rgba(248, 234, 207, .16);
    border-radius: 20px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .12);
}

/* Król + dymek: dotychczasowy wygląd */
.home-main .home-training > .coach.big {
    grid-area: coach;
    display: flex;
    align-items: center;
    gap: 24px;
    min-width: 0;
    margin: 0;
}

.home-main .coach.big > img {
    display: block;
    width: clamp(120px, 18vw, 185px);
    height: auto;
    max-height: 210px;
    flex-shrink: 0;
    object-fit: contain;
}

/* HOME — WYRÓŻNIONA NAZWA UŻYTKOWNIKA */

.home-main .bubble .home-username {
    color: var(--home-gold);
    font-size: 1.2em;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.home-main .bubble {
    position: relative;
    min-width: 0;
    padding: 12px 16px;
    border: 2px solid var(--gold-tx, #584017);
    border-radius: 14px;
    background: var(--tx, #f8eacf);
    color: var(--gold-tx, #584017);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.home-main .bubble::before {
    content: "";
    position: absolute;
    left: -8px;
    bottom: 18px;
    border: 8px solid transparent;
    border-right-color: var(--tx, #f8eacf);
    border-left: 0;
}

.home-main .bubble small {
    display: block;
    color: var(--home-text-muted);
    font-size: 14px;
    font-weight: 700;
}

.home-main .bubble h1,
.home-main .bubble h2 {
    margin: 0;
    color: inherit;
    font-size: inherit;
}

.home-main .coach.big .bubble {
    padding: 16px 20px;
    font-size: 19px;
}

/* Przycisk i rekordy — lewa kolumna */
.home-main .home-training > .home-action {
    grid-area: action;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px 24px;
    min-width: 0;
    margin: 0;
}

/* Kolory zgodne z dymkiem */
.home-main .home-action .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    margin: 0;
    padding: 12px 24px;
    box-sizing: border-box;
    border: 2px solid var(--gold-tx, #584017);
    border-radius: 14px;
    color: var(--gold-tx, #b19015);
    font-family: inherit;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.4;
    letter-spacing: normal;
    text-decoration: none;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}

.home-main .home-action .btn:hover {
    background: var(--tx, #f8eacf);
    color: var(--gold-tx, #584017);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .20);
}

.home-main .home-action .btn:focus-visible {
    outline: 3px solid var(--gold-tx, #584017);
    outline-offset: 3px;
}


/* HOME — TASK FIRE OBOK AKTUALNEGO RANKINGU */

.home-main .home-stats .home-task-fire {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--home-text-muted);
    font-size: 14px;
    font-weight: 700;
}

.home-main .home-stats .home-task-fire i {
    color: var(--home-danger);
    font-size: 23px;
}

.home-main .home-stats .home-task-fire-value {
    color: var(--home-danger);
    font-size: 20px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}


.home-main .home-training .home-stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    min-width: 0;
}

.home-main .home-stats > span {
    display: inline-block;
    box-sizing: border-box;
    padding: 12px 16px;
    border: 2px solid var(--gold-tx, #584017);
    border-radius: 14px;
    background: var(--tx, #f8eacf);
    color: var(--gold-tx, #584017);
    font-size: 14px;
    font-weight: 700;
}

.home-main .home-stats b,
.home-main .home-stats .gold {
    color: var(--gold-tx, #584017);
    	font-size: 20px;
    font-variant-numeric: tabular-nums;
}

/* Etykieta daty rekordu */
.home-main .home-stats .home-best-date {
    color: var(--home-text-muted);
    font-size: 14px;
    font-weight: 700;
}

/* Sama data rekordu */
.home-main .home-stats .home-best-date-value {
    color: var(--gold-tx, #584017);
    font-size: 20px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* Ring: klasa stats-card jest potrzebna dla nav.js,
   ale na HOME nie może odziedziczyć wymiarów kafelka profilu. */
.home-main .home-training > .home-performance.stats-card {
    grid-area: ring;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 26px;
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
    margin: 0;
    padding: 20px 0 0;
    border: 0;
    border-top: 1px solid var(--home-panel-border);
    border-radius: 0;
    background: transparent;
    color: var(--light, #f8eacf);
    box-shadow: none;
    transform: none;
    text-align: left;
}

.home-main .home-training > .home-performance.stats-card:hover {
    background: transparent;
    box-shadow: none;
    transform: none;
}

/* Zachowujemy oryginalny ring i animację z nav.js. */
.home-main .home-performance .progress-ring {
    flex: 0 0 120px;
    width: 120px;
    height: 120px;
    margin: 0;
}

.home-main .home-performance-details {
    flex: 1;
    min-width: 0;
    color: var(--light, #f8eacf);
}

.home-main .home-performance-details h3 {
    margin: 0 0 12px;
    color: var(--tx);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
}

.home-main .home-performance .stats-details {
    font-size: 14px;
    line-height: 1.5;
}

.home-main .home-performance .stats-details p {
    margin: 5px 0;
}

.home-main .home-performance .stats-details strong {
    font-size: 20px;
    font-variant-numeric: tabular-nums;
}

.home-main .home-performance .stats-details .correct {
    color: var(--home-success);
	font-size: 20px;
}

.home-main .home-performance .stats-details .wrong {
    color: var(--ring-bad);
	font-size: 20px;
}

.home-main .home-performance-summary {
    margin: 14px 0 0;
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.6;
}

/* Duży ekran — ring i opis obok króla, dymka oraz rekordu. */
@media (min-width: 1100px) {
    .home-main .home-training {
        grid-template-columns: minmax(0, 1.35fr) minmax(300px, .75fr);
        grid-template-areas:
            "coach ring"
            "action ring";
        column-gap: clamp(24px, 3vw, 52px);
        row-gap: 24px;
        align-items: center;
    }

    .home-main .home-training > .home-performance.stats-card {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 16px;
        padding: 0 0 0 clamp(16px, 2vw, 32px);
        border-top: 0;
        border-left: 1px solid var(--home-panel-border);
        text-align: center;
    }

    .home-main .home-performance-details {
        width: 100%;
        flex: 0 1 auto;
    }
}

/* Telefon: król, wyniki i ring jeden pod drugim. */
@media (max-width: 640px) {
    .home-main .home-training {
        gap: 20px;
        padding: 18px;
        border-radius: 16px;
    }

    .home-main .home-training > .coach.big {
        flex-direction: column;
        gap: 14px;
    }

    .home-main .coach.big > img {
        width: 128px;
        max-height: 155px;
    }

    .home-main .coach.big .bubble {
        width: 100%;
        box-sizing: border-box;
        padding: 16px;
        font-size: 17px;
    }

    .home-main .bubble::before {
        left: calc(50% - 8px);
        top: -8px;
        bottom: auto;
        border: 8px solid transparent;
        border-top: 0;
        border-bottom-color: var(--tx, #f8eacf);
    }

    .home-main .home-training > .home-action {
        flex-direction: column;
        align-items: stretch;
    }

    .home-main .home-training .home-stats {
        flex-direction: column;
        align-items: stretch;
    }

    .home-main .home-stats > span {
        width: 100%;
    }

    .home-main .home-training > .home-performance.stats-card {
        flex-direction: column;
        align-items: center;
        gap: 14px;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-main .home-action .btn {
        transition: none;
    }

    .home-main .home-action .btn:hover {
        transform: none;
    }
}

/* HOME — RING 300 PX, RESPONSYWNY */

.home-main .home-performance .progress-ring {
    width: min(300px, 100%);
    height: auto;
    aspect-ratio: 1 / 1;
    flex: 0 1 auto;
    min-width: 0;
    margin: 0;
}

.home-main .home-performance .progress-ring svg {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
}

.home-main .home-performance .progress-text {
    font-size: clamp(24px, 4vw, 40px);
    font-variant-numeric: tabular-nums;
}

/* LICZNIKI W STYLU HOME-OWN-RATING */

.home-main .home-performance .stats-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.home-main .home-performance .stats-details p {
    margin: 0;
    padding: 12px 16px;
    box-sizing: border-box;
    border: 2px solid var(--gold-tx, #584017);
    border-radius: 14px;
    background: var(--tx, #f8eacf);
    color: var(--gold-tx, #584017);
    font-size: 14px;
    font-weight: 700;
}

.home-main .home-performance .stats-details strong {
    color: inherit;
    font-weight: 800;
}

/* POPRAWNE — ZIELONY */

.home-main .home-performance .stats-details p:nth-child(2) {
	border-color: var(--home-success);
    background: none;
    color: var(--gold-tx, #b19015);
}

/* BŁĘDNE — CZERWONY */

.home-main .home-performance .stats-details p:nth-child(3) {
    border-color: #c43d33;
    background: none;
    color: var(--gold-tx, #b19015);
}

/* MAŁE TELEFONY */

@media (max-width: 480px) {
    .home-main .home-performance .progress-ring {
        width: min(260px, 100%);
    }

    .home-main .home-performance .stats-details {
        flex-direction: column;
        align-items: stretch;
    }

    .home-main .home-performance .stats-details p {
        width: 100%;
    }
}

/* =========================================
   HOME — PISANIE KOMUNIKATU KRÓLA
========================================= */

.home-main .bubble .home-coach-message {
    display: block;
    line-height: 1.6;
    overflow-wrap: break-word;
}

/* Obliczone punkty — czerwone */

.home-main .bubble .home-coach-points {
    color: var(--home-danger);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

/* Migający kursor podczas pisania */

.home-main .bubble .home-coach-message.is-typing::after {
    content: none;
}

@keyframes home-coach-cursor {
    50% {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-main .bubble .home-coach-message::after {
        animation: none;
    }
}

/* =======================================================
   PROFIL PUBLICZNY /user/Nazwa — styl HOME
   Tylko body.public-profile-page; bez wpływu na profile-admin
======================================================= */

.public-profile-page .public-profile-layout {
    width: min(960px, calc(100% - 40px));
    min-width: 0;
    margin: 30px auto 48px;
    box-sizing: border-box;
    font-family: var(--font-family-system, system-ui, sans-serif);
}

.public-profile-page .public-profile-back {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 16px;
}

.public-profile-page .public-profile-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 16px;
    box-sizing: border-box;
    border: 2px solid var(--gold-tx, #584017);
    border-radius: 14px;
    background: var(--tx, #f8eacf);
    color: var(--gold-tx, #584017);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    transition: background .2s ease, border-color .2s ease;
}

.public-profile-page .public-profile-back-btn:hover {
    background: #f7cb30;
    color: var(--gold-tx, #584017);
}

.public-profile-page .public-profile-back-btn:focus-visible {
    outline: 3px solid var(--home-gold, #b19015);
    outline-offset: 3px;
}

.public-profile-page .public-profile-panel {
    width: 100%;
    min-width: 0;
    padding: clamp(18px, 3vw, 32px);
    box-sizing: border-box;
    border: 1px solid var(--home-panel-border, rgba(248, 234, 207, .15));
    border-radius: 20px;
    background: var(--home-panel-bg, #182742);
    color: var(--tx, #f8eacf);
}

.public-profile-page .public-profile-heading {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--home-panel-border, rgba(248, 234, 207, .15));
}

.public-profile-page .public-profile-heading-icon {
    display: grid;
    place-items: center;
    flex: 0 0 66px;
    width: 66px;
    height: 66px;
    border: 2px solid var(--gold-tx, #584017);
    border-radius: 18px;
    background: var(--tx, #f8eacf);
    color: var(--gold-tx, #584017);
    font-size: 32px;
}

.public-profile-page .public-profile-heading-text {
    min-width: 0;
}

.public-profile-page .public-profile-eyebrow {
    margin: 0 0 4px;
    color: #e4ddce;
    font-size: 13px;
    font-weight: 700;
}

.public-profile-page .public-profile-heading h1 {
    margin: 0;
    color: var(--tx, #f8eacf);
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 900;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.public-profile-page .public-profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    min-width: 0;
    margin: 0;
}

.public-profile-page .public-profile-field {
    min-width: 0;
    margin: 0;
    padding: 15px 18px;
    box-sizing: border-box;
    border: 2px solid var(--gold-tx, #584017);
    border-radius: 14px;
    background: var(--tx, #f8eacf);
    overflow-wrap: anywhere;
}

.public-profile-page .public-profile-field dt {
    margin: 0 0 6px;
    color: var(--home-text-muted, #665044);
    font-size: 13px;
    font-weight: 700;
}

.public-profile-page .public-profile-field dd {
    margin: 0;
    color: var(--gold-tx, #584017);
    font-size: clamp(16px, 2vw, 20px);
    font-weight: 800;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
}

.public-profile-page .public-profile-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 10px;
    text-align: center;
}

.public-profile-page .public-profile-empty > i {
    color: var(--tx, #f8eacf);
    font-size: 42px;
}

.public-profile-page .public-profile-empty h1 {
    margin: 0;
    color: var(--tx, #f8eacf);
    font-size: clamp(22px, 3vw, 30px);
}

.public-profile-page .public-profile-empty p {
    margin: 0;
    color: #e4ddce;
    font-size: 15px;
}

@media (max-width: 600px) {
    .public-profile-page .public-profile-layout {
        width: calc(100% - 24px);
        margin: 16px auto 30px;
    }

    .public-profile-page .public-profile-heading {
        gap: 12px;
        margin-bottom: 18px;
    }

    .public-profile-page .public-profile-heading-icon {
        flex-basis: 52px;
        width: 52px;
        height: 52px;
        font-size: 26px;
    }

    .public-profile-page .public-profile-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .public-profile-page .public-profile-field {
        padding: 13px 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .public-profile-page .public-profile-back-btn {
        transition: none;
    }
}

