/* ===== ArnariFotografie SPEURTOCHT ===== */
/* Kleurenschema: #BBD33B (lime groen) + zwart + wit */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --lime: #BBD33B;
    --lime-dark: #9AB02E;
    --lime-light: #D4E86A;
    --black: #0a0a0a;
    --black-light: #1a1a1a;
    --black-card: #141414;
    --white: #ffffff;
    --gray: #888888;
    --gray-dark: #555555;
    --success: #4ade80;
    --danger: #ef4444;
    --orange: #ff6b35;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--black);
    color: var(--white);
    min-height: 100vh;
    /* overflow-x NIET op body — breekt position:sticky op iOS */
    -webkit-font-smoothing: antialiased;
}

/* ===== ANIMATIES ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(187, 211, 59, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px 10px rgba(187, 211, 59, 0.2); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}
@keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes glow {
    0%, 100% { text-shadow: 0 0 5px rgba(187, 211, 59, 0.5); }
    50% { text-shadow: 0 0 20px rgba(187, 211, 59, 0.8), 0 0 40px rgba(187, 211, 59, 0.4); }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
@keyframes confetti {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== CONTAINER ===== */
.speurtocht-container {
    min-height: 100vh;
    padding: 20px 16px 100px;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    overflow-x: clip; /* clip i.p.v. hidden — breekt sticky NIET */
}

/* Achtergrond animatie */
.speurtocht-container::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 50%, rgba(187, 211, 59, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(187, 211, 59, 0.02) 0%, transparent 50%);
    animation: rotate 60s linear infinite;
    pointer-events: none;
    z-index: -1;
}

/* ===== LOGO ===== */
.speurtocht-logo {
    scroll-margin-top: calc(env(safe-area-inset-top, 0px) + var(--header-height, 60px) + var(--timer-height, 80px) + 12px);
    text-align: center;
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease-out, float 4s ease-in-out infinite;
}
.speurtocht-logo img {
    max-width: 90%;
    width: 280px;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(187, 211, 59, 0.3));
}

/* ===== TITEL ===== */
.speurtocht-title {
    font-size: 32px;
    font-weight: 900;
    text-align: center;
    color: var(--lime);
    margin-bottom: 4px;
    animation: fadeIn 0.6s ease-out, glow 3s ease-in-out infinite;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.speurtocht-subtitle {
    font-size: 14px;
    color: var(--gray);
    text-align: center;
    margin-bottom: 24px;
    animation: fadeIn 0.7s ease-out;
}

/* ===== LOGIN SCHERM ===== */
.login-screen {
    animation: fadeIn 0.6s ease-out;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 0;
}

.login-card {
    background: var(--black-card);
    border-radius: 24px;
    padding: 32px 24px;
    border: 2px solid var(--lime);
    text-align: center;
    animation: fadeInScale 0.5s ease-out;
}
.login-card h2 {
    font-size: 22px;
    color: var(--lime);
    margin-bottom: 8px;
    font-weight: 800;
}
.login-card p {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.6;
}
.login-card .form-group {
    margin-bottom: 20px;
}
.login-card input {
    width: 100%;
    padding: 18px 20px;
    background: var(--black-light);
    border: 2px solid var(--gray-dark);
    border-radius: 16px;
    color: var(--white);
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 4px;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    transition: all 0.3s;
}
.login-card input:focus {
    outline: none;
    border-color: var(--lime);
    box-shadow: 0 0 20px rgba(187, 211, 59, 0.2);
}
.login-card input::placeholder {
    color: var(--gray-dark);
    font-size: 18px;
    letter-spacing: 2px;
}

.login-error {
    color: var(--danger);
    font-size: 14px;
    font-weight: 600;
    margin-top: 16px;
    animation: shake 0.4s ease-out;
}

/* ===== GAME HEADER ===== */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--black-card);
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--gray-dark);
    animation: fadeIn 0.5s ease-out;
}
.game-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.game-header-info #playerNameDisplay {
    font-size: 14px;
    color: var(--white);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}
.game-header-info #playerCode {
    font-size: 11px;
    color: var(--gray);
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}
.btn-logout {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--danger);
    border-radius: 8px;
    color: var(--danger);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-logout:hover {
    background: var(--danger);
    color: var(--white);
}

/* ===== KNOP: UITLEG ===== */
.btn-toggle-uitleg {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 2px solid var(--lime);
    border-radius: 12px;
    color: var(--lime);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 16px;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: fadeIn 0.8s ease-out;
}
.btn-toggle-uitleg:hover {
    background: var(--lime);
    color: var(--black);
    box-shadow: 0 0 20px rgba(187, 211, 59, 0.3);
}
.btn-toggle-uitleg:active {
    transform: scale(0.98);
}

/* ===== UITLEG KAART ===== */
.uitleg-card {
    background: var(--black-card);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--gray-dark);
    border-left: 4px solid var(--lime);
    animation: slideDown 0.4s ease-out;
}
.uitleg-card h2 {
    font-size: 18px;
    color: var(--lime);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
}
.uitleg-card p, .uitleg-card li {
    font-size: 14px;
    color: var(--gray);
    line-height: 1.7;
    margin-bottom: 8px;
}
.uitleg-card ul {
    padding-left: 20px;
    margin: 12px 0;
}
.uitleg-card li {
    margin-bottom: 6px;
}
.uitleg-card strong {
    color: var(--white);
}

/* ===== KNOP: NIEUWE OPDRACHT ===== */
.btn-nieuwe-opdracht {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, var(--lime), var(--lime-dark));
    border: none;
    border-radius: 16px;
    color: var(--black);
    font-size: 20px;
    font-weight: 900;
    cursor: pointer;
    margin: 16px 0;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: fadeIn 0.9s ease-out, pulse 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}
.btn-nieuwe-opdracht::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}
.btn-nieuwe-opdracht:hover::before {
    left: 100%;
}
.btn-nieuwe-opdracht:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(187, 211, 59, 0.4);
}
.btn-nieuwe-opdracht:active {
    transform: scale(0.98) translateY(0);
}

/* ===== OPDRACHT KAART ===== */
.opdracht-card {
    scroll-margin-top: calc(env(safe-area-inset-top, 0px) + var(--header-height, 60px) + var(--timer-height, 80px) + 12px);
    background: var(--black-card);
    border-radius: 24px;
    padding: 32px 24px;
    margin-bottom: 24px;
    border: 2px solid var(--lime);
    position: relative;
    overflow: hidden;
    animation: float 3s ease-in-out infinite, fadeIn 0.5s ease-out;
}
.opdracht-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--lime), var(--lime-light));
}
.opdracht-card.voltooid {
    border-color: var(--success);
    animation: fadeIn 0.5s ease-out;
}
.opdracht-card.voltooid::after {
    content: '✓ VOLTOOID';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    background: rgba(74, 222, 128, 0.95);
    color: var(--black);
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 3px;
    z-index: 10;
    animation: pulse 1s ease-in-out;
}

.opdracht-nummer {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--lime), var(--lime-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 900;
    color: var(--black);
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(187, 211, 59, 0.4);
}

.opdracht-categorie {
    display: inline-block;
    background: rgba(187, 211, 59, 0.15);
    color: var(--lime);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 12px;
    border: 1px solid rgba(187, 211, 59, 0.3);
}

.opdracht-titel {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 16px;
    padding-right: 60px;
    color: var(--white);
    line-height: 1.2;
}

.opdracht-tekst {
    font-size: 16px;
    color: var(--gray);
    line-height: 1.8;
    margin-bottom: 20px;
}

.opdracht-extra {
    background: var(--black-light);
    border-radius: 16px;
    padding: 18px;
    font-size: 14px;
    color: var(--lime);
    border-left: 4px solid var(--lime);
    margin-bottom: 16px;
    font-weight: 600;
}

.opdracht-punten {
    display: inline-block;
    background: linear-gradient(135deg, var(--lime), var(--lime-dark));
    color: var(--black);
    font-size: 14px;
    font-weight: 900;
    padding: 8px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
}

/* ===== UPLOAD TOGGLE ===== */
.upload-toggle {
    margin: 20px 0;
    padding: 16px;
    background: var(--black-light);
    border-radius: 16px;
    border: 1px solid var(--gray-dark);
}
.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}
.toggle-label input {
    display: none;
}
.toggle-slider {
    width: 52px;
    height: 28px;
    background: var(--gray-dark);
    border-radius: 14px;
    position: relative;
    transition: all 0.3s;
    flex-shrink: 0;
}
.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: var(--white);
    border-radius: 50%;
    transition: all 0.3s;
}
.toggle-label input:checked + .toggle-slider {
    background: var(--lime);
}
.toggle-label input:checked + .toggle-slider::after {
    left: 27px;
    background: var(--black);
}
.toggle-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--white);
}
.toggle-hint {
    font-size: 12px;
    color: var(--gray);
    margin-top: 8px;
    padding-left: 64px;
}

/* ===== UPLOAD ===== */
.upload-sectie {
    margin: 20px 0;
}
.upload-area {
    border: 3px dashed var(--lime);
    border-radius: 24px;
    padding: 50px 24px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    background: var(--black-light);
    position: relative;
    overflow: hidden;
}
.upload-area::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(187, 211, 59, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}
.upload-area:hover::before {
    opacity: 1;
}
.upload-area:hover {
    border-color: var(--lime-light);
    box-shadow: 0 0 30px rgba(187, 211, 59, 0.1);
    transform: translateY(-2px);
}
.upload-area:active {
    transform: scale(0.98);
}
.upload-icon {
    font-size: 56px;
    margin-bottom: 16px;
    animation: bounce 2s ease-in-out infinite;
}
.upload-text {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--white);
}
.upload-hint {
    font-size: 14px;
    color: var(--gray);
}
.preview-image {
    width: 100%;
    max-height: 350px;
    object-fit: cover;
    border-radius: 20px;
    margin: 20px 0;
    display: none;
    border: 2px solid var(--lime);
    box-shadow: 0 0 20px rgba(187, 211, 59, 0.2);
}

/* ===== KNOP: VOLTOOID ===== */
.btn-voltooid {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, var(--lime), var(--lime-dark));
    border: none;
    border-radius: 16px;
    color: var(--black);
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}
.btn-voltooid::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}
.btn-voltooid:hover::before {
    left: 100%;
}
.btn-voltooid:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(187, 211, 59, 0.4);
}
.btn-voltooid:active {
    transform: scale(0.98);
}
.btn-voltooid:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== VOORTGANG ===== */
.voortgang {
    text-align: center;
    padding: 24px 16px;
    color: var(--gray);
    font-size: 14px;
    animation: fadeIn 1s ease-out;
}
.voortgang-bar {
    width: 100%;
    height: 12px;
    background: var(--black-light);
    border-radius: 6px;
    margin-top: 12px;
    overflow: hidden;
    border: 1px solid var(--gray-dark);
}
.voortgang-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--lime), var(--lime-light));
    border-radius: 6px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(187, 211, 59, 0.3);
}

/* ===== VOLTOOIDE LIJST ===== */
.voltooide-lijst {
    margin-top: 32px;
    animation: fadeIn 0.5s ease-out;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0 16px;
}
.section-title {
    font-size: 20px;
    font-weight: 900;
    color: var(--lime);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.voltooide-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--black-card);
    border-radius: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--gray-dark);
    border-left: 4px solid var(--lime);
    transition: all 0.3s;
    animation: slideInLeft 0.4s ease-out;
}
.voltooide-item:hover {
    transform: translateX(8px);
    border-color: var(--lime);
    box-shadow: 0 4px 20px rgba(187, 211, 59, 0.1);
}
.voltooide-item img {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid var(--lime);
}
.voltooide-item-info {
    flex: 1;
}
.voltooide-item-titel {
    font-size: 16px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 2px;
}
.voltooide-item-cat {
    font-size: 11px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.voltooide-item-status {
    font-size: 13px;
    color: var(--lime);
    font-weight: 600;
}

/* ===== EINDSCHERM ===== */
.end-screen {
    position: fixed;
    inset: 0;
    background: var(--black);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
    animation: fadeIn 0.6s ease-out;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.end-content {
    text-align: center;
    max-width: 500px;
    width: 100%;
    animation: fadeInScale 0.6s ease-out 0.2s both;
    padding: 12px 0 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.end-icon {
    font-size: 36px;
    line-height: 1;
    animation: bounce 2s ease-in-out infinite;
    margin: 0;
}
.end-title {
    font-size: 22px;
    font-weight: 900;
    color: var(--lime);
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: glow 3s ease-in-out infinite;
    line-height: 1.2;
    margin: 0;
}
.end-message {
    font-size: 13px;
    color: var(--gray);
    line-height: 1.5;
    margin: 0;
}
.end-message strong {
    color: var(--white);
}
.end-stats {
    background: var(--black-card);
    border-radius: 14px;
    padding: 12px 14px;
    border: 1.5px solid var(--lime);
    margin: 4px 0;
}
.end-stats-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid var(--gray-dark);
    font-size: 13px;
    min-height: 28px;
}
.end-stats-item:last-child {
    border-bottom: none;
}
.end-stats-label {
    color: var(--gray);
    text-align: left;
}
.end-stats-value {
    color: var(--lime);
    font-weight: 800;
    text-align: right;
    white-space: nowrap;
}
.end-logout-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--lime), var(--lime-dark));
    border: none;
    border-radius: 12px;
    color: var(--black);
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
    -webkit-tap-highlight-color: transparent;
}

/* ===== CONFETTI EFFECT ===== */
.confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}
.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--lime);
    animation: confetti 3s ease-out forwards;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 380px) {
    .speurtocht-title { font-size: 26px; }
    .opdracht-titel { font-size: 22px; }
    .opdracht-card { padding: 24px 20px; }
    .btn-nieuwe-opdracht { font-size: 18px; }
    .btn-voltooid { font-size: 16px; }
    .end-title { font-size: 28px; }
    .login-card input { font-size: 20px; }
}

/* ===== TIMER ===== */
.timer-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--black-card);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 2px solid var(--lime);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: fadeIn 0.5s ease-out;
    backdrop-filter: blur(10px);
}
.timer-bar.warning {
    border-color: var(--orange);
    animation: pulse 1.5s ease-in-out infinite;
}
.timer-bar.danger {
    border-color: var(--danger);
    animation: shake 0.5s ease-out, pulse 1s ease-in-out infinite;
}
.timer-bar.ended {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}
.timer-label {
    font-size: 12px;
    color: var(--gray);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.timer-display {
    font-size: 28px;
    font-weight: 900;
    color: var(--lime);
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}
.timer-bar.warning .timer-display {
    color: var(--orange);
}
.timer-bar.danger .timer-display,
.timer-bar.ended .timer-display {
    color: var(--danger);
}
.timer-icon {
    font-size: 24px;
}

/* ===== DOBBELSTEEN ===== */
.dice-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.95);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.dice-container {
    position: relative;
    width: 120px;
    height: 120px;
    perspective: 600px;
    margin-bottom: 30px;
}

.dice {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s;
}

.dice.spinning {
    animation: diceSpin 0.6s linear infinite;
}

@keyframes diceSpin {
    0% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
    25% { transform: rotateX(180deg) rotateY(90deg) rotateZ(45deg); }
    50% { transform: rotateX(360deg) rotateY(180deg) rotateZ(90deg); }
    75% { transform: rotateX(540deg) rotateY(270deg) rotateZ(135deg); }
    100% { transform: rotateX(720deg) rotateY(360deg) rotateZ(180deg); }
}

.dice-face {
    position: absolute;
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--lime), var(--lime-dark));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    font-weight: 900;
    color: var(--black);
    box-shadow: 0 0 30px rgba(187, 211, 59, 0.4), inset 0 0 20px rgba(0,0,0,0.1);
    border: 3px solid var(--lime-light);
}

.dice-face-front  { transform: translateZ(60px); }
.dice-face-back   { transform: rotateY(180deg) translateZ(60px); }
.dice-face-right  { transform: rotateY(90deg) translateZ(60px); }
.dice-face-left   { transform: rotateY(-90deg) translateZ(60px); }
.dice-face-top    { transform: rotateX(90deg) translateZ(60px); }
.dice-face-bottom { transform: rotateX(-90deg) translateZ(60px); }

.dice-dot {
/*    width: 18px;
    height: 18px;
    background: var(--black);
    border-radius: 50%;
    position: absolute;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3); */
position: absolute;
    width: 24px;         /* Pas de grootte van de camera aan */
    height: 24px;        /* Pas de grootte van de camera aan */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;     /* Bepaalt hoe groot de emoji getoond wordt */
    
    /* Verwijder de onderstaande regels als ze nog in je oude code staan: */
    background-color: transparent !important; /* Haalt de achtergrondkleur van de stip weg */
    border-radius: 0 !important;              /* Maakt het element weer vierkant ipv rond */
}	
}

/* Dot positions for each face */
/* 1: Front (Eén stip in het midden) */
.dice-face-front .dice-dot:nth-child(1) { top: 50%; left: 50%; transform: translate(-50%, -50%); width: 28px; height: 28px; }

/* 2: Left (Twee stippen diagonaal) */
.dice-face-left .dice-dot:nth-child(1) { top: 20%; left: 20%; }
.dice-face-left .dice-dot:nth-child(2) { bottom: 20%; right: 20%; }

/* 3: Top (Drie stippen diagonaal) */
.dice-face-top .dice-dot:nth-child(1) { top: 20%; left: 20%; }
.dice-face-top .dice-dot:nth-child(2) { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.dice-face-top .dice-dot:nth-child(3) { bottom: 20%; right: 20%; }

/* 4: Back (Vier stippen in de hoeken) */
.dice-face-back .dice-dot:nth-child(1) { top: 20%; left: 20%; }
.dice-face-back .dice-dot:nth-child(2) { top: 20%; right: 20%; }
.dice-face-back .dice-dot:nth-child(3) { bottom: 20%; left: 20%; }
.dice-face-back .dice-dot:nth-child(4) { bottom: 20%; right: 20%; }


/* 5: Right (Vier hoeken + één in het midden) */
.dice-face-right .dice-dot:nth-child(1) { top: 20%; left: 20%; }
.dice-face-right .dice-dot:nth-child(2) { top: 20%; right: 20%; }
.dice-face-right .dice-dot:nth-child(3) { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.dice-face-right .dice-dot:nth-child(4) { bottom: 20%; left: 20%; }
.dice-face-right .dice-dot:nth-child(5) { bottom: 20%; right: 20%; }

/* 6: Bottom (Twee rijen van drie stippen) */
.dice-face-bottom .dice-dot:nth-child(1) { top: 20%; left: 20%; }
.dice-face-bottom .dice-dot:nth-child(2) { top: 20%; right: 20%; }
.dice-face-bottom .dice-dot:nth-child(3) { top: 50%; left: 20%; transform: translateY(-50%); }
.dice-face-bottom .dice-dot:nth-child(4) { top: 50%; right: 20%; transform: translateY(-50%); }
.dice-face-bottom .dice-dot:nth-child(5) { bottom: 20%; left: 20%; }
.dice-face-bottom .dice-dot:nth-child(6) { bottom: 20%; right: 20%; }



.dice-text {
    font-size: 18px;
    color: var(--lime);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: pulse 10s ease-in-out infinite;
}

.dice-result {
    font-size: 48px;
    font-weight: 900;
    color: var(--lime);
    margin-top: 20px;
    animation: fadeInScale 2s ease-out; /* Veranderd van 0.5s naar 2s */
}


/* ===== ADMIN & JURY SHARED STYLES ===== */

.admin-login-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.5s ease-out;
}

.admin-login-card {
    background: var(--black-card);
    border-radius: 24px;
    padding: 40px 32px;
    border: 2px solid var(--lime);
    text-align: center;
    max-width: 400px;
    width: 100%;
    animation: fadeInScale 0.5s ease-out;
}

.admin-login-card h2 {
    font-size: 24px;
    color: var(--lime);
    margin-bottom: 8px;
    font-weight: 900;
}

.admin-login-card p {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 28px;
}

.admin-login-card .form-group {
    margin-bottom: 20px;
}

.admin-login-card input {
    width: 100%;
    padding: 16px;
    background: var(--black-light);
    border: 2px solid var(--gray-dark);
    border-radius: 14px;
    color: var(--white);
    font-size: 18px;
    text-align: center;
    letter-spacing: 2px;
    transition: all 0.3s;
}

.admin-login-card input:focus {
    outline: none;
    border-color: var(--lime);
    box-shadow: 0 0 20px rgba(187, 211, 59, 0.2);
}

.admin-login-card input::placeholder {
    color: var(--gray-dark);
}

.admin-login-error {
    color: var(--danger);
    font-size: 14px;
    font-weight: 600;
    margin-top: 12px;
    animation: shake 0.4s ease-out;
}

.admin-login-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.btn-admin {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--lime), var(--lime-dark));
    border: none;
    border-radius: 14px;
    color: var(--black);
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
}

.btn-admin:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(187, 211, 59, 0.3);
}

.btn-admin.secondary {
    background: transparent;
    border: 2px solid var(--lime);
    color: var(--lime);
}

.btn-admin.secondary:hover {
    background: var(--lime);
    color: var(--black);
}

.btn-admin.danger {
    background: transparent;
    border: 2px solid var(--danger);
    color: var(--danger);
}

.btn-admin.danger:hover {
    background: var(--danger);
    color: var(--white);
}

.admin-content {
    display: none;
}

.admin-content.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

.admin-logout-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.btn-admin-logout {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--danger);
    border-radius: 8px;
    color: var(--danger);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-admin-logout:hover {
    background: var(--danger);
    color: var(--white);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--lime);
    text-decoration: none;
    font-weight: 700;
    margin-bottom: 20px;
    font-size: 14px;
}

.back-link:hover {
    text-decoration: underline;
}

.admin-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    text-align: center;
    margin-bottom: 30px;
}

.admin-title {
    font-size: 28px;
    color: var(--lime);
    font-weight: 900;
    margin-bottom: 8px;
}

.admin-subtitle {
    color: var(--gray);
    font-size: 14px;
}

.admin-card {
    background: var(--black-card);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--gray-dark);
    border-left: 4px solid var(--lime);
}

.admin-card h2 {
    font-size: 18px;
    color: var(--lime);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.code-display {
    background: var(--black-light);
    border: 2px dashed var(--lime);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    margin: 20px 0;
}

.code-display .code-text {
    font-size: 42px;
    font-weight: 900;
    color: var(--lime);
    letter-spacing: 8px;
    font-family: 'Courier New', monospace;
}

.code-display .code-info {
    color: var(--gray);
    font-size: 14px;
    margin-top: 8px;
}

.codes-list {
    margin-top: 16px;
}

.code-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    background: var(--black-light);
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--gray-dark);
    transition: all 0.3s;
}

.code-item:hover {
    border-color: var(--lime);
}

.code-item-info {
    flex: 1;
}

.code-item-code {
    font-size: 20px;
    font-weight: 800;
    color: var(--lime);
    font-family: 'Courier New', monospace;
    letter-spacing: 4px;
}

.code-item-meta {
    font-size: 12px;
    color: var(--gray);
    margin-top: 2px;
}

.code-item-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-active {
    background: rgba(74, 222, 128, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.status-expired {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.stat-box {
    background: var(--black-light);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    border: 1px solid var(--gray-dark);
}

.stat-number {
    font-size: 32px;
    font-weight: 900;
    color: var(--lime);
}

.stat-label {
    font-size: 12px;
    color: var(--gray);
    margin-top: 4px;
    text-transform: uppercase;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

@media (max-width: 380px) {
    .code-display .code-text {
        font-size: 32px;
        letter-spacing: 4px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .admin-login-card {
        padding: 32px 20px;
    }
}

/* Verborgen */
.hidden {
    display: none !important;
}

/* ===================================================
   MOBILE & TABLET OPTIMALISATIES — v2
   iPhone safe areas, touch targets, scroll gedrag
   =================================================== */

/* ===== SAFE AREA SUPPORT (iPhone notch/home indicator) ===== */
:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

body {
    /* Voorkom bounce-scroll op iOS */
    overscroll-behavior-y: none;
    /* Soepel scrollen op iOS */
    -webkit-overflow-scrolling: touch;
}

/* Container respecteert safe areas */
.speurtocht-container {
    padding-left: max(16px, calc(16px + var(--safe-left)));
    padding-right: max(16px, calc(16px + var(--safe-right)));
    padding-bottom: max(100px, calc(80px + var(--safe-bottom)));
    padding-top: max(16px, calc(8px + var(--safe-top)));
}

/* Game header: sticky bovenaan */
.game-header {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 60;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(13, 13, 18, 0.96);
    margin-bottom: 12px;
}

/* Timer bar: sticky net onder de header */
.timer-bar {
    position: sticky;
    top: calc(env(safe-area-inset-top, 0px) + var(--header-height, 60px));
    z-index: 55;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(13, 13, 18, 0.96);
}

/* Eindscherm safe areas */
.end-screen {
    padding-top: max(20px, calc(20px + var(--safe-top)));
    padding-bottom: max(20px, calc(20px + var(--safe-bottom)));
    padding-left: max(16px, calc(16px + var(--safe-left)));
    padding-right: max(16px, calc(16px + var(--safe-right)));
}

/* ===== TOUCH TARGETS — minimaal 44px (Apple HIG) ===== */
button,
.btn-nieuwe-opdracht,
.btn-voltooid,
.btn-logout,
.btn-toggle-uitleg,
.end-logout-btn,
.btn-admin,
.upload-area {
    min-height: 44px;
    touch-action: manipulation; /* Voorkomt dubbel-tik zoom */
}

/* Iets grotere touch targets voor kleine knoppen */
.btn-logout {
    min-height: 44px;
    padding: 10px 18px;
}

/* ===== SCROLL GEDRAG ===== */
html {
    scroll-behavior: smooth;
    /* Voorkom dat de pagina 'opveert' op iOS */
    height: -webkit-fill-available;
}

/* Zorg dat scrollbare containers smooth scrollen op iOS */
.uitleg-card,
.voltooide-lijst,
.admin-content,
.end-screen {
    -webkit-overflow-scrolling: touch;
}

/* ===== INPUT VELDEN — geen zoom op iOS (font-size >= 16px) ===== */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"] {
    font-size: 16px !important; /* Voorkomt auto-zoom op iOS bij focus */
}

/* Maar houd het dagcode veld groot en mooi */
.login-card input#loginCode {
    font-size: 22px !important;
    letter-spacing: 5px;
}

/* ===== TABLET LAYOUT (>= 768px) ===== */
@media (min-width: 768px) {
    .speurtocht-container {
        max-width: 680px;
        padding: 32px 32px 120px;
    }

    .login-screen {
        padding: 40px 0;
    }

    .login-card {
        padding: 48px 40px;
    }

    .opdracht-card {
        padding: 40px 36px;
    }

    .opdracht-titel {
        font-size: 28px;
    }

    .opdracht-tekst {
        font-size: 17px;
    }

    .btn-nieuwe-opdracht {
        font-size: 22px;
        padding: 24px;
    }

    .btn-voltooid {
        font-size: 20px;
        padding: 22px;
    }

    .speurtocht-title {
        font-size: 38px;
    }

    .timer-display {
        font-size: 34px;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .admin-container {
        max-width: 680px;
    }

    /* Voltooide lijst: twee kolommen op tablet */
    #voltooideItems {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .end-content {
        padding: 24px 0 40px;
        gap: 16px;
    }

    .end-title {
        font-size: 32px;
    }

    .end-icon {
        font-size: 56px;
    }
}

/* ===== GROTE TABLET / iPad Pro (>= 1024px) ===== */
@media (min-width: 1024px) {
    .speurtocht-container {
        max-width: 750px;
    }

    .speurtocht-logo img {
        width: 320px;
    }

    /* Op groot scherm: sticky werkt goed, geen aanpassingen nodig */
}

/* ===== KLEINE SCHERMEN (iPhone SE, 320px) ===== */
@media (max-width: 375px) {
    .speurtocht-title {
        font-size: 24px;
        letter-spacing: 1px;
    }

    .opdracht-titel {
        font-size: 20px;
    }

    .opdracht-tekst {
        font-size: 14px;
    }

    .opdracht-card {
        padding: 20px 16px;
    }

    .btn-nieuwe-opdracht {
        font-size: 17px;
        padding: 18px;
    }

    .btn-voltooid {
        font-size: 15px;
        padding: 18px;
    }

    .timer-display {
        font-size: 24px;
    }

    .login-card {
        padding: 24px 16px;
    }

    .login-card input#loginCode {
        font-size: 20px !important;
        letter-spacing: 3px;
    }

    .speurtocht-logo img {
        width: 220px;
    }

    .upload-icon {
        font-size: 44px;
    }

    .game-header-info #playerNameDisplay {
        max-width: 130px;
    }

    .dice-container {
        width: 90px;
        height: 90px;
    }

    .dice-face {
        width: 90px;
        height: 90px;
        font-size: 48px;
    }

    .dice-face-front  { transform: translateZ(45px); }
    .dice-face-back   { transform: rotateY(180deg) translateZ(45px); }
    .dice-face-right  { transform: rotateY(90deg) translateZ(45px); }
    .dice-face-left   { transform: rotateY(-90deg) translateZ(45px); }
    .dice-face-top    { transform: rotateX(90deg) translateZ(45px); }
    .dice-face-bottom { transform: rotateX(-90deg) translateZ(45px); }
}

/* ===== LANDSCAPE MODUS ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .speurtocht-logo {
        display: none; /* Logo verbergen in landscape op kleine schermen */
    }

    .login-screen {
        justify-content: flex-start;
        padding-top: 10px;
    }

    .speurtocht-title {
        font-size: 22px;
        margin-bottom: 2px;
    }

    .speurtocht-subtitle {
        margin-bottom: 12px;
    }

    .timer-bar {
        /* Blijft fixed in landscape */
    }

    .dice-overlay {
        flex-direction: row;
        gap: 24px;
    }

    .dice-container {
        width: 80px;
        height: 80px;
        margin-bottom: 0;
    }
}

/* ===== FOCUS STATES (toegankelijkheid) ===== */
button:focus-visible,
input:focus-visible {
    outline: 3px solid var(--lime);
    outline-offset: 3px;
}

/* ===== PREVENT TEXT SELECT op knoppen ===== */
button,
.toggle-label,
.upload-area,
.opdracht-categorie,
.opdracht-punten {
    -webkit-user-select: none;
    user-select: none;
}

/* ===== ACTIVE STATES voor betere touch feedback ===== */
.btn-nieuwe-opdracht:active,
.btn-voltooid:active,
.btn-toggle-uitleg:active,
.end-logout-btn:active {
    transform: scale(0.97) !important;
    opacity: 0.9;
    transition: transform 0.08s, opacity 0.08s;
}

.btn-logout:active {
    transform: scale(0.96);
    background: var(--danger);
    color: var(--white);
}

/* ===== UPLOAD AREA touch feedback ===== */
.upload-area:active {
    transform: scale(0.97);
    background: rgba(187, 211, 59, 0.08);
    transition: transform 0.08s;
}

/* ===== VOLTOOIDE ITEM — geen hover effect op touch ===== */
@media (hover: none) {
    .voltooide-item:hover {
        transform: none;
        box-shadow: none;
    }

    .btn-nieuwe-opdracht:hover {
        transform: none;
        box-shadow: none;
    }

    .btn-toggle-uitleg:hover {
        background: transparent;
        color: var(--lime);
    }
}

/* ===== SCROLLBAR verbergen (cleaner op mobile) ===== */
::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

/* ===== VOORTGANG BAR grotere touch zone ===== */
.voortgang {
    padding: 24px 16px 32px;
}

/* ===== UPLOAD PREVIEW op tablet groter ===== */
@media (min-width: 768px) {
    .preview-image {
        max-height: 450px;
    }
}
