:root {
    /* Kleurenpalet en variabelen */
    --bg-color-1: #02101a;
    --bg-color-2: #052c33;
    --bg-color-3: #0a3d31;
    --accent-glow: #00ffcc;
    --power-color: #39ff14;
    --modal-glow: rgba(57, 255, 20, 0.3);
    --digital-font: 'Courier New', Courier, monospace;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-color-1), var(--bg-color-2), var(--bg-color-3), var(--bg-color-1));
    background-size: 400% 400%;
    animation: labShift 18s ease infinite;
    color: white;
    touch-action: none;
}

@keyframes labShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Operators in de achtergrond */
.bg-operator {
    position: fixed;
    height: 95vh;
    bottom: 0;
    opacity: 0.3;
    z-index: 1;
    transition: all 0.8s ease-in-out;
    cursor: pointer;
    filter: grayscale(0.8) brightness(0.5);
    pointer-events: auto;
}

.bg-operator.active {
    opacity: 0.8;
    filter: grayscale(0) brightness(1.1);
}

.operator-left { 
    left: -50px; 
    -webkit-mask-image: radial-gradient(circle at 30% 80%, black 30%, transparent 85%);
    mask-image: radial-gradient(circle at 30% 80%, black 30%, transparent 85%);
}

.operator-right { 
    right: -50px; 
    transform: scaleX(-1); 
    -webkit-mask-image: radial-gradient(circle at 30% 80%, black 30%, transparent 85%);
    mask-image: radial-gradient(circle at 30% 80%, black 30%, transparent 85%);
}

.operator-left:hover {
    opacity: 0.9;
    filter: grayscale(0.2) brightness(1.2);
    transform: scale(1.02);
}

.operator-right:hover {
    opacity: 0.9;
    filter: grayscale(0.2) brightness(1.2);
    transform: scaleX(-1) scale(1.02);
}

#scaling-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.main-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 980px;
    position: relative;
    transform-origin: center center;
    pointer-events: auto;
}

.ui-header {
    width: 100%;
    height: 110px;
    background: rgba(0,0,0,0.85);
    padding: 10px 25px;
    border-radius: 20px;
    border: 2px solid var(--accent-glow);
    backdrop-filter: blur(20px);
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.8);
    transition: border-color 0.5s;
}

.header-logo {
    max-height: 90px; 
    width: auto;
    filter: drop-shadow(0 0 8px var(--accent-glow));
    transition: filter 0.5s;
    justify-self: center;
}

.stats-block { display: flex; flex-direction: column; justify-content: center; }
.stats-block.left { align-items: flex-start; }
.stats-block.center { align-items: center; height: 100%; }
.stats-block.right { align-items: flex-end; position: relative; }

.fancy-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-glow);
    margin-bottom: 1px;
    transition: color 0.5s;
    opacity: 0.9;
}

.digital-value {
    font-family: var(--digital-font);
    font-weight: bold;
    color: var(--power-color);
    text-shadow: 0 0 12px var(--power-color);
    transition: all 0.5s;
}

.combo-badge {
    background: #ffcc00;
    color: #000;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.8rem;
    position: absolute;
    top: -20px;
    right: 0;
    animation: bounce 0.4s infinite alternate;
    box-shadow: 0 0 15px #ffcc00;
    z-index: 20;
}

@keyframes bounce { from { transform: scale(1); } to { transform: scale(1.15); } }

.game-container {
    position: relative;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.9);
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.6);
}

canvas { display: block; cursor: pointer; image-rendering: pixelated; }

#orientation-warning {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-color-1); z-index: 9999;
    display: none; flex-direction: column; justify-content: center;
    align-items: center; text-align: center; padding: 20px;
}

@media (orientation: portrait) { #orientation-warning { display: flex; } }

.game-over-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(5, 11, 24, 0.98);
    padding: 40px;
    border-radius: 30px;
    border: 3px solid var(--power-color);
    text-align: center;
    z-index: 100;
    display: none;
    min-width: 380px;
    box-shadow: 0 0 120px var(--modal-glow);
}

.btn-restart {
    background: var(--power-color);
    border: none;
    color: #000;
    padding: 15px 40px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 30px;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.btn-restart:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 25px var(--power-color);
}

.total-highlight {
    color: var(--power-color);
    font-size: 2.2rem;
    margin: 10px 0;
    display: block;
}

.new-record-badge {
    background: #ffcc00;
    color: #000;
    padding: 3px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 10px;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 204, 0, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(255, 204, 0, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 204, 0, 0); }
}

@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-2px, -1px) rotate(-1deg); }
    20% { transform: translate(-4px, 0px) rotate(1deg); }
    30% { transform: translate(4px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    100% { transform: translate(0px, 0px) rotate(0deg); }
}

.shake-anim {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}