.tooltip {
    position: relative;
    cursor: pointer;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: 125%;
    transform: translateX(-50%);
    background: #222;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 100;
    font-size: 0.95em;
}

.tooltip:hover::after,
.tooltip:focus::after {
    opacity: 1;
}

/* Beispiel für die HTML-Anpassung:
<span class="tooltip" data-tooltip="Andrej">Von: Andrej</span>
*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, 'Noto Color Emoji';
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.user-info {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
    font-size: 1em;
}

.user-info strong {
    color: #ffd700;
}

.logout-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.header-title {
    transform: scale(1.05);
}

.header-title {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
}

.cs2-icon {
    width: 60px;
    height: 60px;
    filter: drop-shadow(0 4px 10px rgba(255, 215, 0, 0.5));
}

header h1 {
    margin: 0;
    font-size: 2.5em;
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
    margin: 5px 0 0 0;
}

.date-display {
    text-align: center;
    color: white;
    font-size: 1.1em;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.quick-overview {
    margin-bottom: 35px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: background 0.3s ease;
}

.overview-title {
    display: none;
}

.overview-players {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    justify-content: space-evenly;
    align-items: center;
}

.overview-player {
    flex: 1;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.overview-player:hover {
    transform: scale(1.05);
}

.overview-player.status-pending {
    color: #666;
    background: rgba(224, 224, 224, 0.3);
}

.overview-player.status-yes {
    color: white;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.overview-player.status-no {
    color: white;
    background: linear-gradient(135deg, #f44336 0%, #da190b 100%);
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

.overview-player.status-vacation {
    color: #0055aa;
    background: linear-gradient(135deg, #cce8ff 0%, #a8d4f5 100%);
    box-shadow: 0 2px 8px rgba(0, 120, 220, 0.18);
}


.overview-player .player-icon {
    font-size: 1.1em;
    flex-shrink: 0;
}

.overview-player .player-name {
    font-size: 1em;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile Optimierung - sehr kleine Displays */
@media (max-width: 480px) {
    .quick-overview {
        padding: 10px 8px;
    }
    
    .overview-players {
        gap: 4px;
    }
    
    .overview-player {
        padding: 6px 4px;
        font-size: 0.75em;
        gap: 3px;
    }
    
    .overview-player .player-icon {
        font-size: 1em;
    }
    
    .view-toggle-btn {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
        font-size: 0.8em;
    }
}

/* Mobile Optimierung - normale Handys */
@media (max-width: 768px) and (min-width: 481px) {
    .quick-overview {
        padding: 12px 15px;
    }
    
    .overview-players {
        gap: 6px;
    }
    
    .overview-player {
        padding: 6px 8px;
        font-size: 0.85em;
        gap: 4px;
    }
}

/* In-App Benachrichtigungen */
.in-app-notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 350px;
    width: calc(100% - 40px);
}

.in-app-notification {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.in-app-notification:hover {
    transform: scale(1.02);
}

.in-app-notification.closing {
    animation: slideOut 0.3s ease-out forwards;
}

.notification-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.notification-icon {
    font-size: 1.5em;
}

.notification-title {
    font-weight: bold;
    color: #333;
    flex: 1;
    font-size: 1em;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close:hover {
    color: #333;
}

.notification-body {
    color: #666;
    font-size: 0.95em;
    line-height: 1.4;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Mobile Anpassung für In-App Benachrichtigungen */
@media (max-width: 768px) {
    .in-app-notifications {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
    }
    
    .in-app-notification {
        padding: 12px;
    }
    
    .notification-title {
        font-size: 0.9em;
    }
    
    .notification-body {
        font-size: 0.85em;
    }
}

.voting-section {
    margin-bottom: 30px;
}

.players {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(314px, 1fr));
    gap: 30px 20px;
    margin-bottom: 30px;
}

/* Skeleton-Loader (bis die ersten Daten geladen sind) */
.players-skeleton {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(314px, 1fr));
    gap: 30px 20px;
    margin-bottom: 30px;
}

body.app-loading .players-skeleton { display: grid; }
body.app-loading .players { display: none; }

.skeleton-card {
    background: white;
    border-radius: 15px;
    padding: 26px 20px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 3px solid transparent;
}

.sk-line,
.sk-btn {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #e9ecf1;
}

.sk-line::after,
.sk-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
    animation: skShimmer 1.3s ease-in-out infinite;
}

.sk-title { width: 55%; height: 20px; margin: 0 auto 16px; }
.sk-badge { width: 40%; height: 14px; margin: 0 auto 20px; }
.sk-wide { width: 100%; height: 40px; margin-top: 16px; }

.sk-btn-row { display: flex; gap: 10px; }
.sk-btn { flex: 1; height: 44px; border-radius: 10px; }

@keyframes skShimmer {
    100% { transform: translateX(100%); }
}

.players-skeleton.sk-hide {
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.player-card {
    position: relative;
    container-type: inline-size;
    background: white;
    border-radius: 15px;
    padding: 26px 20px 20px; /* Platz für das Badge oben */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
    border: 3px solid transparent;
}

/* Punkte Badge in der Karten-Überschrift */
.points-badge {
    position: absolute;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    top: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 3px 12px;
    border-radius: 24px;
    font-weight: 800;
    font-size: 0.85em;
    background: #ffffff;
    color: #214d24; /* dark green text for contrast */
    border: 1px solid #cfe9d0; /* solid light green border */
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    z-index: 50;
}

.points-badge .points-label {
    font-size: 0.86em;
    opacity: 0.95;
    margin-right: 6px;
    color: rgba(33,77,36,0.95);
    font-weight: 700;
}

.points-badge .points-value {
    font-size: 1em;
}

.points-row {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    margin: 4px 0 6px;
}

/* Keep badge opaque white with dark text even when the card background changes on vote */
.player-card.voted-yes .points-badge,
.player-card.voted-no .points-badge {
    background: #ffffff; /* fully white */
    color: #214d24; /* dark text */
    border: 1px solid #cfe9d0; /* match normal badge border */
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.points-badge .points-icon {
    font-size: 1.05em;
    line-height: 1;
}

/* Mood emoji in badge: size and spacing (keeps badge compact) */
.points-badge .points-mood {
    font-size: 1.15em; /* slightly larger than the numeric value */
    line-height: 1;
    margin-left: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-1px);
}

@media (max-width: 480px) {
    .points-badge {
        padding: 4px 8px;
        gap: 6px;
        font-size: 0.8em;
    }
    .points-badge .points-mood {
        font-size: 1.05em;
        margin-left: 4px;
    }
}

/* 💩 Sticker wenn Punkte <= 0 */
.poop-sticker {
    position: absolute;
    right: 12px;
    bottom: 10px;
    font-size: 2.1em;
    opacity: 0.85;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.25));
    pointer-events: none;
}

.poop-sticker .poop-text {
    display: block;
    font-size: 0.36em;
    font-weight: 800;
    color: rgba(0, 0, 0, 0.55);
    margin-top: -2px;
    text-align: center;
}

.player-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.player-card.voted-yes {
    background: #4CAF50;
    border: 3px solid #2e7d32;
}

.player-card.voted-no {
    background: #f44336;
    border: 3px solid #c62828;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: nowrap;
    gap: 8px;
}

.player-header h3 {
    position: relative;
    font-size: 1.7em;
    color: #333;
    font-weight: bold;
    flex-shrink: 0;
    min-width: fit-content;
}

.player-card.my-card {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    border: 3px solid #ffd700;
}

.player-card.my-card:not(.voted-yes):not(.voted-no) {
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
}

/* My Card Hint - VERSTECKT */
.my-card-hint {
    display: none !important;
}

.last-activity {
    width: 100%;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 0.85em;
    color: #666;
}

.player-card.voted-yes .last-activity,
.player-card.voted-no .last-activity {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.activity-time {
    font-weight: 500;
}

.status-badge {
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 0.98em;
    font-weight: 900;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.3px;
}

.status-badge.pending {
    background: #e0e0e0;
    color: #666;
}

.status-badge.yes {
    background: #4CAF50;
    color: white;
    font-size: 1.1em;
    padding: 10px 20px;
}

.status-badge.no {
    background: #f44336;
    color: white;
    font-size: 1.1em;
    padding: 10px 20px;
}

.player-card.voted-yes .player-header h3 {
    color: white;
}

.player-card.voted-no .player-header h3 {
    color: white;
}

.player-card.voted-yes .status-badge,
.player-card.voted-no .status-badge {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border: 2px solid white;
}

/* Desktop-Ansicht: „Kann um …"-Badge kompakter, damit es nicht mit dem Online-Punkt überlappt */
body:not(.view-mobile) .status-badge {
    padding: 6px 13px;
    font-size: 0.92em;
    letter-spacing: 0.3px;
}
body:not(.view-mobile) .player-card.voted-yes .status-badge,
body:not(.view-mobile) .player-card.voted-no .status-badge {
    border-width: 2px;
}

.voting-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.vote-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.player-card.voted-yes .vote-btn,
.player-card.voted-no .vote-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

.player-card.voted-yes .vote-btn:hover,
.player-card.voted-no .vote-btn:hover {
    background: white;
}

.yes-btn {
    background: #4CAF50;
    color: white;
}

.yes-btn:hover {
    background: #45a049;
    transform: scale(1.05);
}

.no-btn {
    background: #f44336;
    color: white;
}

.no-btn:hover {
    background: #da190b;
    transform: scale(1.05);
}

.vote-btn:active {
    transform: scale(0.95);
}

.time-selection {
    margin-top: 10px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.time-selection label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: white;
}

.time-select {
    width: 100%;
    padding: 10px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    font-size: 1em;
    background: white;
    cursor: pointer;
}

.time-select:focus {
    outline: none;
    border-color: #667eea;
}

.comment-toggle {
    margin-top: 10px;
}

.comment-toggle-btn {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
    font-weight: 500;
}

.player-card:not(.voted-yes):not(.voted-no) .comment-toggle-btn {
    background: #f5f5f5;
    border: 2px solid #ddd;
    color: #667eea;
}

.comment-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.player-card:not(.voted-yes):not(.voted-no) .comment-toggle-btn:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.history-toggle {
    margin-top: 10px;
}

.history-toggle-btn {
    width: 100%;
    padding: 8px;
    background: rgba(0, 0, 0, 0.05);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s;
    color: #666;
    font-weight: 500;
    opacity: 0.6;
}

.history-toggle-btn:hover {
    opacity: 1;
    transform: scale(1.05);
}

.player-card.voted-yes .history-toggle-btn,
.player-card.voted-no .history-toggle-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.player-card.voted-yes .history-toggle-btn:hover,
.player-card.voted-no .history-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.history-section {
    margin-top: 10px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.player-card.voted-yes .history-section,
.player-card.voted-no .history-section {
    background: rgba(255, 255, 255, 0.2);
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 10px;
    margin-bottom: 8px;
    background: white;
    border-radius: 5px;
    font-size: 0.85em;
    gap: 10px;
    line-height: 1.4;
}

.player-card.voted-yes .history-item,
.player-card.voted-no .history-item {
    background: rgba(255, 255, 255, 0.9);
}

.history-item:last-child {
    margin-bottom: 0;
}

.history-action {
    flex: 1;
    color: #333;
    word-wrap: break-word;
}

.history-time {
    color: #666;
    font-size: 0.9em;
    white-space: nowrap;
    font-weight: 500;
}

.comment-section {
    margin-top: 10px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.player-card:not(.voted-yes):not(.voted-no) .comment-section {
    background: #f9f9f9;
}

.comment-input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.95em;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: white;
    resize: vertical;
    min-height: 50px;
    max-height: 100px;
    margin-bottom: 10px;
}

.comment-input:focus {
    outline: none;
    border-color: #667eea;
}

.comment-input::placeholder {
    color: #999;
    font-style: italic;
}

.comment-save-btn {
    width: 100%;
    padding: 8px;
    background: #ccc;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: not-allowed;
    transition: all 0.3s;
    opacity: 0.5;
}

.comment-save-btn.active {
    background: #667eea;
    cursor: pointer;
    opacity: 1;
}

.comment-save-btn.active:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.comment-save-btn:active {
    transform: translateY(0);
}

/* Kommentar-Text: bessere Lesbarkeit auf kleinen Displays */
@media (max-width: 600px) {
    .comment-section {
        padding: 16px;
    }

    .comment-input {
        font-size: 1.05em;
        line-height: 1.5;
        min-height: 90px;
    }

    .chat-message {
        font-size: 1.02em;
        line-height: 1.5;
        padding: 8px 10px;
    }

    .chat-text {
        font-size: 1.02em;
        line-height: 1.5;
    }

    .chat-meta {
        font-size: 0.8em;
    }

    .player-comment {
        font-size: 1.02em;
        line-height: 1.5;
    }

    .history-item {
        font-size: 0.95em;
        line-height: 1.45;
    }
}

/* Chat / Kommentare für alle */
.chat-section {
    position: relative;
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    border: 1px solid #e6e6e6;
}

.player-card.voted-yes .chat-section,
.player-card.voted-no .chat-section {
    background: rgba(255, 255, 255, 0.85);
}

.chat-messages {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 4px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #eee;
}

.chat-empty {
    color: #888;
    font-size: 0.9em;
    padding: 6px 8px;
}

.chat-message {
    padding: 6px 8px;
    background: white;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.chat-message.me {
    background: #e8f0ff;
    border-color: #d6e3ff;
}

.chat-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 0.75em;
    color: #666;
    margin-bottom: 4px;
}

/* Linker Teil: Name */
.chat-from {
    font-weight: 700;
    color: #333;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Name + NEW-Badge gruppiert links */
.chat-meta-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}

.chat-new-badge {
    flex-shrink: 0;
    background: linear-gradient(135deg, #34d399, #10b981);
    color: #fff;
    font-size: 0.72em;
    font-weight: 800;
    letter-spacing: 0.4px;
    padding: 1px 6px;
    border-radius: 8px;
    line-height: 1.5;
    animation: chatNewPulse 1.4s ease infinite;
}

@keyframes chatNewPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

/* Slide-in für frisch eingetroffene Chat-Nachrichten */
.chat-message.is-fresh {
    animation: chatMsgSlideIn 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes chatMsgSlideIn {
    0% { opacity: 0; transform: translateY(-10px) scale(0.92); }
    60% { opacity: 1; }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Online-Punkt ("Zuletzt online") neben dem Spielernamen */
.presence-dot {
    position: absolute;
    left: calc(100% + 5px);
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c2c6cc;
    cursor: help;
    transition: background 0.3s ease;
}

.presence-dot.online {
    background: #34c759;
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.6);
    animation: presencePulse 2s ease infinite;
}

/* Dezente "online vor X"-Zeile unter dem Namen (nur wenn offline) */
.presence-label {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: -1px;
    font-size: 0.58rem;
    font-weight: 500;
    color: #9aa0a8;
    white-space: nowrap;
    letter-spacing: 0.2px;
    pointer-events: none;
}

.player-card.voted-yes .presence-label,
.player-card.voted-no .presence-label {
    color: rgba(255, 255, 255, 0.85);
}

@keyframes presencePulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.5); }
    70% { box-shadow: 0 0 0 6px rgba(52, 199, 89, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0); }
}

/* Rechter Teil: Countdown + Edit-Button + Zeit – alle inline */
.chat-meta-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    white-space: nowrap;
}

.chat-edit-countdown {
    font-style: italic;
    font-size: 0.88em;
    color: #aaa;
    line-height: 1;
}

.chat-text {
    color: #333;
    font-size: 0.95em;
    line-height: 1.35;
    word-wrap: break-word;
}

.chat-input-row {
    margin-top: 6px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
}

/* "Nach unten"-Button mit Zähler versteckter Nachrichten */
.chat-scroll-down {
    position: absolute;
    right: 16px;
    bottom: 64px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 700;
    line-height: 1;
    animation: chatScrollIn 0.15s ease;
}

.chat-scroll-down:hover {
    background: #5568d8;
}

.chat-scroll-arrow {
    font-size: 1em;
    line-height: 1;
}

.chat-scroll-count:empty {
    display: none;
}

.chat-modal-scroll-down {
    bottom: 82px;
    right: 24px;
}

@keyframes chatScrollIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-icon {
    font-size: 1.1em;
    line-height: 1;
    color: #667eea;
}

.chat-input {
    flex: 1;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.9em;
    min-width: 0;
}

.chat-input:focus {
    outline: none;
    border-color: #667eea;
}

.chat-send-btn {
    padding: 8px 10px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85em;
    flex: 0 0 auto;
    width: 36px;
    text-align: center;
}

.chat-send-btn:hover {
    background: #5568d3;
}

.chat-send-btn:active {
    transform: scale(0.98);
}

@media (max-width: 480px) {
    .chat-input-row {
        gap: 6px;
    }

    .chat-send-btn {
        width: 32px;
        padding: 8px 6px;
        font-size: 0.9em;
    }
}

/* Chat Modal */
.chat-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 16px;
}

.chat-modal {
    position: relative;
    width: 100%;
    max-width: 520px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    overflow: hidden;
}

.chat-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
    background: #f7f8ff;
}

.chat-modal-title {
    font-weight: 700;
    color: #333;
}

.chat-modal-close {
    border: none;
    background: transparent;
    font-size: 1.6em;
    cursor: pointer;
    color: #666;
}

.chat-modal-messages {
    padding: 12px;
    overflow-y: auto;
    flex: 1;
    background: #fafafa;
}

.chat-modal-input {
    padding: 12px 12px 16px;
    border-top: 1px solid #eee;
    background: white;
}

.chat-modal-input .chat-input {
    min-height: 44px;
    resize: vertical;
    line-height: 1.3;
}

/* Bearbeiten-Button neben Chat-Nachricht */
.chat-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85em;
    padding: 0 3px;
    opacity: 0.55;
    line-height: 1;
    vertical-align: middle;
    transition: opacity 0.15s;
}
.chat-edit-btn:hover {
    opacity: 1;
}

/* "(bearbeitet vor X Min.)" Hinweis */
.chat-edited {
    font-size: 0.72em;
    color: #999;
    font-style: italic;
}

/* Inline-Bearbeitungsformular */
.chat-edit-form {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.chat-edit-input {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 10px;
    border: 1px solid #6674e0;
    border-radius: 8px;
    font-size: 0.92em;
    resize: vertical;
    min-height: 36px;
    font-family: inherit;
    outline: none;
}
.chat-edit-input:focus {
    border-color: #4455cc;
    box-shadow: 0 0 0 2px rgba(100,116,224,0.2);
}
.chat-edit-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.chat-edit-save {
    background: #6674e0;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 5px 14px;
    font-size: 0.85em;
    cursor: pointer;
    font-weight: 600;
}
.chat-edit-save:hover {
    background: #5568d3;
}
.chat-edit-cancel {
    background: #eee;
    color: #555;
    border: none;
    border-radius: 6px;
    padding: 5px 14px;
    font-size: 0.85em;
    cursor: pointer;
}
.chat-edit-cancel:hover {
    background: #ddd;
}

@media (max-width: 480px) {
    .chat-modal {
        max-width: 100%;
        border-radius: 12px;
    }

    .chat-modal-header {
        padding: 12px;
    }
}

.summary {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

.summary h2 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat {
    text-align: center;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 10px;
}

.stat-number {
    display: block;
    font-size: 3em;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    display: block;
    margin-top: 10px;
    color: #666;
    font-size: 0.9em;
}

.best-time {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
}

.comments-section {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
}

.comments-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.player-comment {
    padding: 12px;
    margin-bottom: 10px;
    background: white;
    border-left: 4px solid #667eea;
    border-radius: 5px;
    font-size: 0.95em;
}

.player-comment strong {
    color: #667eea;
    margin-right: 8px;
}

.actions {
    text-align: center;
}

.reset-btn {
    padding: 15px 40px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.reset-btn:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.3);
}

.reset-btn:active {
    transform: translateY(0);
}

.notification-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
    transition: all 0.3s;
    margin-top: 10px;
}

.notification-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(76, 175, 80, 0.4);
}

.notification-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.5em;
        margin-bottom: 8px;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
        font-size: 0.95em;
        margin-top: 12px;
    }
    
    .logout-btn {
        padding: 10px 20px;
        font-size: 1em;
        width: auto;
    }

    .players {
        grid-template-columns: 1fr;
    }

    .players-skeleton {
        grid-template-columns: 1fr;
    }

    .summary-stats {
        grid-template-columns: 1fr;
    }
    
    .actions {
        margin-top: 15px;
    }
    
    .notification-btn,
    .reset-btn {
        width: 100%;
        padding: 14px;
        font-size: 1em;
    }
}

/* Login Dialog */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.login-dialog {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    z-index: 100000;
    margin: 20px;
}

.login-dialog h2 {
    color: #667eea;
    margin-bottom: 10px;
}

.login-dialog p {
    color: #666;
    margin-bottom: 25px;
}

.login-select,
.login-input {
    width: 100%;
    padding: 12px;
    padding-right: 50px; /* Platz für den Toggle-Button */
    margin-bottom: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1em;
    box-sizing: border-box;
}

.login-select:focus,
.login-input:focus {
    outline: none;
    border-color: #667eea;
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.guest-divider {
    text-align: center;
    color: #bbb;
    font-size: 0.78em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 20px 0 14px;
    position: relative;
}
.guest-divider::before,
.guest-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 42%;
    height: 1px;
    background: linear-gradient(to var(--dir, right), #e0e0e0, transparent);
}
.guest-divider::before { left: 0; --dir: right; }
.guest-divider::after  { right: 0; --dir: left; }

.guest-login-btn {
    width: 100%;
    padding: 13px 18px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
    color: #555;
    border: 1.5px solid #d5d8f5;
    border-radius: 14px;
    font-size: 0.93em;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 13px;
    text-align: left;
    box-shadow: 0 2px 8px rgba(102,126,234,0.07);
}
.guest-login-btn:hover {
    background: linear-gradient(135deg, #eff1ff 0%, #e5e8ff 100%);
    color: #3a3a5c;
    border-color: #a0aaee;
    transform: translateY(-1px);
    box-shadow: 0 5px 18px rgba(102,126,234,0.18);
}
.guest-btn-icon {
    font-size: 1.45em;
    flex-shrink: 0;
    filter: grayscale(0.3);
    line-height: 1;
}
.guest-btn-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.guest-btn-title {
    font-weight: 700;
    font-size: 0.96em;
    color: #444;
}
.guest-btn-sub {
    font-size: 0.73em;
    color: #999;
    font-weight: 400;
}

.guest-mode-badge {
    color: #aaa;
    font-size: 0.88em;
    font-style: italic;
}

.login-error {
    color: #f44336;
    background: #ffebee;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: bold;
}

.password-container {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
}

.toggle-password-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.toggle-password-btn:hover {
    opacity: 1;
}

/* Mobile Anpassungen für Login */
@media (max-width: 768px) {
    .login-dialog {
        width: 95%;
        padding: 30px 20px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .login-dialog h2 {
        font-size: 1.5em;
        margin-bottom: 8px;
    }
    
    .login-dialog p {
        font-size: 0.95em;
        margin-bottom: 20px;
    }
    
    .login-select,
    .login-input {
        padding: 14px;
        padding-right: 50px;
        font-size: 16px; /* Verhindert Auto-Zoom auf iOS */
        margin-bottom: 12px;
    }
    
    .login-btn {
        padding: 16px;
        font-size: 1.05em;
    }
    
    .toggle-password-btn {
        font-size: 1.8em;
        right: 12px;
        padding: 8px;
    }
    
    .login-error {
        font-size: 0.9em;
        padding: 12px;
    }
}

/* ========== FOOTER & VIEW TOGGLE BUTTON ========== */

.page-footer {
    background: transparent;
    padding: 12px 20px;
    box-shadow: none;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.view-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.view-toggle-btn:active {
    transform: translateY(0);
}

.view-toggle-btn.mobile-mode {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    box-shadow: 0 4px 15px rgba(56, 239, 125, 0.4);
}

.view-toggle-btn.mobile-mode:hover {
    box-shadow: 0 6px 20px rgba(56, 239, 125, 0.6);
}

.changelog-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    cursor: pointer;
    font-weight: normal;
    font-size: 0.8em;
    transition: all 0.3s ease;
    box-shadow: none;
    opacity: 0.7;
}

.changelog-btn:hover {
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.changelog-btn:active {
    transform: translateY(0);
}

.changelog-icon {
    font-size: 1.3em;
    line-height: 1;
}

.changelog-text {
    font-size: 0.95em;
}

.toggle-icon {
    font-size: 1.3em;
    line-height: 1;
}

.toggle-text {
    font-size: 0.95em;
}

/* Urlaub-Button im Footer – gleiche Größe wie View-Toggle */
#vacationFooterBtn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #00aaff 0%, #0066cc 100%);
    border: none;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.35);
}
#vacationFooterBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.55);
}
#vacationFooterBtn:active {
    transform: translateY(0);
}
.vacation-footer-icon {
    font-size: 1.3em;
    line-height: 1;
}
.vacation-footer-text {
    font-size: 0.95em;
}

.footer-credits {
    font-size: 0.85em;
    color: rgba(0, 0, 0, 0.6);
    text-align: center;
}

.footer-credits a {
    color: inherit;
    text-decoration: underline;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.footer-credits a:hover {
    opacity: 0.7;
}

@media (max-width: 480px) {
    .page-footer {
        padding: 10px 15px;
    }
    
    .view-toggle-btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }
    
    .toggle-icon {
        font-size: 1.2em;
    }
    
    .toggle-text {
        font-size: 0.85em;
    }
}

/* ===== GAMIFICATION STATISTICS SECTION ===== */
.statistics-section {
    margin: 40px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.points-plan {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eee;
    padding: 14px 16px;
    color: #333;
}

.points-plan-details {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eee;
    overflow: hidden;
}

.points-plan-details > summary {
    cursor: pointer;
    list-style: none;
    padding: 12px 14px;
    font-weight: 900;
    color: #333;
    background: #f7f8ff;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.points-plan-details > summary::-webkit-details-marker {
    display: none;
}

.points-plan-details > summary::after {
    content: 'Anzeigen ▾';
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 6px 10px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.85em;
    display: inline-block;
}

.points-plan-details[open] > summary::after {
    content: 'Verbergen ▴';
}

.points-plan-details .points-plan {
    border: none;
    border-radius: 0;
}

.points-plan ul {
    margin-left: 18px;
    line-height: 1.5;
}

.points-plan .plan-note {
    margin-top: 10px;
    color: #666;
    font-size: 0.95em;
}

/* Mobile: Elo-Vergabe-Plan kompakter, damit der Text nicht zu groß wirkt */
@media (max-width: 600px) {
    .points-plan { padding: 10px 10px; }
    .points-plan-left { font-size: 0.8em; }
    .points-plan-left ul { margin-left: 13px; line-height: 1.3; }
    .points-plan-left ul ul { margin-left: 11px; }
    .points-plan .plan-note { font-size: 0.68em; }
}

/* Monats-Panels */
.points-months {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Jahres-Gruppen in der Elo-Historie */
.points-year {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #dfe3ff;
    overflow: hidden;
}

.points-year-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    background: #eceeff;
}

.points-year-title {
    font-weight: 900;
    font-size: 1.15em;
    color: #333;
}

.points-year-subtitle {
    color: #666;
    font-size: 0.9em;
}

.points-year-toggle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 10px;
    font-weight: 800;
    cursor: pointer;
}

.points-year-body {
    padding: 10px;
}

.points-year-body > .points-month + .points-month {
    margin-top: 12px;
}

.points-month {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eee;
    overflow: hidden;
}

.points-month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    background: #f7f8ff;
    border-bottom: 1px solid #eee;
}

.points-month-title {
    font-weight: 900;
    color: #333;
}

.points-month-subtitle {
    color: #666;
    font-size: 0.9em;
}

.points-month-toggle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 10px;
    font-weight: 800;
    cursor: pointer;
}

.points-month-body {
    padding: 12px 14px 16px;
}

.points-tx-list {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.points-tx-item {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #eee;
    background: #fafafa;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.points-tx-left {
    min-width: 0;
}

.points-tx-reason {
    font-weight: 700;
    color: #333;
    word-break: break-word;
}

.points-tx-meta {
    color: #666;
    font-size: 0.85em;
    margin-top: 2px;
}

.points-tx-delta {
    font-weight: 900;
    white-space: nowrap;
}

.points-tx-delta.pos { color: #2e7d32; }
.points-tx-delta.neg { color: #c62828; }


.statistics-section h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 1.8em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.stats-container {
    margin-bottom: 40px;
}

.stats-container h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-table-wrapper {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.stats-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stats-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    border: none;
}

.stats-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
}

.stats-table tbody tr {
    transition: background-color 0.2s ease;
}

.stats-table tbody tr:hover {
    background-color: #f5f5f5;
}

.stats-table tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.status-ok {
    color: #4caf50;
    font-size: 1.2em;
    font-weight: bold;
}

.status-warning {
    color: #ff9800;
    font-size: 1.2em;
    font-weight: bold;
}

.status-bad {
    color: #f44336;
    font-size: 1.2em;
    font-weight: bold;
}

.status-shame {
    color: #8b4513;
    font-size: 1.2em;
    font-weight: bold;
}

/* Today's Table */
#todayStatsBody tr {
    border-left: 5px solid transparent;
}

#todayStatsBody tr.status-on-time {
    border-left-color: #4caf50;
}

#todayStatsBody tr.status-late {
    border-left-color: #ff9800;
}

#todayStatsBody tr.status-missing {
    border-left-color: #f44336;
}

.details-text {
    font-size: 0.9em;
    color: #555;
    font-style: italic;
    font-weight: 500;
    word-break: break-word;
    max-width: 400px;
}

/* Monthly Table */
.stats-table.monthly {
    font-size: 0.95em;
}

/* Spieler-Zeile anklickbar für Verlauf */
.stats-table.monthly tbody tr {
    cursor: pointer;
}

.stats-table.monthly tbody tr.active-player {
    background: rgba(102, 126, 234, 0.18);
    box-shadow: inset 4px 0 0 #667eea;
}
.stats-table.monthly tbody tr.active-player td {
    font-weight: 600;
}

/* Inline Player-Details direkt unter der Zeile */
.stats-table.monthly tbody tr.points-details-row {
    cursor: default;
}

.stats-table.monthly tbody tr.points-details-row:hover {
    background: transparent;
}

.stats-table.monthly tbody tr.points-details-row td {
    padding: 0 15px 12px;
    border-bottom: none;
}

.stats-table.monthly tbody tr.points-details-row .points-player-details {
    margin-top: 10px;
}

.points-player-details {
    margin-top: 12px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
}

.points-player-details-header {
    padding: 10px 12px;
    background: #f7f8ff;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.points-player-details-title {
    font-weight: 900;
    color: #333;
}

.points-player-details-close {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.2em;
    color: #666;
}

.points-player-details-body {
    padding: 10px 12px 12px;
    max-height: 480px;
    overflow-y: auto;
}

/* Admin Controls (nur Andrej) */
.points-admin {
    margin-top: 14px;
    padding: 12px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
}

.points-admin-header {
    font-weight: 900;
    color: #333;
    margin-bottom: 10px;
}

.points-admin-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 10px;
}

.points-admin-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.9em;
    color: #444;
}

.points-admin-form select,
.points-admin-form input {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 10px;
    min-width: 160px;
}

.points-admin-btn {
    padding: 10px 14px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 900;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.points-admin-btn.danger {
    background: linear-gradient(135deg, #f44336 0%, #c62828 100%);
}

.points-admin-hint {
    color: #666;
    font-size: 0.9em;
}

/* Spieler verwalten */
.admin-players-summary {
    font-weight: 800;
    cursor: pointer;
    margin-bottom: 6px;
}
.admin-player-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 10px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.admin-player-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-player-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.admin-player-actions .points-admin-btn {
    padding: 6px 10px;
    font-size: 0.85em;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .admin-player-actions {
        flex: 1 1 100%;
    }
    .admin-player-actions .points-admin-btn {
        flex: 1 1 0;
        padding: 8px 6px;
        font-size: 0.8em;
    }
}

.admin-player-add {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 6px;
}

.admin-player-add input {
    flex: 1 1 140px;
    min-width: 0;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 2px solid #ddd;
    border-radius: 10px;
}

.admin-player-add .points-admin-btn {
    flex: 1 1 100%;
}

.monthly-rank {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1em;
}

.points-positive {
    color: #4caf50;
    font-weight: bold;
}

.points-negative {
    color: #f44336;
    font-weight: bold;
}

.shame-emoji {
    font-size: 1.3em;
    margin-left: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .statistics-section {
        padding: 15px;
        margin: 20px 0;
    }
    
    .stats-table {
        font-size: 0.85em;
    }
    
    .stats-table th,
    .stats-table td {
        padding: 10px;
    }
    
    .stats-container h3 {
        font-size: 1.1em;
    }
}

/* Changelog Modal */
.changelog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.changelog-dialog {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 600px;
    width: 90%;
    text-align: left;
    position: relative;
    z-index: 100000;
    margin: 20px;
    max-height: 80vh;
    overflow-y: auto;
}

.changelog-dialog h2 {
    color: #667eea;
    margin: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 1.5em;
}

/* Titelzeile: gleich breite Zonen links/rechts halten den Titel exakt mittig */
.changelog-titlebar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
}
.changelog-titlebar .ctb-spacer {
    flex: 0 0 40px;
    width: 40px;
}

/* Mobile-Ansicht: kompakter Changelog (unabhängig von Viewport-Breite) */
body.view-mobile .changelog-dialog { padding: 22px 16px; }
body.view-mobile .changelog-titlebar { margin-bottom: 14px; }
body.view-mobile .changelog-titlebar .ctb-spacer { flex-basis: 32px; width: 32px; }
body.view-mobile .changelog-dialog h2 { font-size: 1.15em; }
body.view-mobile .changelog-dialog .close-btn { width: 32px; height: 32px; font-size: 1.5em; }
body.view-mobile .changelog-version { margin-bottom: 18px; padding-left: 14px; }
body.view-mobile .changelog-version h3 { font-size: 1em; }
body.view-mobile .changelog-version ul { font-size: 0.85em; }

@media (max-width: 480px) {
    .changelog-dialog { padding: 22px 16px; }
    .changelog-titlebar { margin-bottom: 14px; }
    .changelog-titlebar .ctb-spacer { flex-basis: 32px; width: 32px; }
    .changelog-dialog h2 { font-size: 1.15em; }
    .changelog-dialog .close-btn { width: 32px; height: 32px; font-size: 1.5em; }
}

.changelog-dialog .close-btn {
    position: static;
    flex: 0 0 40px;
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #666;
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.changelog-dialog .close-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.changelog-version {
    margin-bottom: 25px;
    border-left: 4px solid #667eea;
    padding-left: 20px;
}

.changelog-version-new {
    border-left-color: #00aaff;
    background: rgba(0, 170, 255, 0.05);
    border-radius: 0 8px 8px 0;
    padding: 12px 12px 12px 20px;
}

.changelog-new-badge {
    display: inline-block;
    background: linear-gradient(135deg, #00aaff, #0066cc);
    color: #fff;
    font-size: 0.58em;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 20px;
    vertical-align: middle;
    margin-left: 8px;
    letter-spacing: 0.05em;
    animation: badgePulse 1.8s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0,170,255,0.5); }
    50%       { box-shadow: 0 0 0 5px rgba(0,170,255,0); }
}

.changelog-version h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.changelog-version .version-date {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.changelog-version ul {
    margin: 0;
    padding-left: 20px;
}

.changelog-version li {
    margin-bottom: 8px;
    color: #555;
    line-height: 1.4;
}

.changelog-version li strong {
    color: #667eea;
}

/* Mobile Anpassungen für Changelog */
@media (max-width: 768px) {
    .changelog-dialog {
        width: 95%;
        padding: 30px 20px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .changelog-dialog h2 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }
    
    .changelog-version {
        padding-left: 15px;
    }
    
    .changelog-version h3 {
        font-size: 1.1em;
    }
    
    .changelog-version ul {
        padding-left: 15px;
    }
}

/* Smile Picker */
.comment-input {
    min-height: 80px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1em;
    resize: vertical;
    box-sizing: border-box;
}

.smile-picker {
    margin-top: 10px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.smile-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    margin-top: 5px; /* Kleiner Abstand oben */
}

.nav-btn {
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 16px;
}

.nav-btn:hover {
    background: #e0e0e0;
}

.page-indicator {
    font-weight: bold;
    font-size: 14px;
}

.smile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    gap: 10px;
}

.smile-grid span {
    font-size: 1.8em;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.smile-grid span img {
    display: block;
    pointer-events: none;
    image-rendering: auto;
}

.smile-grid span:hover {
    background: #f0f0f0;
    transform: scale(1.2);
}

.smile-grid span:active {
    transform: scale(0.9);
}

.added-smile img {
    vertical-align: middle;
    pointer-events: none;
}

.smile-count-num {
    font-size: 0.62em;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.35);
    vertical-align: middle;
    margin-left: 2px;
    font-style: normal;
}

/* Neue Smile-Sektion unter Spieler-Karten */
.smile-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    position: relative;
    min-height: 50px;
}

.smile-display {
    margin-bottom: 1px;
    min-height: 30px;
}

.added-smile {
    display: inline-flex;
    align-items: center;
    font-size: 1.5em;
    margin: 2px 2px;
    padding: 4px 6px;
    background: rgba(0, 0, 0, 0.06);
    border: 1.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.added-smile:hover {
    background: rgba(255, 235, 59, 0.2);
    border-color: rgba(255, 215, 0, 0.5);
    transform: scale(1.1);
}

.smile-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.6em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.added-smile:hover .smile-tooltip {
    opacity: 1;
}

.add-smile-btn {
    position: absolute;
    bottom: 5px;
    right: 10px;
    background: transparent;
    border: none;
    border-radius: 0;
    width: 30px;
    height: 30px;
    font-size: 20px;
    color: blue;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-smile-btn.minus-mode {
    position: absolute;
    top: 10px;
    right: 10px;
    color: red;
    font-weight: bold;
    z-index: 10;
}

.add-smile-btn:hover {
    color: darkblue;
    transform: scale(1.1);
}

.add-smile-btn:active {
    transform: scale(0.95);
}

/* Mobile Anpassungen für Smiles */
@media (max-width: 768px) {
    .added-smile {
        font-size: 1.2em;
        padding: 3px 5px;
        margin: 1px 2px;
    }
    
    .smile-display {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
}

/* Mobile Anpassungen für Smile Picker */
@media (max-width: 768px) {
    .comment-input-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .smile-btn {
        align-self: flex-end;
        width: 35px;
        height: 35px;
        font-size: 1em;
    }
    
    .smile-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }
    
    .smile-picker {
        padding: 10px;
    }
    
    .smile-grid span {
        font-size: 1.5em;
        padding: 6px;
    }
    
    .added-smile {
        font-size: 1.3em;
        margin: 2px 2px;
        padding: 2px 4px;
    }
    
    .add-smile-btn {
        width: 30px;
        height: 30px;
        font-size: 16px;
        bottom: 5px;
        right: 8px;
    }
}

/* Mobile: ausgeklappte Spieler-History – kompakt, Text klein */
@media (max-width: 600px) {
    .stats-table.monthly tbody tr.points-details-row td {
        padding: 0 0 3px;
    }
    .points-player-details {
        border-radius: 3px;
        margin-top: 1px;
    }
    .points-player-details-body {
        padding: 1px 2px 2px;
        max-height: 180px;
    }
    .points-player-details-close {
        font-size: 0.75em;
        padding: 1px 4px;
        top: 4px !important;
        right: 4px !important;
    }
    .points-tx-list {
        gap: 2px;
        margin-top: 2px;
    }
    .points-tx-item {
        padding: 3px 5px;
        gap: 4px;
        border-radius: 4px;
        align-items: flex-start;
    }
    .points-tx-reason {
        font-size: 0.58em;
        line-height: 1.2;
        font-weight: 600;
        word-break: break-word;
    }
    .points-tx-meta {
        font-size: 0.52em;
        margin-top: 0;
        color: #999;
    }
    .points-tx-delta {
        font-size: 0.6em;
        white-space: nowrap;
        font-weight: 900;
        flex-shrink: 0;
    }
}

/* ========== PWA INSTALL (als In-App-Benachrichtigung) ========== */
.pwa-install-notification {
    border-left: 4px solid #667eea;
}
.notification-app-icon {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.pwa-notification-actions {
    margin-top: 12px;
}
.pwa-notification-hint {
    margin-top: 8px;
    font-size: 11px;
    font-style: italic;
    color: #999;
    line-height: 1.35;
}
.pwa-install-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.4);
}
.pwa-install-btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(102, 126, 234, 0.5);
}
.pwa-ios-share {
    display: inline-block;
    padding: 1px 6px;
    background: rgba(102, 126, 234, 0.14);
    color: #5b4bd0;
    border-radius: 6px;
    font-weight: 600;
}

