/* =============================================================================
   GLOBAL CSS - Card Game
   Zentrale Stylesheet-Sammlung fuer die gesamte Anwendung.
   Eingebunden ueber game/head.php
   ============================================================================= */

/* =============================================================================
   1. RESET & BASE
   ============================================================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #dee2e6;
    background-color: #121212;
}

/* Smooth transitions fuer Theme-Wechsel */
html, body, #content, .section-container,
.card-thumbnail, .card-landscape, .card-portrait, .card-placeholder,
.modal-content, .dropdown-menu-dark, .navbar, .bg-dark, footer {
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

/* =============================================================================
   2. TYPOGRAPHY
   ============================================================================= */
a, a:link, a:visited {
    color: #79b8ff;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #58a6ff;
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    color: #dee2e6;
}

/* Legacy Textklassen (Abwaertskompatibilitaet) */
.norm, .norm1, .normg, .norm2, .norm2r, .normres, .normres1,
.normb, .normc, .normr, .normbr, .normbc {
    color: #dee2e6;
    font-size: 0.8rem;
}

.ueber1, .name, .nick {
    font-weight: 600;
    font-size: 0.9rem;
}

table {
    font-size: 0.8rem;
    color: #dee2e6;
}

/* =============================================================================
   3. LAYOUT
   ============================================================================= */

/* Standard-Container mit max-width */
.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

@media (min-width: 992px) {
    .page-container {
        padding: 1rem 1.5rem;
    }
}

/* Legacy Content-Container */
#content {
    background-color: rgba(0, 0, 0, 0.85);
    padding: 20px;
    border-radius: 8px;
}

.section-container {
    margin: 20px auto;
    padding: 20px;
    max-width: 80%;
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.container-centered {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Legacy Wrapper (nur noch fuer alte Seiten) */
.wrapper.style2 { background: none; }

/* Clearfix */
.clearfix::after {
    content: "";
    display: block;
    clear: both;
}

/* =============================================================================
   4. NAVBAR
   ============================================================================= */
.navbar-game {
    background: linear-gradient(180deg, #1a1d23 0%, #212529 100%);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 0.4rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.navbar-game .navbar-brand {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-game .navbar-brand:hover {
    color: #79b8ff;
    text-decoration: none;
}

.navbar-game .nav-link {
    color: #adb5bd;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.navbar-game .nav-link:hover,
.navbar-game .nav-link:focus {
    color: #fff;
    background-color: rgba(255,255,255,0.08);
}

.navbar-game .nav-link.active,
.navbar-game .nav-item.active > .nav-link {
    color: #79b8ff;
}

.navbar-game .dropdown-menu {
    background-color: #2b3035;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    padding: 0.35rem 0;
    margin-top: 0.25rem;
}

.navbar-game .dropdown-item {
    color: #dee2e6;
    font-size: 0.85rem;
    padding: 0.45rem 1rem;
    transition: background-color 0.15s ease;
}

.navbar-game .dropdown-item:hover,
.navbar-game .dropdown-item:focus {
    background-color: rgba(255,255,255,0.08);
    color: #fff;
}

.navbar-game .dropdown-item i {
    width: 1.2rem;
    text-align: center;
    margin-right: 0.4rem;
    color: #6c757d;
}

.navbar-game .dropdown-item:hover i {
    color: #79b8ff;
}

.navbar-game .dropdown-divider {
    border-color: rgba(255,255,255,0.08);
}

.navbar-user-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.65rem;
    background: rgba(255,255,255,0.06);
    border-radius: 2rem;
    font-size: 0.8rem;
    color: #adb5bd;
    border: 1px solid rgba(255,255,255,0.08);
}

.navbar-user-badge i {
    color: #6c757d;
}

/* Theme Switcher Button */
.btn-theme-switch {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #adb5bd;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 2rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-theme-switch:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-color: rgba(255,255,255,0.2);
}

/* Navbar Toggler */
.navbar-game .navbar-toggler {
    border-color: rgba(255,255,255,0.15);
    padding: 0.25rem 0.5rem;
}

.navbar-game .navbar-toggler:focus {
    box-shadow: 0 0 0 0.15rem rgba(255,255,255,0.15);
}

/* =============================================================================
   5. FOOTER
   ============================================================================= */
.footer-game {
    background: linear-gradient(180deg, #212529 0%, #1a1d23 100%);
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 1.25rem 0;
    font-size: 0.8rem;
    color: #6c757d;
}

.footer-game a {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-game a:hover {
    color: #adb5bd;
    text-decoration: none;
}

.footer-game .footer-divider {
    color: rgba(255,255,255,0.15);
    margin: 0 0.5rem;
}

/* =============================================================================
   6. BUTTONS
   ============================================================================= */
.btn:disabled {
    cursor: not-allowed;
    filter: grayscale(70%);
    opacity: 0.65;
}

.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Legacy Custom Buttons */
.button-custom {
    display: inline-block;
    width: 100px;
    height: 35px;
    background-color: #333;
    color: #fff;
    font-weight: bold;
    text-align: center;
    line-height: 35px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.button-custom:hover {
    background-color: #555;
}

.button-custom.bootstrap-style {
    width: 176px;
}

/* Legacy Taskleiste */
.taskleiste, .divtask, .divlink {
    cursor: pointer;
}

.divlink:hover {
    color: #6b8e23;
    text-decoration: underline;
}

/* =============================================================================
   7. MODALS (Global)
   ============================================================================= */
.modal-backdrop {
    background-color: rgba(0,0,0,0.7) !important;
}

.modal-content.bg-dark {
    border-color: #495057 !important;
}

.modal-header.border-secondary,
.modal-footer.border-secondary {
    border-color: rgba(255,255,255,0.1) !important;
}

/* Legacy Modal Styles */
.close {
    color: #fff;
}

.close:hover {
    color: #ff4444;
}

/* Upload Modal */
#uploadModal .alert-info {
    font-size: 0.9rem;
    color: #cfe2ff;
    background-color: #084298;
    border-color: #084298;
}

/* =============================================================================
   8. CARD THUMBNAILS (Detail-Seite & Uebergreifend)
   ============================================================================= */
.card-thumbnail {
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 5px;
    margin: 3px;
    background-size: cover;
    background-position: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    position: relative;
}

.card-thumbnail:not(.drag-disabled):hover {
    transform: scale(1.08);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    z-index: 10;
    cursor: grab;
}

.card-thumbnail.dragging {
    cursor: grabbing;
    z-index: 100;
}

.card-landscape { width: 95px; height: 62px; }
.card-portrait  { width: 62px; height: 95px; }

.sortable-disabled .card-thumbnail,
.card-thumbnail.drag-disabled {
    cursor: not-allowed;
    opacity: 0.7;
    filter: grayscale(40%);
}

/* === Card Placeholders === */
.card-placeholder {
    background-color: rgba(255,255,255,0.03);
    color: #666;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px dashed #444;
    border-radius: 5px;
    margin: 3px;
    font-size: 11px;
    text-align: center;
}

.card-placeholder.drop-target {
    width: 80px;
    height: 100px;
}

.card-placeholder-highlight {
    background-color: rgba(0,255,0,0.08);
    border: 2px dashed #0f0;
    border-radius: 5px;
    margin: 3px;
}

.card-placeholder-highlight.card-landscape { width: 95px; height: 62px; }
.card-placeholder-highlight.card-portrait  { width: 62px; height: 95px; }

/* === Card Stats Overlay === */
.card-stat {
    position: absolute;
    padding: 1px 3px;
    font-size: 0.55rem;
    font-weight: bold;
    line-height: 1.2;
    border-radius: 3px;
    z-index: 4;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    pointer-events: none;
}

.card-stat-level {
    top: 2px; left: 2px;
    background: rgba(0,100,200,0.75);
    color: #fff;
}

.card-stat-wert {
    top: 2px; right: 2px;
    background: rgba(200,50,0,0.75);
    color: #fff;
}

/* === Faction Logo === */
.card-faction-logo {
    position: absolute;
    bottom: 2px; left: 2px;
    width: 16px; height: 16px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 1px 3px rgba(0,0,0,0.6);
    pointer-events: none;
    z-index: 4;
}

/* === Info Button === */
.card-info-button {
    position: absolute;
    bottom: 2px; right: 2px;
    padding: 2px 4px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border-radius: 50%;
    font-size: 0.65rem;
    line-height: 1;
    cursor: pointer;
    z-index: 5;
    transition: background 0.2s;
}

.card-info-button:hover {
    background: rgba(0,123,255,0.8);
}

.ui-sortable-handle .card-info-button {
    cursor: pointer !important;
}

/* =============================================================================
   9. DECK BUILDER (carddeck_detail.php spezifisch)
   ============================================================================= */
.bg-darker {
    background-color: rgba(0,0,0,0.2);
}

/* Dark-Mode Form Controls (Default = Dark) */
.form-control.bg-darker,
.form-select.bg-darker {
    background-color: #1a1d21 !important;
    color: #dee2e6 !important;
    border-color: #495057 !important;
}
.form-select.bg-darker option {
    background-color: #1a1d21;
    color: #dee2e6;
}
.form-control.bg-darker::placeholder {
    color: rgba(222, 226, 230, 0.5) !important;
}
.form-control.bg-darker:focus,
.form-select.bg-darker:focus {
    background-color: #1a1d21 !important;
    color: #dee2e6 !important;
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Light-Mode Override */
body.light-mode .form-control.bg-darker,
body.light-mode .form-select.bg-darker {
    background-color: #f8f9fa !important;
    color: #212529 !important;
    border-color: #ced4da !important;
}
body.light-mode .form-select.bg-darker option {
    background-color: #f8f9fa;
    color: #212529;
}
body.light-mode .form-control.bg-darker::placeholder {
    color: rgba(33, 37, 41, 0.5) !important;
}
body.light-mode .form-control.bg-darker:focus,
body.light-mode .form-select.bg-darker:focus {
    background-color: #ffffff !important;
    color: #212529 !important;
    border-color: #0d6efd !important;
}

/* Rules */
.rule-list { font-size: 0.8rem; }
.rule-list li { padding: 1px 0; }
.rule-list i.fa-fw { margin-right: 4px; }

/* Card Info Modal */
.card-description-scrollable {
    max-height: 130px;
    overflow-y: auto;
    font-size: 0.85em;
}

#cardInfoModal .modal-lg {
    max-width: 680px;
}

/* Tabs / Pills */
.nav-pills .nav-link {
    color: #adb5bd;
    border-radius: 0.375rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.nav-pills .nav-link.active {
    background-color: #0d6efd;
    color: #fff;
}

.nav-pills .nav-link:not(.active):hover {
    color: #fff;
    background-color: rgba(255,255,255,0.1);
}

/* Filter Controls */
.filter-sort-controls {
    background-color: rgba(255,255,255,0.04);
}

.filter-sort-controls .form-select-sm,
.filter-sort-controls .form-control-sm {
    font-size: 0.72rem;
    padding: 0.15rem 0.35rem;
}

/* Progress Bar */
.progress {
    background-color: rgba(255,255,255,0.1);
    border-radius: 0.375rem;
}

.progress-bar strong {
    font-size: 0.75rem;
}

/* =============================================================================
   10. DECK OVERVIEW (carddeck.php spezifisch)
   ============================================================================= */
.deck-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    overflow: hidden;
}

.deck-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    border-color: #6c757d !important;
}

.deck-card-header {
    transition: transform 0.3s ease;
    position: relative;
}

.deck-card:hover .deck-card-header {
    transform: scale(1.03);
}

.deck-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.05) 50%, rgba(0,0,0,0.4) 100%);
    border-radius: 0.375rem 0.375rem 0 0;
}

.deck-name-link:hover {
    text-decoration: underline !important;
    color: #79b8ff !important;
}

.deck-game-ready {
    border-color: rgba(25, 135, 84, 0.5) !important;
}

.deck-game-ready .deck-card-overlay {
    background: linear-gradient(to bottom, rgba(25, 135, 84, 0.15) 0%, rgba(0,0,0,0.05) 50%, rgba(0,0,0,0.4) 100%);
}

/* =============================================================================
   11. BATTLEGRID (Spielfeld)
   ============================================================================= */
.battlegrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 8px;
}

/* =============================================================================
   11b. PLAY DASHBOARD
   ============================================================================= */

/* Statistik-Kacheln */
.dash-stat-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.dash-stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.15);
}

.dash-stat-icon {
    font-size: 1.25rem;
    margin-bottom: 0.4rem;
    opacity: 0.8;
}

.dash-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.dash-stat-label {
    font-size: 0.7rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.2rem;
}

/* Aktive Spiele Card */
.active-game-card {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.active-game-card:hover {
    border-color: #6c757d !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.active-game-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.active-game-status-dot.pulse {
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.5); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(25, 135, 84, 0); }
}

/* Offene Spiele Cards */
.open-game-card {
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.open-game-card:hover {
    transform: translateY(-2px);
    border-color: #0d6efd !important;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
}

/* Freunde-Liste Status-Dot */
.friend-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

/* =============================================================================
   11c. FRIENDS PAGE
   ============================================================================= */

/* Freunde-Karten */
.friend-card {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.friend-card:hover {
    border-color: #6c757d !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.friend-avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Anfrage-Karten */
.friend-request-card {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.friend-request-card:hover {
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.15);
}

/* Tabs Styling */
#friendsTabs .nav-link {
    color: #adb5bd;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

#friendsTabs .nav-link.active {
    background-color: #0d6efd;
    color: #fff;
}

#friendsTabs .nav-link:not(.active):hover {
    color: #fff;
    background-color: rgba(255,255,255,0.08);
}

/* Suche Input Styling */
.search-input {
    background-color: #212529;
    color: #dee2e6;
    border-color: #495057;
}

.search-input::placeholder {
    color: #6c757d;
}

.search-input:focus {
    background-color: #212529;
    color: #dee2e6;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    border-color: #0d6efd;
}

.search-input-icon {
    background-color: #212529;
    border-color: #495057;
    color: #6c757d;
}

/* Suchergebnis Karten */
.search-result-card {
    transition: border-color 0.2s ease;
}

.search-result-card:hover {
    border-color: #6c757d !important;
}

.search-result-name {
    color: #dee2e6;
}

/* Light Mode: Friends */
body.light-mode .friend-card:hover {
    border-color: #adb5bd !important;
}

body.light-mode .friend-request-card:hover {
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.1);
}

body.light-mode #friendsTabs .nav-link {
    color: #495057;
}

body.light-mode #friendsTabs .nav-link:not(.active):hover {
    color: #1a1a2e;
    background-color: rgba(0,0,0,0.04);
}

body.light-mode .search-input {
    background-color: #fff;
    color: #1a1a2e;
    border-color: #dee2e6;
}

body.light-mode .search-input:focus {
    background-color: #fff;
    color: #1a1a2e;
}

body.light-mode .search-input-icon {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #495057;
}

body.light-mode .search-result-card:hover {
    border-color: #adb5bd !important;
}

body.light-mode .search-result-name {
    color: #1a1a2e;
}

/* =============================================================================
   11d. MESSENGER
   ============================================================================= */

/* Container */
.messenger-container {
    border: 1px solid #2d2d2d;
    border-radius: 8px;
    overflow: hidden;
    height: calc(100vh - 250px);
    min-height: 400px;
    display: flex;
}

/* Sidebar */
.messenger-sidebar {
    width: 33.33%;
    min-width: 250px;
    max-width: 350px;
    background-color: #1a1a2e;
    border-right: 1px solid #2d2d2d;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.messenger-sidebar-header {
    padding: 12px;
    border-bottom: 1px solid #2d2d2d;
    flex-shrink: 0;
}

.messenger-conv-list {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.messenger-conv-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background-color 0.15s ease;
}

.messenger-conv-item:hover {
    background-color: rgba(255,255,255,0.06);
}

.messenger-conv-item.active {
    background-color: rgba(13, 110, 253, 0.15);
    border-left: 3px solid #0d6efd;
}

.conv-preview {
    font-size: 0.78rem;
    max-width: 180px;
}

/* Chat Bereich */
.messenger-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #121216;
    overflow: hidden;
    min-height: 0;
    min-width: 0;
}

.messenger-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.messenger-chat-header {
    padding: 10px 16px;
    border-bottom: 1px solid #2d2d2d;
    background-color: #1a1a2e;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

/* Messages Area */
.messenger-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

/* Message Bubbles */
.msg-bubble {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 12px;
    word-wrap: break-word;
    position: relative;
}

.msg-sent {
    align-self: flex-start;
    background-color: #2d2d3a;
    color: #dee2e6;
    border-bottom-left-radius: 4px;
}

.msg-received {
    align-self: flex-end;
    background-color: #0d6efd;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.msg-text {
    font-size: 0.88rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

.msg-meta {
    font-size: 0.68rem;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

.msg-meta .msg-action {
    opacity: 0;
    transition: opacity 0.15s ease;
    margin-left: 4px;
    font-size: 0.65rem;
}

.msg-bubble:hover .msg-action {
    opacity: 0.7;
}

.msg-bubble:hover .msg-action:hover {
    opacity: 1;
}

/* Chat Input */
.messenger-input {
    padding: 12px 16px;
    border-top: 1px solid #2d2d2d;
    background-color: #1a1a2e;
    flex-shrink: 0;
}

/* Min-Width Utility */
.min-width-0 {
    min-width: 0;
}

/* Unread Badge in Navbar */
.navbar-msg-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.55rem;
    padding: 2px 5px;
    border-radius: 50%;
}

/* Light Mode: Messenger */
body.light-mode .messenger-container {
    border-color: #dee2e6;
}

body.light-mode .messenger-sidebar {
    background-color: #f8f9fa;
    border-right-color: #dee2e6;
}

body.light-mode .messenger-sidebar-header {
    border-bottom-color: #dee2e6;
}

body.light-mode .messenger-conv-item {
    border-bottom-color: rgba(0,0,0,0.05);
}

body.light-mode .messenger-conv-item:hover {
    background-color: rgba(0,0,0,0.04);
}

body.light-mode .messenger-conv-item.active {
    background-color: rgba(13, 110, 253, 0.08);
}

body.light-mode .messenger-conv-item strong,
body.light-mode .messenger-conv-item .conv-preview {
    color: #1a1a2e !important;
}

body.light-mode .messenger-chat {
    background-color: #fff;
}

body.light-mode .messenger-chat-header {
    background-color: #f8f9fa;
    border-bottom-color: #dee2e6;
    color: #1a1a2e;
}

body.light-mode .messenger-chat-header strong {
    color: #1a1a2e !important;
}

body.light-mode .messenger-input {
    background-color: #f8f9fa;
    border-top-color: #dee2e6;
}

body.light-mode .msg-sent {
    background-color: #e9ecef;
    color: #1a1a2e;
}

body.light-mode .messenger-empty p {
    color: #6c757d !important;
}

/* Responsive: Mobile */
@media (max-width: 767.98px) {
    .messenger-container {
        height: calc(100vh - 200px);
        min-height: 350px;
        flex-direction: column;
    }

    .messenger-sidebar {
        width: 100%;
        min-width: unset;
        max-width: unset;
        border-right: none;
        flex: 1;
        min-height: 0;
    }

    .messenger-chat {
        display: none;
        width: 100%;
    }

    /* Mobile: Chat aktiv → Sidebar ausblenden, Chat einblenden */
    .messenger-sidebar.sidebar-hidden {
        display: none;
    }

    .messenger-chat.chat-visible {
        display: flex;
        flex: 1;
    }

    .msg-bubble {
        max-width: 85%;
    }
}

/* =============================================================================
   12. UTILITY CLASSES
   ============================================================================= */
.text-muted {
    color: #6c757d !important;
}

hr {
    border-color: rgba(255,255,255,0.15) !important;
}

/* List Group Hover (Dark Theme) */
.list-group-item-action:hover,
.list-group-item-action:focus {
    background-color: rgba(255,255,255,0.08) !important;
    color: #fff !important;
}

/* =============================================================================
   13. RESPONSIVE BREAKPOINTS
   ============================================================================= */
@media (max-width: 767.98px) {
    .card-landscape { width: 80px; height: 52px; }
    .card-portrait  { width: 52px; height: 80px; }
    .card-placeholder.drop-target { width: 60px; height: 80px; }
    .card-placeholder-highlight.card-landscape { width: 80px; height: 52px; }
    .card-placeholder-highlight.card-portrait  { width: 52px; height: 80px; }
    .nav-pills .nav-link { font-size: 0.75rem; padding: 0.3rem 0.5rem; }
    .collapse-toggle-btn { font-size: 0.75rem; }
}

@media (max-width: 575.98px) {
    .card-landscape { width: 70px; height: 46px; }
    .card-portrait  { width: 46px; height: 70px; }
    .card-thumbnail { margin: 2px; }

    /* Deck Overview Cards */
    .deck-card-header { height: 100px !important; }
    .deck-card .card-body { padding: 0.4rem 0.6rem !important; }
    .deck-card .card-footer { padding: 0.3rem 0.6rem !important; }
    .deck-card .card-title { font-size: 0.9rem; }
}

/* =============================================================================
   14. LIGHT MODE
   ============================================================================= */
body.light-mode {
    background: #f0f2f5;
    color: #1a1a2e;
}

body.light-mode h1,
body.light-mode h2,
body.light-mode h3,
body.light-mode h4,
body.light-mode h5,
body.light-mode h6 {
    color: #1a1a2e;
}

body.light-mode .norm, body.light-mode .norm1, body.light-mode .normg,
body.light-mode .norm2, body.light-mode .norm2r, body.light-mode .normres,
body.light-mode .normres1, body.light-mode .normb, body.light-mode .normc,
body.light-mode .normr, body.light-mode .normbr, body.light-mode .normbc {
    color: #495057;
}

body.light-mode a,
body.light-mode a:link,
body.light-mode a:visited {
    color: #003366;
}

body.light-mode a:hover {
    color: #00264d;
}

body.light-mode #content,
body.light-mode .section-container,
body.light-mode .card-container {
    background-color: rgba(255, 255, 255, 0.9);
    color: #1a1a2e;
}

body.light-mode .card-thumbnail,
body.light-mode .card-landscape,
body.light-mode .card-portrait,
body.light-mode .card-placeholder {
    background-color: rgba(0, 0, 0, 0.03);
    border-color: #ddd;
}

body.light-mode .card-placeholder:hover {
    background-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .modal-content {
    background-color: #fff;
    color: #1a1a2e;
}

body.light-mode .modal-header,
body.light-mode .modal-footer {
    border-color: #dee2e6;
}

/* Light Mode: Navbar */
body.light-mode .navbar-game {
    background: linear-gradient(180deg, #fff 0%, #f8f9fa 100%);
    border-bottom-color: #dee2e6;
}

body.light-mode .navbar-game .navbar-brand {
    color: #1a1a2e;
}

body.light-mode .navbar-game .nav-link {
    color: #495057;
}

body.light-mode .navbar-game .nav-link:hover {
    color: #0066cc;
    background-color: rgba(0,0,0,0.04);
}

body.light-mode .navbar-game .dropdown-menu {
    background-color: #fff;
    border-color: #dee2e6;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

body.light-mode .navbar-game .dropdown-item {
    color: #495057;
}

body.light-mode .navbar-game .dropdown-item:hover {
    background-color: #f8f9fa;
    color: #0066cc;
}

body.light-mode .navbar-user-badge {
    background: rgba(0,0,0,0.04);
    border-color: #dee2e6;
    color: #495057;
}

body.light-mode .btn-theme-switch {
    background: rgba(0,0,0,0.04);
    border-color: #dee2e6;
    color: #495057;
}

body.light-mode .btn-theme-switch:hover {
    background: rgba(0,0,0,0.08);
    color: #1a1a2e;
}

/* Light Mode: Footer */
body.light-mode .footer-game {
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    border-top-color: #dee2e6;
    color: #6c757d;
}

body.light-mode .footer-game a {
    color: #6c757d;
}

body.light-mode .footer-game a:hover {
    color: #495057;
}

/* Light Mode: Bootstrap overrides */
body.light-mode .bg-dark {
    background-color: #f8f9fa !important;
}

body.light-mode .text-white {
    color: #1a1a2e !important;
}

body.light-mode .text-light {
    color: #495057 !important;
}

body.light-mode .text-white-50 {
    color: rgba(0,0,0,0.6) !important;
}

body.light-mode .border-secondary {
    border-color: #dee2e6 !important;
}

body.light-mode .card.bg-dark {
    background-color: #fff !important;
    border-color: #dee2e6 !important;
    color: #1a1a2e !important;
}

body.light-mode .card.bg-dark h1,
body.light-mode .card.bg-dark h2,
body.light-mode .card.bg-dark h3,
body.light-mode .card.bg-dark h4,
body.light-mode .card.bg-dark h5,
body.light-mode .card.bg-dark h6,
body.light-mode .card.bg-dark p,
body.light-mode .card.bg-dark .small,
body.light-mode .card.bg-dark small,
body.light-mode .card.bg-dark span:not(.badge),
body.light-mode .card.bg-dark label,
body.light-mode .card.bg-dark .card-body {
    color: #1a1a2e !important;
}

body.light-mode .list-group-item.bg-dark {
    background-color: #fff !important;
    color: #1a1a2e !important;
}

body.light-mode .list-group-item.bg-dark span:not(.badge),
body.light-mode .list-group-item.bg-dark small,
body.light-mode .list-group-item.bg-dark h6,
body.light-mode .list-group-item.bg-dark a:not(.btn) {
    color: #1a1a2e !important;
}

body.light-mode .modal-content.bg-dark {
    background-color: #fff !important;
    color: #1a1a2e !important;
}

body.light-mode .modal-content.bg-dark h1,
body.light-mode .modal-content.bg-dark h2,
body.light-mode .modal-content.bg-dark h3,
body.light-mode .modal-content.bg-dark h4,
body.light-mode .modal-content.bg-dark h5,
body.light-mode .modal-content.bg-dark h6,
body.light-mode .modal-content.bg-dark p,
body.light-mode .modal-content.bg-dark strong {
    color: #1a1a2e !important;
}

body.light-mode .deck-card:hover {
    border-color: #adb5bd !important;
}

body.light-mode .deck-card-overlay {
    background: linear-gradient(to bottom, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(0,0,0,0.2) 100%);
}

body.light-mode .deck-card .card-body .deck-name-link {
    color: #003366 !important;
}

body.light-mode .deck-name-link:hover {
    color: #00264d !important;
}

body.light-mode .deck-card .card-body .text-white-50 {
    color: #6c757d !important;
}

body.light-mode .deck-card .card-footer {
    border-color: #dee2e6 !important;
}

body.light-mode .deck-card .btn-outline-warning {
    color: #997404;
    border-color: #997404;
}

body.light-mode .deck-card .btn-outline-warning:hover {
    background-color: #997404;
    color: #fff;
}

body.light-mode .deck-card .btn-outline-danger {
    color: #b02a37;
    border-color: #b02a37;
}

body.light-mode .deck-card .btn-outline-danger:hover {
    background-color: #b02a37;
    color: #fff;
}

body.light-mode .deck-card .btn-outline-warning:disabled,
body.light-mode .deck-card .btn-outline-danger:disabled {
    opacity: 0.4;
}

body.light-mode .badge.bg-dark {
    background-color: #e9ecef !important;
    color: #1a1a2e !important;
}

/* Light Mode: Dashboard Stat Cards */
body.light-mode .dash-stat-card {
    background: rgba(0,0,0,0.03);
    border-color: #dee2e6;
}

body.light-mode .dash-stat-card:hover {
    border-color: #adb5bd;
}

body.light-mode .open-game-card:hover {
    border-color: #0d6efd !important;
}

/* Light Mode: Dash-Stat-Card Text */
body.light-mode .dash-stat-card {
    color: #1a1a2e;
}
body.light-mode .dash-stat-label {
    color: #495057;
}

/* Light Mode: Form-Controls in Cards/Modals */
body.light-mode .card.bg-dark .form-control,
body.light-mode .card.bg-dark .form-select,
body.light-mode .modal-content.bg-dark .form-control,
body.light-mode .modal-content.bg-dark .form-select {
    background-color: #f8f9fa !important;
    color: #1a1a2e !important;
    border-color: #ced4da !important;
}
body.light-mode .card.bg-dark .form-control:focus,
body.light-mode .card.bg-dark .form-select:focus,
body.light-mode .modal-content.bg-dark .form-control:focus,
body.light-mode .modal-content.bg-dark .form-select:focus {
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15) !important;
}
body.light-mode .card.bg-dark .form-control::placeholder {
    color: #6c757d !important;
}

/* Light Mode: Inline styled elements (color in style attr) */
body.light-mode .card.bg-dark .form-label,
body.light-mode .modal-content.bg-dark .form-label,
body.light-mode .modal-content.bg-dark label {
    color: #495057 !important;
}

/* Light Mode: btn-close sichtbar machen */
body.light-mode .btn-close-white {
    filter: none !important;
}
