@font-face { font-family: 'Inter'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/Inter-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-style: normal; font-display: swap; src: url('/fonts/Inter-Medium.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-style: normal; font-display: swap; src: url('/fonts/Inter-SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fonts/Inter-Bold.ttf') format('truetype'); }
@font-face { font-family: 'Poppins'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/Poppins-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Poppins'; font-weight: 500; font-style: normal; font-display: swap; src: url('/fonts/Poppins-Medium.ttf') format('truetype'); }
@font-face { font-family: 'Poppins'; font-weight: 600; font-style: normal; font-display: swap; src: url('/fonts/Poppins-SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'Poppins'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fonts/Poppins-Bold.ttf') format('truetype'); }

:root {
    color-scheme: dark;
    --black: #000000;
    --white: #FFFFFF;
    --red: #EF3340;
    --green: #00A651;
    --bg: #050605;
    --bg-2: #090B0A;
    --surface: #0B0D0C;
    --surface-raised: #111411;
    --surface-high: #171B18;
    --border: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.22);
    --border-hover: rgba(255, 255, 255, 0.36);
    --text: #FFFFFF;
    --text-2: rgba(255, 255, 255, 0.74);
    --text-3: rgba(255, 255, 255, 0.56);
    --text-4: rgba(255, 255, 255, 0.38);
    --text-mute: var(--text-2);
    --text-dim: var(--text-3);
    --accent: var(--red);
    --accent-hot: #FF5A64;
    --accent-pressed: #C92935;
    --accent-soft: rgba(239, 51, 64, 0.18);
    --button: var(--red);
    --button-hover: var(--green);
    --button-pressed: #C92935;
    --green-soft: rgba(0, 166, 81, 0.16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { min-height: 100%; background: var(--black); }
body {
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(ellipse 85vw 65vh at 4% 0%, rgba(239, 51, 64, 0.18), transparent 64%),
        radial-gradient(ellipse 80vw 65vh at 100% 100%, rgba(0, 166, 81, 0.14), transparent 64%),
        linear-gradient(135deg, #000000 0%, #080A08 52%, #000000 100%);
    -webkit-font-smoothing: antialiased;
}

a, button, input, textarea { font: inherit; }
a { color: var(--green); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 3px;
}
img { max-width: 100%; }

#bg-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    display: block;
    pointer-events: none;
}
.vignette {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse at center, transparent 48%, rgba(0, 0, 0, 0.64) 100%),
        linear-gradient(115deg, rgba(239, 51, 64, 0.05), transparent 45%, rgba(0, 166, 81, 0.05));
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 28px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.90), rgba(0, 0, 0, 0));
}
.site-brand, .home-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    border-radius: 4px;
}
.site-brand img, .home-wordmark {
    display: block;
    width: 162px;
    height: auto;
}
.topnav {
    display: flex;
    align-items: center;
    gap: 8px;
}
.signout {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 8px 15px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    color: var(--text-2);
    text-decoration: none;
    text-transform: uppercase;
    font-family: 'Poppins', 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.6px;
    transition: color 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.signout:hover {
    color: var(--white);
    background: var(--surface-high);
    border-color: var(--green);
    box-shadow: 0 8px 24px rgba(0, 166, 81, 0.16);
}

.container {
    position: relative;
    z-index: 3;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 104px 20px 48px;
}
.container-auth { flex-direction: column; }
.home-link {
    position: fixed;
    top: 25px;
    left: 30px;
    z-index: 10;
}
.home-link:hover { filter: drop-shadow(0 0 9px rgba(0, 166, 81, 0.38)); }

.card, .auth-panel {
    position: relative;
    overflow: hidden;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(11, 13, 12, 0.90);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58);
}
.card::before, .auth-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--red) 0%, var(--red) 42%, var(--white) 50%, var(--green) 58%, var(--green) 100%);
}
.card { max-width: 480px; padding: 38px; }
.auth-panel { max-width: 480px; padding: 42px; }
.card h1, .auth-title, .portal-title {
    font-family: 'Poppins', 'Inter', sans-serif;
    color: var(--white);
    font-weight: 700;
    letter-spacing: -0.025em;
}
.card h1 { margin: 0 0 22px; font-size: 27px; }
.auth-title { margin: 0 0 28px; font-size: 30px; text-align: center; }
.portal-title { margin: 0 0 12px; font-size: 30px; text-align: center; }
.lead {
    color: var(--text-2);
    font-size: 14px;
    line-height: 1.65;
}
.auth-panel > .lead { margin: 0 auto 24px; text-align: center; }
.brand-lockup {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto 24px;
}
.brand-kicker, .section-title {
    color: var(--green);
    font-family: 'Poppins', 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}
.brand-kicker { margin-bottom: 10px; text-align: center; font-size: 11px; }
.section-title { margin-bottom: 10px; }
.section-copy, .note {
    color: var(--text-2);
    font-size: 12px;
    line-height: 1.65;
}
.section-copy { margin-bottom: 16px; }
.muted { color: var(--text-3); }
.note { margin-top: 16px; }
.section-block { width: 100%; }
.divider { width: 100%; height: 1px; margin: 26px 0; background: linear-gradient(90deg, var(--red), var(--border), var(--green)); }

.form { width: 100%; }
.field { margin-bottom: 16px; }
.field label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-2);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
}
.field input, .field textarea {
    width: 100%;
    padding: 13px 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-raised);
    color: var(--white);
    font-size: 14px;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field textarea:focus {
    outline: none;
    border-color: var(--green);
    background: var(--surface-high);
    box-shadow: 0 0 0 3px var(--green-soft);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.turnstile { display: flex; justify-content: center; margin-top: 8px; }

.actions { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.btn {
    display: block;
    width: 100%;
    padding: 13px 24px;
    border: 1px solid var(--red);
    border-radius: 10px;
    background: linear-gradient(105deg, var(--red) 0%, var(--red) 70%, var(--green) 70%, var(--green) 100%);
    color: var(--black);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.20);
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    font-family: 'Poppins', 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    transition: transform 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.btn:hover {
    transform: translateY(-2px);
    border-color: var(--green);
    background: linear-gradient(105deg, #FF5A64 0%, var(--red) 58%, var(--green) 58%, var(--green) 100%);
    color: var(--black);
    box-shadow: 0 12px 28px rgba(239, 51, 64, 0.18), 0 8px 24px rgba(0, 166, 81, 0.12);
}
.btn:active { transform: translateY(0); background: var(--accent-pressed); }
.btn-ghost {
    border-color: var(--border-strong);
    background: rgba(0, 0, 0, 0.60);
    color: var(--text-2);
    box-shadow: none;
}
.btn-ghost:hover {
    border-color: var(--green);
    background: var(--surface-high);
    color: var(--white);
    box-shadow: 0 10px 24px rgba(0, 166, 81, 0.12);
}
.btn-block { display: block; width: 100%; text-align: center; }
.links {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    margin-top: 22px;
    font-size: 12px;
}
.links a, .link { color: var(--green); text-decoration: none; }
.links a:hover, .link:hover { color: var(--white); text-decoration: underline; }
.links .muted { color: var(--text-3); }

.alert {
    width: 100%;
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 12px;
    line-height: 1.55;
}
.alert-info { border-color: rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.06); }
.alert-warn, .alert-err { border-color: rgba(239, 51, 64, 0.52); background: rgba(239, 51, 64, 0.12); color: #FFD7DA; }
.alert-ok { border-color: rgba(0, 166, 81, 0.52); background: rgba(0, 166, 81, 0.12); color: #B9F4D5; }

.chip {
    display: inline-block;
    padding: 5px 11px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-2);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
}
.chip-owner { border-color: rgba(239, 51, 64, 0.56); color: #FFD7DA; }
.chip-admin { border-color: rgba(239, 51, 64, 0.40); background: rgba(239, 51, 64, 0.10); color: #FFD7DA; }
.chip-private { border-color: rgba(255, 255, 255, 0.40); color: var(--white); }
.chip-premium { border-color: rgba(0, 166, 81, 0.50); background: var(--green-soft); color: #B9F4D5; }
.chip-regular { color: var(--text-3); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.34);
}
.stat-label { color: var(--text-3); font-size: 10px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; }
.stat-value { margin-top: 8px; color: var(--white); font-family: 'Poppins', 'Inter', sans-serif; font-size: 22px; font-weight: 700; }
.games-list { margin-top: 6px; }
.game-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: rgba(0, 0, 0, 0.30);
    transition: border-color 0.15s, background 0.15s;
}
.game-row:hover { border-color: var(--green); background: rgba(0, 166, 81, 0.06); }
.game-name { font-size: 13px; font-weight: 700; }
.game-game { margin-top: 3px; color: var(--text-3); font-size: 11px; }
code { padding: 2px 5px; border-radius: 4px; background: var(--black); color: var(--white); }

@media (max-width: 640px) {
    .site-header { padding: 18px; }
    .site-brand img, .home-wordmark { width: 138px; }
    .home-link { top: 20px; left: 20px; }
    .container { padding: 88px 14px 30px; }
    .card, .auth-panel { padding: 30px 24px; border-radius: 15px; }
    .auth-title, .portal-title { font-size: 26px; }
    .grid-2 { grid-template-columns: 1fr; }
    .topnav { gap: 6px; }
    .signout { padding: 7px 11px; font-size: 9px; letter-spacing: 1px; }
}
@media (max-width: 390px) {
    .site-header { align-items: flex-start; }
    .site-brand img { width: 112px; }
    .signout { padding: 6px 9px; }
    .links { flex-direction: column; align-items: center; }
}
@media (max-height: 700px) {
    .container { padding-top: 82px; padding-bottom: 24px; }
    .container-home { padding-top: 18px; padding-bottom: 18px; }
    .container-home .auth-panel { padding-top: 28px; padding-bottom: 28px; }
    .container-home .brand-lockup { width: 320px; margin-bottom: 16px; }
    .container-home .portal-title { font-size: 26px; }
    .container-home .auth-panel > .lead { margin-bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
