/**
 * IFL PvP - Main Styles
 * ==================================
 * Professional arena look: navy/slate base, blue vs red team accents, amber CTAs.
 * No pink/purple; consistent with in-game Arena and Game Over screens.
 */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Rajdhani:wght@500;600;700&family=Orbitron:wght@500;700;900&display=swap');

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background: #080a0e;
    background-image: radial-gradient(ellipse 100% 80% at 50% 40%, #0c1018 0%, #080a0e 60%, #06080c 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Rajdhani', 'Segoe UI', sans-serif;
    min-height: 100vh;
}

/* Subtle ambient glow – blue/amber (no pink/purple) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 25% 30%, rgba(68, 136, 255, 0.04) 0%, transparent 45%),
        radial-gradient(circle at 75% 70%, rgba(204, 153, 68, 0.03) 0%, transparent 45%);
    pointer-events: none;
    z-index: -1;
}

/* Game container: fixed aspect ratio (1600:900) so it never stretches/crops weird in fullscreen */
#game-container {
    position: relative;
    width: min(100vw, 100vh * 1600 / 900);
    height: min(100vh, 100vw * 900 / 1600);
    margin: auto;
    overflow: hidden;
    background: #080a0e;
    border: 1px solid rgba(30, 40, 56, 0.9);
    box-shadow:
        0 0 0 1px rgba(68, 136, 255, 0.08),
        inset 0 0 80px rgba(0, 0, 0, 0.6);
    border-radius: 4px;
}

#game-container canvas {
    display: block;
    vertical-align: middle;
}

/* Loading Overlay – title block centered, prompt at bottom. Transparent from first paint so canvas shows through (seamless). */
#loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease-out;
}

/* From first screen: see through to canvas (no solid background flash) */
#loading-overlay.bg-transparent {
    background: transparent !important;
    background-image: none !important;
}

.loading-title-block {
    position: absolute;
    top: 45%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* When chase is ready: clicks go to game; bg already transparent from first screen */
#loading-overlay.title-ready {
    pointer-events: none;
}

/* Logo block – IFL PvP as a game logo */
.loading-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 0;
    position: relative;
    padding: 0 0.5rem;
}

/* IFL – cool, team-blue side */
.logo-ifl {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 4.5rem;
    font-weight: 400;
    letter-spacing: 0.28em;
    color: #fff;
    text-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.5),
        0 2px 0 rgba(0, 0, 0, 0.4),
        0 0 24px rgba(68, 136, 255, 0.3);
    background: linear-gradient(180deg, #e8f0ff 0%, #aaccff 45%, #6688dd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
    position: relative;
    z-index: 1;
}

/* PvP – warm, combat / amber side */
.logo-pvp {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 4.5rem;
    font-weight: 400;
    letter-spacing: 0.35em;
    margin-left: -0.05em;
    color: #fff;
    position: relative;
    z-index: 1;
    text-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.5),
        0 2px 0 rgba(0, 0, 0, 0.4),
        0 0 24px rgba(204, 153, 68, 0.35);
    background: linear-gradient(180deg, #fff8e8 0%, #ffdd88 40%, #cc9944 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}

/* Logo glow pulse */
.loading-logo .logo-ifl,
.loading-logo .logo-pvp {
    animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35)); }
    50% { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35)) drop-shadow(0 0 20px rgba(204, 153, 68, 0.25)); }
}

/* Subtitle under logo */
.loading-subtitle {
    font-family: 'Rajdhani', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.4em;
    color: #6688aa;
    margin-top: 10px;
    margin-bottom: 0;
    opacity: 0.95;
}

/* Bottom right corner – credit above version */
.loading-bottom-right {
    position: absolute;
    bottom: 12px;
    right: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.loading-version {
    font-family: 'Rajdhani', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: #445566;
    margin: 0;
    opacity: 0.85;
}

/* Footer: prompt at ~3/4 down during chase; moves up under subtitle when chase finishes */
.loading-footer {
    position: absolute;
    top: 75%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    transition: top 0.8s ease-out;
}

#loading-overlay.footer-raised .loading-footer {
    top: 64%;
}

/* Click prompt – visually subordinate */
.loading-text {
    padding-bottom: 0;
}

/* Logo scale on small viewports */
@media (max-width: 600px) {
    .logo-ifl,
    .logo-pvp {
        font-size: 3rem !important;
        letter-spacing: 0.18em !important;
    }
    .logo-pvp {
        letter-spacing: 0.22em !important;
    }
}

/* Loading Bar – chase animation with real sprites runs in BootScene after load */

/* Loading Bar */
.loading-bar-container {
    width: 420px;
    max-width: 85vw;
    height: 10px;
    background: #0c0e14;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(68, 136, 255, 0.15);
    margin-bottom: 28px;
}

.loading-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg,
        #4488ff 0%,
        #66aaff 30%,
        #cc9944 70%,
        #ffaa44 100%);
    background-size: 200% 100%;
    border-radius: 5px;
    transition: width 0.3s ease-out;
    animation: barShine 2.5s linear infinite;
    box-shadow: 0 0 12px rgba(68, 136, 255, 0.4);
}

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

/* Loading Text – small, muted, way at bottom */
.loading-text {
    font-family: 'Rajdhani', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #4a5566;
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: textPulse 1.8s ease-in-out infinite;
}

/* Menu buttons – same font as overlay, shown after "Click to play" */
.loading-menu-buttons {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 0;
}
.loading-menu-buttons.visible {
    display: flex;
}

/* Clean options: A=glow (current), B=underline, C=color-only, D=letter-spread */
.loading-menu-btn {
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.25em;
    color: #e8e8e8;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 16px;
    text-transform: uppercase;
    transition: color 0.15s ease, text-shadow 0.2s ease, letter-spacing 0.2s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    outline: none;
}
.loading-menu-btn:hover:not(:disabled) {
    color: #ffdd88;
    text-shadow: 0 0 20px rgba(255, 221, 136, 0.35);
}
.loading-menu-btn:focus {
    outline: none;
}
.loading-menu-btn:active:not(:disabled),
.loading-menu-btn:focus:not(:disabled) {
    color: #aaccff;
    text-shadow: 0 0 24px rgba(68, 136, 255, 0.5);
}
.loading-menu-btn:disabled,
.loading-menu-btn-disabled {
    color: #444466;
    cursor: default;
}

@keyframes textPulse {
    0%, 100% { opacity: 0.5; color: #3d4852; }
    50% { opacity: 0.85; color: #5c6b7a; }
}

/* Credit – subtle, bottom of boot screen */
.loading-credit {
    font-family: 'Rajdhani', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #3a4250;
    letter-spacing: 1px;
    opacity: 0.7;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0c0e14;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #2a3444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a4555;
}

::selection {
    background: rgba(68, 136, 255, 0.35);
    color: #ffffff;
}

:focus {
    outline: 2px solid rgba(68, 136, 255, 0.5);
    outline-offset: 2px;
}

/* Typography */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
