html {
    box-sizing: border-box;
}
*, *:before, *:after {
    box-sizing: inherit;
}
html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
canvas {
    display: block;
}
body {
    margin: 0;
    background: linear-gradient(135deg, #ff66cc 0%, #9966ff 100%);
    overflow: hidden;
}

#unity-container {
    width: 100%;
    height: 100%;
}

#unity-canvas {
    width: 100%;
    height: 100%;
    background: #000000;
}

/* ===== MODERN LOADING SCREEN ===== */
#loading-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #ff66cc 0%, #9966ff 100%); /* Pink to purple gradient */
    z-index: 1000;
}


.loading-background {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.loading-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
}


.loading-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 500px;
    padding: 40px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: contentFadeIn 1s ease-out;
}

@keyframes contentFadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.loading-logo-container {
    position: relative;
    margin-bottom: 30px;
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.logo-glow {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

#unity-logo {
    position: relative;
    z-index: 2;
}

#unity-logo img {
    max-width: 100px;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

.loading-text {
    margin-bottom: 30px;
}

.game-title {
    font-size: 2.5em;
    font-weight: 700;
    color: white;
    margin: 0 0 10px 0;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 255, 255, 0.3); }
    to { text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 255, 255, 0.6); }
}

.loading-subtitle {
    font-size: 1.1em;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    font-weight: 300;
    animation: subtitleFade 3s ease-in-out infinite;
}

@keyframes subtitleFade {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.loading-progress-container {
    margin-bottom: 30px;
}

#unity-progress-bar-empty {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

#unity-progress-bar-full {
    height: 100%;
    background: linear-gradient(90deg, #ff66cc, #9966ff);
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
}

@keyframes progressShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.progress-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.loading-percentage {
    margin-top: 15px;
    font-size: 1.5em;
    font-weight: 600;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: percentagePulse 1s ease-in-out infinite;
}

@keyframes percentagePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.loading-tips {
    margin-bottom: 20px;
}

.tip-container {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-tip {
    font-size: 1em;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-style: italic;
    animation: tipFade 0.5s ease-in-out;
}

@keyframes tipFade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.loading-footer-links {
    margin-top: 20px;
    text-align: center;
}

.website-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 1em;
    font-weight: 400;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.85em;
}

.website-link:hover {
    color: #ff00ff;
    border-bottom-color: #ff00ff;
    text-shadow: 0 0 15px rgba(255, 0, 255, 0.7);
    transform: translateY(-2px);
}

.loading-footer {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
}

.loading-dots {
    display: flex;
    gap: 8px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: dotBounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ===== FULLSCREEN BUTTON ===== */
#unity-fullscreen-button {
    position: absolute;
    left: 10px;
    bottom: 10px;
    width: 38px;
    height: 38px;
    background: url('fullscreen-button.png') no-repeat center;
    background-size: contain;
    transition: all 0.3s ease;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.1);
}

#unity-fullscreen-button:hover {
    background: url('fullscreen-button-hover.png') no-repeat center;
    background-size: contain;
    transform: scale(1.1);
    background-color: rgba(255, 255, 255, 0.2);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .loading-content {
        max-width: 90%;
        padding: 30px 20px;
    }
    
    .game-title {
        font-size: 2em;
    }
    
    .loading-subtitle {
        font-size: 1em;
    }
    
    #unity-logo img {
        max-width: 100px;
    }
}

@media (max-width: 480px) {
    .loading-content {
        padding: 20px 15px;
    }
    
    .game-title {
        font-size: 1.8em;
    }
    
    .loading-subtitle {
        font-size: 0.9em;
    }
    
    #unity-logo img {
        max-width: 80px;
    }
}

/* ===== DARK MODE SUPPORT ===== */
.light #unity-progress-bar-empty {
    background: rgba(0, 0, 0, 0.2);
}

.light #unity-progress-bar-full {
    background: linear-gradient(90deg, #ff66cc, #9966ff);
}

.light .game-title {
    color: #333;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.light .loading-subtitle {
    color: rgba(0, 0, 0, 0.7);
}

.light .loading-tip {
    color: rgba(0, 0, 0, 0.8);
}

.light .loading-percentage {
    color: #333;
}

.light .loading-dots span {
    background: rgba(0, 0, 0, 0.4);
}
