:root {
    --bg-pink-light: #ffe6f0;
    --bg-pink-main: #ffb3d1;
    --accent-pink: #ff66a3;
    --accent-pink-dark: #e05590;
    /* Das Pink als "r, g, b" für Schatten und Flächen mit Transparenz */
    --accent-rgb: 255, 102, 163;
    --bg-solid: #ffc0cb;
    --bg-gradient: linear-gradient(135deg, #ffd1dc 0%, #ffc0cb 50%, #ffb6c1 100%);
    --cloud: rgba(255, 255, 255, 0.45);
    --text-dark: #4a2e3b;
    --white: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.85);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
}

body {
    background: var(--bg-solid);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    position: relative;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Verlauf als feste Ebene statt background-attachment: fixed – das ignoriert iOS Safari */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    /* lvh = Höhe bei eingeklappter Adressleiste, sonst bleibt unten beim Scrollen ein Streifen frei */
    height: 100vh;
    height: 100lvh;
    background: var(--bg-gradient);
    z-index: -2;
    pointer-events: none;
}

.clouds-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.cloud {
    position: absolute;
    background: var(--cloud);
    border-radius: 100px;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.6);
}

.cloud::before, .cloud::after {
    content: '';
    position: absolute;
    background: var(--cloud);
    border-radius: 50%;
}

.cloud-1 {
    width: 250px;
    height: 80px;
    top: 10%;
    left: -300px;
    animation: floatClouds 45s linear infinite;
}
.cloud-1::before { width: 100px; height: 100px; top: -50px; left: 30px; }
.cloud-1::after { width: 120px; height: 120px; top: -60px; right: 40px; }

.cloud-2 {
    width: 350px;
    height: 100px;
    top: 45%;
    left: -400px;
    animation: floatClouds 30s linear infinite;
    animation-delay: -10s;
    opacity: 0.7;
}
.cloud-2::before { width: 140px; height: 140px; top: -70px; left: 50px; }
.cloud-2::after { width: 150px; height: 150px; top: -80px; right: 60px; }

.cloud-3 {
    width: 200px;
    height: 70px;
    top: 75%;
    left: -250px;
    animation: floatClouds 55s linear infinite;
    animation-delay: -5s;
    opacity: 0.5;
}
.cloud-3::before { width: 80px; height: 80px; top: -40px; left: 25px; }
.cloud-3::after { width: 90px; height: 90px; top: -45px; right: 30px; }

@keyframes floatClouds {
    0% { transform: translateX(-150px); }
    100% { transform: translateX(calc(100vw + 500px)); }
}

header {
    width: 100%;
    text-align: center;
    margin-bottom: 30px;
}

.top-right-buttons {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 999;
}

.top-nav-btn {
    background: var(--accent-pink-dark);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0 14px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(6px);
    transition: background 0.2s, transform 0.2s, border-color 0.2s, color 0.2s;
}

.top-nav-btn i { color: var(--white); font-size: 1rem; }
.top-nav-btn:hover {
    background: var(--accent-pink);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    color: var(--white);
}

.top-nav-btn.disabled {
    opacity: 0.4;
    background: var(--accent-pink-dark);
    border-color: rgba(255, 255, 255, 0.05);
    pointer-events: none;
    cursor: not-allowed;
}

#btn-github:hover { background: #24292e; border-color: rgba(255, 255, 255, 0.4); transform: translateY(-2px); }
#btn-discord:hover { background: #5865F2; border-color: #5865F2; transform: translateY(-2px); }
#btn-youtube:hover { background: #FF0000; border-color: #FF0000; transform: translateY(-2px); }

.discord-custom-widget {
    width: 100%;
    max-width: 340px;
    margin: 0 auto 25px auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
}

.discord-top {
    display: flex;
    align-items: center;
    gap: 15px;
}

.discord-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(88, 101, 242, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.8);
    flex-shrink: 0;
}

.discord-main-icon { font-size: 1.8rem; color: #5865F2; }
.discord-title-area h3 { font-size: 1.1rem; color: var(--text-dark); margin-bottom: 2px; }
.discord-stats { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: #666; font-weight: 500; }
.stat-separator { color: #bbb; }

.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #23a55a;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 0 rgba(35, 165, 90, 0.4);
    animation: pulse 2s infinite;
    vertical-align: middle;
    margin-right: 2px;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(35, 165, 90, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(35, 165, 90, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(35, 165, 90, 0); }
}

.gray-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #80848e;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 2px;
}

.discord-members-list {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    padding: 10px;
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid rgba(var(--accent-rgb), 0.15);
}

.discord-member-item { display: flex; align-items: center; gap: 12px; padding: 6px 8px; text-align: left; }
.member-avatar-wrapper { position: relative; width: 28px; height: 28px; flex-shrink: 0; }
.member-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.member-info { display: flex; flex-direction: column; align-items: flex-start; overflow: hidden; line-height: 1.3; width: calc(100% - 40px); }
.member-name { font-size: 0.9rem; font-weight: 600; color: var(--text-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; width: 100%; }
.member-activity { font-size: 0.75rem; color: #777; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; width: 100%; }
.discord-member-loading, .no-members { font-size: 0.85rem; color: #777; text-align: center; padding: 5px; }

.discord-join-btn {
    background: #5865F2;
    color: var(--white);
    text-decoration: none;
    text-align: center;
    padding: 10px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
    display: block;
}
.discord-join-btn:hover { background: #4752C4; transform: scale(1.02); }

.tabs {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.5);
    padding: 8px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 rgba(var(--accent-rgb), 0.2);
    margin-bottom: 30px;
    width: 100%;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 10px 15px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 0;
    text-align: center;
}

.tab-btn.active, .tab-btn:hover {
    background: var(--white);
    color: var(--accent-pink);
    box-shadow: 0 4px 15px rgba(var(--accent-rgb), 0.3);
    transform: translateY(-2px);
}

.tab-content {
    display: none;
    width: 100%;
    max-width: 900px;
    animation: fadeIn 0.4s ease-in-out;
}

.tab-content.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    width: 100%;
}

.card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
    border: 2px solid var(--white);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease;
}

.card:hover { transform: translateY(-5px); }

.server-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.server-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
}
/* Platz nur reservieren, wenn es auch eine Ping-Anzeige gibt */
.server-header:has(.server-ping) { padding-right: 65px; }

.server-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #ddd;
    object-fit: cover;
    flex-shrink: 0;
}

.server-title-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.server-title-area h3 {
    font-size: 1.1rem;
    color: var(--text-dark);
    word-break: break-word;
}

.server-motd {
    font-size: 0.85rem;
    color: #666;
    min-height: 1.2em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-status-badge {
    align-self: flex-start;
    display: inline-block !important;
    width: auto !important;
    max-width: fit-content !important;
    font-size: 0.75rem !important;
    padding: 3px 10px !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    margin-top: 2px !important;
}

.server-status-badge.status-online, .status-online { 
    background: #d4edda !important; 
    color: #155724 !important; 
}

.server-status-badge.status-offline, .status-offline { 
    background: #f8d7da !important; 
    color: #721c24 !important; 
    border: 1px solid rgba(114, 28, 36, 0.1) !important;
}

.server-ping {
    position: absolute;
    top: 0;
    right: 0;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #2e7d32;
    background-color: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    z-index: 5;
    white-space: nowrap;
}

.server-ip-box {
    background: rgba(255, 255, 255, 0.7);
    padding: 6px 10px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: monospace;
    font-size: 0.85rem;
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    gap: 8px;
    width: 100%;
}

.ip-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    user-select: none;
    -webkit-user-select: none;
}

.copy-btn {
    background: var(--accent-pink);
    color: var(--white);
    border: none;
    padding: 5px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    font-family: 'Poppins', sans-serif;
    transition: background 0.2s;
    flex-shrink: 0;
}

.copy-btn:hover { background: var(--accent-pink-dark); }

.server-info-text {
    font-size: 0.85rem;
    color: #666;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-count-wrapper {
    position: relative;
    cursor: pointer;
}

.player-count { transition: color 0.3s ease, transform 0.3s ease; }
.player-count.count-updated {
    color: var(--accent-pink);
    font-weight: 600;
    transform: scale(1.05);
}

.player-count-wrapper:hover .player-tooltip,
.player-count-wrapper:focus-within .player-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-5px);
}

.player-tooltip {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 6px;
    background: rgba(40, 40, 40, 0.9);
    color: #fff;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 150px;
    overflow-y: auto;
}

.tooltip-player-item { display: flex; align-items: center; gap: 6px; }
.tooltip-player-item img { width: 16px; height: 16px; border-radius: 3px; }

.card.archived { opacity: 0.75; border-color: #eee; }
.card.archived .server-status-badge { background: #e2e3e5 !important; color: #383d41 !important; }
.archived-icon { width: 48px; height: 48px; border-radius: 12px; background: #ddd; object-fit: cover; }
.server-status-badge.status-archived, .status-archived { background: #e2e3e5 !important; color: #383d41 !important; }

.download-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.download-card p { font-size: 0.9rem; color: #666; margin-bottom: 15px; }
.download-btn {
    background: var(--accent-pink);
    color: var(--white);
    text-decoration: none;
    text-align: center;
    padding: 10px;
    border-radius: 12px;
    font-weight: 600;
    display: block;
    transition: background 0.2s, transform 0.2s;
}
.download-btn:hover { background: var(--accent-pink-dark); transform: scale(1.02); }
.download-card .download-btn + .download-btn { margin-top: 8px; }

.section-label {
    font-size: 1rem;
    font-weight: 600;
    margin: 20px 0 10px 5px;
    color: var(--white);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.member-status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: absolute;
    bottom: 0;
    right: 0;
    border: 2px solid #fff;
}
.member-status-indicator.status-online { background-color: #23a55a !important; }
.member-status-indicator.status-idle { background-color: #f0b232 !important; }
.member-status-indicator.status-dnd { background-color: #f23f43 !important; }
.member-status-indicator.status-offline { background-color: #80848e !important; }

.screenshot-card {
    position: relative;
    overflow: hidden;
    padding: 0 !important;
    cursor: pointer;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
}

.screenshot-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.screenshot-card:hover img {
    transform: scale(1.03);
}

.screenshot-overlay, .lightbox-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 15px;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.screenshot-overlay *, .lightbox-overlay * {
    pointer-events: auto;
}

.screenshot-card:hover .screenshot-overlay,
.lightbox-image-container:hover .lightbox-overlay {
    opacity: 1;
}

.screenshot-card .screenshot-number {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(40, 40, 40, 0.75);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0 12px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.lightbox-floating-counter {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(40, 40, 40, 0.75);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0 12px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1020;
}

.lightbox-image-container.flash-counter .lightbox-floating-counter {
    opacity: 1;
}

.screenshot-number.fade-in {
    animation: numberFade 0.3s ease-in-out;
}

@keyframes numberFade {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    50% {
        opacity: 0.3;
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.ui-action-btn {
    background: rgba(40, 40, 40, 0.75);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.2s, transform 0.2s, border-color 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.ui-action-btn:hover {
    background: var(--accent-pink);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox-modal.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Feste 16:9-Bühne: andere Auflösungen werden skaliert, andere Formate bekommen
   schwarze Balken – so springen Pfeile und Buttons beim Durchklicken nicht herum */
.lightbox-image-container {
    position: relative;
    width: min(80vw, calc(82vh * 16 / 9));
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    background: #000;
}

#lightbox-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(40, 40, 40, 0.75);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: var(--accent-pink);
}

.lightbox-arrow {
    background: rgba(40, 40, 40, 0.75);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1.2rem;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1010;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.lightbox-arrow:hover {
    background: var(--accent-pink);
    transform: translateY(-50%) scale(1.08);
}

.lightbox-prev {
    left: -70px;
}

.lightbox-next {
    right: -70px;
}

@media (max-width: 768px) {
    .lightbox-prev {
        left: 10px;
    }
    .lightbox-next {
        right: 10px;
    }
}

@keyframes slideFromRight {
    0% {
        opacity: 0;
        transform: translateX(40px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideFromLeft {
    0% {
        opacity: 0;
        transform: translateX(-40px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-right {
    animation: slideFromRight 0.3s ease-out;
}

.slide-left {
    animation: slideFromLeft 0.3s ease-out;
}


.detail-server-card { margin-bottom: 20px; }
.player-history-card { padding: 15px 20px; gap: 10px; }
.player-history-header { display: grid; grid-template-columns: 1fr 110px 130px; gap: 10px; font-size: 0.85rem; font-weight: 600; color: #777; padding: 0 12px 8px; border-bottom: 1px solid rgba(0, 0, 0, 0.08); }
.player-history-list { display: flex; flex-direction: column; gap: 8px; max-height: 480px; overflow-y: auto; padding-right: 5px; }
.player-history-item {
    display: grid;
    grid-template-columns: 1fr 110px 130px;
    gap: 10px;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: transform 0.2s ease, background 0.2s ease;
}
.player-history-item:hover { background: rgba(255, 255, 255, 0.95); transform: translateX(3px); }
.player-history-item.is-offline { opacity: 0.6; }
.player-user-info { display: flex; align-items: center; gap: 12px; }
.player-user-info img { width: 24px; height: 24px; border-radius: 4px; }
.player-user-info .player-name { font-weight: 600; font-size: 0.95rem; color: var(--text-dark); }
.no-players-text { text-align: center; color: #888; font-size: 0.9rem; padding: 15px 0; }

/* ---------- Ergänzungen ---------- */

.no-scroll { overflow: hidden; }

:focus-visible { outline: 3px solid var(--accent-pink); outline-offset: 2px; }

input { user-select: text; -webkit-user-select: text; }

main { width: 100%; display: flex; flex-direction: column; align-items: center; }

.page-title {
    color: var(--white);
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.loading-card { text-align: center; color: #777; font-size: 0.9rem; }

.server-card.clickable { cursor: pointer; }

.details-link {
    align-self: flex-end;
    color: var(--accent-pink);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}
.details-link:hover { text-decoration: underline; }

.download-card .download-count {
    font-size: 0.8rem;
    color: var(--accent-pink);
    font-weight: 600;
}

.empty-text { text-align: center; color: #777; grid-column: 1 / -1; }

/* Detailseite */
.detail-page { max-width: 800px; width: 100%; }
.detail-page > * { width: 100%; }
#server-card-slot { margin-bottom: 15px; }

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 10px;
}

.stat-card { align-items: center; text-align: center; padding: 15px; gap: 2px; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--accent-pink); }
.stat-label { font-size: 0.8rem; color: #777; font-weight: 500; }

.section-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 25px;
}

.range-switch {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.5);
    padding: 4px;
    border-radius: 14px;
}
.range-switch button {
    background: transparent;
    border: none;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
}
.range-switch button.active { background: var(--white); color: var(--accent-pink); }

.chart-card { padding: 15px; }
.chart-card:hover, .player-history-card:hover, .stat-card:hover { transform: none; }

.history-chart { position: relative; }
.history-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-line { fill: none; stroke: var(--accent-pink); stroke-width: 2; stroke-linejoin: round; }
.chart-area { fill: rgba(var(--accent-rgb), 0.15); }
.chart-dot { fill: var(--accent-pink); }
.chart-down { fill: rgba(114, 28, 36, 0.12); }
.chart-grid { stroke: rgba(0, 0, 0, 0.07); }
.chart-label { font-size: 11px; fill: #888; font-family: 'Poppins', sans-serif; }

.chart-tooltip {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    background: rgba(40, 40, 40, 0.9);
    color: #fff;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    pointer-events: none;
}

.player-search {
    border: 1px solid rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    padding: 6px 12px;
    font-size: 0.85rem;
    color: var(--text-dark);
    min-width: 180px;
}
.player-search:focus { outline: 2px solid var(--accent-pink); }

.col-playtime, .col-seen { font-size: 0.85rem; color: #666; }
.col-seen { text-align: right; white-space: nowrap; }
.player-history-header .col-seen { text-align: right; white-space: nowrap; }
.player-user-info { min-width: 0; }
.player-user-info .player-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Admin */
.admin-page [hidden] { display: none !important; }
.admin-page textarea { user-select: text; -webkit-user-select: text; }
button.top-nav-btn { cursor: pointer; font-family: inherit; }
.admin-main > * { width: 100%; max-width: 900px; }
.admin-main .card:hover { transform: none; }

.admin-login { max-width: 360px; gap: 10px; }
.admin-login label { font-weight: 600; }

.admin-page input:not([type="checkbox"]), .admin-page textarea {
    width: 100%;
    padding: 9px 12px;
    border: 2px solid rgba(var(--accent-rgb), 0.25);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-dark);
    font-size: 0.9rem;
    resize: vertical;
}
.admin-page input:focus, .admin-page textarea:focus { outline: none; border-color: var(--accent-pink); }
.admin-page input[type="checkbox"] { accent-color: var(--accent-pink); width: 16px; height: 16px; }

.admin-error { color: #c0392b; font-size: 0.85rem; font-weight: 500; }
.admin-hint { font-size: 0.75rem; color: #888; margin-top: -8px; }

.admin-list { display: flex; flex-direction: column; gap: 16px; }
.admin-item { gap: 12px; justify-content: flex-start; }
.admin-item h3 { font-size: 1.1rem; }
.admin-new { border: 2px dashed rgba(var(--accent-rgb), 0.5); }

.admin-fields { display: grid; grid-template-columns: 2fr 2fr 1fr; gap: 10px; }
.admin-fields label, .admin-wide { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; font-weight: 600; color: #777; }
.admin-checks { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; font-size: 0.9rem; }
.admin-checks label { display: flex; align-items: center; gap: 6px; }
.admin-checks input[type="date"] { width: auto; padding: 5px 8px; }
.admin-checks label[hidden] { display: none; }

.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-pink);
    color: var(--white);
    border: none;
    border-radius: 12px;
    padding: 9px 16px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.admin-btn:hover { background: var(--accent-pink-dark); transform: scale(1.02); }
.admin-btn:disabled, .admin-btn.disabled { opacity: 0.5; pointer-events: none; }
.admin-btn.secondary { background: rgba(var(--accent-rgb), 0.12); color: var(--accent-pink); align-self: flex-start; }
.admin-btn.secondary:hover { background: rgba(var(--accent-rgb), 0.22); }
.admin-btn.danger { background: #e74c3c; }
.admin-btn.danger:hover { background: #c0392b; }

.admin-files { display: flex; flex-direction: column; gap: 8px; }
.admin-label { font-size: 0.8rem; font-weight: 600; color: #777; }
.admin-file-list { display: flex; flex-direction: column; gap: 6px; }
.admin-file-list:empty::before { content: "Noch keine Dateien"; font-size: 0.85rem; color: #999; }
.admin-file-row {
    display: grid;
    grid-template-columns: minmax(140px, 220px) 1fr auto;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    padding: 6px 6px 6px 8px;
}
.admin-file-name { font-size: 0.8rem; color: #666; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.admin-icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-dark);
    cursor: pointer;
    transition: background 0.2s;
}
.admin-icon-btn:hover { background: rgba(231, 76, 60, 0.2); color: #c0392b; }
.admin-icon-btn.danger { background: #e74c3c; color: var(--white); }
.admin-icon-btn.danger:hover { background: #c0392b; color: var(--white); }

.admin-uploads { display: flex; flex-direction: column; gap: 6px; }
.admin-uploads:empty { display: none; }
#screenshot-uploads { margin: 15px 0; }
.admin-progress { display: grid; grid-template-columns: minmax(0, 1fr) 2fr 60px; align-items: center; gap: 10px; font-size: 0.8rem; }
.admin-progress-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-progress-bar { height: 8px; background: rgba(255, 255, 255, 0.7); border-radius: 4px; overflow: hidden; }
.admin-progress-bar > div { width: 0; height: 100%; background: var(--accent-pink); transition: width 0.2s; }
.admin-progress-value { text-align: right; font-weight: 600; }
.admin-progress.done .admin-progress-bar > div { width: 100%; background: #23a55a; }
.admin-progress.failed .admin-progress-bar > div { background: #e74c3c; }
.admin-progress.failed .admin-progress-value { color: #c0392b; }

.admin-dropzone {
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 30px;
    margin-bottom: 15px;
    border: 2px dashed rgba(var(--accent-rgb), 0.5);
    cursor: pointer;
    text-align: center;
    font-weight: 600;
}
.admin-dropzone i { font-size: 2rem; color: var(--accent-pink); }
.admin-dropzone small { font-weight: 400; color: #888; }
.admin-dropzone.dragover { background: rgba(255, 255, 255, 0.95); border-color: var(--accent-pink); }

.admin-screenshot { cursor: default; }
.admin-screenshot .admin-icon-btn { position: absolute; top: 10px; right: 10px; }

.admin-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 20px);
    background: var(--text-dark);
    color: var(--white);
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 1000;
    max-width: calc(100vw - 32px);
}
.admin-toast.visible { opacity: 1; transform: translate(-50%, 0); }
.admin-toast.error { background: #c0392b; }

/* Handy */
@media (max-width: 700px) {
    .admin-fields { grid-template-columns: 1fr; }
    .admin-file-row { grid-template-columns: 1fr auto; }
    .admin-file-name { grid-column: 1 / -1; grid-row: 2; }
    .admin-progress { grid-template-columns: 1fr 60px; }
    .admin-progress-bar { grid-column: 1 / -1; grid-row: 2; }

    body { padding: 20px 16px; }

    .top-right-buttons {
        position: static;
        justify-content: center;
        margin-bottom: 20px;
    }
    .top-nav-btn span { display: none; }
    .top-nav-btn { padding: 0 14px; }

    .tabs { gap: 4px; padding: 6px; }
    .tab-btn { padding: 8px 6px; font-size: 0.85rem; }

    .page-title { font-size: 1.8rem; }

    .stats-row { gap: 8px; }
    .stat-card { padding: 10px 6px; }
    .stat-value { font-size: 1.2rem; }
    .stat-label { font-size: 0.7rem; }

    .player-history-header, .player-history-item { grid-template-columns: 1fr auto; }
    .col-playtime { display: none; }
    .player-search { min-width: 0; flex: 1 1 100%; }

    .server-header:has(.server-ping) { padding-right: 60px; }

    .lightbox-modal { padding: 10px; }
    .lightbox-image-container { width: min(calc(100vw - 20px), calc(82vh * 16 / 9)); }
    .lightbox-content { max-width: 100vw; }
    .lightbox-close { top: -55px; }
    .lightbox-arrow { width: 40px; height: 40px; font-size: 1rem; }
}

/* Sehr schmale Handys (z. B. iPhone SE) */
@media (max-width: 380px) {
    body { padding: 16px 12px; }
    .tab-btn { flex: 1 1 auto; padding: 8px 4px; font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .card { padding: 16px; }
    .discord-custom-widget { padding: 16px; }
}

/* Touch-Geräte: kein „hängenbleibender“ Hover, Download-Button immer sichtbar */
@media (hover: none) {
    .card:hover, .tab-btn:hover:not(.active), .player-history-item:hover { transform: none; }
    .tab-btn:hover:not(.active) { background: transparent; color: var(--text-dark); box-shadow: none; }
    .screenshot-card:hover img { transform: none; }
    .lightbox-overlay { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .cloud, .pulse-dot { animation: none; }
    .tab-content, .slide-right, .slide-left { animation: none; }
}

/* ---------- Feiertags-Design ----------
   data-holiday auf <html> setzt der Worker (gewählt in /admin). Nur die Farben ändern sich,
   dazu die Deko-Ebene aus common.js und eine Mütze auf dem Discord-Icon. */

html[data-holiday="easter"] {
    --accent-pink: #2f9a5f;
    --accent-pink-dark: #257d4c;
    --accent-rgb: 47, 154, 95;
    --text-dark: #2f3b33;
    --bg-solid: #e6f6e4;
    --bg-gradient: linear-gradient(135deg, #fff6c9 0%, #d9f5e3 50%, #e7dcff 100%);
    --cloud: rgba(255, 255, 255, 0.55);
    --hat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 52'%3E%3Cg transform='rotate(-14 22 40)'%3E%3Cellipse cx='22' cy='24' rx='9' ry='22' fill='%23fff' stroke='%23e9b8c9' stroke-width='2'/%3E%3Cellipse cx='22' cy='26' rx='4.5' ry='15' fill='%23ffb3cb'/%3E%3C/g%3E%3Cg transform='rotate(14 42 40)'%3E%3Cellipse cx='42' cy='24' rx='9' ry='22' fill='%23fff' stroke='%23e9b8c9' stroke-width='2'/%3E%3Cellipse cx='42' cy='26' rx='4.5' ry='15' fill='%23ffb3cb'/%3E%3C/g%3E%3C/svg%3E");
}

html[data-holiday="halloween"] {
    --accent-pink: #e8650f;
    --accent-pink-dark: #c95408;
    --accent-rgb: 232, 101, 15;
    --text-dark: #3b2a3f;
    --bg-solid: #f6cdb0;
    --bg-gradient: linear-gradient(135deg, #ffd9b3 0%, #f6c6a8 40%, #d9c2f0 100%);
    --cloud: rgba(255, 244, 235, 0.35);
    --hat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 52'%3E%3Cellipse cx='32' cy='44' rx='30' ry='6.5' fill='%233b2152'/%3E%3Cpath d='M17 44 L31 6 C33 1 40 2 44 8 C40 8 38 11 39 16 L47 44 Z' fill='%234a2a66'/%3E%3Cpath d='M19.5 37 L44.5 37 L46 42.5 L18 42.5 Z' fill='%23e8650f'/%3E%3C/svg%3E");
}

html[data-holiday="christmas"] {
    --accent-pink: #d62839;
    --accent-pink-dark: #b81f2f;
    --accent-rgb: 214, 40, 57;
    --text-dark: #263042;
    --bg-solid: #dbe9f6;
    --bg-gradient: linear-gradient(135deg, #e6f1fb 0%, #d3e5f6 50%, #e8e2f6 100%);
    --cloud: rgba(255, 255, 255, 0.7);
    --hat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 48'%3E%3Cpath d='M9 36 C10 22 18 9 31 6 C42 3 52 8 56 20 L58 30 C54 25 50 22 46 22 C43 26 42 31 42 36 Z' fill='%23d62839'/%3E%3Cpath d='M31 6 C42 3 52 8 56 20 L58 30 C55 25 52 22 49 21 C47 14 41 9 31 6 Z' fill='%23a8192a'/%3E%3Crect x='5' y='32' width='42' height='11' rx='5.5' fill='%23fff'/%3E%3Ccircle cx='57' cy='31' r='6' fill='%23fff'/%3E%3C/svg%3E");
}

/* Mütze (oder Hasenohren) auf dem Discord-Icon */
html[data-holiday] .discord-icon-wrapper {
    position: relative;
}

html[data-holiday] .discord-icon-wrapper::after {
    content: '';
    position: absolute;
    left: -14px;
    top: -18px;
    width: 46px;
    height: 36px;
    background: var(--hat) no-repeat center / contain;
    transform: rotate(-16deg);
    pointer-events: none;
}

html[data-holiday="halloween"] .discord-icon-wrapper::after {
    left: -10px;
    top: -26px;
    width: 50px;
    height: 40px;
    transform: rotate(-12deg);
}

html[data-holiday="easter"] .discord-icon-wrapper::after {
    left: 6px;
    top: -26px;
    width: 40px;
    height: 34px;
    transform: none;
}

/* Deko-Ebene (aus common.js): aufsteigende Ostereier, Fledermäuse, Schnee */
.holiday-decor {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.holiday-decor > span {
    position: absolute;
    top: 0;
    left: var(--x);
    width: var(--size);
    height: var(--size);
    animation-duration: var(--duration);
    animation-delay: var(--delay);
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.holiday-decor > .egg {
    height: calc(var(--size) * 1.3);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    box-shadow: inset -5px -7px 12px rgba(0, 0, 0, 0.08), 0 4px 14px rgba(0, 0, 0, 0.05);
    opacity: 0.75;
    animation-name: holiday-rise;
}

.egg.v0 { background: linear-gradient(180deg, #ffd1e3 0 32%, #ff9cc6 32% 42%, #ffd1e3 42% 58%, #ffffff 58% 66%, #ffd1e3 66%); }
.egg.v1 { background: linear-gradient(180deg, #fff3a8 0 36%, #9fdcb6 36% 46%, #fff3a8 46% 62%, #ff9cc6 62% 70%, #fff3a8 70%); }
.egg.v2 { background: linear-gradient(180deg, #c8f0d6 0 30%, #ffffff 30% 38%, #c8f0d6 38% 56%, #b9a4f5 56% 66%, #c8f0d6 66%); }
.egg.v3 { background: linear-gradient(180deg, #e2d6ff 0 34%, #fff3a8 34% 44%, #e2d6ff 44% 60%, #9fdcb6 60% 68%, #e2d6ff 68%); }

@keyframes holiday-rise {
    0% { transform: translate(0, 110vh) rotate(-10deg); }
    50% { transform: translate(24px, 45vh) rotate(10deg); }
    100% { transform: translate(0, -20vh) rotate(-10deg); }
}

.holiday-decor > .bat {
    left: 0;
    top: var(--y);
    height: calc(var(--size) * 0.5);
    opacity: 0.55;
    animation-name: holiday-fly;
}

.bat::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 50'%3E%3Cpath d='M50 16 L47 9 L45 17 C38 8 26 4 12 8 C20 12 22 18 20 24 C14 22 8 24 2 30 C14 30 22 34 26 40 C30 34 38 32 44 34 C46 38 48 40 50 42 C52 40 54 38 56 34 C62 32 70 34 74 40 C78 34 86 30 98 30 C92 24 86 22 80 24 C78 18 80 12 88 8 C74 4 62 8 55 17 L53 9 Z' fill='%233b2152'/%3E%3C/svg%3E") no-repeat center / contain;
    animation: holiday-flap 0.35s ease-in-out infinite alternate;
}

@keyframes holiday-fly {
    0% { transform: translate(-15vw, 0); }
    25% { transform: translate(15vw, -4vh); }
    50% { transform: translate(45vw, 3vh); }
    75% { transform: translate(75vw, -3vh); }
    100% { transform: translate(115vw, 0); }
}

@keyframes holiday-flap {
    to { transform: scaleY(0.35); }
}

.holiday-decor > .moon {
    left: 7%;
    top: 9%;
    width: clamp(70px, 10vw, 130px);
    height: clamp(70px, 10vw, 130px);
    border-radius: 50%;
    background: radial-gradient(circle at 38% 36%, #fffaf0 0%, #ffecc2 60%, #ffd98a 100%);
    box-shadow: 0 0 60px 18px rgba(255, 214, 140, 0.5);
    opacity: 0.85;
    animation: none;
}

.holiday-decor > .flake {
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 6px rgba(110, 140, 185, 0.45);
    opacity: 0.9;
    animation-name: holiday-fall;
}

.holiday-decor > .flake.v2 {
    border-radius: 0;
    width: calc(var(--size) * 2.6);
    height: calc(var(--size) * 2.6);
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 2v20M3.3 7l17.4 10M3.3 17 20.7 7M9 4l3 2 3-2M9 20l3-2 3 2'/%3E%3C/svg%3E") no-repeat center / contain;
    box-shadow: none;
    filter: drop-shadow(0 0 2px rgba(110, 140, 185, 0.6));
}

@keyframes holiday-fall {
    0% { transform: translate(0, -5vh); }
    50% { transform: translate(var(--drift), 50vh); }
    100% { transform: translate(0, 105vh); }
}

/* Ohne Animationen bleibt alles verteilt stehen, statt sich am Rand zu sammeln */
@media (prefers-reduced-motion: reduce) {
    .holiday-decor > span { animation: none; }
    .holiday-decor > .egg,
    .holiday-decor > .flake { top: var(--y); }
    .holiday-decor > .bat { left: var(--x); }
}

/* ---------- Feiertags-Auswahl (Admin) ---------- */

.holiday-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.holiday-option {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    border: 2px solid rgba(var(--accent-rgb), 0.2);
    border-radius: 16px;
    background: var(--card-bg);
    color: var(--text-dark);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}

.holiday-option:hover { transform: translateY(-2px); }
.holiday-option[aria-checked="true"] { border-color: var(--accent-pink); box-shadow: 0 4px 15px rgba(var(--accent-rgb), 0.3); }

.holiday-option .swatch {
    position: relative;
    height: 60px;
    border-radius: 10px;
    overflow: hidden;
}

.holiday-option .swatch::after {
    content: '';
    position: absolute;
    left: 10px;
    bottom: 10px;
    width: 45%;
    height: 12px;
    border-radius: 6px;
    background: var(--swatch);
}

.holiday-option .swatch.none { --swatch: #ff66a3; background: linear-gradient(135deg, #ffd1dc 0%, #ffc0cb 50%, #ffb6c1 100%); }
.holiday-option .swatch.auto { --swatch: rgba(255, 255, 255, 0.9); background: linear-gradient(90deg, #d9f5e3 0 25%, #ffc0cb 25% 50%, #f6c6a8 50% 75%, #d3e5f6 75%); }
.holiday-option .swatch.easter { --swatch: #2f9a5f; background: linear-gradient(135deg, #fff6c9 0%, #d9f5e3 50%, #e7dcff 100%); }
.holiday-option .swatch.halloween { --swatch: #e8650f; background: linear-gradient(135deg, #ffd9b3 0%, #f6c6a8 40%, #d9c2f0 100%); }
.holiday-option .swatch.christmas { --swatch: #d62839; background: linear-gradient(135deg, #e6f1fb 0%, #d3e5f6 50%, #e8e2f6 100%); }

.holiday-option .text { display: flex; flex-direction: column; gap: 2px; padding: 0 2px 2px; }
.holiday-option .text small { color: #666; font-size: 0.78rem; line-height: 1.4; }

.holiday-state { margin-top: 14px; color: #666; font-size: 0.9rem; text-align: center; }
