@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Press Start 2P', cursive;
}

body {
    font-family: 'Press Start 2P', cursive;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32"><rect fill="%2338a9cc" width="16" height="16"/><rect fill="%2345b8d9" x="16" width="16" height="16"/><rect fill="%2345b8d9" y="16" width="16" height="16"/><rect fill="%2352c7e6" x="16" y="16" width="16" height="16"/></svg>');
    background-size: 32px 32px;
    color: #fff;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo img {
    max-width: 300px;
    height: auto;
}

.header {
    background: rgba(60, 60, 60, 0.9);
    border: 4px solid rgba(0, 0, 0, 0.5);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: inset -4px -4px 0px rgba(0, 0, 0, 0.5), inset 4px 4px 0px rgba(255, 255, 255, 0.2);
}

.header h1 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #fff;
    text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.5);
    font-family: 'Press Start 2P', cursive;
}

.stats-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.stat-box {
    background: rgba(40, 40, 40, 0.8);
    padding: 15px;
    text-align: center;
    border: 3px solid rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: inset -2px -2px 0px rgba(0, 0, 0, 0.5), inset 2px 2px 0px rgba(255, 255, 255, 0.2);
}

.stat-box.stat-filter {
    cursor: pointer;
    user-select: none;
}

.stat-box.stat-filter:hover {
    transform: translateY(-2px);
}

.stat-box.stat-filter:focus {
    outline: 2px solid rgba(255, 215, 0, 0.7);
    outline-offset: 2px;
}

.stat-box.stat-filter.active {
    border-color: #ffd700;
    box-shadow:
        inset -2px -2px 0px rgba(0, 0, 0, 0.5),
        inset 2px 2px 0px rgba(255, 255, 255, 0.25),
        0 0 0 2px rgba(255, 215, 0, 0.35);
}

.stat-box.stat-filter.alive.active {
    border-color: #ffd700;
    background: rgba(92, 184, 92, 0.35);
}

.stat-box.stat-filter.dead.active {
    border-color: #ffd700;
    background: rgba(217, 83, 79, 0.35);
}

.stat-box:not(.stat-filter):hover {
    transform: translateY(-2px);
}

.stat-box.alive {
    border-color: #5cb85c;
    background: rgba(92, 184, 92, 0.2);
}

.stat-box.dead {
    border-color: #d9534f;
    background: rgba(217, 83, 79, 0.2);
}

.stat-box div {
    font-size: 0.75rem;
    margin-bottom: 8px;
    letter-spacing: 2px;
    line-height: 1.2;
    font-family: 'Press Start 2P', cursive;
    text-transform: uppercase;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: bold;
    display: block;
    line-height: 1;
    margin: 0;
    font-family: 'Press Start 2P', cursive;
    color: #ffd700;
}

.search-box {
    width: 100%;
    max-width: 640px;
    min-height: 48px;
    box-sizing: border-box;
    display: block;
    margin-left: auto;
    margin-right: auto;
    padding: 12px 18px;
    font-size: 0.85rem;
    border: 3px solid rgba(0, 0, 0, 0.5);
    background: rgba(40, 40, 40, 0.9);
    color: #fff;
    margin-bottom: 20px;
    font-family: 'Press Start 2P', cursive;
    box-shadow: inset -2px -2px 0px rgba(0, 0, 0, 0.5), inset 2px 2px 0px rgba(255, 255, 255, 0.1);
}

.search-box:focus {
    outline: none;
    background: rgba(50, 50, 50, 0.9);
}

.search-box::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Press Start 2P', cursive;
}

.filter-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Oude ALLE / IN LEVEN / OVERLEDEN-knoppen: uit voor nu; class verwijderen om weer te tonen */
.filter-bar.filter-bar-hidden {
    display: none;
}

.filter-button {
    padding: 6px 12px;
    border: 3px solid #555;
    background: #3c3c3c;
    cursor: pointer;
    text-align: center;
    font-weight: bold;
    font-family: 'Press Start 2P', cursive;
    text-transform: uppercase;
    font-size: 0.65rem;
    color: #aaa;
    transition: all 0.15s ease;
    box-shadow: inset -2px -2px 0px #2a2a2a, inset 2px 2px 0px #4f4f4f;
    user-select: none;
}

.filter-button:hover {
    background: #4a4a4a;
    color: #fff;
}

.filter-button.active {
    border-color: #ffd700;
}

.filter-button.alive {
    background: #3d6b1e;
    border-color: #555;
    color: #fff;
    box-shadow: inset -2px -2px 0px #2d5016, inset 2px 2px 0px #4a8225;
}

.filter-button.alive:hover {
    background: #4a8225;
}

.filter-button.alive.active {
    background: #4a8225;
    color: #fff;
    border-color: #ffd700;
}

.filter-button.dead {
    background: #8b2020;
    border-color: #555;
    color: #fff;
    box-shadow: inset -2px -2px 0px #6b1818, inset 2px 2px 0px #a02828;
}

.filter-button.dead:hover {
    background: #a02828;
}

.filter-button.dead.active {
    background: #a02828;
    color: #fff;
    border-color: #ffd700;
}

.filter-info {
    margin-top: 20px;
}

.api-warning {
    margin-top: 10px;
    padding: 10px 16px;
    border: 2px solid rgba(255, 215, 0, 0.6);
    border-radius: 8px;
    background: rgba(200, 160, 0, 0.15);
    color: #fff;
    text-align: center;
    font-weight: bold;
    font-size: 0.85rem;
}

.filter-text {
    text-align: center;
    opacity: 0.7;
    margin-bottom: 20px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.compare-button,
.main-site-button,
.discord-button,
.signup-button {
    padding: 12px 20px;
    text-decoration: none;
    font-weight: bold;
    font-family: 'Press Start 2P', cursive;
    text-transform: uppercase;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 3px solid rgba(0, 0, 0, 0.5);
    box-shadow: inset -2px -2px 0px rgba(0, 0, 0, 0.5), inset 2px 2px 0px rgba(255, 255, 255, 0.2);
}

.compare-button {
    background: rgba(120, 80, 60, 0.9);
    color: #fff;
}

.compare-button:hover {
    background: rgba(140, 100, 80, 0.9);
    transform: translateY(-1px);
}

.main-site-button {
    background: rgba(80, 100, 120, 0.9);
    color: #fff;
}

.main-site-button:hover {
    background: rgba(100, 120, 140, 0.9);
    transform: translateY(-1px);
}

.main-site-icon {
    width: 18px;
    height: 18px;
}

.discord-button {
    background: #5865F2;
    color: #fff;
}

.discord-button:hover {
    background: #6875ff;
    transform: translateY(-1px);
}

.discord-icon {
    width: 18px;
    height: 18px;
    filter: invert(1);
}

.signup-button {
    background: #2ecc71;
    color: #fff;
}

.signup-button:hover {
    background: #3ddb80;
    transform: translateY(-1px);
}

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

.player-card {
    background: rgba(60, 60, 60, 0.9);
    padding: 15px;
    border: 3px solid rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-shadow: inset -3px -3px 0px rgba(0, 0, 0, 0.5), inset 3px 3px 0px rgba(255, 255, 255, 0.2);
}

.player-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.3);
}

.player-card.alive {
    border-top: 4px solid #5cb85c;
}

.player-card.dead {
    opacity: 0.8;
    border-top: 4px solid #d9534f;
}

.player-card.dead:hover {
    border-color: rgba(217, 83, 79, 0.5);
}

/* Twitch Live Indicator */
@keyframes live-glow {
    0%, 100% { box-shadow: inset -3px -3px 0px rgba(0, 0, 0, 0.5), inset 3px 3px 0px rgba(255, 255, 255, 0.2), 0 0 8px rgba(255, 0, 0, 0.4); }
    50% { box-shadow: inset -3px -3px 0px rgba(0, 0, 0, 0.5), inset 3px 3px 0px rgba(255, 255, 255, 0.2), 0 0 20px rgba(255, 0, 0, 0.7); }
}

.player-card.live {
    border-color: #ff2020;
    animation: live-glow 2s ease-in-out infinite;
}

.player-card.live.alive {
    border-top: 4px solid #ff2020;
}

.player-card.live.dead {
    border-top: 4px solid #ff2020;
}

.live-badge {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff2020;
    color: #fff;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    padding: 3px 8px;
    z-index: 10;
    user-select: none;
    border: 2px solid rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.player-avatar {
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 12px;
    object-fit: contain;
    display: block;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(0, 0, 0, 0.5);
    box-shadow: inset -2px -2px 0px rgba(0, 0, 0, 0.5);
}

.player-info {
    text-align: center;
    min-height: fit-content;
}

.player-name {
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 3px;
    font-family: 'Press Start 2P', cursive;
    text-transform: uppercase;
}

.minecraft-name {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-bottom: 10px;
    font-family: 'Press Start 2P', cursive;
}

.twitch-name {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: -3px;
    margin-bottom: 8px;
    font-family: 'Press Start 2P', cursive;
    color: #9146FF;
}

.player-badges {
    display: flex;
    gap: 5px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.badge {
    padding: 4px 10px;
    font-size: 0.65rem;
    font-weight: bold;
    font-family: 'Press Start 2P', cursive;
    text-transform: uppercase;
    border: 2px solid rgba(0, 0, 0, 0.5);
    box-shadow: inset -1px -1px 0px rgba(0, 0, 0, 0.5), inset 1px 1px 0px rgba(255, 255, 255, 0.2);
}

.badge.alive {
    background: #5cb85c;
    color: #fff;
}

.badge.dead {
    background: #d9534f;
    color: #fff;
}

.player-stats {
    display: flex;
    justify-content: space-around;
    padding-top: 12px;
    border-top: 2px solid rgba(0, 0, 0, 0.5);
    gap: 8px;
}

.stat {
    text-align: center;
    flex: 1;
}

.stat-label {
    font-size: 0.6rem;
    opacity: 0.7;
    text-transform: uppercase;
    margin-bottom: 4px;
    font-family: 'Press Start 2P', cursive;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1rem;
    font-weight: bold;
    font-family: 'Press Start 2P', cursive;
    color: #ffd700;
}

.stat-value.positive {
    color: #5cb85c;
}

.stat-value.negative {
    color: #d9534f;
}

.no-results {
    text-align: center;
    font-size: 1.5rem;
    padding: 50px;
    opacity: 0.5;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.modal {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 30px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.modal-avatar {
    width: 100px;
    height: 100px;
    border-radius: 15px;
    object-fit: cover;
    border: 3px solid #00ff87;
}

.modal-title {
    flex: 1;
}

.modal-player-name {
    font-size: clamp(1rem, 4vw, 2rem);
    font-weight: bold;
    margin-bottom: 5px;
    font-family: 'Press Start 2P', cursive;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.modal-minecraft-name {
    font-size: clamp(0.65rem, 2.6vw, 1.2rem);
    opacity: 0.7;
    margin-bottom: 10px;
    font-family: 'Press Start 2P', cursive;
    overflow-wrap: anywhere;
}

.modal-status-badges {
    display: flex;
    gap: 10px;
}

/* Grotere IN LEVEN / OVERLEDEN badge in de modal */
.modal-status-badges .badge {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 2rem;
    border-radius: 50%;
    cursor: pointer;
    font-family: 'Press Start 2P', cursive;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #ff3864;
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    overflow-x: hidden;
}

.modal-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
    min-width: 0;
}

.modal-stat {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
    min-width: 0;
}

.modal-stat-label {
    font-size: clamp(0.45rem, 1.2vw, 0.8rem);
    opacity: 0.7;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-family: 'Press Start 2P', cursive;
    line-height: 1.3;
    word-break: break-word;
}

.modal-stat-value {
    font-size: clamp(1rem, 3vw, 1.8rem);
    font-weight: bold;
    font-family: 'Press Start 2P', cursive;
    line-height: 1.2;
    word-break: break-word;
}

.modal-stat-value.positive {
    color: #00ff87;
}

.modal-stat-value.negative {
    color: #ff3864;
}

.modal-twitch-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: #9146FF;
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-weight: bold;
    font-family: 'Press Start 2P', cursive;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.modal-twitch-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(145, 70, 255, 0.4);
}

.modal-twitch-icon {
    width: 24px;
    height: 24px;
    filter: invert(1);
}

.modal-deathclip-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: #d9534f;
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-weight: bold;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.modal-deathclip-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(217, 83, 79, 0.4);
    background: #c9302c;
}

/* Discord Widget */
.discord-widget {
    position: fixed;
    right: 20px;
    bottom: 20px;
    top: auto;
    transform: none;
    z-index: 100;
}

.discord-widget iframe {
    border-radius: 10px;
    border: 3px solid rgba(0, 0, 0, 0.5);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    width: clamp(250px, 25vw, 350px);
    height: clamp(350px, 45vh, 500px);
}

/* Responsive Design */
@media (max-width: 1300px) {
    .discord-widget {
        display: none;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header {
        padding: 15px;
        margin-bottom: 15px;
    }

    .header h1 {
        font-size: 1.2rem;
        margin-bottom: 15px;
        letter-spacing: 1px;
    }

    .logo-container {
        margin-bottom: 15px;
    }

    .logo img {
        max-width: 200px;
    }

    /* Stats bar - force 3 columns on mobile */
    .stats-bar {
        display: grid !important;
        grid-template-columns: 1fr 1fr 1fr !important;
        flex-wrap: nowrap;
        gap: 6px;
        margin-bottom: 15px;
    }

    .stat-box {
        padding: 6px 2px;
        border-width: 2px;
        min-width: 0;
        overflow: hidden;
    }

    .stat-box div {
        font-size: 0.38rem;
        margin-bottom: 3px;
        letter-spacing: 0px;
        word-break: break-word;
    }

    .stat-number {
        font-size: 1.2rem;
    }

    /* Search box */
    .search-box {
        width: 100%;
        max-width: none;
        min-height: 44px;
        font-size: 0.62rem;
        padding: 10px 14px;
        margin-bottom: 12px;
    }

    /* Filter buttons */
    .filter-bar:not(.filter-bar-hidden) {
        gap: 4px;
        margin-bottom: 12px;
    }

    .filter-button {
        padding: 5px 10px;
        font-size: 0.55rem;
        border-width: 2px;
    }

    /* Filter text */
    .filter-text {
        font-size: 0.5rem;
        margin-bottom: 12px;
    }

    /* Action buttons */
    .action-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .compare-button,
    .main-site-button,
    .discord-button,
    .signup-button {
        width: 100%;
        justify-content: center;
        padding: 10px 15px;
        font-size: 0.7rem;
    }

    /* Player grid */
    .player-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
        margin-top: 15px;
    }

    .player-card {
        padding: 10px;
        border-width: 2px;
    }

    .player-card.alive {
        border-top-width: 3px;
    }

    .player-card.dead {
        border-top-width: 3px;
    }

    .player-avatar {
        margin-bottom: 8px;
    }

    .player-name {
        font-size: 0.65rem;
        margin-bottom: 2px;
    }

    .twitch-name {
        font-size: 0.5rem;
        margin-bottom: 5px;
    }

    .badge {
        padding: 3px 6px;
        font-size: 0.5rem;
    }

    .player-badges {
        margin-bottom: 8px;
    }

    .player-stats {
        padding-top: 8px;
        gap: 4px;
    }

    .stat-label {
        font-size: 0.4rem;
        letter-spacing: 0px;
    }

    .stat-value {
        font-size: 0.7rem;
    }

    /* Modal */
    .modal-overlay {
        padding: 10px;
    }

    .modal-header {
        flex-direction: column;
        text-align: center;
        padding: 15px;
        gap: 10px;
    }

    .modal-avatar {
        width: 70px;
        height: 70px;
        border-radius: 10px;
    }

    .modal-player-name {
        font-size: 1.1rem;
    }

    .modal-minecraft-name {
        font-size: 0.7rem;
    }

    .modal-close {
        top: 8px;
        right: 8px;
        width: 30px;
        height: 30px;
        font-size: 1.4rem;
    }

    .modal-body {
        padding: 15px;
    }

    .modal-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 15px;
    }

    .modal-stat {
        padding: 10px 5px;
        border-radius: 8px;
    }

    .modal-stat-label {
        font-size: 0.45rem;
        margin-bottom: 5px;
    }

    .modal-stat-value {
        font-size: 1rem;
    }

    .modal-twitch-button {
        padding: 10px;
        font-size: 0.65rem;
        margin-bottom: 10px;
    }

    .modal-twitch-icon {
        width: 18px;
        height: 18px;
    }

    .modal-deathclip-button {
        padding: 10px;
        font-size: 0.6rem;
    }

    .no-results {
        font-size: 0.8rem;
        padding: 30px;
    }
}
