:root {
    --primary-color: #00d2ff;
    --secondary-color: #ff0099;
    --gold: #ffd700;
    --dark-bg: #1a1a2e;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --text-color: #ffffff;
    --font-main: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background: radial-gradient(circle at center, #2a2a4e, #1a1a2e);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-container {
    text-align: center;
    width: 100%;
    max-width: 800px;
    padding: 20px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color), var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 20px rgba(0, 210, 255, 0.5);
    animation: gradient-anim 5s infinite;
}

@keyframes gradient-anim {
    0% {
        filter: hue-rotate(0deg);
    }

    100% {
        filter: hue-rotate(360deg);
    }
}

.instruction {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #ccc;
}

.instruction strong {
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold);
}

/* Roulette Styles */
.roulette-container {
    position: relative;
    width: 500px;
    height: 500px;
    margin: 0 auto;
}

.pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3rem;
    color: var(--gold);
    z-index: 10;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.8));
}

.roulette {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    /* Important for segments */
    box-shadow: 0 0 50px rgba(0, 210, 255, 0.3), inset 0 0 20px rgba(0, 0, 0, 0.5);
    border: 5px solid var(--gold);
    transition: transform 4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.segment {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    /* From center to right edge */
    height: 50%;
    /* Top half */
    transform-origin: 0% 100%;
    /* Bottom Left corner of the segment rect is the center of circle? No. */
    /* Wait, drawing segments with div rotation is tricky for wedges. 
       Better approach for modern CSS: conic-gradient for background colors 
       and absolute divs for numbers/text rotated.
       But we want multicolor. Let's use conic-gradient generated in JS or 
       a simplified approach defined here with clip-path?
       Conic gradient is easier for background. 
       Let's use conic-gradient on the .roulette element directly in JS for dynamic colors.
    */
    /* For markers/text, we place them absolutely */
    width: 20px;
    height: 50%;
    left: calc(50% - 10px);
    transform-origin: bottom center;
    display: flex;
    justify-content: center;
    padding-top: 10px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px black;
    pointer-events: none;
    z-index: 2;
}

.center-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: var(--dark-bg);
    border-radius: 50%;
    border: 4px solid var(--gold);
    overflow: hidden;
    z-index: 5;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

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

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: radial-gradient(circle at top left, #2a2a4e, #111);
    padding: 40px;
    border-radius: 20px;
    border: 2px solid var(--gold);
    box-shadow: 0 0 50px var(--primary-color);
    text-align: center;
    max-width: 500px;
    width: 90%;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.visible .modal-content {
    transform: scale(1);
}

.close-button {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #aaa;
}

.close-button:hover {
    color: white;
}

.momoa-reaction {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid var(--gold);
    margin: 0 auto 20px;
    overflow: hidden;
}

.momoa-reaction img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal h2 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 2rem;
    text-shadow: 0 0 10px rgba(255, 0, 153, 0.5);
}

.blessing-text {
    font-size: 1.5rem;
    line-height: 1.4;
    margin-bottom: 20px;
    font-weight: 700;
}

.sub-text {
    font-style: italic;
    color: #aaa;
    margin-bottom: 30px;
}

#play-again-btn {
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#play-again-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 210, 255, 0.6);
}

/* Back to Sakhrat.es Link */
.back-link {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 210, 255, 0.4);
}

.back-icon {
    font-size: 1.2rem;
}

/* Mobile Spin Button */
.mobile-spin-btn {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    border: 4px solid var(--gold);
    color: white;
    font-size: 1rem;
    font-weight: 800;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 210, 255, 0.5);
    z-index: 50;
    transition: transform 0.2s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.mobile-spin-btn span:first-child {
    font-size: 1.8rem;
}

.mobile-spin-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 10px rgba(0, 210, 255, 0.3);
}

/* Removed rotate overlay activation */

/* Mobile Devices (Portrait & Landscape) */
@media screen and (max-width: 768px) {
    body {
        overflow-y: auto;
    }

    .mobile-spin-btn {
        display: flex;
    }

    .main-container {
        padding: 60px 10px 100px;
        /* Space for back and spin buttons */
    }

    header h1 {
        font-size: 1.5rem;
        margin: 10px 0;
    }

    .instruction {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }

    .roulette-container {
        width: 85vw;
        height: 85vw;
        max-width: 350px;
        max-height: 350px;
    }

    .pointer {
        font-size: 2.2rem;
        top: -15px;
    }

    .center-image {
        width: 80px;
        height: 80px;
    }

    .modal-content {
        padding: 25px;
        max-width: 90%;
    }

    .modal h2 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }

    .momoa-reaction {
        width: 100px;
        height: 100px;
        margin-bottom: 15px;
    }

    .blessing-text {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    .sub-text {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }

    #play-again-btn {
        padding: 12px 20px;
        font-size: 1rem;
    }

    .back-link {
        top: 15px;
        left: 15px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

/* Tablets and smaller desktops */
@media (max-width: 900px) and (min-width: 769px) {
    .roulette-container {
        width: 400px;
        height: 400px;
    }

    header h1 {
        font-size: 2rem;
    }
}

/* Very small screens */
@media (max-width: 400px) and (orientation: landscape) {
    .roulette-container {
        width: 220px;
        height: 220px;
    }

    header h1 {
        font-size: 1.1rem;
    }

    .instruction {
        font-size: 0.8rem;
    }

    .center-image {
        width: 60px;
        height: 60px;
    }
}