:root {
    /* Palette - Midnight Royale */
    --color-bg: #050505;
    --color-bg-radial: #1a1a1a;
    --color-gold-100: #F9F1CC;
    --color-gold-300: #875fff;
    --color-gold-500: #2d1ff7;
    --color-gold-700: #2638ff;
    --color-gold-900: #554616;

    --color-accent-red: #807e00;
    --color-accent-green: #004d25;
    --color-accent-black: #0a0a0a;

    --font-display: 'Cinzel', serif;
    --font-body: 'Montserrat', sans-serif;

    --shadow-gold: 0 0 20px rgba(212, 175, 55, 0.3);
    --shadow-inner: inset 0 0 50px rgba(0, 0, 0, 0.8);

    --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-bg);
    color: var(--color-gold-100);
    font-family: var(--font-body);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background Effects */
.hero-bg {
    position: fixed;
    top: 0;
    left: 0;
    background-image: url('casino-riches_gt_hero-background-image.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -3;
}

.ambient-light {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    z-index: -2;
    pointer-events: none;
    opacity: 0.8;
}

.vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 50%, black 100%);
    z-index: -1;
    pointer-events: none;
}

/* Layout */
.casino-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    height: 100vh;
    max-width: 100%;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

/* Typography */
.brand-header {
    text-align: center;
    margin-bottom: 0;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.brand-title {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(to bottom, var(--color-gold-100), var(--color-gold-500), var(--color-gold-700));
    -webkit-background-clip: text;
    background-clip: text;
    /* Standard property */
    color: transparent;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.2rem;
}

.brand-subtitle {
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--color-gold-300);
    opacity: 0.8;
}

/* Wheel Container */
.wheel-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
    perspective: 1000px;
    flex: 1;
    width: 100%;
}

/* Wheel Frame & Decoration */
.wheel-frame {
    position: relative;
    width: 80vmin;
    height: 80vmin;
    max-width: 450px;
    max-height: 450px;
    border-radius: 50%;
    padding: 10px;
    background: linear-gradient(135deg, var(--color-gold-700), var(--color-gold-300), var(--color-gold-900));
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.8),
        0 0 0 2px var(--color-gold-900),
        var(--shadow-gold);
}

.wheel-outer-rim {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #050505;
    /* Dark background for 3D */
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 1);
    overflow: hidden;
    /* Contain the 3D canvas */
}

.wheel-inner-rim {
    width: 100%;
    height: 100%;
    position: relative;
}

/* The 2D canvas used for texture generation - hidden but rendered */
canvas#wheelCanvas {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: -1;
}

/* The 3D Canvas */
canvas.three-canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Center Cap & Spin Button */
.wheel-center-cap {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    z-index: 30;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spin-button {
    width: 100%;
    height: 100%;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 31;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.1s;
}

.spin-button:hover {
    transform: scale(1.1);
}

.spin-button:active {
    transform: scale(0.95);
}

/* Pointer */
.wheel-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 50px;
    background: linear-gradient(to bottom, var(--color-gold-100), var(--color-gold-500));
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.5));
    z-index: 20;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    opacity: 1;
    transition: opacity 0.3s ease;
    visibility: visible;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a1a, #050505);
    border: 2px solid var(--color-gold-500);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 0 50px var(--color-gold-500);
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 300px;
    position: relative;
    /* Blinking Border Effect */
    animation: borderBlink 2s infinite;
}

@keyframes borderBlink {

    0%,
    100% {
        box-shadow: 0 0 20px var(--color-gold-500), inset 0 0 10px var(--color-gold-500);
        border-color: var(--color-gold-500);
    }

    50% {
        box-shadow: 0 0 40px #fff, inset 0 0 20px #fff;
        border-color: #fff;
    }
}

.modal.hidden .modal-content {
    transform: scale(0.7);
}

.modal-header h2 {
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--color-gold-300);
    margin-bottom: 1rem;
    text-shadow: 0 0 20px var(--color-gold-500);
}

.modal-body p {
    color: var(--color-gold-100);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.modal-body h3 {
    font-family: var(--font-display);
    font-size: 4rem;
    color: #fff;
    margin-bottom: 2rem;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.primary-btn {
    padding: 1rem 3rem;
    background: var(--color-gold-500);
    color: var(--color-bg);
    border: none;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 50px;
}

.primary-btn:hover {
    background: var(--color-gold-300);
    background: linear-gradient(135deg, var(--color-gold-700), var(--color-gold-300), var(--color-gold-900));
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.8),
        0 0 0 2px var(--color-gold-900),
        var(--shadow-gold);
}

.wheel-outer-rim {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #050505;
    /* Dark background for 3D */
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 1);
    overflow: hidden;
    /* Contain the 3D canvas */
}

.wheel-inner-rim {
    width: 100%;
    height: 100%;
    position: relative;
}

/* The 2D canvas used for texture generation - hidden but rendered */
canvas#wheelCanvas {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: -1;
}

/* The 3D Canvas */
canvas.three-canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Center Cap & Spin Button */
.wheel-center-cap {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    z-index: 30;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spin-button {
    width: 100%;
    height: 100%;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 31;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.1s;
}

.spin-button:hover {
    transform: scale(1.1);
}

.spin-button:active {
    transform: scale(0.95);
}

/* Pointer */
.wheel-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 50px;
    background: linear-gradient(to bottom, var(--color-gold-100), var(--color-gold-500));
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.5));
    z-index: 20;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    opacity: 1;
    transition: opacity 0.3s ease;
    visibility: visible;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a1a, #050505);
    border: 2px solid var(--color-gold-500);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 0 50px var(--color-gold-500);
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 300px;
    position: relative;
    /* Blinking Border Effect */
    animation: borderBlink 2s infinite;
}

@keyframes borderBlink {

    0%,
    100% {
        box-shadow: 0 0 20px var(--color-gold-500), inset 0 0 10px var(--color-gold-500);
        border-color: var(--color-gold-500);
    }

    50% {
        box-shadow: 0 0 40px #fff, inset 0 0 20px #fff;
        border-color: #fff;
    }
}

.modal.hidden .modal-content {
    transform: scale(0.7);
}

.modal-header h2 {
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--color-gold-300);
    margin-bottom: 1rem;
    text-shadow: 0 0 20px var(--color-gold-500);
}

.modal-body p {
    color: var(--color-gold-100);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.modal-body h3 {
    font-family: var(--font-display);
    font-size: 4rem;
    color: #fff;
    margin-bottom: 2rem;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.primary-btn {
    padding: 1rem 3rem;
    background: var(--color-gold-500);
    color: var(--color-bg);
    border: none;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 50px;
}

.primary-btn:hover {
    background: var(--color-gold-300);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .brand-title {
        font-size: 2rem;
    }

    .brand-subtitle {
        font-size: 0.6rem;
    }

    .wheel-frame {
        width: 90vmin;
        height: 90vmin;
        max-width: 350px;
        max-height: 350px;
    }

    .modal-content {
        width: 90%;
        padding: 2rem;
        min-width: auto;
    }

    .modal-header h2 {
        font-size: 2rem;
    }

    .modal-body h3 {
        font-size: 3rem;
    }

    .primary-btn {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .wheel-frame {
        width: 95vmin;
        height: 95vmin;
        max-width: 320px;
        max-height: 320px;
    }

    .brand-title {
        font-size: 1.8rem;
    }
}