/* --- BASIS INSTELLINGEN --- */
* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-image: url('achtergrond_groot.png'); 
    background-position: center; 
    background-size: cover; 
    background-repeat: no-repeat; 
    background-attachment: fixed;
}

.verborgen {
    display: none !important;
}

/* --- BEURT INDICATOR --- */
#beurt-indicator {
    position: fixed;
    top: 0; left: 0; width: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    text-align: center;
    padding: 15px 0;
    z-index: 9999;
    display: none;
    box-shadow: 0 2px 15px rgba(0,0,0,0.6);
}

#beurt-indicator h2 {
    margin: 0;
    font-size: 20px;
}

/* --- STARTSCHERM --- */
#setup-scherm {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    text-align: center;
    border: 4px solid #333;
    width: 320px;
}

#start-spel-knop {
    margin-top: 20px;
    padding: 12px 24px;
    font-size: 18px;
    font-weight: bold;
    background-color: #3498db; 
    color: white;
    border: 2px solid #333;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 2px 2px 0px #333;
}

/* --- HET BORD --- */
#game-container {
    display: grid;
    grid-template-columns: repeat(7, 85px); 
    grid-template-rows: repeat(7, 85px);    
    gap: 4px; 
    background-color: #333; 
    padding: 10px;
    border-radius: 8px;
    margin-top: 80px;
}

.vakje {
    background-color: white; 
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    font-size: 10px;
    font-weight: bold;
    padding: 5px;
    position: relative; 
}

.middenstuk {
    grid-column: 2 / 7;
    grid-row: 2 / 7;
    background-color: #b0c4de;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 24px;
    border-radius: 4px;
}

/* --- POPPETJES EN HUISJES --- */
.speler-token {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid white;
    margin-top: auto;
    margin-bottom: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.token-naam {
    font-size: 7px;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 1px black;
}

/* --- KNOPPEN ONDER HET BORD --- */
#dobbel-knop {
    padding: 12px 24px;
    font-size: 18px;
    font-weight: bold;
    background-color: #279b61;
    color: white;
    border: 2px solid #333;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 3px 3px 0px #333;
    margin: 10px;
}

#inventaris-knop {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    background-color: #3498db;
    color: white;
    border: 2px solid #333;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 3px 3px 0px #333;
}

/* --- POP-UPS --- */
#kaart-popup, #inventaris-popup, #bewijs-popup {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.7); 
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.kaart-content {
    background-color: white;
    border: 4px solid #333;
    border-radius: 12px;
    width: 320px;
    text-align: center;
    overflow: hidden;
}

.inventaris-content {
    background-color: white;
    border: 4px solid #333;
    border-radius: 15px;
    width: 90%;
    max-width: 450px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

#kaart-header {
    padding: 20px;
    color: white;
    font-size: 24px;
    font-weight: bold;
}

#kaart-knoppen button {
    display: block;
    width: 90%;
    margin: 10px auto;
    padding: 12px;
    font-size: 15px;
    font-weight: bold;
    color: #3e2723;
    background: linear-gradient(135deg, #fdd835 0%, #fbc02d 100%);
    border: 2px solid #333;
    border-radius: 8px;
    cursor: pointer;
}

/* --- LIVE LOG --- */
#live-log {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #333;
    margin: 20px auto;
    width: 320px;
    height: 80px;
    overflow-y: auto;
    padding: 5px;
    font-family: monospace;
    font-size: 12px;
    border-radius: 6px;
}

/* --- PASPOORT GRID --- */
#inventaris-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 15px 0;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 10px;
    border: 2px inset #eee;
}

.p-btn {
    margin: 5px;
    padding: 8px 15px;
    background: linear-gradient(135deg, #fdd835 0%, #fbc02d 100%);
    border: 2px solid #333;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 2px 2px 0px #333;
}

.inventaris-item {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 2px solid #ccc;
    background-color: #eee;
    color: #999;
    font-size: 10px;
    font-weight: bold;
    transition: transform 0.2s;
    text-transform: uppercase;
}

.inventaris-item.bezocht {
    border: 2px solid #333;
    color: white;
    cursor: pointer;
    box-shadow: 3px 3px 0px rgba(0,0,0,0.2);
}

.inventaris-item.bezocht:hover { transform: scale(1.05); }
#sluit-inventaris { margin-top: 10px; padding: 10px 25px; background-color: #eee; border: 2px solid #333; font-weight: bold; border-radius: 5px; cursor: pointer; }

/* --- RECAP SCHERM --- */
#recap-scherm {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: #000;
    color: white;
    z-index: 20000;
    overflow-y: auto;
    padding: 20px;
    text-align: center;
}

.stat-card {
    background: #222;
    border: 2px solid #f1c40f;
    padding: 12px;
    margin: 10px;
    border-radius: 8px;
    text-align: center;
}

.reset-btn {
    background-color: #c0392b; color: white; padding: 15px 30px; border: 2px solid white; border-radius: 8px; font-weight: bold; cursor: pointer;
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 10002; box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

/* --- PURE CSS POLAROIDS --- */
.polaroid-wrapper {
    background: #ffffff; padding: 15px 15px 50px 15px; width: 320px; max-width: 90%; margin: 30px auto; box-shadow: 0 8px 15px rgba(0,0,0,0.5); transition: transform 0.3s; position: relative; display: inline-block;
}
.polaroid-wrapper:nth-child(even) { transform: rotate(3deg); }
.polaroid-wrapper:nth-child(odd) { transform: rotate(-3deg); }

.speler-foto-binnen {
    width: 100%; height: auto; max-height: 400px; object-fit: contain; background-color: #f4f4f4; border: 1px solid #ddd; display: block;
}
.polaroid-label {
    position: absolute; bottom: 15px; left: 0; width: 100%; text-align: center; color: #333; font-family: Arial, sans-serif; font-size: 16px; font-weight: bold;
}

/* --- SPELER BADGES OP HET BORD --- */
.badge-container {
    position: absolute; bottom: 2px; width: 100%; display: flex; justify-content: center; flex-wrap: wrap; gap: 2px;
}
.speler-badge {
    width: 10px; height: 10px; border-radius: 50%; border: 1px solid white; box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* --- WEERGAVE FOTO IN PASPOORT --- */
.bewijs-foto-weergave {
    width: 100%; max-height: 250px; object-fit: contain; background-color: #f4f4f4; border: 2px solid #ddd; border-radius: 8px; margin-top: 10px; box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}

/* ==========================================================================
   🔥 GLOEDNIEUW: DYNAMISCHE OVERLAYS (VOOR VEILING & LIVE AANVAL) 🔥
   ========================================================================== */
.custom-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 25000; /* Altijd bovenop alles */
    animation: overlayFadeIn 0.3s ease;
}

.custom-overlay-content {
    background-color: white;
    border: 5px solid #333;
    border-radius: 16px;
    width: 90%;
    max-width: 340px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    color: #333;
}

.custom-overlay-content button {
    margin-top: 10px;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==========================================================================
   💥 DE MOBILE FIX: Zorgt dat het bord perfect schaalt op telefoons! 💥
   ========================================================================== */
@media screen and (max-width: 630px) {
    #game-container {
        grid-template-columns: repeat(7, 45px); 
        grid-template-rows: repeat(7, 45px);
        gap: 2px; padding: 6px; margin-top: 75px;
    }
    .vakje { font-size: 7px; padding: 2px; letter-spacing: -0.3px; }
    .middenstuk { font-size: 14px; }
    .speler-token { width: 15px; height: 15px; border-width: 1px; margin-bottom: 2px; }
    .token-naam { font-size: 5px; }
    .badge-container { bottom: 1px; gap: 1px; }
    .speler-badge { width: 6px; height: 6px; border-width: 0.5px; }
    #dobbel-knop, #inventaris-knop { padding: 10px 18px; font-size: 14px; margin: 5px; }
    #live-log { width: 290px; height: 70px; }
    /* --- PASPOORT MOBILE FIX --- */
    .inventaris-content {
        width: 95%;
        padding: 15px 10px;
        max-height: 85vh; /* Zorgt dat de popup maximaal 85% van je schermhoogte inneemt */
        overflow-y: auto; /* Voegt een scrollbar toe als de inhoud langer is dan je scherm */
    }

    #inventaris-grid {
        gap: 5px;
        padding: 5px;
        margin: 10px 0;
    }

    .inventaris-item {
        font-size: 7.5px; /* Krimp de namen in de vakjes */
        padding: 2px;
    }

    .p-btn {
        padding: 6px 10px; /* Maak de speler-knoppen iets kleiner */
        font-size: 11px;
    }

    .bewijs-foto-weergave {
        max-height: 180px; /* Zorgt dat de opgevraagde foto niet heel je scherm overneemt */
    }
}