@font-face {
    font-family: 'Ubuntu Condensed';
    src: url('/static/Ubuntu-C.ttf');
}

:root {
    --card: linear-gradient(180deg, rgba(16, 44, 82, .9) 0%, rgba(10, 30, 60, .86) 100%);
    --line: rgba(255, 255, 255, .16);
    --text: #ffffff;
    --muted: rgba(255, 255, 255, .78);
    --yellow: #ffd23f;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;
    font-family: 'Ubuntu Condensed', 'Ubuntu', system-ui, sans-serif;
    color: var(--text);
    background: #2b6da8;
    overflow-x: hidden;
}

.sky, .stars, .glow, .scene-left, .scene-right {
    position: fixed;
    pointer-events: none;
}

.sky, .stars, .glow { inset: 0; }

.sky { background: linear-gradient(180deg, #2c7fc4 0%, #57a7de 45%, #9ad3f1 75%, #c9ecfb 100%); }

.stars {
    opacity: 0;
    background-image:
        radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 27% 8%, #fff 50%, transparent 51%),
        radial-gradient(2px 2px at 41% 22%, rgba(255, 255, 255, .9) 50%, transparent 51%),
        radial-gradient(1px 1px at 56% 12%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 68% 30%, rgba(255, 255, 255, .8) 50%, transparent 51%),
        radial-gradient(2px 2px at 79% 9%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 88% 24%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 34% 36%, rgba(255, 255, 255, .7) 50%, transparent 51%),
        radial-gradient(2px 2px at 6% 42%, rgba(255, 255, 255, .8) 50%, transparent 51%),
        radial-gradient(1px 1px at 48% 5%, #fff 50%, transparent 51%);
}

.glow { background: radial-gradient(circle at 46% 12%, rgba(255, 249, 214, .85) 0, rgba(255, 238, 160, .35) 70px, rgba(255, 238, 160, 0) 260px); }

.scene-left {
    left: 0;
    bottom: 0;
    width: min(970px, 62vw);
    aspect-ratio: 970 / 641;
    background: url('/static/br_large.png') left bottom / contain no-repeat;
    animation: slide-up .9s ease-out;
}

.scene-right {
    right: 0;
    bottom: 0;
    width: min(435px, 32vw);
    aspect-ratio: 435 / 232;
    background: url('/static/br_right.png') right bottom / contain no-repeat;
    animation: slide-up .9s ease-out;
}

body.sky-sunset .sky { background: linear-gradient(180deg, #2b3f7a 0%, #6b4f9a 30%, #e2778a 62%, #ffb36b 85%, #ffd59a 100%); }
body.sky-sunset .glow { background: radial-gradient(circle at 70% 78%, rgba(255, 220, 140, .9) 0, rgba(255, 170, 90, .45) 90px, rgba(255, 150, 80, 0) 340px); }
body.sky-sunset .scene-left { background-image: url('/static/br_large_night.png'); filter: sepia(.12) brightness(.95); }
body.sky-sunset .scene-right { filter: sepia(.12) brightness(.95); }

body.sky-night .sky { background: linear-gradient(180deg, #0b1a3a 0%, #13305f 45%, #1f4f8a 80%, #2d679f 100%); }
body.sky-night .stars { opacity: 1; animation: twinkle 6s ease-in-out infinite alternate; }
body.sky-night .glow { background: radial-gradient(circle at 46% 12%, #fdfbe9 0, #fdfbe9 22px, rgba(220, 230, 255, .35) 24px, rgba(200, 220, 255, 0) 160px); }
body.sky-night .scene-left { background-image: url('/static/br_large_night.png'); filter: brightness(.72) saturate(.9); }
body.sky-night .scene-right { filter: brightness(.72) saturate(.9); }

.page {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 500px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 24px 16px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    animation: fade-down .6s ease-out;
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    display: block;
    line-height: 0;
}

.brand-online {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    font-size: 14px;
    border-radius: 999px;
    background: rgba(10, 30, 60, .7);
    border: 1px solid var(--line);
    white-space: nowrap;
}

.brand-online .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #6fd03f;
    box-shadow: 0 0 8px #6fd03f;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .1);
    backdrop-filter: blur(4px);
    padding: 20px;
}

h1 {
    margin: 0 0 6px;
    font-size: 26px;
    color: var(--yellow);
    text-shadow: 0 2px 0 rgba(0, 0, 0, .4);
}

p {
    margin: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.35;
}

.auth-intro { margin-bottom: 16px; }

.tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 4px;
    margin-bottom: 14px;
    border-radius: 10px;
    background: rgba(0, 0, 0, .25);
}

.tab {
    padding: 8px;
    font: inherit;
    font-size: 16px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.tab.active {
    color: #fff;
    background: rgba(255, 255, 255, .14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15);
}

form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

form[hidden] { display: none; }

label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 15px;
}

input[type=text], input:not([type]), input[type=password] {
    width: 100%;
    padding: 10px 12px;
    font: inherit;
    font-size: 17px;
    color: #10233d;
    background: #f4f8fc;
    border: 2px solid #0d2a4d;
    border-radius: 8px;
    box-shadow: inset 0 2px 0 rgba(0, 0, 0, .08);
}

input[type=password] {
    font-family: system-ui, sans-serif;
    letter-spacing: .1em;
}

input:focus {
    outline: none;
    border-color: var(--yellow);
}

.gender {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.gender-option {
    position: relative;
    align-items: center;
    gap: 2px;
    padding: 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .06);
    border: 2px solid transparent;
    cursor: pointer;
}

.gender-option input {
    position: absolute;
    opacity: 0;
}

.gender-option img {
    height: 110px;
    image-rendering: pixelated;
}

.gender-option:has(input:checked) {
    border-color: var(--yellow);
    background: rgba(255, 210, 63, .12);
}

.btn {
    display: inline-block;
    padding: 10px 18px;
    font: inherit;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    color: #fff;
    border-radius: 9px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .4);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), 0 3px 0 rgba(0, 0, 0, .25);
    cursor: pointer;
    transition: transform .1s ease, filter .15s ease;
}

.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(2px); }

.btn-green {
    background: linear-gradient(180deg, #6fd03f 0%, #3f9d1f 100%);
    border: 2px solid #23600f;
}

.btn-blue {
    background: linear-gradient(180deg, #4fb2f0 0%, #1f71bd 100%);
    border: 2px solid #10467a;
}

.btn-big {
    padding: 14px 26px;
    font-size: 22px;
}

.flash {
    margin-bottom: 12px;
    padding: 10px 12px;
    font-size: 15px;
    border-radius: 8px;
}

.flash-error {
    background: rgba(220, 60, 60, .25);
    border: 1px solid rgba(255, 120, 120, .6);
}

.flash-success {
    background: rgba(90, 200, 60, .22);
    border: 1px solid rgba(140, 230, 110, .6);
}

.home-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.home-avatar {
    width: 128px;
    flex-shrink: 0;
    image-rendering: pixelated;
    filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .35));
}

.home-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.home-text h1 {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.motto { font-style: italic; }

.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.stat {
    padding: 3px 9px;
    font-size: 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid var(--line);
}

.stat-hc {
    font-weight: bold;
    color: #3a2a00;
    background: linear-gradient(180deg, #ffe27a, #f2b71e);
    border-color: #a9780a;
}

.logout {
    margin-top: 14px;
    align-items: flex-end;
}

.link {
    padding: 0;
    font: inherit;
    font-size: 14px;
    color: var(--muted);
    background: none;
    border: 0;
    text-decoration: underline;
    cursor: pointer;
}

@media (max-width: 760px) {
    .page { justify-content: flex-start; padding-top: 18px; }

    .scene-left { opacity: .45; }

    .scene-right { opacity: .6; }

    .home-main {
        flex-direction: column;
        text-align: center;
    }

    .home-text { align-items: center; }
}

@keyframes twinkle { from { opacity: .55; } to { opacity: 1; } }
@keyframes fade-down { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes slide-up { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }

.brand-logo img {
    display: block;
    width: min(420px, 86vw);
    height: auto;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .4));
    animation: logo-float 4s ease-in-out infinite;
}

.card { width: 100%; }

.home-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
}

.home-actions .btn { width: 100%; }

@keyframes logo-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@media (prefers-reduced-motion: reduce) {
    .brand-logo img, .page, .scene-left, .scene-right { animation: none; }
}
