:root { 
    --steam-blue: #1b2838; 
    --steam-dark: #171a21; 
    --text-grey: #c6d4df; 
    --steam-green: #90ba3c; 
    --steam-light-blue: #66c0f4; 
}

* { box-sizing: border-box; }

body { 
    background: var(--steam-dark); 
    color: white; 
    font-family: 'Segoe UI', sans-serif; 
    margin: 0; 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
}

.container { max-width: 1400px; margin: 0 auto; padding: 20px 15px; flex: 1; width: 100%; }

.header-area { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; gap: 10px; flex-wrap: wrap; }
h1 { font-size: 1.6rem; color: var(--steam-light-blue); margin: 0; }

.controls-group { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ui-btn { background: var(--steam-blue); border: 1px solid #2a475e; color: white; padding: 8px 12px; border-radius: 4px; cursor: pointer; font-size: 0.8rem; outline: none; transition: 0.2s; display: flex; align-items: center; justify-content: center; }
.ui-btn:hover { border-color: var(--steam-light-blue); background: #2a475e; }
.ui-btn:disabled { opacity: 0.5; cursor: not-allowed; }

#refresh-btn { min-width: 40px; font-size: 1.1rem; }
.spin { animation: steam-spin 0.8s ease-in-out; }
@keyframes steam-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.admin-controls { display: flex; gap: 10px; background: var(--steam-blue); padding: 15px; border-radius: 4px; border: 1px solid #2a475e; margin-bottom: 25px; }
.admin-controls input { flex: 1; padding: 10px; background: #101216; border: 1px solid #2a475e; color: white; border-radius: 4px; outline: none; }
.admin-controls button { padding: 10px 20px; background: var(--steam-green); border: none; color: white; font-weight: bold; cursor: pointer; border-radius: 4px; transition: 0.2s; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 15px; align-items: stretch; }


/* --- Listenansicht --- */
/* --- Optimierte Listenansicht (Display-Contents Version) --- */
.list-view { 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
}

.list-view .card { 
    flex-direction: row; 
    align-items: center; 
    padding: 10px 20px; 
    height: 90px; 
    gap: 25px;
    position: relative;
}

.list-view .game-banner { 
    width: 140px; 
    height: 65px; 
    object-fit: cover; 
    border-radius: 4px; 
    flex-shrink: 0; 
}

/* Der Card-Body ordnet seine Kinder (Titel + Stats-Box-Inhalt) horizontal an */
.list-view .card-body {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-grow: 1;
    gap: 30px;
}

.list-view .game-title { 
    width: 200px; 
    text-align: left; 
    flex-shrink: 0;
}

/* WICHTIG: Die Stats-Box wird als Container ignoriert, damit ihre Kinder 
   (Player-Info & Owner-Column) direkt im Card-Body Layout mitwirken */
.list-view .stats-box { 
    display: contents; 
}

/* Die Besitzer-Spalte rückt in die Mitte */
.list-view .owner-column {
    flex-grow: 1;
    display: flex;
    align-items: center;
    order: 2; /* Positioniert sie visuell nach dem Titel */
}

/* Spieler-Info nach rechts */
.list-view .player-info { 
    display: flex; 
    flex-direction: column; 
    align-items: flex-end; 
    min-width: 100px;
    margin-left: auto;
    order: 3;
}

.list-view .player-count { 
    font-size: 1.2rem;
    color: var(--steam-green);
}

.list-view .owner-count-info {
    border-top: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.list-view .owner-count-info div:first-child {
    margin-bottom: 2px !important; /* Weniger Abstand zum Bild in der Liste */
    font-size: 0.6rem !important;
}

/* Optionen-Button am Rand */
.list-view .game-options-container {
    position: static;
    order: 4;
}

/* Diagramm in Liste ausblenden */
.list-view .chart-wrapper { 
    display: none !important; 
}

.list-view .guild-badge { 
    top: 5px; left: 5px; 
}

/* --- Card Styling --- */
.card { 
    background: var(--steam-blue); 
    border: 1px solid #2a475e; 
    border-radius: 4px; 
    position: relative; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    height: 100%; /* Sicherstellen, dass die Karte die volle Grid-Höhe nutzt */
}
.card.active-guild { border: 2px solid var(--steam-green); }
.guild-badge { position: absolute; top: 8px; left: 8px; background: var(--steam-green); color: var(--steam-dark); font-size: 0.6rem; font-weight: bold; padding: 2px 6px; border-radius: 3px; z-index: 5; }

.game-banner { width: 100%; aspect-ratio: 460/215; object-fit: cover; }
.card-body { 
    padding: 5px 12px 12px 12px; 
    flex-grow: 1; 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    justify-content: space-between; /* Verteilt Titel oben und Stats unten gleichmäßig */
}
.game-title { color: white; font-weight: bold; text-align: center; font-size: 0.85rem; }

.stats-box { 
    background: rgba(0,0,0,0.2); 
    border-radius: 4px; 
    padding: 6px; 
    flex-grow: 1; /* Box füllt den Platz im Card-Body aus */
    display: flex; 
    flex-direction: column; 
}
.player-info { display: flex; justify-content: space-between; align-items: center; }
.player-count { color: var(--steam-green); font-weight: bold; font-size: 1.1rem; }

.chart-wrapper { height: 60px; width: 100%; margin-top: 5px; }

.status-label { display: flex; align-items: center; gap: 8px; font-size: 0.6rem; color: var(--text-grey); font-weight: bold; }
.dot { height: 7px; width: 7px; background-color: var(--steam-green); border-radius: 50%; display: inline-block; position: relative; }
.dot::after { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--steam-green); border-radius: 50%; animation: pulse-ring 2s infinite; }
@keyframes pulse-ring { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(2.8); opacity: 0; } }

footer { background: #101216; color: var(--text-grey); padding: 25px 15px; border-top: 1px solid #2a475e; font-size: 0.75rem; display: flex; flex-direction: column; align-items: center; gap: 15px; }
.footer-blue { color: var(--steam-light-blue); font-weight: bold; }
.footer-time { color: var(--steam-green); font-weight: bold; }

@media (max-width: 1007px) {
    .list-view .card { flex-direction: column; height: auto; }
    .list-view .game-banner { width: 100%; margin: 0; }
}

/* --- ZENTRALES MODAL SYSTEM (Ohne Animation) --- */
.modal-system { 
    display: none; 
    position: fixed; 
    top: 0; left: 0; width: 100vw; height: 100vh; 
    background: rgba(0,0,0,0.85); 
    z-index: 2000; 
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
}

.modal-system .modal-content { 
    background: var(--steam-dark); 
    width: 90%; 
    max-width: 400px; 
    padding: 25px; 
    border-radius: 8px; 
    border: 1px solid var(--steam-light-blue); 
    text-align: center;
    box-shadow: 0 0 40px rgba(0,0,0,1);
    
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0; 

    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    color: white; font-size: 1.2rem; margin: 0 0 20px 0;
    border-bottom: 1px solid rgba(102, 192, 244, 0.2);
    padding-bottom: 10px;
}

#optionsModalBody { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }

.modal-opt-btn {
    width: 100%; padding: 14px; border: none; border-radius: 4px;
    font-weight: bold; cursor: pointer; font-size: 0.95rem; transition: 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 10px;
}

.focus-btn { background: var(--steam-blue); color: white; border: 1px solid #2a475e; }
.focus-btn:hover { background: #2a475e; border-color: var(--steam-light-blue); }

.delete-btn { background: #a52a2a; color: white; }
.delete-btn:hover { background: #ff4d4d; }

.close-modal { margin-top: 10px; width: 100%; background: rgba(255,255,255,0.05); color: var(--text-grey); }

/* --- OPTIONEN BUTTON AUF DER CARD --- */
.game-options-container { position: absolute; top: 8px; right: 8px; z-index: 10; }
.options-btn {
    background: rgba(0, 0, 0, 0.7); color: white; border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px; width: 32px; height: 32px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: all 0.3s ease;
}
.options-btn svg { display: block; transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.options-btn:hover { background: var(--steam-light-blue); border-color: white; }
.options-btn:hover svg { transform: rotate(90deg); }

/* --- MITGLIEDER SPEZIFISCH --- */
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; margin-top: 20px; }

.member-card {
    display: flex !important; flex-direction: row !important; align-items: center;
    padding: 15px; position: relative; min-height: 100px;
    background: var(--steam-blue); border: 1px solid #2a475e; border-radius: 4px;
    transition: transform 0.2s; cursor: pointer;
}
/* --- Permanente Glow-Effekte für Member-Cards --- */

/* Rot leuchtend - Offline / Beschäftigt */
.member-card.state-0 { 
    border-color: #ff4d4d !important; 
    box-shadow: 0 0 10px rgba(255, 77, 77, 0.3);
}

/* Grün leuchtend - Online */
.member-card.state-1 { 
    border-color: var(--steam-green) !important; 
    box-shadow: 0 0 10px rgba(144, 186, 60, 0.3);
}

/* Orange leuchtend - Abwesend */
.member-card.state-3 { 
    border-color: #ffa500 !important; 
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.3);
}

/* --- Verstärkter Effekt beim Hover --- */
.member-card:hover { 
    transform: translateY(-5px);
}

.member-card.state-0:hover { box-shadow: 0 0 20px rgba(255, 77, 77, 0.6); }
.member-card.state-1:hover { box-shadow: 0 0 20px rgba(144, 186, 60, 0.6); }
.member-card.state-3:hover { box-shadow: 0 0 20px rgba(255, 165, 0, 0.6); }

/* Sanfter Übergang für alle Statusänderungen */
.member-card {
    transition: transform 0.2s ease, box-shadow 0.3s ease, border-color 0.3s ease !important;
}
.member-avatar { width: 64px; height: 64px; border-radius: 4px; margin-right: 15px; border: 2px solid rgba(255,255,255,0.1); flex-shrink: 0; }
.member-info { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; }
.member-name { font-weight: bold; color: white; margin-bottom: 4px; font-size: 1rem; }
.member-stats { font-size: 0.75rem; color: var(--text-grey); line-height: 1.4; }
.lvl-badge { background: rgba(102, 192, 244, 0.2); color: var(--steam-light-blue); padding: 1px 5px; border-radius: 3px; font-weight: bold; }

.btn-delete {
    position: absolute; top: 5px; right: 5px; background: rgba(255,0,0,0.1);
    border: none; color: #ff4d4d; width: 24px; height: 24px; border-radius: 4px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-weight: bold; transition: 0.2s; z-index: 20;
}
.btn-delete:hover { background: #ff4d4d; color: white; }

/* --- SPIELE-MODAL (Ohne Animation) --- */
#gameModal {
    display: none; 
    position: fixed; 
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.85);
    z-index: 3000;
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
}

#gameModal .modal-content {
    background: var(--steam-dark);
    width: 90%;
    max-width: 500px;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--steam-light-blue);
    text-align: center;
    box-shadow: 0 0 40px rgba(0,0,0,1);

    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;

    max-height: 85vh; 
    overflow-y: auto; 
}

/* Fixiert die Größe der Besitzer-Icons unter der Grafik */
.game-owners .owner-icon {
    width: 24px !important;
    height: 24px !important;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: inline-block;
}

/* Verhindert, dass die Icons bei vielen Besitzern das Layout sprengen */
.game-owners {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

/* Info-Text über den Icons */
.owner-count-info {
    font-size: 0.7rem;
    color: var(--text-grey);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 5px;
}

/* Reserviert Platz für die Mitglieder-Sektion, damit die Karte nicht springt */
.game-owners-area {
    min-height: 55px; 
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Optional: Damit der Titel immer oben bleibt */
.game-owners-area {
    min-height: 55px; 
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    margin-top: auto; /* WICHTIG: Schiebt den Owner-Bereich nach ganz unten */
}

/* --- PAGINATION SYSTEM --- */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 40px 0;
    flex-wrap: wrap; /* Wichtig für Mobilgeräte */
}

.page-btn {
    background: var(--steam-blue);
    color: var(--steam-light-blue);
    border: 1px solid #2a475e;
    padding: 10px 18px;
    cursor: pointer;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.2s ease;
    min-width: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--steam-light-blue);
    background: #2a475e;
    transform: translateY(-2px);
}

.page-btn.active {
    background: var(--steam-light-blue);
    color: var(--steam-dark);
    border-color: white;
    box-shadow: 0 0 15px rgba(102, 192, 244, 0.3);
}

/* Spezielles Styling für Vor/Zurück Buttons */
.page-btn.nav-arrow {
    background: rgba(102, 192, 244, 0.1);
    padding: 10px 25px;
}

.page-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
    filter: grayscale(1);
}

/* Pagination Info-Text (falls du ihn nutzt) */
.pagination-info {
    color: var(--text-grey);
    font-size: 0.8rem;
    margin: 0 15px;
}

/* --- SteamReact Branding --- */
.brand-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

#ui-title {
    font-size: 1.8rem;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    margin: 0;
}

.react-text {
    color: #fff;
    background: linear-gradient(135deg, #66c0f4, #4facfe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-left: 4px;
    font-weight: 800;
    text-transform: uppercase;
    filter: drop-shadow(0 0 8px rgba(102, 192, 244, 0.4));
}


.logo-icon.pulse-wave {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    width: 24px;
    height: 20px;
}

.pulse-wave .bar {
    width: 4px;
    background: #66c0f4;
    border-radius: 2px;
    animation: wave-anim 1s ease-in-out infinite;
}

.pulse-wave .bar:nth-child(1) { height: 60%; animation-delay: 0.1s; }
.pulse-wave .bar:nth-child(2) { height: 100%; animation-delay: 0.2s; background: #90ba3c; }
.pulse-wave .bar:nth-child(3) { height: 75%; animation-delay: 0.3s; }

@keyframes wave-anim {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.6); }
}

/* --- Guild Edition Tag --- */
.edition-text {
    font-size: 0.55rem;          /* Schön klein wie ein TM-Zeichen */
    vertical-align: super;       /* Schiebt den Text nach oben */
    margin-left: 4px;            /* Kleiner Abstand zum Haupttext */
    font-weight: 400;            /* Etwas dünner als "React", damit es nicht zu fett wirkt */
    text-transform: uppercase;   /* Alles in Großbuchstaben */
    letter-spacing: 1px;         /* Etwas mehr Platz zwischen den Buchstaben */
    
    /* Optional: Gleicher Verlauf wie React oder ein schlichtes Weiß/Grau */
    background: none;            
    -webkit-text-fill-color: rgba(255, 255, 255, 0.7); /* Leicht transparentes Weiß */
    filter: none;                /* Kein Glow für den kleinen Text (bessere Lesbarkeit) */
}

/* Falls du willst, dass auch "Guild Edition" im Blauverlauf leuchtet, 
   lösche die zwei Zeilen oben (background/text-fill) einfach raus. */