/* GameFunTV VR Edition Stylesheet - Optimized for Meta Quest & WebXR */

:root {
    --vr-bg: #050711;
    --vr-card: rgba(14, 18, 38, 0.92);
    --vr-primary: #8b5cf6;
    --vr-accent: #06b6d4;
    --vr-neon: #a855f7;
    --vr-text: #f8fafc;
    --vr-muted: #94a3b8;
    --vr-border: rgba(139, 92, 246, 0.35);
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--vr-bg);
    color: var(--vr-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

/* ==================== VR AUTH (LOGIN & REGISTER) ==================== */
.vr-auth-body {
    overflow-y: auto;
    background: radial-gradient(circle at 50% 30%, #1e153b 0%, #050711 75%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.vr-auth-container {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.vr-badge-header {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid var(--vr-border);
    border-radius: 30px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #c084fc;
    margin: 0 auto;
}

.vr-pulse-dot {
    width: 10px;
    height: 10px;
    background: #34d399;
    border-radius: 50%;
    box-shadow: 0 0 10px #34d399;
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.vr-auth-card {
    background: var(--vr-card);
    border: 1px solid var(--vr-border);
    border-radius: 20px;
    padding: 36px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(139, 92, 246, 0.25);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.vr-auth-header {
    text-align: center;
}

.vr-auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    margin-bottom: 12px;
    font-size: 22px;
    font-weight: 800;
}

.vr-logo-orb {
    color: var(--vr-accent);
    font-size: 26px;
}

.vr-auth-logo em {
    font-style: normal;
    background: linear-gradient(135deg, #a855f7, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.vr-auth-header h1 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 8px;
}

.vr-auth-header p {
    color: var(--vr-muted);
    font-size: 14px;
    line-height: 1.5;
}

.vr-alert-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
}

.vr-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.vr-field label {
    font-size: 13px;
    font-weight: 700;
    color: #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.vr-field input {
    background: rgba(5, 7, 17, 0.85);
    border: 1.5px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    padding: 14px 18px;
    color: #fff;
    font-size: 16px; /* Great for VR virtual keyboard */
    min-height: 54px;
    outline: none;
    transition: all 0.2s ease;
}

.vr-field input:focus {
    border-color: #a855f7;
    box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.3);
}

.vr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 56px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.04em;
    border-radius: 14px;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: transform 0.15s, box-shadow 0.2s, background-color 0.2s;
}

.vr-btn:hover {
    transform: scale(1.02);
}

.vr-btn-accent {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: #fff;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.45);
}

.vr-btn-accent:hover {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.6);
}

.vr-btn-large-guest {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(59, 130, 246, 0.15));
    border: 1.5px solid rgba(6, 182, 212, 0.4);
    color: #38bdf8;
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.2);
}

.vr-btn-large-guest:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(59, 130, 246, 0.25));
    border-color: #38bdf8;
    color: #fff;
}

.vr-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.vr-divider::before,
.vr-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(139, 92, 246, 0.2);
}

.vr-auth-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    font-size: 14px;
    color: var(--vr-muted);
}

.vr-auth-footer a {
    color: #c084fc;
    text-decoration: none;
    font-weight: 700;
}

.vr-headset-guide {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.guide-chip {
    background: rgba(14, 18, 38, 0.7);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
    color: #cbd5e1;
    font-weight: 600;
}

/* ==================== VR IN-GAME HUD & OVERLAYS ==================== */
#vr-root {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

#vr-root canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    outline: none;
}

.vr-hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Top bar in VR (minimal and clean) */
.vr-topbar {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: linear-gradient(180deg, rgba(5, 7, 17, 0.9) 0%, rgba(5, 7, 17, 0) 100%);
}

.vr-brand {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vr-brand .pill-vr {
    background: #7c3aed;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.05em;
}

.vr-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vr-nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.vr-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Start screen & WebXR Enter prompt */
.vr-start-overlay {
    pointer-events: auto;
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 17, 0.8);
    backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    transition: opacity 0.3s;
}

.vr-start-overlay.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.vr-start-modal {
    background: var(--vr-card);
    border: 1px solid var(--vr-border);
    border-radius: 24px;
    padding: 44px 38px;
    max-width: 540px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 50px rgba(124, 58, 237, 0.35);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.vr-start-modal h1 {
    font-size: 32px;
    font-weight: 900;
}

.vr-start-modal p {
    color: var(--vr-muted);
    font-size: 15px;
    line-height: 1.6;
}

.vr-enter-btn-primary {
    min-height: 64px;
    font-size: 18px;
    font-weight: 900;
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
    color: #fff;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 0.05em;
    transition: transform 0.15s, box-shadow 0.2s;
}

.vr-enter-btn-primary:hover {
    transform: scale(1.03);
    box-shadow: 0 14px 40px rgba(139, 92, 246, 0.7);
}

.vr-screen-fallback-btn {
    min-height: 48px;
    font-size: 14px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    border-radius: 12px;
    cursor: pointer;
}

.vr-screen-fallback-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.vr-status-pill {
    font-size: 12px;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 20px;
    padding: 6px 14px;
    display: inline-block;
    margin: 0 auto;
}

.vr-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(14, 18, 38, 0.95);
    border: 1px solid var(--vr-border);
    padding: 28px 36px;
    border-radius: 16px;
    text-align: center;
    z-index: 100;
    transition: opacity 0.3s;
}

.vr-loading.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.vr-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(139, 92, 246, 0.2);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: vrSpin 1s infinite linear;
    margin: 0 auto 16px auto;
}

@keyframes vrSpin {
    to { transform: rotate(360deg); }
}


/* VR Games Quick Switcher Bar (Visible on 2D Screen and Meta Quest Browser bar) */
.vr-games-bar {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(14, 18, 38, 0.85);
    border: 1px solid var(--vr-border);
    border-radius: 40px;
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(139, 92, 246, 0.25);
    max-width: 900px;
    margin: 0 auto 16px auto;
    overflow-x: auto;
}

.vr-game-pill {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.vr-game-pill:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: #a855f7;
    color: #fff;
    transform: translateY(-2px);
}

.vr-game-pill.active {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    border-color: #c084fc;
    color: #fff;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.5);
}

@media (max-width: 768px) {
    .vr-games-bar {
        justify-content: flex-start;
        border-radius: 12px;
        margin: 0 10px 10px 10px;
    }
}
