/* ============================================================
   It's All in the Game — Hoofdstijlblad
   SMZ: Samen voor de goede beoordeling
   ============================================================ */

:root {
    --blauw:       #0070B8;
    --blauw-dark:  #005a93;
    --blauw-diep:  #003082;
    --geel-groen:  #C8D400;
    --geel-groen-dark: #a8b200;
    --oranje:      #F5A623;
    --oranje-dark: #d4891a;
    --wit:         #FFFFFF;
    --grijs-licht: #F0F2F5;
    --grijs:       #9E9E9E;
    --tekst:       #1a1a2e;
    --radius:      12px;
    --shadow:      0 4px 20px rgba(0,0,0,0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--grijs-licht);
    color: var(--tekst);
    min-height: 100vh;
}

/* ============================================================
   STARTPAGINA
   ============================================================ */
body.start-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--blauw) 0%, #004a8c 100%);
}

.start-container {
    width: 100%;
    max-width: 420px;
    padding: 16px;
}

.start-card {
    background: white;
    border-radius: var(--radius);
    padding: 36px 32px;
    box-shadow: var(--shadow);
}

.start-logo {
    text-align: center;
    margin-bottom: 16px;
}

.goose-icon {
    height: 60px;
}

.start-card h1 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--blauw-diep);
    text-align: center;
    margin-bottom: 28px;
    line-height: 1.4;
}

.start-card h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--blauw-diep);
    text-align: center;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--blauw-diep);
    margin-bottom: 6px;
}

.form-group select,
.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    color: var(--tekst);
    background: white;
    transition: border-color .2s;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: var(--blauw);
}

.divider {
    text-align: center;
    color: var(--grijs);
    font-size: 0.85rem;
    margin: 20px 0;
    position: relative;
}

.divider::before, .divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 42%;
    height: 1px;
    background: #e0e0e0;
}
.divider::before { left: 0; }
.divider::after  { right: 0; }

/* Knoppen */
.btn {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform .1s, filter .1s;
    text-align: center;
    margin-bottom: 8px;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--blauw);
    color: white;
}
.btn-primary:hover { filter: brightness(1.1); }

.btn-secondary {
    background: #e0e0e0;
    color: var(--tekst);
}
.btn-secondary:hover { filter: brightness(0.95); }

.btn-green {
    background: var(--geel-groen);
    color: var(--blauw-diep);
}
.btn-green:hover { filter: brightness(1.05); }

.btn-copy {
    background: #424242;
    color: white;
    border-radius: 8px;
}
.btn-copy:hover { filter: brightness(1.2); }

.btn-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}
.btn-row .btn { margin-bottom: 0; }

.game-id-box {
    background: var(--grijs-licht);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    margin-bottom: 20px;
}

.game-id-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--grijs);
    margin-bottom: 6px;
}

.game-id-value {
    font-size: 0.8rem;
    font-family: monospace;
    color: var(--blauw-diep);
    word-break: break-all;
}

.link-box {
    background: var(--grijs-licht);
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}

.join-url {
    font-size: 0.75rem;
    font-family: monospace;
    word-break: break-all;
    color: var(--blauw);
    margin-bottom: 10px;
}

.hint {
    font-size: 0.8rem;
    color: var(--grijs);
    text-align: center;
    margin-top: 10px;
}

.error-msg {
    background: #ffebee;
    color: #c62828;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.9rem;
    margin-top: 10px;
}

.hidden { display: none !important; }

/* ============================================================
   SPELPAGINA — Layout
   ============================================================ */
body.game-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: #e8edf2;
}

.game-layout {
    display: flex;
    flex: 1;
    gap: 0;
    overflow: hidden;
    padding: 12px 12px 0;
    gap: 12px;
}

/* Speelbord */
.board-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.board-wrapper {
    position: relative;
    flex: 1;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: #b8e4f7;
    user-select: none;
}

.board-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

/* Pionnen */
.pawn {
    position: absolute;
    width: 3%;
    min-width: 21px;
    transform: translate(-50%, -100%);
    cursor: grab;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
    transition: filter .15s;
    touch-action: none;
}

.pawn:hover { filter: drop-shadow(0 3px 8px rgba(0,0,0,0.5)) brightness(1.1); }
.pawn.dragging {
    cursor: grabbing;
    z-index: 100;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.5));
}

.pawn svg { width: 100%; height: auto; display: block; }

/* Pion-legenda */
.pawn-legend {
    display: flex;
    gap: 12px;
    padding: 8px 12px;
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--blauw-diep);
}

.legend-pawn {
    width: 24px;
    height: auto;
}
.legend-pawn svg { width: 100%; height: auto; }

/* ============================================================
   ZIJBALK
   ============================================================ */
.sidebar {
    width: 200px;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 12px;
}

.sidebar-btn {
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 700;
    font-family: inherit;
    transition: transform .1s, filter .1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 12px;
    box-shadow: var(--shadow);
}

.sidebar-btn:active { transform: scale(0.97); }
.sidebar-btn:hover  { filter: brightness(1.07); }

/* Spelregels */
.btn-spelregels {
    background: var(--blauw);
    color: white;
    font-size: 1.1rem;
    padding: 14px 16px;
}
.btn-goose { height: 36px; }

/* Dobbelsteen-sectie */
.dice-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: white;
    border-radius: var(--radius);
    padding: 14px 12px;
    box-shadow: var(--shadow);
}

.dice {
    width: 72px;
    height: 72px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18), inset 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s;
}

.dice-face {
    width: 56px;
    height: 56px;
}

.dice-face svg {
    width: 100%;
    height: 100%;
}

.dice.rolling {
    animation: diceRoll 0.12s infinite;
}

@keyframes diceRoll {
    0%   { transform: rotate(0deg) scale(1); }
    25%  { transform: rotate(5deg) scale(1.05); }
    75%  { transform: rotate(-5deg) scale(0.95); }
    100% { transform: rotate(0deg) scale(1); }
}

.btn-dice {
    background: var(--geel-groen);
    color: var(--blauw-diep);
    font-size: 0.85rem;
    width: 100%;
    padding: 10px;
}
.btn-dice:disabled {
    background: #e0e0e0;
    color: var(--grijs);
    cursor: not-allowed;
}

/* Werk-knop */
.btn-werk {
    background: var(--geel-groen);
    color: var(--blauw-diep);
    flex-direction: column;
    flex: 1;
    font-size: 1rem;
}
.btn-werk .btn-icon { height: 48px; }

/* Persoonlijk-knop */
.btn-persoonlijk {
    background: var(--oranje);
    color: var(--blauw-diep);
    flex-direction: column;
    flex: 1;
    font-size: 1rem;
}
.btn-persoonlijk .btn-icon { height: 48px; }

.btn-icon { object-fit: contain; }

/* ============================================================
   RESET BAR
   ============================================================ */
.reset-bar {
    padding: 10px;
    display: flex;
    justify-content: center;
}

.btn-reset {
    background: var(--blauw);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,112,184,0.3);
    transition: filter .1s;
}
.btn-reset:hover  { filter: brightness(1.1); }
.btn-reset:active { transform: scale(0.97); }

.reset-icon { width: 18px; height: 18px; }

/* ============================================================
   MODALS / POPUPS
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal {
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 8px 40px rgba(0,0,0,0.25);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--grijs);
    line-height: 1;
    z-index: 2;
}
.modal-close:hover { color: var(--tekst); }

/* Spelregels modal */
.modal-spelregels {
    width: 100%;
    max-width: 560px;
    padding: 32px 36px;
}

.modal-spelregels h2 {
    color: var(--blauw-diep);
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.modal-spelregels h3 {
    color: var(--blauw-diep);
    margin: 16px 0 10px;
    font-size: 1rem;
}

.spelregels-content p { margin-bottom: 8px; font-size: 0.95rem; }
.spelregels-content ol { padding-left: 20px; }
.spelregels-content li { margin-bottom: 8px; font-size: 0.92rem; line-height: 1.5; }

.kleur-oranje { color: var(--oranje-dark); }
.kleur-groen  { color: #2E7D32; }
.kleur-blauw  { color: var(--blauw); }

/* Kaart modal */
.modal-card {
    width: 100%;
    max-width: 500px;
    padding: 40px 32px 32px;
}

.card-display {
    border-radius: 10px;
    padding: 28px 24px;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.card-green {
    background: #C8D400;
    color: var(--blauw-diep);
}

.card-orange {
    background: #F5A623;
    color: var(--blauw-diep);
}

.card-header {
    font-size: 1rem;
    font-weight: 800;
    text-align: center;
    font-style: italic;
}

.card-question {
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.55;
}

.card-instruction {
    font-size: 0.85rem;
    text-align: center;
    opacity: 0.8;
    font-style: italic;
    line-height: 1.4;
}

/* Confirm modal */
.modal-confirm {
    max-width: 380px;
    padding: 32px;
    text-align: center;
}
.modal-confirm h3 { margin-bottom: 12px; color: var(--blauw-diep); }
.modal-confirm p  { margin-bottom: 20px; color: #555; font-size: 0.9rem; }

/* Finish modal */
.modal-finish {
    max-width: 420px;
    padding: 48px 32px;
    text-align: center;
    overflow: hidden;
}

.finish-emoji { font-size: 4rem; margin-bottom: 12px; }
.modal-finish h2 { font-size: 2rem; color: var(--blauw-diep); margin-bottom: 8px; }
.modal-finish p  { color: #555; margin-bottom: 24px; }

#confetti-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
}

/* ============================================================
   ADMIN (basis)
   ============================================================ */
.admin-page {
    background: var(--grijs-licht);
    min-height: 100vh;
}

.admin-header {
    background: var(--blauw-diep);
    color: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 { font-size: 1.1rem; }
.admin-header a   { color: rgba(255,255,255,.7); text-decoration: none; font-size: .85rem; }
.admin-header a:hover { color: white; }

.admin-content {
    max-width: 900px;
    margin: 32px auto;
    padding: 0 16px;
}

.admin-card {
    background: white;
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.admin-card h2 {
    color: var(--blauw-diep);
    margin-bottom: 20px;
    font-size: 1.1rem;
    border-bottom: 2px solid var(--geel-groen);
    padding-bottom: 10px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.admin-table th {
    background: var(--blauw-diep);
    color: white;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
}

.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.admin-table tr:hover td { background: #f5f5f5; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-green    { background: var(--geel-groen); color: var(--blauw-diep); }
.badge-orange   { background: var(--oranje);     color: var(--blauw-diep); }
.badge-inactive { background: #e0e0e0; color: #757575; }

.form-inline {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.form-inline input,
.form-inline select,
.form-inline textarea {
    padding: 8px 12px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: .9rem;
}
.form-inline textarea { width: 100%; resize: vertical; }

.btn-sm {
    padding: 6px 12px;
    font-size: .82rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
}
.btn-danger  { background: #c62828; color: white; }
.btn-warning { background: var(--oranje); color: var(--blauw-diep); }
.btn-success { background: var(--geel-groen); color: var(--blauw-diep); }