@font-face {
    font-family: 'Overwave';
    font-style: normal;
    font-weight: 400;
    src: local('Overwave'), url('https://fonts.cdnfonts.com/s/53957/Overwave-AL6AL.woff') format('woff');
}

:root {
    --color-bg-base: #141313;
    --color-bg-panel: rgba(26, 25, 25, 0.7);
    --color-primary: #ff5500;
    --color-primary-rgb: 255, 85, 0;
    /* Base orange rgb for flares */
    --color-primary-glow: rgba(var(--color-primary-rgb), 0.4);
    --color-text-main: #ffffff;
    --color-text-sub: #b5b5bc;
    --color-border: rgba(255, 255, 255, 0.05);

    --font-main: 'Outfit', sans-serif;
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

body {
    background-color: var(--color-bg-base);
    color: var(--color-text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--color-primary-glow) 0%, transparent 70%);
    filter: blur(80px);
    border-radius: 50%;
    opacity: 0.5;
}

/* --- ANIMATED BG ELEMENTS --- */
.esports-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background-color: var(--color-bg-base);
}

.esports-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: url('brazil_bg.jpg');
    background-size: cover;
    background-repeat: repeat;
    opacity: 0.08;
    z-index: 0;
    /* Detrás de las flares y líneas */
    animation: panBrazil 60s linear infinite;
}

@keyframes panBrazil {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-10%, -10%);
    }
}

/* Flares */
.flare {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    /* Menos blur para que se vea más definido */
    opacity: 0.8;
    /* Más opacos */
    animation: floatFlare 8s infinite alternate ease-in-out;
    /* Más rápidos */
}

.flare-1 {
    width: 500px;
    height: 500px;
    background: rgba(var(--color-primary-rgb), 0.6);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.flare-2 {
    width: 600px;
    height: 600px;
    background: rgba(var(--color-primary-rgb), 0.4);
    bottom: -200px;
    right: -100px;
    animation-delay: -2s;
    animation-duration: 12s;
}

.flare-3 {
    width: 400px;
    height: 400px;
    background: rgba(var(--color-primary-rgb), 0.5);
    top: 40%;
    left: 40%;
    animation-delay: -5s;
    animation-duration: 10s;
}

@keyframes floatFlare {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(150px, 80px) scale(1.3);
    }

    100% {
        transform: translate(-50px, -100px) scale(1.1);
    }
}

/* Moving Lines */
.moving-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(var(--color-primary-rgb), 1), #ffffff, transparent);
    height: 3px;
    width: 250px;
    opacity: 0.9;
    transform: rotate(-45deg);
    animation: shootLine linear infinite;
    box-shadow: 0 0 10px rgba(255, 102, 0, 0.8);
    /* Glow effect on lines */
}

.line-1 {
    top: 20%;
    left: -200px;
    animation-duration: 4s;
    animation-delay: 0s;
}

.line-2 {
    top: 60%;
    left: -200px;
    animation-duration: 5s;
    animation-delay: 1.5s;
    width: 350px;
}

.line-3 {
    top: -10%;
    left: 30%;
    animation-duration: 3s;
    animation-delay: 2.5s;
    width: 150px;
}

.line-4 {
    top: 80%;
    left: 50%;
    animation-duration: 6s;
    animation-delay: 0.5s;
    width: 500px;
    opacity: 0.5;
}

.line-5 {
    top: 40%;
    left: 80%;
    animation-duration: 4.5s;
    animation-delay: 3.5s;
    width: 280px;
}

@keyframes shootLine {
    0% {
        transform: rotate(-45deg) translateX(-100vw);
    }

    100% {
        transform: rotate(-45deg) translateX(250vw);
    }
}

/* Adjust app-container to sit above background */
.app-container {
    position: relative;
    z-index: 10;
}

.glass-panel {
    background: rgba(26, 25, 25, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

/* Container */
.app-container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 1rem;
    animation: fadeInDown 0.8s ease-out;
}

.logo {
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: -1px;
    color: var(--color-site-title, #ffffff);
    margin-bottom: 0.5rem;
}

.app-header p {
    color: var(--color-text-sub);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Social Links */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text-main);
    border-radius: 50%;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.social-icon svg {
    width: 20px;
    height: 20px;
}

.social-icon:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 102, 0, 0.2);
    background: rgba(255, 102, 0, 0.1);
}

/* Form Panel */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

.glass-panel {
    background: var(--color-bg-panel);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.controls-panel {
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

la.subtitle {
    font-size: 1.1rem;
    color: var(--color-text-sub);
    font-weight: 300;
}

.header-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.language-switcher {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.3rem;
    border-radius: 20px;
    border: 1px solid var(--color-border);
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--color-text-sub);
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    color: var(--color-text-main);
    background: rgba(255, 255, 255, 0.1);
}

.lang-btn.active {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 0 10px var(--color-primary-glow);
}

label {
    font-size: 0.95rem;
    color: var(--color-text-sub);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input[type="text"] {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-md);
    color: white;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    outline: none;
}

input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

input[type="text"]:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 15px rgba(255, 85, 0, 0.2);
}

/* Custom Color Picker Styling */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 15px;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.color-picker-wrapper:hover {
    border-color: rgba(255, 85, 0, 0.4);
}

.color-picker-wrapper:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 15px rgba(255, 85, 0, 0.2);
}

.custom-color-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: none;
    padding: 0;
}

.custom-color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.custom-color-input::-webkit-color-swatch {
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease;
}

.custom-color-input:hover::-webkit-color-swatch {
    transform: scale(1.1);
}

.custom-color-input::-moz-color-swatch {
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.color-hex-display {
    font-family: monospace;
    font-size: 1.1rem;
    color: var(--color-text-main);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* --- COMPONENTES ESPECÍFICOS --- */

.country-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.country-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--color-border);
    padding: 0.8rem 0.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--color-text-sub);
}

.country-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.country-btn.active {
    background: rgba(255, 102, 0, 0.15);
    /* Tint sutil primario */
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(255, 102, 0, 0.3);
}

.flag-icon-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
}

.country-name {
    font-size: 0.8rem;
    font-weight: 600;
}

/* Button */
.primary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--color-primary) 0%, #cc5200 100%);
    border: none;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 102, 0, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 102, 0, 0.5);
    background: linear-gradient(135deg, #ff7a22 0%, #e65c00 100%);
}

.primary-btn:active {
    transform: translateY(1px);
}

.icon {
    width: 20px;
    height: 20px;
}

/* Canvas Area */
.preview-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 100%;
}

.canvas-wrapper {
    width: 100%;
    /* Mantener relación de aspecto 1500:500 (3:1) */
    aspect-ratio: 3 / 1;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--color-border);
    position: relative;
    background: #000;
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.preview-label {
    color: var(--color-text-sub);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Keyframes */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
        gap: 1rem;
    }

    .logo {
        font-size: 2.5rem;
    }

    .glass-panel {
        padding: 1.5rem;
    }

    .controls-panel {
        gap: 1rem;
    }

    .social-links {
        gap: 1rem;
        margin-top: 1rem;
    }

    .social-icon {
        width: 38px;
        height: 38px;
    }

    .app-header p {
        font-size: 0.95rem;
    }

    .primary-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    .header-controls {
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 2rem;
    }

    .color-picker-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .custom-color-input {
        width: 100%;
    }

    .country-selector {
        gap: 0.3rem;
    }

    .country-btn {
        padding: 0.6rem 0.2rem;
    }

    .flag-icon-img {
        width: 24px;
        height: auto;
    }

    .country-name {
        font-size: 0.72rem;
    }
}