/* === Grundlayout === */

:root {
  /* Default (Light) */
  --bg: #f8f9fa;
  --fg: #000;
}
[data-theme="dark"] {
  --bg: #121212;
  --fg: #eee;
}
#theme-toggle {
    width: var(--toggle-size);
    height: var(--toggle-size);
    background-color: var(--marine);
    border: none;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease;
    margin-left: 10px;
    padding: 0;
  }
  #theme-toggle:hover {
    transform: scale(1.1);
  }
  #theme-toggle svg {
    width: 60%;
    height: 60%;
    fill: var(--icon-color);
  }
body {
  background-color: var(--bg);
  color: var(--fg);
}


body {
  font-family: 'Segoe UI', sans-serif;
  font-size: 20px;
 /* background-color: #f8f9fa; */
  margin-top: 0;
  padding: 0;
}

.beta-badge {
  display: inline-block;
  background: linear-gradient(135deg, #ff8a00, #e52e71);
  color: #fff;
  font-family: 'Segoe UI', sans-serif;
  font-weight: bold;
  font-size: 0.75rem;       /* je nach Geschmack z.B. auch 0.8rem */
  line-height: 1;
  padding: 0.15em 0.35em;   /* vertikal, horizontal */
  border-radius: 0.25em;    /* macht die Ecken schön rund */
  text-transform: uppercase;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  vertical-align: middle;   /* damit das Badge gut zur Textlinie passt */
}
.beta-badge:hover {
  background: linear-gradient(135deg, #e52e71, #ff8a00);
}

.link-badge {
    display: inline-block;
    background: linear-gradient(135deg, #1a73e8, #155ab6);
    color: #fff;
    font-family: 'Segoe UI', sans-serif;
    font-weight: bold;
    font-size: 1.75rem;
    line-height: 1;
    padding: 0.15em 0.35em;
    border-radius: 0.25em;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    vertical-align: middle;
    text-decoration: none;
    transition: background 0.3s ease;
  }
  .link-badge:hover {
    background: linear-gradient(135deg, #155ab6, #1a73e8);
  }
  
  .player-meta {
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.2rem; /* nach Bedarf anpassen */
  color: #555;      /* nach Design anpassen */
}

.player-meta p {
  margin: 0;
  padding: 0.25em 0;
}

/* Optional: Bei sehr schmalen Bildschirmen untereinander statt nebeneinander */
@media (max-width: 800px) {
  .player-meta {
	font-size: 0.6rem; /* nach Bedarf anpassen */
  }
}
  
/* suggestions */
.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-top: none;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  max-height: 250px;
  overflow-y: auto;
  font-size: 0.95rem;
  border-radius: 6px;
}

.suggestion-item {
  padding: 10px;
  cursor: pointer;
  color: #333;
  white-space: nowrap;
}

.suggestion-item:hover {
  background-color: #f0f0f0;
}

/* Spielerprofil */
.player-info {
  text-align: center;
  margin-bottom: 30px;
}

/* Übersicht */
.stats-overview {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  max-width: 1600px;
  margin: 0 auto 20px auto;
  padding: 0 10px;
}

.stat-card {
  flex: 1 1 calc(23% - 10px);
  background-color: #fff;
  border-radius: 12px;
  padding: 10px;
  min-width: 300px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10%;
  height: 80%;
  width: 5px;
  border-radius: 5px;
  background: linear-gradient(to bottom, #3498db, #2980b9);
}

.stat-card.avg-damage::before {
  background: linear-gradient(to bottom, #f39c12, #e67e22);
}

.stat-card.winrate::before {
  background: linear-gradient(to bottom, #2ecc71, #27ae60);
}

.stat-card.wn8::before {
  background: linear-gradient(to bottom, #9b59b6, #8e44ad);
}

.stat-card .label {
  color: #7f8c8d;
  font-size: 16px;
  margin-bottom: 8px;
}

.stat-card .value {
  color: #000;
  font-size: 24px;
  font-weight: bold;
}















/* ---------------------- */
/* 1. Light-Mode (Default) */
/* ---------------------- */

/* Basis-Styles für alle Statistik-Tabellen */
.color-schema-table,
.custom-sort-table,
#shipTable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #ffffff;           /* heller Hintergrund */
  color: #1e293b;                /* dunklere Standard-Schrift */
  border-radius: 10px;
  overflow: hidden;
  font-size: 1rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

/* Tabellenkopf */
.color-schema-table th,
.custom-sort-table th,
#shipTable th {
  background: #f3f4f6;
  color: #1e293b;                /* dunkle Kopfzeilen-Schrift */
  padding: 10px 6px;
  border-bottom: 2px solid #e5e7eb;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
}

/* Tabellenzellen */
.color-schema-table td,
.custom-sort-table td,
#shipTable td {
  padding: 6px 6px;
  border-bottom: 1px solid #e5e7eb;
  text-align: center;
  background: transparent;
  color: #2d3748;                /* kräftigere Zellen-Schrift */
}

/* Letzte Zeile ohne Linie */
.color-schema-table tr:last-child td,
.custom-sort-table tr:last-child td,
#shipTable tr:last-child td {
  border-bottom: none;
}

/* Wechselnde Zeilenfarbe */
.color-schema-table tr:nth-child(even),
.custom-sort-table tr:nth-child(even),
#shipTable tr:nth-child(even) {
  background: #f9fafb;
}

.color-schema-table tr:nth-child(odd),
.custom-sort-table tr:nth-child(odd),
#shipTable tr:nth-child(odd) {
  background: #ffffff;
}

/* Hover-Effekt */
.color-schema-table tr:hover,
.custom-sort-table tr:hover,
#shipTable tr:hover {
  background: #e5e7eb;
  color: #1e293b;                /* Hover-Schrift ebenfalls dunkel */
}

/* ---------------------- */
/* 2. Dark-Mode Overrides  */
/* ---------------------- */

html[data-theme="dark"] .color-schema-table,
html[data-theme="dark"] .custom-sort-table,
html[data-theme="dark"] #shipTable {
  background: #17324c;
  color: #fff;
  box-shadow: 0 2px 12px rgba(16,42,67,0.10);
}

html[data-theme="dark"] .color-schema-table th,
html[data-theme="dark"] .custom-sort-table th,
html[data-theme="dark"] #shipTable th {
  background: #204060;
  color: #fff;
  border-bottom: 2px solid #102a43;
}

html[data-theme="dark"] .color-schema-table td,
html[data-theme="dark"] .custom-sort-table td,
html[data-theme="dark"] #shipTable td {
  border-bottom: 1px solid #1c2e4a;
  color: #fff;                    /* weiße Zellen-Schrift */
}

html[data-theme="dark"] .color-schema-table tr:nth-child(even),
html[data-theme="dark"] .custom-sort-table tr:nth-child(even),
html[data-theme="dark"] #shipTable tr:nth-child(even) {
  background: #1c2e4a;
}

html[data-theme="dark"] .color-schema-table tr:nth-child(odd),
html[data-theme="dark"] .custom-sort-table tr:nth-child(odd),
html[data-theme="dark"] #shipTable tr:nth-child(odd) {
  background: #17324c;
}

html[data-theme="dark"] .color-schema-table tr:hover,
html[data-theme="dark"] .custom-sort-table tr:hover,
html[data-theme="dark"] #shipTable tr:hover {
  background: #243f5e;
  color: #000 !important;
}

html[data-theme="dark"] .color-schema-table tr:last-child td,
html[data-theme="dark"] .custom-sort-table tr:last-child td,
html[data-theme="dark"] #shipTable tr:last-child td {
  border-bottom: none;
}












/* Flaggen und Typ-Bilder kleiner & schöner */
.ship-type img,
.ship-nation img {
    display: block;
    margin: 0 auto 2px;
    height: 26px;
    border-radius: 2px;
    box-shadow: 0 0 4px #0e1b2c55;
}

/* Optional: Schiffname linksbündig */
.ship-name {
    text-align: left;
    font-weight: 500;
    padding-left: 12px;
}


/* Farben für Farbschema-Tabelle */
.color-schema-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-weight: bold;
}

.color-schema-table th,
.color-schema-table td {
  padding: 12px;
  border: 1px solid #ddd;
}

.color-schema-table thead {
  background-color: white;
  color: black;
}




/* Footer */
footer,
.site-footer {
  background-color: #f5f5f5;
  color: #333;
  font-size: 0.85em;
  padding: 20px;
  text-align: center;
  border-top: 1px solid #ccc;
  margin-top: 40px;
}
.site-footer a {
  color: #336699;
  text-decoration: none;
}
.site-footer a:hover {
  text-decoration: underline;
}

html[data-theme="dark"] .site-footer {
  background-color: #102a43;
  color: #ccc;
  border-top: 1px solid #2a4a6b;
}
html[data-theme="dark"] .site-footer a {
  color: #80bfff;
}

.site-footer .footer-social img {
  width: 24px;
  height: 24px;
  vertical-align: middle;
  filter: invert(100%);
  transition: transform 0.3s ease;
}

.site-footer .footer-social a:hover img {
  transform: scale(1.1);
}









/* Responsive Grid Layouts */
.cards-grid,
.grid-3,
.grid-2 {
  display: grid;
  gap: 1.5rem;
  padding: 1rem;
}

.cards-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.card {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.card.wide {
  grid-column: span 2;
}

@media (max-width: 1100px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .cards-grid,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .card.wide {
    grid-column: span 1;
  }
}

/* === Schiffstabelle – shipTable === */
.ship-stats-section {
  width: 90%;
  margin: 0 auto 40px auto;
  padding: 0 10px;
  text-align: center;
}

.ship-stats-section-heading {
  font-size: 1.8em;
  font-weight: bold;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #222; /* Standard (Light Mode) */
  cursor: pointer;
}

html[data-theme="dark"] .ship-stats-section-heading {
  color: #e0e0e0;
}
.ship-stats-section-heading:hover {
  opacity: 0.85;
  text-decoration: underline;
}

#ship-stats-wrapper {
  display: flex;
  justify-content: center;
  padding: 10px;
}


#shipTable {
  width: fit-content;  /* ← zentriert! */
  width: 100%;
  margin: 0 auto;
  border-collapse: collapse;
  font-size: 0.95rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

#shipTable thead {
  background-color: #f8f9fa;
  color: #222;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#shipTable th,
#shipTable td {
  padding: 12px;
  border: 1px solid #ddd;
  text-align: center;
}

#shipTable tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

#shipTable td.ship-name {
  font-size: 1.15em;
  font-weight: 600;
}

#shipTable td.ship-type,
#shipTable td.ship-nation {
  font-size: 0.85em;
  font-weight: 400;
  color: #bbb;
}
#shipTable td.winrate,
#shipTable td.wn8 {
  font-size: 1.1em;
  font-weight: 600;
}

/* Dark Mode Unterstützung */
body.dark-mode #shipTable {
  background: #102a43;
  color: #e0e0e0;
}

body.dark-mode #shipTable thead {
  background-color: #1a3b5c;
  color: #f0f0f0;
}

body.dark-mode #shipTable td,
body.dark-mode #shipTable th {
  border-color: #2a4a6b;
}

body.dark-mode #shipTable tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.05);
}



body.dark-mode #player-name {
  color: #e0e0e0;
}

/* --- Ergänzt aus player.php --- */
.stats-overview,
.stats-section .table-wrapper {
  width: 90%;
  margin: 0 auto 30px auto;
}
.stats-overview {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 20px;
}
.stat-card {
  flex: 1 1 140px;
  background: #f0f0f0;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.stat-card .label {
  font-size: 0.9em;
  color: #555;
}
.stat-card .value {
  font-size: 1.5em;
  font-weight: bold;
  margin-top: 5px;
}

/* Dark Mode Unterstützung für stat-card */
html[data-theme="dark"] .stat-card {
  background: #1e1e1e;
}
html[data-theme="dark"] .stat-card .label {
  color: #bbb;
}
html[data-theme="dark"] .stat-card .value {
  color: #fff;
}

/* Dark Mode für stats-table */
html[data-theme="dark"] .stats-table {
  background-color: #102a43;
  color: #e0e0e0;
}
html[data-theme="dark"] .stats-table th,
html[data-theme="dark"] .stats-table td {
  background-color: #102a43;
  color: #ffffff;
  border-color: #2a4a6b;
}
html[data-theme="dark"] .stats-table thead {
  background-color: #1a3b5c;
  color: #f0f0f0;
}
html[data-theme="dark"] .stats-table tr:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Spielername und Überschriften Style */
/* Spielername */
#player-name {
  text-align: center;
  font-size: 2em;
  color: #222;
  margin-top: 1rem;
}
html[data-theme="dark"] #player-name {
  color: #e0e0e0;
}

/* Überschriften zentrieren */
.stats-section h2,
.ship-stats-section h2 {
  text-align: center;
  font-size: 1.8em;
  margin-bottom: 0.8rem;
  color: #222;
}
html[data-theme="dark"] .stats-section h2,
html[data-theme="dark"] .ship-stats-section h2 {
  color: #e0e0e0;
}

/* Kopfzeile dunkler im Dark Mode */
/* Kopfzeile dunkler als Zellen im Dark Mode */
html[data-theme="dark"] .stats-table thead th {
  background-color: #0b1e33;
  color: #ffffff;
}

/* Stat-Card gleiche Farbe wie Tabellenkopf im Dark Mode */
/* stat-card Farbe im Dark Mode an Tabellen-Kopfzeile angleichen */
html[data-theme="dark"] .stat-card {
  background: #0b1e33;
  color: #ffffff;
}

/* Schiffsstatistik-Tabelle im Dark Mode anpassen */
/* Dark Mode für Schiffsstatistik (color-schema-table) */
html[data-theme="dark"] .color-schema-table {
  background-color: #14324F;
  color: #e0e0e0;
}
html[data-theme="dark"] .color-schema-table th,
html[data-theme="dark"] .color-schema-table td {
  background-color: #102a43;
  color: #ffffff;
  border-color: #2a4a6b;
  border-bottom: 1px solid #386EA1;  /* horizontale Trennlinien */
  border-right: ;   /* vertikale Trennlinien */
  padding: 0.6rem 0.8rem;          /* etwas Luft in den Zellen */
}
html[data-theme="dark"] .color-schema-table thead th {
  background-color: #0b1e33;
  color: #ffffff;
}
html[data-theme="dark"] .color-schema-table tr:hover {
  background-color: background-color: #ffffff;
}


/* Größere Schrift und Highlight für Winrate & WN8 in .stats-table */
.stats-table .winrate,
.stats-table .wn8 {
  font-weight: bold;
  font-size: 1.35em;
  border-radius: 0.5em;
  padding: 2px 8px;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0,0,0,0.12);
  transition: background 0.25s, color 0.25s;
}

.stats-table .winrate:hover, .stats-table .wn8:hover {
  box-shadow: 0 0 8px 2px rgba(80,180,255,0.22);
  filter: brightness(1.08);
}

.stats-table .pr {
  font-weight: bold;
  font-size: 1.2em;
  border-radius: 0.5em;
  padding: 2px 8px;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0,0,0,0.12);
}

.pr {
    font-weight: bold;
    font-size: 1.2em;
    text-align: center;
    /* ggf. wie bei .wn8 einfärben */
}
.pr.neutral {
    color: #555;
}

/* Tabelle außen abgerundet, innen eckig */
.stats-section .table-wrapper {
    border-radius: 16px;         /* Außen abgerundet */
    overflow: hidden;            /* Ecken der Tabelle "abschneiden" */
}

.stats-table {
    border-radius: 0;            /* Tabelle selbst nicht abrunden */
    width: 100%;
    border-collapse: separate;   /* damit overflow: hidden wirkt */
    border-spacing: 1;
}

.stats-table th,
.stats-table td {
    border-radius: 0 !important; /* Eckig, keine Rundung in den Zellen */
    /* Optional: border für optisch saubere Trennung */
    border: none;
    /* Für bündiges Aussehen evtl. padding anpassen */
}

/* Farbcodes für PR/WN8/Winrate weiterhin wie gehabt, ohne border-radius */
.pr, .wn8, .winrate {
    border-radius: 0 !important;
    /* Rest wie gehabt, z.B. padding, font-size */
}

/* Optional, damit keine Ecke einzeln abgerundet wird (falls alte Styles vorhanden): */
.stats-table td:first-child,
.stats-table th:first-child,
.stats-table td:last-child,
.stats-table th:last-child {
    border-radius: 0 !important;
}



/* Top-Spieler & Clan Tabellen */
/* Allgemeines Table-Styling */
/* Grundlegende Tabellengestaltung bleibt */

.stats-table th, .stats-table td {
  /* Beibehalten, falls schon in deiner CSS */
  padding: 0.45em 0.8em;
  text-align: center;
  border: none;
}


/* Nickname auffällig und groß */
.player-link .nickname {
  font-size: 1.23em;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 12px #1da2ff66, 0 1px 0 #111d; /* leichter Glow */
  letter-spacing: 0.01em;
  transition: color 0.2s, text-shadow 0.2s;
  line-height: 1.2;
}

.player-link {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0;
  color: #fff !important;
  font-size: 1.23em;
  font-weight: 800;
  text-shadow: 0 2px 12px #1da2ff66, 0 1px 0 #111d;
  letter-spacing: 0.01em;
  transition: color 0.2s, text-shadow 0.2s;
  line-height: 1.2;
  display: inline;
}

/* Hover bleibt auffällig */
.player-link:hover .nickname {
  color: #ffe678;
  text-shadow: 0 2px 12px #ffe67899, 0 1px 0 #111d;
}

/* Keine Unterstreichung */
.player-link,
.player-link:hover {
  text-decoration: none !important;
}


.player-link .external-link-icon {
  color: #fff4b8;
  font-size: 1em;
  opacity: .75;
  transition: color 0.18s;
}
.player-link:hover .external-link-icon {
  color: #ffe678;
  opacity: 1;
}



/* Tabellenzellen, Standard: dünne Schrift, hell */
.stats-table td,
.stats-table th {
  font-weight: 400;
  color: #c6d8f2;
  font-size: 1.03em;
}
.stats-table th {
  font-weight: 800;
  color: #fff;
}

/* WN8: Fetter, viel größer, präsenter */
.wn8-cell {
  font-size: 1.38em !important;
  font-weight: 900 !important;
  color: #fff !important;
  letter-spacing: 0.02em;
  box-shadow: 0 0 18px #12e2ff14 inset;

  /* Hintergrundfarbe kommt weiter per JS */
}

/* ---------------------- */
/* 1. Light-Mode (Default) */
/* ---------------------- */
.pr-cell,
.winrate-cell,
.tier-cell,
.battles-cell {
  font-size: 1em !important;
  font-weight: 400 !important;
  color: #0b263b !important;       /* dunkles Marineblau */
  background: none !important;
  box-shadow: none !important;
}

/* ---------------------- */
/* 2. Dark-Mode Overrides  */
/* ---------------------- */
html[data-theme="dark"] .pr-cell,
html[data-theme="dark"] .winrate-cell,
html[data-theme="dark"] .tier-cell,
html[data-theme="dark"] .battles-cell {
  /* behalte deine bisherigen Dark-Mode-Werte */
  font-size: 1em !important;
  font-weight: 400 !important;
  color: #c6d8f2 !important;
  background: none !important;
  box-shadow: none !important;
}



.custom-sort-table td.nickname-cell {
  background: linear-gradient(90deg, #194686 70%, #209af5 100%);
  border-radius: 0;
  padding-left: 0.8em;
  padding-right: 0.8em;
  box-shadow: 0 2px 12px 0 #209af544;
  transition: background 0.22s;
}

/* Schöne Zeilenübergänge beim Hover */
.stats-table tr:hover {
  background: #213960 !important;
}

html[data-theme="dark"] .stats-table tbody tr {
  border-bottom: 1px solid #283b52;
}
body[data-theme="light"] .stats-table tbody tr {
  border-bottom: 1px solid #e3e3e3;
}
.stats-section .stats-table tbody tr {
  border-bottom: 1px solid #ffffff;
}
.stats-table tbody tr:last-child { border-bottom: none !important; }


.player-header {
  text-align: center;
  margin-top: 20px;
}
.player-nick {
  display: inline;
  font-size: 2.2em;
  font-weight: bold;
  color: #fff;
}
.player-clan {
  display: inline;
  margin-left: 0.7em;
  font-weight: normal;
  font-size: 1.1em;
  color: #c9d7ea;
  letter-spacing: 0.5px;
}
.clan-link {
  color: #c9d7ea;
  text-decoration: none;
  font-weight: normal;
  padding: 0 1px;
  transition: color 0.18s;
}
.clan-link:hover,
.clan-link:focus {
  color: #e7e9ff;
}

/* ---------------------- */
/* 1. Light-Mode (Default) */
/* ---------------------- */
.player-header {
  background: none; /* falls du einen Hintergrund haben willst, hier anpassen */
  padding: 1rem 0;
}

.player-header .player-info,
.player-header .player-info a.site-titlel,
.player-header .player-info .player-clan,
.player-header .player-info .player-clan a.clan-link {
  color: #0b263b;            /* dunkles Marineblau für Light-Mode */
  text-decoration: none;
}

/* Optional: Hover-Effekt im Light-Mode */
.player-header .player-info a.site-titlel:hover,
.player-header .player-info .player-clan a.clan-link:hover {
  color: #09203a;            /* noch dunkler im Hover */
  text-decoration: underline;
}

/* ---------------------- */
/* 2. Dark-Mode Overrides  */
/* ---------------------- */
html[data-theme="dark"] .player-header .player-info,
html[data-theme="dark"] .player-header .player-info a.site-titlel,
html[data-theme="dark"] .player-header .player-info .player-clan,
html[data-theme="dark"] .player-header .player-info .player-clan a.clan-link {
  color: #e2e8f0;            /* helle Schrift im Dark-Mode */
}

/* Optional: Hover-Effekt im Dark-Mode */
html[data-theme="dark"] .player-header .player-info a.site-titlel:hover,
html[data-theme="dark"] .player-header .player-info .player-clan a.clan-link:hover {
  color: #ffffff;            /* reines Weiß im Hover */
}












/* ==== Flex-Wrapper für die beiden Tabellen-Cards ==== */
.stats-cards-container {
  display: flex;
  flex-wrap: nowrap;
  gap: 1.0rem;
  align-items: flex-start;
}
/* Jede Card belegt 50% minus Half-Gap */
.stats-cards-container .stats-card {
  flex: 1 1 calc(50% - 0.75rem);
}
/* Ab 800px Breite aufspalten, darunter stapeln */
@media (max-width: 1400px) {
  .stats-cards-container {
    flex-direction: column;
  }
  .stats-cards-container .stats-card {
    flex: 1 1 100%;
  }
}


/* 1) Scroll-Wrapper für Tabellen */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
/* 2) Basis-Stil für alle .custom-sort-table */
.custom-sort-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 1rem;       /* Grundgröße */
}
.custom-sort-table th,
.custom-sort-table td {
  padding: 0.55rem 0.85rem; /* großzügige Polsterung */
  text-align: center;
  white-space: nowrap;   /* verhindert Zeilenumbruch */
}
/* Erlaubt in Nickname-Spalte Zeilenumbruch */
.custom-sort-table .nickname-cell,
.custom-sort-table .player-link {
  white-space: normal;
}
/* 3) Kleinere Schrift und Polster auf engen Viewports */
@media (max-width: 1600px) {
  .custom-sort-table {
    font-size: 0.925rem;    /* 14px */
  }
  .custom-sort-table th,
  .custom-sort-table td {
    padding: 0.4rem 0.55rem;
  }
}
/* 3) Kleinere Schrift und Polster auf engen Viewports */
@media (max-width: 1200px) {
  .custom-sort-table {
    font-size: 0.925rem;    /* 14px */
  }
  .custom-sort-table th,
  .custom-sort-table td {
    padding: 0.3rem 0.55rem;
  }
}
/* Responsive, falls gewünscht */
@media (max-width: 1000px) {
  .stats-table, .color-schema-table, .custom-sort-table, #shipTable {
    font-size: 0.92rem;
  }
  .ship-type img, .ship-nation img { height: 18px; }
}
/* 3) Kleinere Schrift und Polster auf engen Viewports */
@media (max-width: 800px) {
  .custom-sort-table {
    font-size: 0.875rem;    /* 14px */
  }
  .custom-sort-table th,
  .custom-sort-table td {
    padding: 0.2rem 0.45rem;
  }
}
@media (max-width: 600px) {
  .custom-sort-table {
    font-size: 0.55rem;     /* 12px */
  }
  .custom-sort-table th,
  .custom-sort-table td {
    padding: 0.02rem 0.04rem;
  }
}
/* Basis-Style für den Note-Block */
.top-list-note {
  margin-bottom: 0.5em;
  color: #1765ad;
  font-size: 1rem;
}
/* Dark Mode */
html[data-theme="dark"] .top-list-note {
  color: #a3d4f7;
}
/* Auf kleinen Bildschirmen Schrift verkleinern */
@media (max-width: 800px) {
  .top-list-note {
    font-size: 0.875rem;
	}
	/* h2 in den Top-Listen etwas kleiner */
  .stats-card h2,
  .stats-section h2,
  .ship-stats-section h2 {
    font-size: 1.2rem;
	margin-bottom: 0.25rem;
  }
  }


/* === Stats-Section-Tabelle ins Top-List-Styling übernehmen === */
.stats-section .table-wrapper {
  /* wie .table-responsive */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.5rem; /* passt zum .custom-sort-table */
}

/* Basis-Stil kopiert von .custom-sort-table.color-schema-table */
.stats-section .stats-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #17324c;
  color: #fff;
  border-radius: 10px;
  overflow: hidden;
  font-size: 1rem;
  box-shadow: 0 2px 12px rgba(16,42,67,0.10);
}
/* Tabellenkopf */
.stats-section .stats-table th {
  background: #204060;
  color: #fff;
  padding: 10px 6px;
  border-bottom: 2px solid #102a43;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
}
/* Zellen */
.stats-section .stats-table td {
  padding: 6px 6px;
  border-bottom: 1px solid #1c2e4a;
  text-align: center;
  background: transparent;
}
/* Zebra-Rows */
.stats-section .stats-table tr:nth-child(even) {
  background: #1c2e4a;
}
.stats-section .stats-table tr:nth-child(odd) {
  background: #17324c;
}
/* Hover */
.stats-section .stats-table tr:hover {
  color: #000 !important;
  background: #243f5e;
}
.stats-table tr > td:first-child,
.stats-table thead tr > th:first-child {
  font-weight: bold;
}
/* Responsive Font & Padding (wie bei custom-sort-table) */
@media (max-width: 1200px) {
  .stats-section .stats-table {
    font-size: 0.925rem;
  }
  .stats-section .stats-table th,
  .stats-section .stats-table td {
    padding: 0.3rem 0.55rem;
  }
}
@media (max-width: 800px) {
  .stats-section .stats-table {
    font-size: 0.875rem;
  }
  .stats-section .stats-table th,
  .stats-section .stats-table td {
    padding: 0.2rem 0.45rem;
  }
}
@media (max-width: 600px) {
  .stats-section .stats-table {
    font-size: 0.75rem;
  }
  .stats-section .stats-table th,
  .stats-section .stats-table td {
    padding: 0.1rem 0.2rem;
  }
}

/* neutral: keine Hintergrundfarbe */
.wn8.neutral {
  background-color: transparent !important;            /* oder eine dezente Textfarbe */
}
/* neutral: keine Hintergrundfarbe */
.pr.neutral {
  background-color: transparent !important;            /* oder eine dezente Textfarbe */
}
/* neutral: keine Hintergrundfarbe */
.winrate.neutral {
  background-color: transparent !important;            /* oder eine dezente Textfarbe */
}

/* Wrapper um den Text, damit das Popup relativ dazu positioniert wird */
.tooltip {
  position: relative;
  display: inline-block;
  cursor: pointer;
}
/* Das eigentliche Popup, standardmäßig unsichtbar */
.tooltip .tooltip-content {
  visibility: hidden;
  opacity: 0;
  width: 200px;                     /* Passe die Breite an */
  background-color: #204060;        /* Dunkler Hintergrund passend zu deinem Design */
  color: #fff;                      /* Helle Schrift */
  text-align: left;
  padding: 0.5rem;
  border-radius: 4px;
  position: absolute;
  bottom: 125%;                     /* Popup oberhalb des Textes */
  left: 50%;
  transform: translateX(-50%);
  transition: opacity 0.2s ease-in-out;
  z-index: 10;
}
/* Pfeil nach unten unter dem Popup */
.tooltip .tooltip-content::after {
  content: "";
  position: absolute;
  top: 100%;  /* unten am Popup */
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #204060 transparent transparent transparent;
}
/* Sichtbar werden beim Hover */
.tooltip:hover .tooltip-content {
  visibility: visible;
  opacity: 1;
}
/* 1) Grundgröße für Tabellenkopf */
.table-wrapper .stats-table thead th {
  padding: 0.4rem 0.6rem;
  font-size: 1.3rem;    /* z.B. 19.2px auf Desktop */
}
/* 2) Ab 1200px Breite etwas kleiner */
@media (max-width: 1200px) {
  .table-wrapper .stats-table thead th {
    font-size: 1rem;  /* z.B. 17.6px */
  }
  .table-wrapper .stats-table td {
    padding: 0.2rem 0.3rem;
	font-size: 1rem;
  }
  #player-name {
  font-size: 24px;
  font-weight: bold;
  color: #fff;
}
}
@media (max-width: 800px) {
  .table-wrapper .stats-table {
    font-size: 0.55rem;
  }
  .table-wrapper .stats-table th,
  .table-wrapper .stats-table td {
    padding: 0.05rem 0.05rem;
	font-size: 0.5rem;
  }
    .nickname-cell td {
    padding: 0.05rem 0.05rem;
	font-size: 0.5rem;
  }
  }
/* 3) Ab 600px Breite noch kompakter */
@media (max-width: 650px) {
	
  .table-wrapper .stats-table thead th {
    font-size: 0.4rem;    /* z.B. 16px */
	padding: 0.03rem 0.03rem;
  }
    .table-wrapper .stats-table td {
    padding: 0.03rem 0.03rem;
	font-size: 0.4rem;
  }
  .nickname-cell td {
    padding: 0.02rem 0.02rem;
	font-size: 0.4rem;
  }  
  .player-link .nickname {
    font-size: 0.6em;
  }
  .wn8-cell {
    font-size: 0.6 !important;
  }
    #player-name {
  font-size: 20px;
  font-weight: bold;
  color: #fff;
}
}

/* 3) Ab 500px Breite noch kompakter */
@media (max-width: 480px) {
  /* Kopf- und Zellen-Styling bleibt so, wie du es hast */
  .table-wrapper .stats-table thead th {
    font-size: 0.4rem;
    padding: 0.01rem 0.01rem;
}
  .table-wrapper .stats-table td {
    padding: 0.01rem 0.01rem;
    font-size: 0.4rem;
}
  .pr-cell, .winrate-cell, .tier-cell, .server-cell, .battles-cell {
  font-size: 0.5rem !important;
}
  .nickname-cell{
  font-size: 0.5rem !important;
}
  .wn8-cell {
    font-size: 0.5rem !important;
}
  .break-20ch {
  max-width: 20ch;
  overflow-wrap: break-word;
  word-break: break-all;
}
}
/* Weißer Rahmen nur ab der 2. Spalte in der Winrate-Zeile */
.stats-table tr.row-winrate td:not(:first-child) {
  border: 1px solid #ffffff !important;
}
/* Weißer Rahmen nur ab der 2. Spalte in der WN8-Zeile */
.stats-table tr.row-wn8 td:not(:first-child) {
  border: 1px solid #ffffff !important;
}
#openCardsBtn {
      padding: 0.6em 1.2em;
      font-size: 1rem;
      background: #3498db;
      color: #fff;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      transition: background 0.2s;
    }
    #openCardsBtn:hover {
      background: #2980b9;
    }
	
	
/* ---------------------- */
/* 1. Light-Mode Overrides */
/* ---------------------- */
html[data-theme="light"] .stats-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #ffffff !important;       /* heller Hintergrund */
  color: #0b263b !important;            /* dunkles Marineblau */
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .stats-table thead th {
  background: #f3f4f6 !important;
  color: #0b263b !important;            /* Marineblau im Header */
  padding: 10px 6px !important;
  border-bottom: 2px solid #e5e7eb !important;
}

html[data-theme="light"] .stats-table tbody td {
  padding: 6px 6px !important;
  border-bottom: 1px solid #e5e7eb !important;
  text-align: center !important;
  color: #0b263b !important;            /* Marineblau für alle Zellen */
}

html[data-theme="light"] .stats-table tbody tr:nth-child(even) {
  background: #f9fafb !important;
}

html[data-theme="light"] .stats-table tbody tr:nth-child(odd) {
  background: #ffffff !important;
}

html[data-theme="light"] .stats-table tbody tr:hover {
  background: #e5e7eb !important;
  color: #0b263b !important;
}

/* Spezielle Zellen im Light-Mode */
html[data-theme="light"] .stats-table .pr-cell,
html[data-theme="light"] .stats-table .winrate-cell,
html[data-theme="light"] .stats-table .tier-cell,
html[data-theme="light"] .stats-table .battles-cell {
  color: #0b263b !important;            /* dunkles Marineblau */

  box-shadow: none !important;
}

/* Tooltips und Links im Light-Mode */
html[data-theme="light"] .stats-table .tooltip-content a {
  color: #0b263b !important;
}

/* ---------------------- */
/* 2. Dark-Mode Overrides  */
/* ---------------------- */
html[data-theme="dark"] .stats-table {
  background: #17324c;
  color: #fff;
  box-shadow: 0 2px 12px rgba(16,42,67,0.10);
}

html[data-theme="dark"] .stats-table thead th {
  background: #204060;
  color: #fff;
  border-bottom: 2px solid #102a43;
}

html[data-theme="dark"] .stats-table tbody td {
  border-bottom: 1px solid #1c2e4a;
  color: #fff;
}

html[data-theme="dark"] .stats-table tbody tr:nth-child(even) {
  background: #1c2e4a;
}

html[data-theme="dark"] .stats-table tbody tr:nth-child(odd) {
  background: #17324c;
}

html[data-theme="dark"] .stats-table tbody tr:hover {
  background: #243f5e;
  color: #000 !important;
}

/* Spezielle Zellen im Dark-Mode */
html[data-theme="dark"] .stats-table .pr-cell,
html[data-theme="dark"] .stats-table .winrate-cell,
html[data-theme="dark"] .stats-table .tier-cell,
html[data-theme="dark"] .stats-table .battles-cell {
  color: #c6d8f2 !important;
}

/* Tooltips und Links im Dark-Mode */
html[data-theme="dark"] .stats-table .tooltip-content a {
  color: #80bfff;
}

/* Nur Nicht-Winrate/WN8/PR-Zellen transparent halten */
html[data-theme="light"] .stats-table tbody td:not(.winrate):not(.wn8) {
  background: transparent !important;
}

html[data-theme="light"] .stats-table tbody td.winrate,
html[data-theme="light"] .stats-table tbody td.wn8 {
  color: #fff !important;
  /* background bleibt per JS/inline-Style */
}

/* 1) Nicknames in Tables im Light-Mode dunkel und ohne Glow */
html[data-theme="light"] .stats-table .player-link {
  color: #0b263b !important;
  text-shadow: none !important;
}


html[data-theme="light"] .custom-sort-table.color-schema-table td[style*="background-color"] {
  color: #fff !important;
}

html[data-theme="light"] .stats-table tbody td:not(.winrate):not(.wn8) {
  background-color: transparent !important;
}

/* Light-Mode: Clan-Header anpassen */
html[data-theme="light"] .clan-header h1 {
  /* Dunkles Marineblau statt Weiß */
  color: #0b263b !important;
}

html[data-theme="light"] .clan-header span {
  /* Leicht helleres Grau statt #c9d7ea */
  color: #6b7a8f !important;
}

/* Optional: Text unter dem Header (Server/Mitglieder) */
html[data-theme="light"] .clan-header + div {
  /* Etwas dunkleres Grau */
  color: #4a5a6b !important;
}
/* Stylisches Hover für Spieler-Nicknames in der Clan-Tabelle */
.stats-table.color-schema-table .player-link {
  position: relative;
  color: inherit;                /* behält die normale Farbe */
  text-decoration: none;
  transition: color 0.3s ease;
}

.stats-table.color-schema-table .player-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;         /* knapp unterhalb der Schrift */
  height: 2px;
  width: 0;
  background: currentColor;      /* nutzt die Textfarbe */
  transition: width 0.3s ease;
}

.stats-table.color-schema-table .player-link:hover::after {
  width: 100%;
}
.stats-table.color-schema-table .player-link:hover {
  color: #4DB8FF !important;  /* helleres Blau */
}

.stats-table.color-schema-table .player-link:hover::after {
  background: currentColor;   /* bleibt synchron zur Textfarbe */
}

/* === Serverstats-Tabellen-Optimierung === */
.serverstats-table {
  width: 90%;
  margin: 0.5em auto 2em auto;
  border-collapse: collapse;
  table-layout: fixed;
  text-align: center;
}

/* Header-Zellen */
.serverstats-table th {
  padding: 0.6em 0.8em;
  background-color: #f3f4f6;
  color: #0b263b;
  font-weight: 600;
  border-bottom: 2px solid #e5e7eb;
}

/* Daten-Zellen */
.serverstats-table td {
  padding: 0.5em 0.8em;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Feste Spaltenbreiten */
.serverstats-table th:nth-child(1),
.serverstats-table td:nth-child(1) { width: 5%; }
.serverstats-table th:nth-child(2),
.serverstats-table td:nth-child(2) { width: 45%; }
.serverstats-table th:nth-child(3),
.serverstats-table td:nth-child(3),
.serverstats-table th:nth-child(4),
.serverstats-table td:nth-child(4) { width: 15%; }
.serverstats-table th:nth-child(5),
.serverstats-table td:nth-child(5) { width: 20%; }

/* Hover-Effekt */
.serverstats-table tbody tr:hover {
  background-color: rgba(11, 38, 59, 0.1);
}

/* Responsive: ab 800px */
@media (max-width: 800px) {
  .serverstats-table {
    width: 100%;
    font-size: 0.9rem;
  }
  .serverstats-table th,
  .serverstats-table td {
    padding: 0.4em 0.5em;
  }
}

/* Responsive: ab 500px */
@media (max-width: 500px) {
  .serverstats-table {
    font-size: 0.8rem;
  }
  .serverstats-table th,
  .serverstats-table td {
    padding: 0.3em 0.4em;
  }
}
/* Light-Mode: alle Texte in der Serverstats-Tabelle marinblau */
html[data-theme="light"] .serverstats-table,
html[data-theme="light"] .serverstats-table th,
html[data-theme="light"] .serverstats-table td {
  color: #0b263b !important;
}

/* ===== Layout ===== */
.ship-page {
  background: var(--bg-page);
  color: var(--fg-text);
  padding: 2rem 1rem;
  max-width: 900px;
  margin: auto;
}

/* A) Header-Karte */
.ship-card {
  background: var(--accent);
  color: var(--bg-card);
  padding: 1.5rem;
  text-align: center;
  border-radius: 0 0 1rem 1rem;
  box-shadow: 0 4px 8px var(--shadow);
}
.ship-card h1 { margin: 0 0 0.5rem; font-size: 2rem; }
.ship-card p  { margin: 0; font-size: 1rem; }

/* B) Detail-Grid */
.ship-details dl {
  display: grid;
  grid-template-columns: 1fr 2fr;
  row-gap: 0.75rem;
  column-gap: 1rem;
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 2px 6px var(--shadow);
  margin-top: -1rem;
}
.ship-details dt {
  font-weight: 600;
  color: var(--fg-text);
  text-transform: capitalize;
}
.ship-details dd {
  margin: 0;
  color: var(--fg-muted);
}

/* C) Toggle-Sektionen */
.ship-extra {
  margin-top: 1.5rem;
}
.toggle-btn {
  display: block;
  width: 100%;
  background: var(--accent);
  color: var(--bg-card);
  border: none;
  padding: 0.75rem;
  margin-bottom: 0.25rem;
  text-align: left;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background .2s;
}
.toggle-btn:hover {
  background: var(--accent-hover);
}
.toggle-content {
  display: none;
  background: var(--bg-card);
  color: var(--fg-text);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px var(--shadow);
  overflow-x: auto;
}
.toggle-content img {
  max-width: 100px;
  margin-right: 0.5rem;
  vertical-align: middle;
}

        .btn-download {
		display: inline-flex;
          display: inline-block;
          margin-top: 20px;
          padding: 12px 24px;
          background: linear-gradient(135deg, #1a73e8, #155ab6);
          color: #fff;
          text-decoration: none;
          font-size: 16px;
          font-weight: bold;
          border-radius: 8px;
          box-shadow: 0 4px 12px rgba(0,0,0,0.15);
          transition: transform 0.1s ease-in-out, box-shadow 0.1s;
        }
        .btn-download:hover {
          background: linear-gradient(135deg, #155ab6, #1a73e8);
          box-shadow: 0 6px 16px rgba(0,0,0,0.2);
        }

/* nur für unsere WN8-Farbschema-Tabelle */
.wn8-schema td.col-winrate,
.wn8-schema td.col-wn8 {
  font-weight: 800; /* fett = bold */
  font-size: 1.6rem;
}
/* Responsive: ab 600px */
@media (max-width: 600px) {
    font-size: 0.8rem;
	.wn8-schema td.col-winrate,
.wn8-schema td.col-wn8 {
  font-weight: 800; /* fett = bold */
  font-size: 0.7rem;
}
}
.top-stats-heading {
    text-align: center;
    color: #102a43; /* Light Mode: Marineblau */
    font-weight: bold;
    font-size: 1.6rem;
    margin-bottom: 10px;
    margin-top: 30px;
}
/* Dark Mode mit data-theme-Attribut */
html[data-theme="dark"] .top-stats-heading {
    color: #cfe8ff; /* Hellblau für dunklen Hintergrund */
}