/* Fonts */
@font-face {
    font-family: 'ScotchFontByLyajka';
    src: url('fonts/scotchfontbylyajka.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Main styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'ScotchFontByLyajka', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000 url('backgrounds/bg99.png') center/cover no-repeat;
    background-attachment: fixed;
    color: #fff;
    overflow: hidden;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3), 0 0 20px rgba(255, 255, 255, 0.1);
    font-weight: 500;
    letter-spacing: 0.5px;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(200, 162, 200, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 182, 193, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(173, 216, 230, 0.08) 0%, transparent 50%);
    animation: backgroundGlow 8s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: -1;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(45deg, transparent 30%, rgba(200, 162, 200, 0.03) 50%, transparent 70%),
        linear-gradient(-45deg, transparent 30%, rgba(255, 182, 193, 0.02) 50%, transparent 70%);
    animation: backgroundShift 12s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes backgroundGlow {
    0% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    100% {
        opacity: 0.6;
        transform: scale(0.95);
    }
}

@keyframes backgroundShift {
    0% {
        transform: translateX(0) translateY(0);
    }
    25% {
        transform: translateX(10px) translateY(-5px);
    }
    50% {
        transform: translateX(-5px) translateY(10px);
    }
    75% {
        transform: translateX(5px) translateY(-10px);
    }
    100% {
        transform: translateX(0) translateY(0);
    }
}

/* Game container */
#game-container {
    position: relative;
    width: 819px;
    height: 819px;
    border: 2px solid rgba(200, 162, 200, 0.3);
    border-radius: 15px;
    overflow: hidden;
    background: #000;
    box-shadow: 
        0 0 20px rgba(200, 162, 200, 0.2),
        inset 0 0 20px rgba(200, 162, 200, 0.05);
    animation: borderGlow 3s ease-in-out infinite alternate;
}

@keyframes borderGlow {
    0% {
        border-color: rgba(200, 162, 200, 0.3);
        box-shadow: 
            0 0 20px rgba(200, 162, 200, 0.2),
            inset 0 0 20px rgba(200, 162, 200, 0.05);
    }
    100% {
        border-color: rgba(200, 162, 200, 0.5);
        box-shadow: 
            0 0 30px rgba(200, 162, 200, 0.3),
            inset 0 0 30px rgba(200, 162, 200, 0.1);
    }
}

/* Game background */
#game-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    box-shadow: 
        inset 0 0 100px rgba(200, 162, 200, 0.1),
        inset 0 0 200px rgba(200, 162, 200, 0.05);
    filter: brightness(1.1) contrast(1.05);
    transition: background-image 1s ease-in-out, filter 0.8s ease-in-out;
}

/* Background Glow */
#background-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 20%, rgba(200, 162, 200, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(200, 162, 200, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 50% 50%, rgba(200, 162, 200, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1.2;
    animation: backgroundGlow 8s ease-in-out infinite alternate;
}

@keyframes backgroundGlow {
    0% {
        opacity: 0.3;
        filter: blur(0px);
    }
    100% {
        opacity: 0.6;
        filter: blur(1px);
    }
}

/* Sparkling Fireflies */
#sparkle-fireflies {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
}

.sparkle-firefly {
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, rgba(200, 162, 200, 1) 0%, rgba(200, 162, 200, 0.7) 30%, rgba(200, 162, 200, 0.3) 60%, transparent 100%);
    border-radius: 50%;
    box-shadow: 
        0 0 15px rgba(200, 162, 200, 1),
        0 0 30px rgba(200, 162, 200, 0.8),
        0 0 45px rgba(200, 162, 200, 0.6);
    animation: sparkleFloat 6s ease-in-out infinite;
    opacity: 0;
}

@keyframes sparkleFloat {
    0% {
        transform: translate(0, 0) scale(0);
        opacity: 0;
    }
    10% {
        transform: translate(10px, -5px) scale(1.2);
        opacity: 1;
    }
    20% {
        transform: translate(25px, -15px) scale(0.8);
        opacity: 0.8;
    }
    30% {
        transform: translate(40px, -25px) scale(1.5);
        opacity: 1;
    }
    40% {
        transform: translate(30px, -40px) scale(0.6);
        opacity: 0.6;
    }
    50% {
        transform: translate(15px, -50px) scale(1.3);
        opacity: 0.9;
    }
    60% {
        transform: translate(-5px, -45px) scale(0.7);
        opacity: 0.7;
    }
    70% {
        transform: translate(-20px, -30px) scale(1.1);
        opacity: 0.8;
    }
    80% {
        transform: translate(-35px, -15px) scale(0.9);
        opacity: 0.6;
    }
    90% {
        transform: translate(-25px, -5px) scale(1.4);
        opacity: 0.9;
    }
    100% {
        transform: translate(0, 0) scale(0);
        opacity: 0;
    }
}


/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease;
    z-index: 2;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

/* Title screen */
#title-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(200, 162, 200, 0.05));
}

.title-content {
    text-align: center;
}

.game-title {
    font-size: 4rem;
    font-weight: 600;
    color: #c8a2c8;
    margin-bottom: 0.5rem;
    text-shadow: 
        0 0 20px rgba(200, 162, 200, 0.8),
        0 0 40px rgba(200, 162, 200, 0.4),
        0 0 60px rgba(200, 162, 200, 0.2);
    letter-spacing: 1px;
}

.title-subtitle {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
    font-weight: 500;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    letter-spacing: 0.5px;
}

.author-link {
    color: #c8a2c8;
    text-decoration: none;
    transition: all 0.3s ease;
    text-shadow: 
        0 0 10px rgba(200, 162, 200, 0.6),
        0 0 20px rgba(200, 162, 200, 0.3);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.author-link:hover {
    color: #fff;
    text-shadow: 
        0 0 15px rgba(200, 162, 200, 1),
        0 0 30px rgba(200, 162, 200, 0.6),
        0 0 45px rgba(200, 162, 200, 0.3);
    transform: scale(1.05);
}

/* Buttons */
.game-button {
    background: rgba(200, 162, 200, 0.1);
    border: 1px solid rgba(200, 162, 200, 0.3);
    color: #fff;
    padding: 16px 32px;
    font-size: 1.5rem;
    font-family: 'ScotchFontByLyajka', 'Segoe UI', sans-serif;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(200, 162, 200, 0.1);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.game-button:hover {
    background: rgba(200, 162, 200, 0.2);
    border-color: rgba(200, 162, 200, 0.5);
    box-shadow: 0 0 20px rgba(200, 162, 200, 0.3);
    transform: translateY(-2px);
}

/* Game screen */
#game-screen {
    display: flex;
    flex-direction: column;
}

/* Text panel */
#text-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 3;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

#character-name {
    font-size: 1.8rem;
    color: #c8a2c8;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 
        0 0 15px rgba(200, 162, 200, 0.8),
        0 0 30px rgba(200, 162, 200, 0.4);
    letter-spacing: 0.5px;
    transition: opacity 0.3s ease-in-out;
}

#dialogue-text {
    font-size: 1.6rem;
    line-height: 1.6;
    color: #fff;
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.4),
        0 0 20px rgba(255, 255, 255, 0.2),
        0 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 10px;
    white-space: pre-line;
    position: relative;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: opacity 0.3s ease-in-out;
}

/* Typewriter cursor */
#dialogue-text::after {
    content: '|';
    color: #c8a2c8;
    animation: blink 1s infinite;
    margin-left: 2px;
}

#dialogue-text.completed::after {
    display: none;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.continue-indicator {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

.continue-indicator.hidden {
    display: none;
}

/* Choice panel */
#choice-panel {
    position: absolute;
    bottom: 200px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(200, 162, 200, 0.2);
    border-radius: 15px;
    padding: 16px;
    min-width: 280px;
    z-index: 4;
    box-shadow: 0 0 15px rgba(200, 162, 200, 0.1);
}

#choice-panel.hidden {
    display: none;
}

#choice-title {
    font-size: 0.9rem;
    color: #c8a2c8;
    text-align: center;
    margin-bottom: 12px;
    font-weight: 400;
}

.choice-button {
    background: rgba(200, 162, 200, 0.1);
    border: 1px solid rgba(200, 162, 200, 0.3);
    color: #fff;
    padding: 16px 20px;
    font-size: 1.3rem;
    font-family: 'ScotchFontByLyajka', 'Segoe UI', sans-serif;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease, opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    display: block;
    width: 100%;
    margin-bottom: 8px;
    text-align: center;
}

.choice-button:hover {
    background: rgba(200, 162, 200, 0.2);
    border-color: rgba(200, 162, 200, 0.5);
    box-shadow: 0 0 15px rgba(200, 162, 200, 0.2);
    transform: translateX(5px);
}

.choice-button:last-child {
    margin-bottom: 0;
}

/* Final choice screen */
#final-choice-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(200, 162, 200, 0.05));
}

#final-choice-screen #game-background {
    filter: brightness(0.2) contrast(1.05) blur(4px);
}

.final-choice-content {
    text-align: center;
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
}

.final-choice-content h2 {
    font-size: 3rem;
    color: #c8a2c8;
    margin-bottom: 2rem;
    font-weight: 400;
}

.final-choice-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.final-choice-button {
    background: rgba(200, 162, 200, 0.1);
    border: 1px solid rgba(200, 162, 200, 0.3);
    color: #000;
    padding: 25px 40px;
    font-size: 2rem;
    font-family: 'ScotchFontByLyajka', 'Segoe UI', sans-serif;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 180px;
    justify-content: center;
    box-shadow: 0 0 10px rgba(200, 162, 200, 0.1);
}

.final-choice-button:hover {
    background: rgba(200, 162, 200, 0.2);
    border-color: rgba(200, 162, 200, 0.5);
    box-shadow: 0 0 20px rgba(200, 162, 200, 0.3);
    transform: translateY(-2px);
}

.button-icon {
    font-size: 1.2rem;
}

.pfp-text {
    font-size: 1.2rem;
    color: #000;
    margin-top: 1.5rem;
    text-align: center;
    font-style: italic;
}

/* Responsive design */
@media (max-width: 1000px) {
    #game-container {
        width: 90vw;
        height: 90vw;
        margin: 15px auto;
    }
}

@media (max-width: 768px) {
    #game-container {
        width: 95vw;
        height: 95vw;
        margin: 10px auto;
    }
    
    .game-title {
        font-size: 3rem;
    }
    
    .title-subtitle {
        font-size: 1.6rem;
    }
    
    .final-choice-content h2 {
        font-size: 2rem;
    }
    
    .final-choice-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    #text-panel {
        padding: 15px;
    }
    
    #character-name {
        font-size: 1.5rem;
    }
    
    #dialogue-text {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    #game-container {
        width: 98vw;
        height: 98vw;
        margin: 5px auto;
    }
    
    .game-title {
        font-size: 2.5rem;
    }
    
    .title-subtitle {
        font-size: 1.3rem;
    }
    
    .final-choice-content h2 {
        font-size: 1.5rem;
    }
    
    #text-panel {
        padding: 10px;
    }
    
    #character-name {
        font-size: 1.3rem;
    }
    
    #dialogue-text {
        font-size: 1.1rem;
    }
}