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


/* ============= */
/* Splash Screen */
/* ============= */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(100px);
}

.splash-content {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 33px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.splash-content h1 {
    color: var(--primary-color);
    margin: 0 0 1.5rem;
    font-size: 2rem;
    position: relative;
    padding-bottom: 0.8rem;
}

.splash-content h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 240px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.important-notice {
    margin: 0.5rem 0 1.5rem;
    display: block;
    color: var(--primary-color);
    font-weight: 550;
    font-size: 1.5rem;
    text-transform: none;
    letter-spacing: 0.5px;
    position: relative;
    padding-bottom: 0.5rem;
}

.important-notice::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.splash-message {
    color: var(--on-surface-color);
    margin: 1.5rem 0;
    line-height: 1.6;
    font-size: 1.1rem;
}

.legal-notice {
    color: var(--on-surface-color);
    font-size: 0.9rem;
    margin: 1.5rem 0;
    line-height: 1.5;
    opacity: 0.8;
}

.legal-notice a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.legal-notice a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.splash-button {
    background: var(--primary-color);
    color: var(--on-primary);
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.splash-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: #666;
}

.splash-button:not(:disabled):hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

* {
    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;
    margin: 0;
    overflow-x: hidden;
}

/* Hintergrund mit weichem Farbverlauf */
/* Container füllt alles */
#bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 200%;   /* bisschen größer, damit keine Ecken sichtbar */
    height: 200%;
    top: -50%;
    left: -50%;
    z-index: -1;
  
    background: linear-gradient(135deg, #14f400, #000000, #ff0000);
    animation: spin 120s linear infinite;
  }
  @media (max-width: 768px) {
    #bg {
      animation: none;
    }
  }
  
  @keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
  }

/* Content Wrapper */
.content-wrapper {
    position: relative;
    z-index: 1;
    background-color: rgba(30, 30, 30, 0);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px 20px 40px;
    box-sizing: border-box;
}

.game-container {
    background: rgba(0, 0, 0, 0.5);
    color: var(--on-surface-color);
    border-radius: 5cap;
    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;
    z-index: 1;
    overflow: visible;
    min-height: auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Full screen on mobile */
@media (max-width: 768px) {
    .game-container {
        border-radius: 0;
        min-height: 100vh;
        height: 100%;
        margin: 0;
        padding: 20px 15px;
        max-width: 100%;
        background: rgba(0, 0, 0, 0.7);
        border: none;
        box-shadow: none;
        backdrop-filter: blur(5px);
        display: flex;
        flex-direction: column;
    }
    
    .content-wrapper {
        padding: 0;
        min-height: 100vh;
        display: block;
    }
    
    .history {
        display: none !important;
    }
    
    .wheel-container {
        width: 100%;
        max-width: 100%;
        height: auto;
        aspect-ratio: 1/1;
        margin: 4cap auto 4cqh !important;
        max-width: 350px;
    }
    
    .balance-container {
        margin-bottom: 8px !important;
    }
    
    .balance-amount {
        margin: 0 auto !important;
        padding: 5px 15px !important;
        font-size: 1.8rem !important;
    }
}

/* Optional: Add a subtle gradient overlay */
.game-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
}

.balance-container {
    margin-bottom: 30px;
}

.balance-container h2 {
    color: var(--dark-color);
    margin-bottom: 10px;
}

.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-container {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 60px auto;
    border-radius: 50%;
    overflow: visible;
    z-index: 1;
    perspective: 1000px;
    transform-style: preserve-3d;
    background: rgba(30, 30, 30, 0.3);
    border: 2px solid rgba(187, 134, 252, 0.2);
}

#wheel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: var(--shadow);
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
    z-index: 2;
    transform-style: preserve-3d;
    background: #1e1e1e;
}

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

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

.spin-btn:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 0 40px rgba(255, 255, 0, 1.2);
    background: #ffff00;
    filter: brightness(1.1);
    animation: buttonPulse 1s infinite !important;
}

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

.bet-controls {
    margin-bottom: 30px;
}

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

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

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

.bet-btn.active {
    background: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

.current-bet span:last-child {
    font-weight: 600;
    color: var(--primary-color);
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 0 5px;
}

.history-header h3 {
    color: var(--on-surface-color);
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.clear-history-btn {
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--on-surface-color);
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
    padding: 0;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    margin: 0;
    width: 34px;
    height: 34px;
    position: relative;
    top: 1px;
    line-height: 34px;
}

.clear-history-btn:hover {
    background: rgba(255, 107, 107, 0.3);
    border-color: rgba(255, 107, 107, 0.5);
    transform: scale(1.1);
}

.clear-history-btn:active {
    transform: scale(0.95);
}

.history {
    margin-top: 30px;
    background: rgba(30, 30, 30, 0.5);
    border-radius: 40px;
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    min-height: 100px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

#game-history {
    margin-top: 10px;
    overflow-y: auto;
    max-height: 100%;
    padding-right: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) rgba(255, 255, 255, 0.1);
    flex: 1;
    min-height: 0;
}

#game-history::-webkit-scrollbar {
    width: 6px;
}

#game-history::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

#game-history::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 3px;
}

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

.history-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 5px;
    padding: 12px 10px;
    margin: 0;
    transform: translateX(2px);
    transition: all 0.15s ease;
}

.history-item:last-child {
    border-bottom: none;
}

.reset-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    padding: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(207, 102, 121, 0.3);
}

.reset-btn:hover {
    background: #ff5252;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(207, 102, 121, 0.5);
}

.reset-btn:active {
    transform: scale(0.95);
}

.history-win {
    color: var(--accent-color);
    font-weight: 600;
}

.history-loss {
    color: var(--danger-color);
    font-weight: 600;
}

/* Animations */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes confetti-fall {
    0% { 
        transform: translateY(-100px) rotate(0deg) translateX(0); 
        opacity: 1;
    }
    100% { 
        transform: translateY(100vh) rotate(720deg) translateX(var(--random-x)); 
        opacity: 0;
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Result Modal */
#result-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(3px);
}

.result-content {
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    padding: 2.5rem;
    border-radius: 15px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    transform: scale(0.95);
    transition: all 0.3s ease-out;
    animation: modalAppear 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes modalAppear {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

#result-title {
    color: #fff;
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

#result-message {
    color: #e0e0e0;
    margin-bottom: 2rem;
    line-height: 1.8;
    font-size: 1.1rem;
}

.result-item {
    margin: 0.8rem 0;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.result-item.highlight {
    background: rgba(76, 175, 80, 0.15);
    border-left: 4px solid #4CAF50;
    animation: pulse 2s infinite;
}

.result-label {
    font-weight: 600;
    color: #a0a0a0;
    margin-right: 0.5rem;
}

.result-value {
    color: #ffffff;
    font-weight: 500;
}

.win-amount {
    color: #4CAF50;
    font-size: 1.3rem;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

#result-close {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
    position: relative;
    overflow: hidden;
}

#result-close:hover {
    background: #45a049;
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(76, 175, 80, 0.6);
}

#result-close:active {
    transform: translateY(1px);
}

/* Confetti */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: #f00;
    opacity: 0.8;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    animation: confetti-fall 3s linear forwards;
    transform-origin: center;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    #result-title {
        font-size: 1.8rem;
    }
    
    .result-item {
        padding: 0.5rem;
    }
    
    #result-close {
        padding: 10px 25px;
        font-size: 1rem;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--surface-color);
    color: var(--on-surface-color);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    animation: modalAppear 0.3s ease-out;
    border: 1px solid var(--border-color);
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.modal p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.modal button {
    background: var(--primary-color);
    color: var(--on-primary);
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.modal button:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(3, 218, 198, 0.4);
}

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

@keyframes buttonPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(255, 255, 0, 0.8);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 35px rgba(255, 255, 0, 1);
    }
}

.spin-btn {
    background: #ffff00;
    color: #000000;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: buttonPulse 2s infinite;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: visible;
    z-index: 1;
}

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

.spin-btn:hover:not(.disabled) {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 0 40px rgba(255, 255, 0, 1.2);
    background: #ffff00;
    filter: brightness(1.1);
}

.spin-btn.disabled {
    background: #9e9e9e !important;
    cursor: not-allowed;
    animation: none !important;
    transform: none !important;
    box-shadow: none !important;
    filter: none !important;
}

.spin-btn.disabled::before {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .balance-amount {
        font-size: 1.8rem;
        padding: 12px 24px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .wheel-container {
        width: 300px;
        height: 300px;
    }
    
    .bet-amount {
        gap: 5px;
    }
    
    .bet-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .spin-btn {
        padding: 12px 30px;
        font-size: 1.1rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}
