/* ============================================
   ESCAPE ROOMS - Stylesheet (hub + speelpagina)
   ============================================ */

/* ---------- Hub: filters ---------- */
.er-filters {
    display: flex;
    align-items: flex-end;
    gap: 28px;
    flex-wrap: wrap;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 18px 22px;
    margin-bottom: 24px;
}

.er-filter label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-medium);
    margin-bottom: 6px;
}

.er-filter select {
    padding: 10px 14px;
    border: 2px solid #E8E8F0;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-white);
    outline: none;
    min-width: 200px;
}

.er-filter select:focus {
    border-color: var(--primary);
}

.er-chip-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.er-chip {
    padding: 9px 16px;
    border: 2px solid #E8E8F0;
    border-radius: 50px;
    background: var(--bg-white);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-medium);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.er-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.er-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ---------- Hub: room cards ---------- */
.er-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.er-loading,
.er-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-light);
    padding: 48px 20px;
    font-size: 15px;
}

.er-empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
    opacity: 0.6;
}

.er-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.er-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.er-card-image {
    position: relative;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
}

.er-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.er-card-placeholder {
    font-size: 56px;
}

.er-card-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.er-badge {
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.er-badge-cat {
    background: rgba(255, 255, 255, 0.92);
    color: var(--primary);
}

.er-badge-group {
    background: var(--primary);
    color: #fff;
}

.er-card-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.er-card-body h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-dark);
}

.er-card-body p {
    font-size: 13px;
    color: var(--text-medium);
    line-height: 1.5;
    flex: 1;
}

.er-stars {
    color: #F5B941;
    font-size: 16px;
    letter-spacing: 2px;
}

.er-stars-empty {
    color: #C9CEDB;
}

.er-stars-count {
    font-size: 12px;
    color: var(--text-light);
    letter-spacing: 0;
    margin-left: 4px;
    font-weight: 600;
}

/* ---------- Speelpagina: hero ---------- */
.er-hero {
    position: relative;
    width: 100%;
    min-height: 260px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    background-size: cover;
    background-position: center;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.er-hero-overlay {
    width: 100%;
    padding: 48px 32px 26px;
    background: linear-gradient(transparent, rgba(20, 16, 48, 0.82));
    color: #fff;
}

.er-hero-overlay h2 {
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 6px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.er-hero-overlay p {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.92);
    max-width: 720px;
    line-height: 1.5;
}

.er-hero-meta {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* ---------- Speelpagina: statusbalk ---------- */
.er-statusbar {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 14px 20px;
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    position: sticky;
    top: 72px;
    z-index: 50;
}

.er-status-keys strong,
.er-status-progress strong {
    color: var(--primary);
}

/* ---------- Speelpagina: grid + kaarten ---------- */
.er-play-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.er-play-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 200px;
    transition: var(--transition);
}

.er-card-label {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--primary);
}

.er-q-text {
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-dark);
    flex: 1;
}

.er-q-answer {
    display: flex;
    gap: 8px;
}

.er-q-answer input {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 2px solid #E8E8F0;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    outline: none;
}

.er-q-answer input:focus {
    border-color: var(--primary);
}

.er-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

.er-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.er-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.er-btn-secondary {
    background: var(--bg-light);
    color: var(--text-medium);
}

.er-q-feedback {
    font-size: 13px;
    font-weight: 600;
    color: #D63031;
    min-height: 18px;
}

/* Fout antwoord: korte schud-animatie */
.er-play-card.er-wrong {
    animation: erShake 0.35s ease;
    box-shadow: 0 0 0 3px rgba(214, 48, 49, 0.35);
}

@keyframes erShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-7px); }
    75% { transform: translateX(7px); }
}

/* Goed beantwoord */
.er-play-card.er-answered {
    background: #F0FBF2;
    box-shadow: inset 0 0 0 2px #BDE8C8;
}

.er-q-done {
    font-size: 14px;
    font-weight: 700;
    color: #2E7D32;
}

/* Gelockte kaart: gefaded en niet leesbaar */
.er-play-card.er-locked {
    background: var(--bg-light);
    align-items: center;
    justify-content: center;
    text-align: center;
}

.er-play-card.er-locked .er-card-label {
    opacity: 0.45;
}

.er-locked-icon {
    font-size: 40px;
    opacity: 0.45;
}

.er-locked-text {
    font-size: 13px;
    color: var(--text-light);
}

/* Finale-kaart */
.er-play-card.er-finale {
    box-shadow: inset 0 0 0 2px #F5B941, var(--shadow-sm);
}

.er-play-card.er-finale .er-card-label {
    color: #C98A00;
}

.er-play-card.er-finale.er-answered {
    background: #FFF9E8;
    box-shadow: inset 0 0 0 2px #F5B941;
}

/* Timer-kaart */
.er-timer-card {
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #1E1B3A;
}

.er-timer-card .er-card-label {
    color: #B8B3F0;
}

.er-timer-display {
    font-size: 52px;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
}

.er-timer-controls {
    display: flex;
    gap: 10px;
}

.er-timer-hint {
    font-size: 12px;
    color: #B8B3F0;
    line-height: 1.4;
}

.er-timer-display.er-timer-low {
    color: #FF6B6B;
    animation: erTimerLow 1s ease infinite;
}

@keyframes erTimerLow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

/* ---------- Sleutel-animatie ---------- */
.er-key-fly {
    position: fixed;
    z-index: 2000;
    font-size: 40px;
    pointer-events: none;
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0deg);
    transition: transform 0.75s cubic-bezier(0.45, -0.15, 0.55, 1), opacity 0.75s ease;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25));
}

.er-key-fly.er-key-gold {
    filter: drop-shadow(0 0 10px rgba(245, 185, 65, 0.9)) drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25));
}

.er-status-keys.er-key-pulse,
.er-status-gold.er-key-pulse {
    animation: erKeyPulse 0.45s ease;
}

@keyframes erKeyPulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.35); color: var(--primary); }
    100% { transform: scale(1); }
}

.er-status-keys,
.er-status-gold {
    display: inline-block;
    transition: transform 0.2s ease;
}

.er-status-gold strong {
    color: #C98A00;
}

/* ---------- Finale-sectie (volle breedte) ---------- */
.er-finale-section {
    margin-top: 24px;
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    background: linear-gradient(135deg, #1E1B3A, #2D2654);
    box-shadow: inset 0 0 0 2px #F5B941, var(--shadow-md);
    color: #fff;
}

.er-finale-label {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #F5B941;
    margin-bottom: 14px;
}

.er-finale-locked-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.er-finale-lock {
    font-size: 44px;
    opacity: 0.85;
}

.er-finale-locked-text {
    flex: 1;
    min-width: 220px;
}

.er-finale-locked-text strong {
    display: block;
    font-size: 17px;
    margin-bottom: 4px;
}

.er-finale-locked-text span {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.5;
}

.er-finale-slots {
    display: flex;
    gap: 8px;
}

.er-finale-slot {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border-radius: 12px;
    border: 2px dashed rgba(245, 185, 65, 0.45);
    filter: grayscale(1);
    opacity: 0.45;
    transition: all 0.3s ease;
}

.er-finale-slot.filled {
    border-style: solid;
    border-color: #F5B941;
    background: rgba(245, 185, 65, 0.18);
    filter: none;
    opacity: 1;
    box-shadow: 0 0 14px rgba(245, 185, 65, 0.45);
}

.er-finale-open-btn {
    background: linear-gradient(135deg, #F5B941, #E09A00);
    color: #2D2654;
    font-size: 15px;
    padding: 13px 22px;
}

.er-finale-q {
    font-size: 19px;
    line-height: 1.55;
    margin-bottom: 18px;
}

.er-finale-answer {
    max-width: 560px;
}

.er-finale-answer input {
    background: rgba(255, 255, 255, 0.95);
    border-color: #F5B941;
}

.er-finale-answer .er-btn {
    background: linear-gradient(135deg, #F5B941, #E09A00);
    color: #2D2654;
}

.er-finale-section .er-q-feedback {
    color: #FF8A80;
    margin-top: 10px;
}

.er-finale-done-text {
    font-size: 17px;
    font-weight: 700;
    color: #7BE495;
}

.er-finale-section.er-wrong {
    animation: erShake 0.35s ease;
}

/* ---------- Cijferslot ---------- */
/* Eén aaneengesloten slot: de wieltjes zitten strak tegen elkaar
   met alleen een dun scheidingslijntje tussen de cijfervensters. */
.er-lock {
    display: flex;
    gap: 0;
    margin: 4px 0 14px;
    width: fit-content;
    max-width: 100%;
    background: #1E1B3A;
    border-radius: 12px;
    padding: 8px 6px;
    box-shadow: inset 0 0 0 2px #34304F, 0 3px 8px rgba(0, 0, 0, 0.25);
}

.er-lock-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1 1 0;
    min-width: 0;
}

.er-lock-digit {
    width: 100%;
    min-width: 28px;
    max-width: 44px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 800;
    font-family: 'Courier New', monospace;
    color: #7BE495;
    background: #0D0B1E;
    border-radius: 0;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.7);
    text-shadow: 0 0 10px rgba(123, 228, 149, 0.85);
    user-select: none;
}

.er-lock-col:first-child .er-lock-digit {
    border-radius: 8px 0 0 8px;
}

.er-lock-col:last-child .er-lock-digit {
    border-radius: 0 8px 8px 0;
}

.er-lock-col + .er-lock-col .er-lock-digit {
    border-left: 2px solid #2A2647;
}

/* Letterslot: neon-cyaan in plaats van LED-groen, zodat het zich
   duidelijk onderscheidt van het cijferslot */
.er-lock-col[data-charset="letterslot"] .er-lock-digit {
    color: #5BC9FF;
    text-shadow: 0 0 10px rgba(91, 201, 255, 0.9), 0 0 22px rgba(91, 201, 255, 0.45);
}

.er-lock-col:first-child:last-child .er-lock-digit {
    border-radius: 8px;
}

.er-lock-digit.er-lock-tick {
    animation: erLockTick 0.18s ease;
}

@keyframes erLockTick {
    0% { transform: translateY(-6px); opacity: 0.4; }
    100% { transform: translateY(0); opacity: 1; }
}

.er-lock-up,
.er-lock-down {
    width: 36px;
    height: 24px;
    border: none;
    border-radius: 6px;
    background: #34304F;
    color: #B8B3F0;
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.er-lock-up:hover,
.er-lock-down:hover {
    background: var(--primary);
    color: #fff;
}

.er-lock-up:active,
.er-lock-down:active {
    transform: scale(0.92);
}

.er-q-lock-row {
    justify-content: flex-start;
}

/* ---------- Kluis-draaislot ---------- */
/* Cijfers 0-9 in een cirkel met in het midden een draaiknop. De pijl
   even stil op een cijfer = invoeren (groene laadring loopt vol). */
.er-dial-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 4px 0 6px;
}

.er-dial {
    --er-dial-r: 76px;
    position: relative;
    width: 192px;
    height: 192px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #2A2647, #1E1B3A 70%);
    box-shadow: inset 0 0 0 2px #34304F, inset 0 0 24px rgba(0, 0, 0, 0.5), 0 3px 8px rgba(0, 0, 0, 0.25);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
}

.er-dial:active {
    cursor: grabbing;
}

.er-dial-num {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 32px;
    height: 32px;
    margin: -16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(var(--a)) translateY(calc(-1 * var(--er-dial-r))) rotate(calc(-1 * var(--a)));
    border-radius: 50%;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: 800;
    color: #7BE495;
    text-shadow: 0 0 8px rgba(123, 228, 149, 0.7);
    cursor: pointer;
}

.er-dial-num.er-dial-active {
    color: #C9FFD9;
    text-shadow: 0 0 12px rgba(123, 228, 149, 1);
}

/* Laadring: vult met de klok mee terwijl de pijl stilstaat */
.er-dial-num.er-dial-charging {
    background: conic-gradient(rgba(123, 228, 149, 0.5) calc(var(--p, 0) * 1%), rgba(123, 228, 149, 0.12) 0);
}

.er-dial-knob {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 96px;
    height: 96px;
    margin: -48px;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 32%, #6A6590, #3A3560 60%, #2A2647);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), inset 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.er-dial-knob::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 6px;
    margin-left: -7px;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 13px solid #F5B941;
    filter: drop-shadow(0 0 4px rgba(245, 185, 65, 0.7));
}

.er-dial-knob::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 26px;
    height: 26px;
    margin: -13px;
    border-radius: 50%;
    background: #2A2647;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6);
}

.er-dial-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.er-dial-display {
    display: flex;
    gap: 4px;
}

.er-dial-slot {
    width: 30px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0D0B1E;
    border-radius: 6px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.7), inset 0 0 0 2px #34304F;
    font-family: 'Courier New', monospace;
    font-size: 22px;
    font-weight: 800;
    color: #4A4670;
    user-select: none;
}

.er-dial-slot.filled {
    color: #F5B941;
    text-shadow: 0 0 8px rgba(245, 185, 65, 0.8);
}

.er-dial-hint {
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
    max-width: 280px;
}

.er-finale-section .er-dial-hint {
    color: rgba(255, 255, 255, 0.65);
}

/* ---------- Datum (dag + maand, optioneel jaartal) ---------- */
.er-date-row {
    flex-wrap: wrap;
}

.er-date-row select {
    flex: 1;
    min-width: 0;
    padding: 11px 10px;
    border: 2px solid #E8E8F0;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background: var(--bg-white);
    color: var(--text-dark);
    cursor: pointer;
}

.er-date-row select:focus {
    border-color: var(--primary);
}

.er-date-row .er-date-year {
    flex: 0 1 86px;
}

.er-finale-answer.er-date-row select {
    background: rgba(255, 255, 255, 0.95);
    border-color: #F5B941;
}

/* ---------- Meerkeuze ---------- */
.er-mc-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.er-mc-btn {
    padding: 11px 14px;
    border: 2px solid #E8E8F0;
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    font-family: inherit;
}

.er-mc-btn:hover {
    border-color: var(--er-accent, var(--primary));
    background: var(--bg-light);
}

/* Strafminuut na foute gok */
.er-play-card.er-cooldown {
    background: #FFF0F0;
    box-shadow: inset 0 0 0 2px #FFCCCC;
}

.er-play-card.er-cooldown .er-locked-icon {
    opacity: 1;
}

.er-cooldown-left {
    color: #D63031;
}

/* ---------- Schuifpuzzel ---------- */
.er-puzzle-thumb {
    width: 100%;
    max-height: 110px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    filter: blur(2px) grayscale(0.4);
    opacity: 0.8;
}

.er-puzzle-modal {
    max-width: 580px;
}

.er-puzzle-hint {
    font-size: 13px;
    color: var(--text-medium);
    margin-bottom: 14px;
}

.er-puzzle-board {
    display: grid;
    gap: 4px;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #1E1B3A;
    border-radius: var(--radius-md);
    padding: 6px;
    transition: box-shadow 0.3s ease;
}

.er-puzzle-board.er-puzzle-win {
    box-shadow: 0 0 0 4px #7BE495, 0 0 24px rgba(123, 228, 149, 0.6);
}

.er-puzzle-tile {
    border-radius: 6px;
    cursor: pointer;
    background-repeat: no-repeat;
    transition: transform 0.1s ease;
}

.er-puzzle-tile:hover {
    transform: scale(0.97);
}

.er-puzzle-empty {
    border-radius: 6px;
    border: 2px dashed rgba(255, 255, 255, 0.25);
}

.er-puzzle-status {
    margin-top: 12px;
    font-size: 16px;
    font-weight: 700;
    color: #2E7D32;
    text-align: center;
    min-height: 20px;
}

/* ---------- Find it (zoek de verschillen) ---------- */
.er-findit-modal {
    max-width: 960px;
    width: 95vw;
}

/* Twee helften altijd naast elkaar (ook op smalle schermen).
   De stage krijgt de vaste 16:9-verhouding; de helften vullen elk de
   halve breedte en de volle hoogte (dus elk 8:9). */
.er-findit-stage {
    display: flex;
    gap: 6px;
    width: 100%;
    aspect-ratio: 16 / 9;
}

.er-findit-half {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    background-color: #1E1B3A;
    background-repeat: no-repeat;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: crosshair;
    touch-action: manipulation;
    user-select: none;
}

/* Onthuld kader, absoluut binnen de helft → schaalt altijd mee */
.er-fi-box {
    position: absolute;
    box-sizing: border-box;
    border: 3px solid #FFD54A;
    border-radius: 4px;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 0 14px rgba(255, 213, 74, 0.85);
    pointer-events: none;
    animation: erFiReveal 0.35s ease;
}

@keyframes erFiReveal {
    from { transform: scale(1.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.er-fi-miss {
    position: absolute;
    transform: translate(-50%, -50%);
    color: #FF5252;
    font-size: 26px;
    font-weight: 900;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    animation: erFiMiss 0.6s ease forwards;
}

@keyframes erFiMiss {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
    30% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

/* ---------- Kleurthema's per room ---------- */
body.er-theme-halloween { --er-accent: #E65100; --er-dark1: #2B1606; --er-dark2: #5A2E06; }
body.er-theme-kerst { --er-accent: #C62828; --er-dark1: #0F2415; --er-dark2: #1E4428; }
body.er-theme-ruimte { --er-accent: #4FC3F7; --er-dark1: #0B1026; --er-dark2: #283593; }

.er-hero {
    background: linear-gradient(135deg, var(--er-dark2, var(--primary)), var(--er-dark1, var(--primary-light)));
}

body[class*="er-theme-"] .er-timer-card,
body[class*="er-theme-"] .er-finale-section {
    background: linear-gradient(135deg, var(--er-dark1), var(--er-dark2));
}

body[class*="er-theme-"] .er-card-label {
    color: var(--er-accent);
}

/* ---------- Klassikaal spelen: host-dashboard ---------- */
.er-host-link {
    text-decoration: none;
    white-space: nowrap;
    align-self: center;
}

.er-host-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.er-host-room {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.er-host-room-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-dark);
}

.er-host-pill {
    font-size: 13px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    background: #EFEDFF;
    color: #5A52D5;
}

.er-host-pill.is-playing {
    background: #E3F7E8;
    color: #2E7D32;
}

.er-host-pill.is-closed {
    background: #F0F0F4;
    color: var(--text-light);
}

.er-host-actions {
    display: flex;
    gap: 10px;
}

.er-host-join {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 36px;
    flex-wrap: wrap;
    background: #1E1B3A;
    border-radius: var(--radius-md, 16px);
    padding: 26px 24px;
    margin-bottom: 16px;
    color: #fff;
    text-align: center;
}

.er-host-join-label {
    font-size: 14px;
    color: #B8B3F0;
    font-weight: 600;
}

.er-host-join-url {
    font-size: 26px;
    font-weight: 800;
    margin: 2px 0 10px;
}

.er-host-code {
    font-size: 54px;
    font-weight: 800;
    letter-spacing: 0.18em;
    color: #F5B941;
    text-shadow: 0 0 18px rgba(245, 185, 65, 0.45);
    font-family: 'Courier New', monospace;
    margin-top: 2px;
}

.er-host-qr {
    background: #fff;
    border-radius: 12px;
    padding: 10px;
    line-height: 0;
}

.er-host-qr:empty {
    display: none;
}

.er-host-qr img {
    display: block;
    width: 148px;
    height: 148px;
    image-rendering: pixelated;
}

.er-host-timer {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 14px;
    background: #1E1B3A;
    border-radius: var(--radius-md, 16px);
    padding: 14px 24px;
    margin-bottom: 16px;
}

.er-host-timer-label {
    font-size: 15px;
    font-weight: 700;
    color: #B8B3F0;
}

.er-host-timer-display {
    font-size: 44px;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
}

.er-host-teams-head {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.er-host-teams-head h2 {
    font-size: 18px;
    color: var(--text-dark);
}

.er-host-teamcount {
    display: inline-block;
    min-width: 26px;
    text-align: center;
    background: var(--primary);
    color: #fff;
    border-radius: 999px;
    font-size: 14px;
    padding: 2px 8px;
}

.er-host-hint {
    font-size: 14px;
    color: var(--text-light);
}

.er-host-teams-lobby {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.er-host-chip {
    background: var(--bg-white);
    border: 2px solid #E8E8F0;
    border-radius: 999px;
    padding: 9px 18px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
    box-shadow: var(--shadow-sm);
    animation: erChipPop 0.25s ease;
}

@keyframes erChipPop {
    0% { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.er-host-teams-board {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.er-host-team {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-white);
    border-radius: var(--radius-md, 16px);
    padding: 14px 18px;
    box-shadow: var(--shadow-sm);
}

.er-host-team.is-finished {
    background: #FFF9E8;
    box-shadow: inset 0 0 0 2px #F5B941, var(--shadow-sm);
}

.er-host-team-rank {
    flex: 0 0 36px;
    font-size: 20px;
    font-weight: 800;
    color: var(--text-medium);
    text-align: center;
}

.er-host-team-main {
    flex: 1;
    min-width: 0;
}

.er-host-team-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.er-host-progressbar {
    height: 10px;
    background: #EEEDF6;
    border-radius: 999px;
    overflow: hidden;
}

.er-host-progressfill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 999px;
    transition: width 0.6s ease;
}

.er-host-team.is-finished .er-host-progressfill {
    background: linear-gradient(90deg, #F5B941, #E09A00);
}

.er-host-team-meta {
    flex: 0 0 auto;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-medium);
}

.er-host-team-done {
    color: #C98A00;
}

body[class*="er-theme-"] .er-btn:not(.er-btn-secondary):not(.er-finale-open-btn) {
    background: linear-gradient(135deg, var(--er-accent), var(--er-dark2));
}

body[class*="er-theme-"] .er-status-keys strong,
body[class*="er-theme-"] .er-status-progress strong {
    color: var(--er-accent);
}

/* ---------- Confetti ---------- */
.er-confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2100;
    overflow: hidden;
}

.er-confetti span {
    position: absolute;
    top: -24px;
    display: block;
    animation: erConfettiFall linear forwards;
}

@keyframes erConfettiFall {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(115vh) rotate(720deg); }
}

/* ---------- Tijd-is-om overlay ---------- */
.er-timesup-modal .er-victory-confetti {
    animation: erShake 0.6s ease;
}

.er-timesup-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.er-timesup-actions .btn-cancel {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

/* ---------- Victory overlay ---------- */
.er-victory-modal {
    text-align: center;
    padding: 40px 36px 32px;
    max-width: 440px;
}

.er-victory-confetti {
    font-size: 56px;
    margin-bottom: 8px;
}

.er-victory-modal h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.er-victory-modal > p {
    font-size: 15px;
    color: var(--text-medium);
    margin-bottom: 20px;
}

.er-victory-review {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 22px;
}

.er-victory-review p {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.er-review-stars button {
    background: none;
    border: none;
    font-size: 32px;
    color: #F5B941;
    cursor: pointer;
    padding: 0 4px;
    transition: transform 0.15s ease;
}

.er-review-stars button:hover {
    transform: scale(1.2);
}

.er-review-thanks {
    color: #2E7D32 !important;
    margin-top: 6px;
}

.er-victory-back {
    display: inline-block;
    text-decoration: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .er-play-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .er-play-grid { grid-template-columns: 1fr; }
    .er-statusbar { top: 64px; }
    .er-hero-overlay h2 { font-size: 24px; }
}
