/* Global Styles */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;700&family=Playfair+Display:ital,wght@1,400;1,700&display=swap');

:root {
    --primary-glow: #00e5ff;
    /* Cyber Blue */
    --secondary-glow: #ff9100;
    /* Amber/Gold */
    --bg-dark: #0f172a;
    /* Deep tech blue/black */
    --text-light: #e2e8f0;
    --text-dark: #1e293b;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.5);
    --lirex-orange: #ff6b00;
    --lirex-blue: #0056b3;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-dark);
    /* High-tech background blend */
    background-image:
        radial-gradient(circle at 20% 30%, rgba(0, 86, 179, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 107, 0, 0.15) 0%, transparent 50%),
        url('assets/background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-blend-mode: overlay;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Snowflake / Cyber particle canvas placeholder if needed,
   but for now we use CSS effects */

header {
    text-align: center;
    margin-bottom: 2rem;
    z-index: 10;
    position: relative;
    padding: 2rem;
    /* Lighter background for logo visibility */
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    animation: slideDown 0.8s ease-out;
    color: var(--text-dark);
    /* Dark text for light bg */
}

.logo {
    max-width: 220px;
    height: auto;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s;
}

.logo:hover {
    transform: scale(1.05);
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    /* Use Lirex Blue for contrast on light header */
    color: var(--lirex-blue);
    background: none;
    background-clip: border-box;
    -webkit-background-clip: border-box;
    -webkit-text-fill-color: initial;
    margin: 0.5rem 0;
    text-shadow: none;
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.5rem;
        /* Smaller font for mobile */
    }

    .logo {
        max-width: 140px;
    }

    header {
        padding: 1rem;
        width: 90%;
        /* Prevent full width breakage */
        margin: 0 auto 1rem auto;
    }
}

p.subtitle {
    font-size: 1.1rem;
    color: #475569;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
}

/* Banica Container / Tray */
/* Banica Container / Tray */
.banica-container {
    padding: 2%;
    /* Relative padding */
    position: relative;
    border-radius: 50%;
    /* Metal Tray Look */
    background: radial-gradient(circle, #b0bec5 0%, #78909c 100%);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(0, 0, 0, 0.8);
    border: 4px solid #546e7a;
    transition: transform 0.3s ease;

    /* Responsive sizing wrapper */
    width: auto;
    max-width: 90vw;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* The Wheel - Holds the Banica Image */
.wheel {
    position: relative;
    width: 85vw;
    height: 85vw;
    max-width: 350px;
    max-height: 350px;

    border-radius: 50%;
    /* The Banica Spiral Texture */
    background-image: url('assets/banica-spiral.png');
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    /* Inner shadow for depth */

    animation: intro-spin 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    /* Keep content inside circle */
}

@media (min-width: 600px) {
    .wheel {
        width: 500px;
        height: 500px;
        max-width: 500px;
        max-height: 500px;
    }
}



@keyframes intro-spin {
    from {
        transform: rotate(-180deg) scale(0.1);
        opacity: 0;
    }

    to {
        transform: rotate(0) scale(1);
        opacity: 1;
    }
}

/* Individual Pieces - Invisible Overlay Wedges */
.slice-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    /* Radius length */
    height: 50%;
    /* Radius length */
    transform-origin: 0% 0%;
    background: transparent;
    border: none;
    box-shadow: none;
    cursor: pointer;
    z-index: 10;
}

/* Hover Effect: Glow on the specific wedge area */
.slice-btn:hover {
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.2) 0%, transparent 80%);
}

.slice-btn:hover .fortune-slip {
    transform: scale(1.2);
    box-shadow: 0 0 15px #fff;
}

/* Taken Effect */
.slice-btn.taken {
    cursor: default;
    pointer-events: none;
}

.slice-btn.taken .fortune-slip {
    opacity: 0;
    transform: scale(0);
}

/* Fortune Slip Visual (The paper) */
.fortune-slip {
    position: absolute;
    /* Position loosely in the middle of the wedge area */
    /* Since we are inside a rotated/skewed container, we need to be careful. */
    /* Actually, simplest is to position these absolutely in the Wheel context,
       but if they are children of slice-btn they move with it.
       Let's separate them in JS or handle counter-transform.

       Better approach for "glitchy" fix:
       The slice-btn handles the click area (wedge).
       The slip is a visual child.
       To avoid skew distortion, we might need to counter-skew.
    */
    width: 30px;
    height: 12px;
    background: #fffdf7;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);

    /* Center it in the wedge approximately */
    /* For a 30deg wedge, center is around 15deg line. */
    /* If wedge is transformed: rotate(R) skewY(-60). */
    /* It's hard to position inside. */
}

/* BETTER STRATEGY IN JS: Separate elements.
   css here defines the look.
*/
.fortune-slip-item {
    position: absolute;
    width: 50px;
    height: 12px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.5);
    z-index: 20;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* Paper rolled look */
    background: linear-gradient(to bottom, #fdfbf7 0%, #eee 20%, #fdfbf7 40%, #eee 60%, #fdfbf7 100%);

    /* Red thread in the middle */
    border-left: 2px solid transparent;
    border-right: 2px solid transparent;
}

/* Pseudo element for the red thread/tie */
.fortune-slip-item::before {
    content: '';
    position: absolute;
    left: 45%;
    top: -2px;
    width: 6px;
    /* slightly wider band */
    height: 16px;
    /* taller than slip */
    background-color: #d32f2f;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.fortune-slip-item:hover {
    transform: scale(1.4) !important;
    /* Override inline rotation for scale */
    box-shadow: 0 0 20px var(--primary-glow);
}

.fortune-slip-item.taken {
    opacity: 0;
    transform: scale(0) !important;
    pointer-events: none;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.modal-content {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    margin: 10% auto;
    padding: 2rem;
    border: 1px solid var(--lirex-orange);
    box-shadow:
        0 0 50px rgba(255, 107, 0, 0.3),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 600px;
    border-radius: 20px;
    text-align: center;
    position: relative;
    animation: modalPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: #fff;
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .fortune-text {
        font-size: 1.5rem;
        /* Smaller text for mobile */
    }

    .fortune-icon {
        font-size: 3rem;
    }

    .modal-content {
        padding: 1.5rem;
    }
}

@keyframes modalPop {
    from {
        transform: scale(0.5) translateY(100px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.close {
    color: #fff;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 35px;
    transition: color 0.3s;
}

.close:hover {
    color: var(--lirex-orange);
}

.fortune-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-20px);
    }

    60% {
        transform: translateY(-10px);
    }
}

.fortune-text {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    background: linear-gradient(to right, #fff, #b3e5fc);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 2rem 0;
    line-height: 1.3;
}

.modal h2 {
    color: var(--lirex-orange);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1.2rem;
    margin-top: 0;
}

.btn-close {
    background: linear-gradient(90deg, var(--lirex-blue), #003d80);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 86, 179, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 86, 179, 0.6);
}

footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    text-align: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: #888;
    backdrop-filter: blur(5px);
    font-size: 0.8rem;
}