* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-filter: contrast(108%) brightness(78%) saturate(102%);
    --vignette-center: rgba(0, 0, 0, 0.12);
    --vignette-mid: rgba(0, 0, 0, 0.28);
    --vignette-edge: rgba(0, 0, 0, 0.74);
    --panel-bg: linear-gradient(180deg, rgba(10, 10, 10, 0.34) 0%, rgba(10, 10, 10, 0.2) 100%);
    --panel-border: rgba(255, 255, 255, 0.08);
    --panel-shadow: rgba(0, 0, 0, 0.34);
    --accent: #9ee7ff;
    --text-main: #f7f7f7;
    --text-soft: rgba(255, 255, 255, 0.78);
    --symbol-bg: rgba(255, 255, 255, 0.08);
    --symbol-border: rgba(255, 255, 255, 0.14);
    
    /* Sistema de Z-Index */
    --z-background: 0;
    --z-overlay-vignette: 1;
    --z-overlay-grain: 2;
    --z-container: 10;
    --z-controls: 30;
}

html, body {
    height: 100%;
    background-color: #000;
}

body {
    position: relative;
    font-family: 'Inter', sans-serif;
    color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* Estilo para el video de fondo */
#bg-video {
    position: fixed;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: var(--z-background);
    transform: translate(-50%, -50%);
    object-fit: cover;
    filter: var(--bg-filter);
    transition: filter 0.5s ease;
}

.overlay-vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, var(--vignette-center) 0%, var(--vignette-mid) 48%, var(--vignette-edge) 100%);
    z-index: var(--z-overlay-vignette);
    pointer-events: none;
}

.overlay-grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://pantry-production.s3.amazonaws.com/du_hq_shores/uploads/standard_image/image/614614/b6e22e9e99.gif');
    background-size: 220px 220px;
    opacity: 0.035;
    z-index: var(--z-overlay-grain);
    pointer-events: none;
    mix-blend-mode: soft-light;
}

.container {
    position: relative;
    z-index: var(--z-container);
    text-align: center;
    max-width: 420px;
    width: 90%;
    padding: 28px 22px 24px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    backdrop-filter: blur(6px);
    box-shadow: 0 18px 60px var(--panel-shadow);
    animation: fadeIn 2.5s ease-out forwards;
    overflow: hidden;
}

.container::before,
.container::after {
    content: '';
    position: absolute;
    inset: -18%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: -1;
    will-change: transform, opacity, background-position;
}

.mode-control {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: var(--z-controls);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(8, 8, 12, 0.82) 0%, rgba(16, 16, 24, 0.66) 100%);
    border: 1px solid color-mix(in srgb, var(--accent) 34%, rgba(255, 255, 255, 0.06) 66%);
    backdrop-filter: blur(16px);
    box-shadow:
        0 6px 28px rgba(0, 0, 0, 0.44),
        inset 0 1px 0 rgba(255, 255, 255, 0.07),
        0 0 20px -5px color-mix(in srgb, var(--accent) 32%, transparent 68%);
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.mode-control label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    opacity: 0.9;
    font-weight: 500;
}

.mode-control select {
    border: 1px solid color-mix(in srgb, var(--accent) 28%, rgba(255, 255, 255, 0.10) 72%);
    background: rgba(0, 0, 0, 0.42);
    color: #f2f2f2;
    border-radius: 10px;
    padding: 7px 12px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-family: inherit;
}

.mode-control button {
    border: 1px solid color-mix(in srgb, var(--accent) 44%, rgba(255, 255, 255, 0.12) 56%);
    background: color-mix(in srgb, var(--accent) 12%, rgba(0, 0, 0, 0.40) 88%);
    color: #f2f2f2;
    border-radius: 10px;
    padding: 7px 12px;
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    font-family: inherit;
}

.mode-control button:hover,
.mode-control button:focus-visible {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 24%, rgba(0, 0, 0, 0.40) 76%);
    box-shadow: 0 0 12px -2px color-mix(in srgb, var(--accent) 45%, transparent 55%);
    outline: none;
}

.mode-control select:hover,
.mode-control select:focus-visible {
    border-color: var(--accent);
    box-shadow: 0 0 10px -3px color-mix(in srgb, var(--accent) 38%, transparent 62%);
    outline: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.username {
    font-family: 'Playfair Display', serif;
    font-size: 3.2rem;
    font-weight: 700;
    letter-spacing: 6px;
    margin-top: 20px;
    text-transform: lowercase;
    color: var(--text-main);
    text-shadow: 0 4px 22px rgba(0, 0, 0, 0.88);
}

.scene-tag {
    margin-top: 16px;
    font-size: 0.68rem;
    letter-spacing: 0.34em;
    color: var(--accent);
    text-transform: uppercase;
}

.badges {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.badges span,
.scene-symbols span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--symbol-bg);
    border: 1px solid var(--symbol-border);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}

.scene-marquee {
    display: none;
    margin: 18px auto 10px;
    width: min(100%, 360px);
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding: 7px 0;
    color: var(--accent);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    white-space: nowrap;
}

.scene-marquee.is-active {
    display: block;
}

.scene-marquee span {
    display: inline-block;
    padding-left: 100%;
    animation: marqueeMove 13s linear infinite;
}

.scene-symbols {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 6px 0 18px;
    flex-wrap: wrap;
}

.profile-pic {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 14px 34px rgba(0, 0, 0, 0.3);
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.container:hover .profile-pic {
    transform: scale(1.03);
    border-color: color-mix(in srgb, var(--accent) 45%, rgba(255, 255, 255, 0.15) 55%);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 18px 42px rgba(0, 0, 0, 0.38);
}

.quote {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    margin: 25px 0;
    font-size: 1.1rem;
    color: #f1f1f1;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
}

.location {
    font-size: 0.65rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text-soft);
    margin-bottom: 45px;
}

.status-card {
    background: rgba(14, 14, 14, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    padding: 12px 25px;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    backdrop-filter: blur(10px);
    margin-bottom: 45px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.status-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--accent) 28%, rgba(255,255,255,0.08) 72%);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.34);
}

.mini-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
}

.status-info { text-align: left; }

.status-name {
    display: block;
    font-weight: 500;
    font-size: 0.85rem;
    color: #f2f2f2;
}

.verified {
    color: color-mix(in srgb, var(--accent) 60%, #9a9a9a 40%);
    font-size: 0.7rem;
}

.last-seen {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.6);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 35px;
}

.social-links a {
    color: #fff;
    font-size: 1.1rem;
    text-decoration: none;
    transition: 0.5s;
    opacity: 0.56;
}

.social-links a:hover {
    opacity: 1;
    transform: translateY(-3px);
    text-shadow: 0 0 15px var(--accent);
}

.view-count {
    margin-top: 70px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.52);
}

/* =========================================
   TEMAS ESPECÍFICOS
   ========================================= */

body.theme-drift {
    --accent: #c8f0ff;
    --bg-filter: contrast(108%) brightness(78%) saturate(102%);
}

body.theme-drift .container {
    border-color: rgba(200, 240, 255, 0.12);
    box-shadow: 0 18px 60px rgba(8, 18, 26, 0.42);
}

body.theme-drift .profile-pic {
    box-shadow: 0 0 34px rgba(200, 240, 255, 0.12);
}

body.theme-drift .container::before {
    opacity: 1;
    background:
        radial-gradient(circle at 20% 42%, rgba(232, 241, 247, 0.24), transparent 22%),
        radial-gradient(circle at 78% 35%, rgba(230, 235, 241, 0.18), transparent 20%),
        radial-gradient(circle at 50% 78%, rgba(216, 224, 232, 0.14), transparent 28%);
    filter: blur(18px);
    animation: smokeFloat 9s ease-in-out infinite alternate;
}

body.theme-races {
    --accent: #ff5858;
    --bg-filter: contrast(116%) brightness(80%) saturate(122%);
    --panel-bg: linear-gradient(180deg, rgba(18, 8, 8, 0.46) 0%, rgba(10, 8, 8, 0.24) 100%);
}

body.theme-races .scene-symbols span:first-child {
    font-size: 1rem;
}

body.theme-races .container::before {
    opacity: 1;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 88, 88, 0.12) 35%, transparent 70%);
    transform: skewX(-18deg);
    animation: raceSweep 2.8s linear infinite;
}

body.theme-car {
    --accent: #ff9b4a;
    --bg-filter: contrast(110%) brightness(82%) saturate(120%);
    --panel-bg: linear-gradient(180deg, rgba(26, 10, 4, 0.48) 0%, rgba(12, 8, 4, 0.24) 100%);
}

body.theme-car .container::after {
    opacity: 1;
    background:
        linear-gradient(112deg, transparent 0%, rgba(255, 120, 48, 0.06) 30%, rgba(255, 184, 74, 0.22) 50%, transparent 68%),
        linear-gradient(125deg, transparent 12%, rgba(255, 70, 20, 0.18) 44%, transparent 74%);
    mix-blend-mode: screen;
    animation: speedRush 1.2s linear infinite;
}

body.theme-world {
    --accent: #ffd36b;
    --bg-filter: contrast(110%) brightness(84%) saturate(118%);
    --panel-bg: linear-gradient(180deg, rgba(26, 19, 8, 0.5) 0%, rgba(14, 10, 4, 0.26) 100%);
    --symbol-bg: rgba(255, 211, 107, 0.12);
    --symbol-border: rgba(255, 211, 107, 0.24);
}

body.theme-world .container::before {
    opacity: 1;
    background:
        radial-gradient(circle at 18% 25%, rgba(255, 211, 107, 0.22), transparent 20%),
        radial-gradient(circle at 82% 72%, rgba(255, 227, 160, 0.16), transparent 22%),
        linear-gradient(135deg, transparent 0%, rgba(255, 211, 107, 0.08) 48%, transparent 100%);
    animation: empireGlow 5.2s ease-in-out infinite alternate;
}

body.theme-tokyo {
    --accent: #b493ff;
    --bg-filter: contrast(112%) brightness(80%) saturate(124%);
    --panel-bg: linear-gradient(180deg, rgba(18, 10, 26, 0.5) 0%, rgba(10, 8, 18, 0.26) 100%);
    --symbol-bg: rgba(180, 147, 255, 0.12);
    --symbol-border: rgba(180, 147, 255, 0.22);
}

body.theme-tokyo .container::before,
body.theme-tokyo .container::after {
    opacity: 1;
}

body.theme-tokyo .container::before {
    background:
        repeating-linear-gradient(115deg, transparent 0 16px, rgba(180, 147, 255, 0.11) 16px 18px, transparent 18px 34px),
        radial-gradient(circle at 70% 24%, rgba(112, 255, 245, 0.14), transparent 18%);
    animation: tokyoSlide 8s linear infinite;
}

body.theme-tokyo .container::after {
    background: radial-gradient(circle at 50% 50%, transparent 34%, rgba(180, 147, 255, 0.18) 35%, transparent 42%);
    filter: blur(2px);
    animation: tokyoPulse 3.5s ease-in-out infinite;
}

body.theme-oldmoney {
    --accent: #d4af37;
    --bg-filter: sepia(30%) contrast(105%) brightness(85%);
    --panel-bg: linear-gradient(180deg, rgba(20, 18, 16, 0.6) 0%, rgba(10, 9, 8, 0.4) 100%);
    --panel-border: rgba(212, 175, 55, 0.15);
    --text-main: #fdfbf7;
    --text-soft: rgba(253, 251, 247, 0.7);
    --symbol-bg: rgba(212, 175, 55, 0.08);
    --symbol-border: rgba(212, 175, 55, 0.2);
}

body.theme-oldmoney .username {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    letter-spacing: 4px;
    text-transform: capitalize;
}

body.theme-oldmoney .container {
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(212, 175, 55, 0.05);
}

/* =========================================
   ANIMACIONES
   ========================================= */

@keyframes marqueeMove {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

@keyframes smokeFloat {
    from { transform: translate3d(-10px, -8px, 0) scale(1); }
    to { transform: translate3d(14px, 10px, 0) scale(1.08); }
}

@keyframes raceSweep {
    from { transform: translateX(-55%) skewX(-18deg); }
    to { transform: translateX(55%) skewX(-18deg); }
}

@keyframes speedRush {
    from { transform: translateX(-18px) skewX(-10deg); }
    to { transform: translateX(18px) skewX(-10deg); }
}

@keyframes empireGlow {
    from { transform: scale(0.98); opacity: 0.84; }
    to { transform: scale(1.04); opacity: 1; }
}

@keyframes tokyoSlide {
    from { transform: translateX(-12px); }
    to { transform: translateX(12px); }
}

@keyframes tokyoPulse {
    0%, 100% { transform: scale(0.96); opacity: 0.72; }
    50% { transform: scale(1.03); opacity: 1; }
}

/* =========================================
   MEDIA QUERIES Y ACCESIBILIDAD
   ========================================= */

@media (max-width: 640px) {
    .mode-control { left: 12px; right: 12px; top: 12px; flex-wrap: wrap; }
    .mode-control select { min-width: 0; flex: 1 1 180px; }
    .scene-tag { letter-spacing: 0.22em; }
    .scene-symbols { gap: 8px; }
    .scene-symbols span,
    .badges span { min-width: 30px; height: 30px; font-size: 0.64rem; }
    .username { font-size: 2.6rem; }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-play-state: paused !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .container {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    .scene-marquee span {
        animation: none;
        padding-left: 0;
        text-align: center;
        width: 100%;
    }
}