.nav-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: radial-gradient(circle at 20% 20%, #363f4b 10%, #c27f41 70%);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  color: white;
  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: white;
  text-decoration: none;
  border-radius: 3px;
  align-items: center;
  gap: 6px;
}
#login-link {
    color: white;
    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%, #854f1c 70%);
}

.menu-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: white;
}

/* 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: white;
  font-size: 18px;
  position: relative;
  cursor: pointer;
}

#fen-count {
  position: absolute;
  top: -6px;
  right: -8px;
  background: red;
  color: white;
  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%, #c27f41 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: white;
  text-decoration: none;
  font-size: 15px;
}

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

.user-trigger {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  /* większy odstęp między ikonami */
  color: white;
  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%, #c27f41 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: white;
    text-decoration: none;
}

.dropdown-menu a:hover {
    background: radial-gradient(circle at 20% 20%, #363f4b 10%, #854f1c 70%);
}
.mobile-submenu {
    display: none;
    flex-direction: column;
    background: radial-gradient(circle at 20% 20%, #363f4b 10%, #c27f41 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%, #854f1c 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: white;
  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: white;
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
}

.folder-label button:hover {
  background: #d44747;
}
.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: white;
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 12px;
  margin-left: 5px;
  cursor: pointer;
}

.confirm-wrapper button.confirm-btn {
  width: 80px;
  background: #4caf50;
  border-color: #4caf50;
}

.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: #d44747;
}
#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: fixed;
  width: 100%;
  background: radial-gradient(circle at 20% 20%, #363f4b 10%, #c27f41 70%);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  text-align: center;
  bottom: 0;
  color: var(--light, white);
}
.footer-links {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
}

.left-links,
.right-links {
  display: flex;
  gap: 15px;
  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: white;
    cursor: pointer;
    font-size: 14px;
}

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

.tab-content {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    color: white;
    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); }
}

.server-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    gap: 20px;
    background: #f7f7f7;
    border-radius: 8px;
    text-decoration: none;
    color: black;
    width: auto;
    box-sizing: border-box;
}
/*Sygnał ping i serwer */
.server-status .server-info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    font-size: 14px;
}

.server-status .ping,
.server-status .server {
    line-height: 1.4;
}

.server-status span#ping,
.server-status span#response {
    font-weight: bold;
    margin-left: 4px;
}

#signal {
    display: inline-flex;
    align-items: flex-end;
    gap: 3px;
    height: 20px;
}

#signal>i {
    width: 6px;
    height: 20%;
    background-color: red;
    border-radius: 2px;
    transition: background-color 0.3s;
}

#signal>i:nth-child(1) {
    height: 25%;
}

#signal>i:nth-child(2) {
    height: 50%;
}

#signal>i:nth-child(3) {
    height: 75%;
}

#signal>i:nth-child(4) {
    height: 100%;
}
/* Modal content */


/* Modal container (hidden by default) */
.modal {
    display: none;
    position: fixed;
    left: 0;
    top: 70px;
    width: 100%;
    height: auto;
    overflow-y: auto;
    z-index: 999;
    pointer-events: none;
    justify-content: center;
    align-items: center;
}

/* Modal content box */
.modal-content {
    background: radial-gradient(circle at 20% 20%, #363f4b 10%, #493a2c 70%);
    color: #f5f5f5;
    margin: auto;
    padding: 25px 30px;
    border-radius: 15px;
    max-width: 600px;
    /* lekki cień */
    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;
}
/* ...................... */
@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%, #c27f41 70%);
    border-top: 1px solid #444;
  }

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

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

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

  .dropdown-menu {
    position: relative;

  }
}
.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 */
}
