@font-face {
    font-family: 'SplineSans';
    src: url("SplineSans-Regular.woff2");
    font-weight: 400;
    font-style: normal;
}

:root {
    --glass-bg: rgba(23, 23, 23, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.15);
    --neon-blue: #248AFE;
    --neon-purple: #bd34fe;
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    --card-radius: 24px;
    --transition-speed: 0.3s;
}

body {
    font-family: 'SplineSans', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background-color: #0f0f11;
    background-image: url('../bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Background Overlay for depth */
body::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(8,8,10,0.85) 0%, rgba(15,15,20,0.7) 100%);
    z-index: -1;
}

/* Main Bento Grid Container */
.bento-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr 340px;
    grid-template-rows: 80px 1fr auto;
    gap: 20px;
    width: 95vw;
    height: 90vh;
    max-width: 1600px;
    position: relative;
    z-index: 10;
}

/* Common Tile Styles (Glassmorphism) */
.tile {
    background: rgba(23, 23, 23, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    padding: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    transition: transform var(--transition-speed), border-color var(--transition-speed);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

@supports (backdrop-filter: blur(1px)) {
    .tile {
        background: var(--glass-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    }
}

@supports not (backdrop-filter: blur(1px)) {
    .tile::before {
        content: '';
        position: absolute;
        top: -20px;
        left: -20px;
        right: -20px;
        bottom: -20px;
        background: linear-gradient(135deg, rgba(8,8,10,0.85) 0%, rgba(15,15,20,0.7) 100%);
        filter: blur(20px);
        z-index: -1;
    }
}

.tile:hover {
    border-color: var(--glass-highlight);
    transform: translateY(-2px);
}

/* --- Header Area --- */
.tile.header {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}
.brand img { height: 40px; }
.brand span { background: linear-gradient(to right, #fff, #aaa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.nav-links {
    display: flex;
    gap: 10px;
}

.nav-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 10px 20px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 5px;
}

.nav-btn:hover, .nav-btn.active {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

/* --- Main Content Area --- */
.tile.main-hero {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    text-shadow: 0px 0px 20px #000000;
    background: rgba(23, 23, 23, 0.4); /* Slightly slightly lighter/different */
}

.tile.main-hero h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #b2b2b2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.tile.main-hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 40px;
}

.hero-stats {
    display: inline-flex;
    gap: 30px;
    background: rgba(0,0,0,0.3);
    padding: 15px 30px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    margin-bottom: 40px;
}
.stat-item { display: flex; flex-direction: column; }
.stat-val { font-size: 1.5rem; font-weight: 700; color: var(--neon-blue); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-primary {
    background: var(--neon-blue);
    color: white;
    padding: 15px 35px;
    border-radius: 16px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 0 20px rgba(36, 138, 254, 0.4);
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.btn-primary:hover {
    box-shadow: 0 0 40px rgba(36, 138, 254, 0.6);
    transform: translateY(-2px);
}
.btn-secondary {
    background: rgba(255,255,255,0.05);
    color: white;
    padding: 15px 35px;
    border-radius: 16px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--glass-border);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: white;
}

/* --- Sidebar / Auth Area --- */
.tile.auth-card {
    grid-column: 3 / 4;
    grid-row: 2 / 3;
    display: flex;
    justify-content: center;
}

.auth-inner {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.auth-header {
    margin-bottom: 30px;
    text-align: left;
}
.auth-header h2 { font-size: 2rem; margin: 0; font-weight: 600; }
.auth-header span { color: var(--text-muted); font-size: 0.9rem; }

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group input, .form-group select {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    padding: 15px;
    padding-right: 40px; /* Icon space */
    border-radius: 14px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
    box-sizing: border-box; 
}
.form-group input:focus {
    border-color: var(--neon-blue);
    background: rgba(0,0,0,0.4);
}
.form-group i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.form-group input::placeholder { color: rgba(255,255,255,0.3); }

.toggle-link {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    margin-top: 15px;
    font-size: 0.9rem;
    text-decoration: underline;
    padding: 0;
}
.toggle-link:hover { color: white; }

/* --- Left Sidebar / Info --- */
.tile.info-panel {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    background: var(--glass-bg);
}

.info-list {
    display: grid;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}
.info-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    transition: 0.3s;
    text-decoration: none;
    color: var(--text-main);
}
.info-item:hover {
    background: rgba(255,255,255,0.08);
}
.info-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neon-blue);
}

/* --- Bottom Area --- */
.tile.footer-bar {
    grid-column: 1 / 4;
    grid-row: 3 / 4;
    flex-direction: row;
    height: 60px;
    padding: 0 30px;
    align-items: center;
    justify-content: center;
    gap: 20px;
}
.lang-flags img { width: 24px; margin: 0 5px; opacity: 0.6; transition: 0.3s; cursor: pointer; }
.lang-flags img:hover { opacity: 1; transform: scale(1.2); }

/* --- Hero Images Decorative --- */
.hero-deco {
    position: absolute;
    bottom: -50px;
    right: -50px;
    height: 300px;
    z-index: -1;
    pointer-events: none;
    filter: drop-shadow(0 0 50px rgba(0,0,0,0.5));
}

/* --- Google Recaptcha Fix --- */
.g-recaptcha {
    margin: 15px auto;
    transform: scale(0.9);
    transform-origin: 0 0;
}

/* Responsiveness */
@media (max-width: 1024px) {
    .bento-wrapper {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        height: auto;
        display: flex;
        flex-direction: column;
    }
    .tile.main-hero { order: 1; }
    .tile.auth-card { order: 2; min-height: 400px; }
    .tile.info-panel { order: 3; }
    .tile.header { order: 0; }
    .tile.footer-bar { order: 4; }
}

/* Utilities */
.hidden { display: none !important; }
.c-blue { color: var(--neon-blue); }
.text-gradient { background: linear-gradient(to right, #248AFE, #bd34fe); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* --- Professional Modal System --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(145deg, rgba(20, 20, 25, 0.95) 0%, rgba(30, 30, 35, 0.9) 100%);
    border: 1px solid var(--glass-highlight);
    border-radius: var(--card-radius);
    padding: 0;
    width: 90%;
    max-width: 550px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.1rem;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
}

/* Modal Helper Classes */
.modal-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.rules-list p {
    margin-bottom: 12px;
    padding: 10px 15px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    border-left: 3px solid var(--neon-blue);
}

/* Helper for JS toggles to work visually well */
.grs, .kyt { width: 100%; transition: opacity 0.3s; }

/* Background Video */
#bg-video {
    position: fixed;
    right: 0;
    bottom: 0;
    min-width: 100%;
    min-height: 100%;
    width: 100%;
    height: 100%;
    z-index: -2;
    object-fit: cover;
}

i {
    margin-right: 5px;
    margin-left: 5px;
}

/* Fallback for flex gap in older browsers */
@supports not (gap: 1px) {
    .brand > * + * { margin-left: 15px; }
    .nav-links .nav-btn + .nav-btn { margin-left: 10px; }
    .nav-btn > * + * { margin-left: 8px; }
    .hero-stats .stat-item + .stat-item { margin-left: 30px; }
    .action-buttons > * + * { margin-left: 15px; }
    .tile.footer-bar > * + * { margin-left: 20px; }
    .modal-title > * + * { margin-left: 10px; }
    .form-group > * + * { margin-left: 15px; }
    .info-list .info-item + .info-item { margin-top: 15px; }
}
