@font-face {
    font-family: 'StarseedPro';
    src: url('StarseedPro.woff2.woff') format('woff2');
    font-weight: normal;
    font-style: normal;
}

:root {
    --color-blue: #007BFF;
    --color-red: #ff6b6b;
    --color-cyan: #4ecdc4;
    --color-green: #28A745;
    --color-dark: #121212;
    --color-text: #FFFFFF;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'StarseedPro', sans-serif;
    background-color: var(--color-dark);
    color: var(--color-text);
    overflow: hidden;
    touch-action: manipulation;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    display: flex;
    flex-direction: column;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
    z-index: 10;
}

/* Global Mute Button */
.mute-btn {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 999;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.mute-btn:hover {
    background: rgba(40, 167, 69, 0.3); /* Subtle green theme accent */
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0, 230, 118, 0.4);
}

@keyframes panBg {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

/* Home Screen */
#home-screen {
    background: url('pixel_carpet_bg.png') center/cover no-repeat;
    animation: panBg 40s linear infinite;
}

#home-screen::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    /* Dark semi-transparent overlay to ensure text readability */
    background: rgba(10, 10, 10, 0.88); 
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: none;
    z-index: 1;
}

#particles-container {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

/* Subtle CSS particles */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #00E5FF;
    box-shadow: 0 0 8px #00E5FF;
    animation: floatUp 10s infinite linear;
    opacity: 0.6;
}

@keyframes floatUp {
    0% { transform: translateY(100vh) scale(1); opacity: 0; }
    10% { opacity: 0.8; }
    90% { opacity: 0.8; }
    100% { transform: translateY(-10vh) scale(1.5); opacity: 0; }
}

.signature {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: normal;
    font-family: 'StarseedPro', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    z-index: 2;
    text-align: center;
    width: 100%;
}

.home-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 3rem 1.5rem;
    overflow-y: auto;
    width: 100%;
    z-index: 2;
}

.main-title {
    font-size: 3.5rem;
    text-align: center;
    line-height: 1.2;
    font-family: 'StarseedPro', sans-serif;
    margin-bottom: 1.5rem;
    color: #fff;
    position: relative;
    text-shadow: 2px 2px 0px var(--color-red), -2px -2px 0px var(--color-cyan);
    animation: rgbShift 4s infinite alternate ease-in-out;
}

@keyframes rgbShift {
    0% { text-shadow: 3px 3px 0px var(--color-red), -3px -3px 0px var(--color-cyan); transform: translate(0,0); }
    20% { text-shadow: -3px 3px 0px var(--color-red), 3px -3px 0px var(--color-cyan); transform: translate(-1px,1px); }
    40% { text-shadow: 3px -3px 0px var(--color-red), -3px 3px 0px var(--color-cyan); transform: translate(1px,-1px); }
    60% { text-shadow: -3px -3px 0px var(--color-red), 3px 3px 0px var(--color-cyan); transform: translate(-1px,-1px); }
    80% { text-shadow: 4px 0px 0px var(--color-red), -4px 0px 0px var(--color-cyan); transform: translate(1px,0); }
    100% { text-shadow: 0px 4px 0px var(--color-red), 0px -4px 0px var(--color-cyan); transform: translate(0,1px); }
}

.subtitle {
    font-size: 2rem;
    color: var(--color-cyan);
    margin-bottom: 2.5rem;
    font-family: 'StarseedPro', sans-serif;
    font-weight: normal;
    text-shadow: 0 0 8px rgba(78, 205, 196, 0.6);
    min-height: 2.5rem;
    text-align: center;
}

/* Blinking cursor for typewriter */
.subtitle::after {
    content: '|';
    animation: blink 1s infinite step-end;
}

@keyframes blink {
    50% { opacity: 0; }
}

.categories {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 400px;
    gap: 1.5rem;
    padding-bottom: 4rem; /* room for signature */
}

.category-card {
    background: linear-gradient(135deg, rgba(18, 18, 18, 0.6), rgba(18, 18, 18, 0.4));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 16px;
    padding: 1.2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    font-size: 1.8rem;
    font-family: 'StarseedPro', sans-serif;
    color: var(--color-red);
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.category-card:hover {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.9), rgba(255, 107, 107, 0.7));
    color: #000;
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 32px rgba(255, 107, 107, 0.4);
}

.category-card:nth-child(even) {
    border-color: rgba(78, 205, 196, 0.3);
    color: var(--color-cyan);
}

.category-card:nth-child(even):hover {
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.9), rgba(78, 205, 196, 0.7));
    color: #000;
    box-shadow: 0 12px 32px rgba(78, 205, 196, 0.4);
}

.cat-icon {
    font-size: 2rem;
}

/* Game Screen */
#game-screen {
    background: url('pixel_carpet_bg.png') center/cover no-repeat;
    animation: panBg 40s linear infinite reverse;
}

#game-screen::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 10, 10, 0.84);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    pointer-events: none;
    z-index: 1;
}

.back-btn {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 100;
    font-size: 1.2rem;
    font-weight: normal;
    font-family: 'StarseedPro', sans-serif;
    color: var(--color-red);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    background: rgba(18, 18, 18, 0.8);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
}

.back-btn:hover {
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.8), rgba(255, 107, 107, 0.5));
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.4);
}

.game-board {
    display: flex;
    width: 100vw;
    height: 100vh;
    padding: 6rem 3rem 3rem 3rem;
    gap: 3rem;
    transition: opacity 0.5s ease;
    z-index: 2;
    position: relative;
}

/* Desktop: Left / Right */
@keyframes floatCards {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

@keyframes sweepShine {
    0% { transform: translateX(-150%) skewX(-15deg); }
    100% { transform: translateX(250%) skewX(-15deg); }
}

.option {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    user-select: none;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5), 
                inset 2px 2px 4px rgba(255, 255, 255, 0.8), 
                inset -2px -2px 6px rgba(0, 0, 0, 0.3), 
                inset 0 0 30px rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow: hidden;
    animation: floatCards 6s ease-in-out infinite;
}

.option::after {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 150%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05) 30%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.05) 70%, transparent);
    animation: sweepShine 6s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

.left-option {
    background: linear-gradient(135deg, rgba(255, 140, 140, 0.95), rgba(255, 80, 80, 0.75));
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5),
                0 0 30px rgba(255, 107, 107, 0.4),
                inset 2px 2px 4px rgba(255, 255, 255, 0.8),
                inset -2px -2px 6px rgba(0, 0, 0, 0.3),
                inset 0 0 30px rgba(255, 255, 255, 0.15);
}

.left-option::after {
    animation-delay: 0s;
}

.right-option {
    background: linear-gradient(135deg, rgba(120, 245, 235, 0.95), rgba(60, 215, 205, 0.75));
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5),
                0 0 30px rgba(78, 205, 196, 0.4),
                inset 2px 2px 4px rgba(255, 255, 255, 0.8),
                inset -2px -2px 6px rgba(0, 0, 0, 0.3),
                inset 0 0 30px rgba(255, 255, 255, 0.15);
    animation-delay: -3s;
}

.right-option::after {
    animation-delay: -3s;
}

.option-text {
    font-size: 3.5rem;
    font-weight: 700;
    font-family: 'StarseedPro', sans-serif;
    line-height: 1.2;
    z-index: 2;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5), 0 4px 16px rgba(0,0,0,0.8);
    max-width: 90%;
    word-break: break-word;
    letter-spacing: 2px;
}

.results-container {
    margin-top: 2rem;
    width: 80%;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    z-index: 2;
}

.percentage {
    font-size: 5rem;
    font-family: 'StarseedPro', sans-serif;
    font-weight: normal;
    color: #fff;
    line-height: 1;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5), 0 4px 16px rgba(0,0,0,0.8);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: #FFF;
    transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* State Classes */
.option.selected {
    flex: 1.3;
    transform: scale(1.05);
    z-index: 5;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7),
                0 0 50px rgba(255, 255, 255, 0.3),
                inset 2px 2px 4px rgba(255, 255, 255, 0.9),
                inset -2px -2px 6px rgba(0, 0, 0, 0.4),
                inset 0 0 40px rgba(255, 255, 255, 0.25);
}

.option.dimmed {
    flex: 0.7;
    filter: brightness(0.4) grayscale(0.5);
    transform: scale(0.95);
}

.option.show-results .results-container {
    opacity: 1;
    transform: translateY(0);
}

.game-board.fading {
    opacity: 0;
}

/* Hover effects for Desktop Only to prevent sticky hover on mobile */
@media (hover: hover) {
    .option:not(.selected):not(.dimmed):hover {
        filter: brightness(1.15) saturate(1.1);
        transform: scale(1.03) translateY(-10px);
        box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6),
                    0 0 40px rgba(255, 255, 255, 0.2),
                    inset 2px 2px 4px rgba(255, 255, 255, 0.9),
                    inset -2px -2px 6px rgba(0, 0, 0, 0.4),
                    inset 0 0 40px rgba(255, 255, 255, 0.2);
        animation-play-state: paused;
    }
}

/* Mobile: Top / Bottom */
@media (max-width: 768px) {
    .game-board {
        flex-direction: column;
        padding: 4.5rem 1rem 1rem 1rem;
        gap: 1rem;
    }
    .option {
        padding: 1.5rem;
        box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.8);
    }
    .option-text {
        font-size: 2rem;
    }
    .percentage {
        font-size: 4rem;
    }
    .main-title {
        font-size: 2.2rem;
    }
    .results-container {
        margin-top: 1rem;
    }
}
