:root {
    --bg-color: #121212;
    --surface-color: #1e1e1e;
    --primary-color: #bb86fc;
    --primary-variant: #3700b3;
    --secondary-color: #03dac6;
    --danger-color: #cf6679;
    --on-bg-color: #e1e1e1;
    --on-surface-color: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --border-color: #333333;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Poppins', sans-serif; 
}

body {
    background-color: var(--bg-color);
    color: var(--on-bg-color);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* === Background Canvas === */
#bg {
    position: fixed;
    top: -50%; 
    left: -50%; 
    width: 200%; 
    height: 200%;
    z-index: -1;
    background: linear-gradient(135deg, #14f400, #000000, #ff0000);
}

/* === Layout === */
.content-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px 20px 40px;
}

.game-container {
    background: rgba(0, 0, 0, 0.5);
    color: var(--on-surface-color);
    border-radius: 33px;
    box-shadow: var(--shadow);
    padding: 30px;
    max-width: 800px;
    width: 100%;
    margin: 20px auto 60px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    position: relative;
}

/* === Navigation Buttons === */
.info-button {
    position: fixed;
    top: 20px; 
    right: 20px;
    width: 50px; 
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    display: flex; 
    align-items: center; 
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.info-icon { 
    width: 24px; 
    height: 24px; 
    stroke: currentColor; 
    transition: transform 0.2s; 
}

.info-button:hover { 
    background: rgba(255, 255, 255, 0.2); 
    transform: translateY(-2px); 
}

.info-button:hover .info-icon { 
    transform: scale(1.1); 
    color: var(--primary-color); 
}

/* === Game Elements === */
.balance-container { 
    margin-bottom: 30px; 
}

.balance-amount {
    font-size: 2.5rem; 
    font-weight: 700;
    color: var(--primary-color);
    background: rgba(187, 134, 252, 0.1);
    padding: 15px 30px;
    border-radius: 50px;
    display: inline-block;
    box-shadow: var(--shadow);
    border: 1px solid var(--primary-color);
}

/* Wheel */
.wheel-container {
    position: relative;
    width: 400px; 
    height: 400px;
    margin: 60px auto;
    border-radius: 50%;
    z-index: 1;
    background: rgba(30, 30, 30, 0.3);
    border: 2px solid rgba(187, 134, 252, 0.2);
}

#wheel { 
    width: 100%; 
    height: 100%; 
    border-radius: 50%; 
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99); 
}

.wheel-center {
    position: absolute; 
    top: 50%; 
    left: 50%;
    width: 50px; 
    height: 50px;
    background: white; 
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.wheel-arrow {
    position: absolute; 
    top: -20px; 
    left: 50%;
    transform: translateX(-50%);
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 30px solid var(--danger-color);
    z-index: 5;
}

/* Controls */
.bet-amount { 
    display: flex; 
    justify-content: center; 
    gap: 10px; 
    margin-bottom: 20px; 
    flex-wrap: wrap; 
}

.bet-btn {
    background: var(--primary-variant); 
    color: white;
    border: 1px solid var(--primary-color);
    padding: 10px 20px; 
    border-radius: 50px;
    cursor: pointer; 
    font-weight: 600;
    transition: all 0.3s ease;
    animation: float 1.5s ease-in-out infinite alternate;
}

.bet-btn:hover { 
    transform: translateY(0); 
    box-shadow: 0 4px 15px rgba(187, 134, 252, 0.4); 
    animation-play-state: paused; 
}

.all-in-btn { 
    background: linear-gradient(45deg, #ff8a00, #ff0058); 
    border: none; 
}

@keyframes float {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-5px); }
}

.current-bet { 
    font-size: 1.2rem; 
    margin-bottom: 20px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 10px; 
}

.reset-btn {
    background: var(--danger-color); 
    color: white; 
    border: none;
    width: 30px; 
    height: 30px; 
    border-radius: 50%;
    cursor: pointer; 
    font-size: 1.4rem; 
    display: flex; 
    align-items: center; 
    justify-content: center;
}

.spin-btn {
    background: #ffff00; 
    color: #000; 
    border: none;
    padding: 15px 40px; 
    font-size: 1.2rem; 
    border-radius: 50px;
    cursor: pointer; 
    font-weight: 600; 
    text-transform: uppercase;
    animation: buttonPulse 2s infinite;
    position: relative; 
    z-index: 1;
}

.spin-btn:disabled { 
    background: #9e9e9e; 
    cursor: not-allowed; 
    animation: none; 
    transform: none; 
}

.spin-btn::before {
    content: ''; 
    position: absolute; 
    inset: -5px;
    border-radius: 55px; 
    border: 2px solid #ffff00;
    animation: pulseRing 2s cubic-bezier(0.4, 0, 0.2, 1) infinite; 
    z-index: -1;
}

@keyframes buttonPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes pulseRing {
    0% { transform: scale(0.9); opacity: 1; }
    100% { transform: scale(1.3); opacity: 0; }
}

/* Stats & History */
.game-stats { 
    margin-top: 1.5rem; 
    background: rgba(30, 30, 30, 0.6); 
    padding: 1rem; 
    border-radius: 33px; 
    border: 1px solid var(--border-color); 
}

.stats-bar { 
    display: flex; 
    height: 30px; 
    border-radius: 15px; 
    overflow: hidden; 
    background: rgba(255,255,255,0.1); 
    margin-bottom: 0.5rem; 
}

.stats-wins { 
    background: linear-gradient(90deg, #4caf50, #8bc34a); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: width 0.5s; 
}

.stats-losses { 
    background: linear-gradient(90deg, #f44336, #ff9800); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: width 0.5s; 
}

.stats-wins span, .stats-losses span { 
    color: white; 
    font-weight: bold; 
    font-size: 0.9rem; 
}

.history { 
    margin-top: 30px; 
    background: rgba(30,30,30,0.5); 
    border-radius: 40px; 
    padding: 20px; 
    border: 1px solid var(--border-color); 
    max-height: 400px; 
    display: flex; 
    flex-direction: column; 
}

.history-header { 
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 15px; 
}

.clear-history-btn { 
    background: transparent; 
    border: 1px solid rgba(255,255,255,0.3); 
    color: white; 
    width: 30px; 
    height: 30px; 
    border-radius: 50%; 
    cursor: pointer; 
}

#game-history { 
    overflow-y: auto; 
    flex: 1; 
}

.history-item { 
    padding: 12px 10px; 
    border-bottom: 1px solid var(--border-color); 
    display: flex; 
    justify-content: space-between; 
}

.history-win { color: #4caf50; }
.history-loss { color: var(--danger-color); }

/* === Common Modal/Overlay Styles === */
.splash-screen, .info-overlay, .modal {
    position: fixed; 
    inset: 0; 
    background: rgba(0,0,0,0.8);
    display: flex; 
    justify-content: center; 
    align-items: center;
    z-index: 2000; 
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.info-overlay, .modal { 
    visibility: hidden; 
    opacity: 0; 
}

.info-overlay.visible, .modal[style*="display: flex"] { 
    visibility: visible; 
    opacity: 1; 
}

/* === REDESIGNED SPLASH SCREEN === */
.splash-screen { 
    z-index: 3000; 
    background: rgba(10, 10, 10, 0.9); 
}

.splash-card {
    background: linear-gradient(145deg, #1e1e2f, #161625);
    padding: 0;
    border-radius: 24px;
    width: 90%; 
    max-width: 420px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.7), 0 0 0 1px rgba(187, 134, 252, 0.1);
    overflow: hidden;
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.splash-header {
    background: linear-gradient(to bottom, #2a2a3e, #1e1e2f);
    padding: 30px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.splash-icon { 
    font-size: 3rem; 
    margin-bottom: 10px; 
}

.splash-header h1 { 
    color: #fff; 
    font-size: 1.8rem; 
    margin: 0; 
    font-weight: 700; 
}

.splash-body { 
    padding: 30px 25px; 
}

.notice-badge {
    background: rgba(187, 134, 252, 0.15); 
    color: var(--primary-color);
    display: inline-block; 
    padding: 6px 16px; 
    border-radius: 50px;
    font-size: 0.85rem; 
    font-weight: 600; 
    text-transform: uppercase;
    margin-bottom: 20px; 
    letter-spacing: 1px;
}

.main-text { 
    color: #e0e0e0; 
    font-size: 1.1rem; 
    line-height: 1.6; 
    margin-bottom: 20px; 
}

.sub-text { 
    color: #888; 
    font-size: 0.85rem; 
}

.sub-text a { 
    color: var(--primary-color); 
    text-decoration: none; 
}

.splash-footer { 
    padding: 0 25px 30px; 
}

.splash-button {
    background: var(--primary-color); 
    color: #000;
    border: none; 
    width: 100%; 
    padding: 15px;
    border-radius: 12px; 
    font-weight: 700; 
    font-size: 1rem;
    cursor: pointer; 
    transition: all 0.2s;
}

.splash-button:disabled { 
    opacity: 0.5; 
    cursor: wait; 
    background: #444; 
    color: #aaa; 
}

.splash-button:not(:disabled):hover { 
    transform: translateY(-2px); 
    box-shadow: 0 5px 15px rgba(187, 134, 252, 0.3); 
}

/* === INFO OVERLAY REDESIGN === */
.info-content {
    background: var(--surface-color);
    width: 90%; 
    max-width: 500px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    overflow: hidden;
    text-align: left;
}

.info-header {
    padding: 20px 25px;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255,255,255,0.02);
}

.info-header h2 { 
    font-size: 1.5rem; 
    color: #fff; 
    margin: 0; 
}

.close-button {
    background: none; 
    border: none; 
    color: #aaa;
    font-size: 28px; 
    cursor: pointer; 
    line-height: 1; 
    padding: 0;
}

.close-button:hover { 
    color: #fff; 
}

.info-body { 
    padding: 25px; 
}

.info-section { 
    margin-bottom: 25px; 
}

.info-section:last-child { 
    margin-bottom: 0; 
}

.info-section h3 {
    font-size: 0.9rem; 
    text-transform: uppercase; 
    color: #888;
    margin-bottom: 10px; 
    letter-spacing: 1px;
}

.info-section p { 
    margin: 0; 
    color: #ddd; 
}

.dev-link { 
    color: var(--primary-color); 
    text-decoration: none; 
    font-weight: 500; 
}

.setting { 
    background: rgba(255,255,255,0.05); 
    border-radius: 12px; 
    padding: 15px; 
}

.setting-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 5px; 
}

.setting-description { 
    font-size: 0.8rem; 
    color: #888; 
}

.reset-balance-btn {
    width: 100%; 
    padding: 14px;
    background: rgba(207, 102, 121, 0.1); 
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
    border-radius: 12px; 
    font-weight: 600;
    cursor: pointer; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 8px;
    transition: all 0.2s;
}

.reset-balance-btn:hover { 
    background: var(--danger-color); 
    color: #fff; 
}

.icon { 
    font-size: 1.2rem; 
}

/* === POPUP RESULT (ANIMATED) === */
.modal-content {
    background: var(--surface-color); 
    padding: 30px; 
    border-radius: 24px;
    max-width: 400px; 
    width: 90%; 
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 15px 50px rgba(0,0,0,0.6);
}

.modal h2 { 
    margin-bottom: 10px; 
    font-size: 2rem; 
}

.modal button {
    background: var(--primary-color); 
    color: black; 
    border: none;
    padding: 12px 30px; 
    border-radius: 25px; 
    font-weight: 600;
    cursor: pointer; 
    margin-top: 20px;
    transition: transform 0.2s;
}

.modal button:hover { 
    transform: scale(1.05); 
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.animate-pop {
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

/* Switch Styling */
.switch { 
    position: relative; 
    display: inline-block; 
    width: 46px; 
    height: 24px; 
}

.switch input { 
    opacity: 0; 
    width: 0; 
    height: 0; 
}

.slider { 
    position: absolute; 
    cursor: pointer; 
    inset: 0; 
    background-color: #444; 
    transition: .4s; 
    border-radius: 34px; 
}

.slider:before { 
    position: absolute; 
    content: ""; 
    height: 18px; 
    width: 18px; 
    left: 3px; 
    bottom: 3px; 
    background-color: white; 
    transition: .4s; 
    border-radius: 50%; 
}

input:checked + .slider { 
    background-color: var(--primary-color); 
}

input:checked + .slider:before { 
    transform: translateX(22px); 
}

/* === Corner Animations (Neu animiert) === */
.wheel-ambiance { 
    position: absolute; 
    inset: 0; 
    pointer-events: none; 
    border-radius: 50%; 
    animation: pulse 4s infinite; 
}

@keyframes pulse { 
    0%, 100% { box-shadow: 0 0 30px 10px rgba(187,134,252,0.15); } 
    50% { box-shadow: 0 0 60px 30px rgba(187,134,252,0.25); } 
}

.corner-decoration { 
    position: absolute; 
    width: 100px; 
    height: 100px; 
    border: 4px solid; 
    pointer-events: none; 
}

/* Jede Ecke bekommt eine eigene Animation, um sanft nach außen zu "atmen" */
.corner-top-left { 
    top: -15px; left: -15px; 
    border-right: 0; border-bottom: 0; 
    border-radius: 20px 0 0 0; 
    border-color: var(--primary-color);
    animation: cornerTL 2.1s infinite alternate ease-in-out;
}
.corner-top-right { 
    top: -15px; right: -15px; 
    border-left: 0; border-bottom: 0; 
    border-radius: 0 20px 0 0; 
    border-color: var(--secondary-color); 
    animation: cornerTR 2.2s infinite alternate ease-in-out;
}
.corner-bottom-left { 
    bottom: -15px; left: -15px; 
    border-right: 0; border-top: 0; 
    border-radius: 0 0 0 20px; 
    border-color: var(--danger-color); 
    animation: cornerBL 2.3s infinite alternate ease-in-out;
}
.corner-bottom-right { 
    bottom: -15px; right: -15px; 
    border-left: 0; border-top: 0; 
    border-radius: 0 0 20px 0; 
    border-color: #ffc107; 
    animation: cornerBR 2.4s infinite alternate ease-in-out;
}

/* Keyframes für die Ecken - Flüssiges "Atmen" mit Blur & Tilt */

/* Oben Links: Bewegt sich nach links oben, kippt leicht, wird scharf */
@keyframes cornerTL {
    0% { 
        /* Startzustand: Zentriert, keine Drehung, leicht verkleinert, stark verschwommen */
        transform: translate(0, 0) rotate(0deg) scale(0.95);
        filter: blur(5px) drop-shadow(0 0 0 rgba(187, 134, 252, 0));
    }
    100% { 
        /* Endzustand: Nach außen bewegt, gekippt, vergrößert, komplett scharf mit starkem Leuchten */
        transform: translate(-8px, -4px) rotate(-6deg) scale(1.05);
        filter: blur(0px) drop-shadow(-6px -6px 20px var(--primary-color));
    }
}

/* Oben Rechts */
@keyframes cornerTR {
    0% { 
        transform: translate(0, 0) rotate(0deg) scale(0.95);
        filter: blur(5px) drop-shadow(0 0 0 rgba(3, 218, 198, 0));
    }
    100% { 
        transform: translate(8px, -4px) rotate(6deg) scale(1.05);
        filter: blur(0px) drop-shadow(6px -6px 20px var(--secondary-color));
    }
}

/* Unten Links */
@keyframes cornerBL {
    0% { 
        transform: translate(0, 0) rotate(0deg) scale(0.95);
        filter: blur(5px) drop-shadow(0 0 0 rgba(207, 102, 121, 0));
    }
    100% { 
        transform: translate(-8px, 4px) rotate(6deg) scale(1.05);
        filter: blur(0px) drop-shadow(-6px 6px 20px var(--danger-color));
    }
}

/* Unten Rechts */
@keyframes cornerBR {
    0% { 
        transform: translate(0, 0) rotate(0deg) scale(0.95);
        filter: blur(5px) drop-shadow(0 0 0 rgba(255, 193, 7, 0));
    }
    100% { 
        transform: translate(8px, 4px) rotate(-6deg) scale(1.05);
        filter: blur(0px) drop-shadow(6px 6px 20px #ffc107);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .content-wrapper { 
        display: block; 
        padding: 0; 
    }
    .game-container { 
        border-radius: 0; 
        margin: 0; 
        min-height: 100vh; 
        padding: 20px 10px; 
    }
    .wheel-container { 
        width: 300px; 
        height: 300px; 
        margin: 40px auto; 
    }
    .balance-amount { 
        font-size: 1.8rem; 
        padding: 10px 20px; 
    }
    .history { 
        display: none; 
    }
}
/* === LOADER & BLUR EFFECT === */
.loader-screen {
    position: fixed;
    inset: 0;
    background: rgba(18, 18, 18, 0.95); /* Dunkler, leicht transparenter Hintergrund */
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Das drehende Rad als Lade-Icon */
.loader-wheel {
    width: 80px;
    height: 80px;
    border: 8px solid rgba(187, 134, 252, 0.2);
    border-top-color: var(--primary-color);
    border-bottom-color: var(--secondary-color);
    border-radius: 50%;
    animation: spinLoader 1s linear infinite;
    margin-bottom: 20px;
    box-shadow: 0 0 15px rgba(187, 134, 252, 0.4);
}

.loader-screen h2 {
    color: #fff;
    font-size: 1.5rem;
    letter-spacing: 2px;
    animation: pulseText 1.5s infinite;
}

@keyframes spinLoader {
    to { transform: rotate(360deg); }
}

@keyframes pulseText {
    0%, 100% { opacity: 1; text-shadow: 0 0 10px rgba(255, 255, 255, 0.8); }
    50% { opacity: 0.5; text-shadow: none; }
}

/* Der Blur-Effekt für den Hintergrund und Content */
.blur-active {
    filter: blur(20px);
    transition: filter 0.8s ease-out; /* Sanftes Scharfstellen */
    pointer-events: none; /* Verhindert Klicks im Hintergrund während dem Laden */
}