:root {
    --primary-glow: #00c6ff;
    --secondary-glow: #0072ff;
    --accent-gold: #ffd700;
    --accent-red: #ff416c;
    --accent-green: #10b981;
    --glass-bg: rgba(15, 23, 42, 0.68);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
}

@font-face {
    font-family: "HubDisplay";
    src: local("STXingkai"), local("KaiTi"), local("Kaiti SC"), local("PingFang SC");
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text-main);
    font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    background: #0f172a;
}

button,
input,
textarea,
select {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

.bg-animation {
    position: fixed;
    inset: 0;
    z-index: -2;
    background: linear-gradient(125deg, #0f172a 0%, #1e1b4b 40%, #0f172a 100%);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.circles {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    margin: 0;
    padding: 0;
}

.circles li {
    position: absolute;
    bottom: -150px;
    display: block;
    width: 20px;
    height: 20px;
    list-style: none;
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 0 10px rgba(0, 198, 255, 0.28);
    animation: floatUp 25s linear infinite;
}

.circles li:nth-child(1){ left: 25%; width: 80px; height: 80px; animation-delay: 0s; }
.circles li:nth-child(2){ left: 10%; width: 20px; height: 20px; animation-delay: 2s; animation-duration: 12s; }
.circles li:nth-child(3){ left: 70%; width: 20px; height: 20px; animation-delay: 4s; }
.circles li:nth-child(4){ left: 40%; width: 60px; height: 60px; animation-delay: 0s; animation-duration: 18s; }
.circles li:nth-child(5){ left: 65%; width: 20px; height: 20px; animation-delay: 0s; }
.circles li:nth-child(6){ left: 75%; width: 110px; height: 110px; animation-delay: 3s; }
.circles li:nth-child(7){ left: 35%; width: 150px; height: 150px; animation-delay: 7s; }
.circles li:nth-child(8){ left: 50%; width: 25px; height: 25px; animation-delay: 15s; animation-duration: 45s; }

@keyframes floatUp {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; border-radius: 0; }
    100% { transform: translateY(-1000px) rotate(720deg); opacity: 0; border-radius: 50%; }
}

.shell {
    width: min(1120px, calc(100% - 28px));
    margin: 0 auto;
    padding: 34px 0 60px;
}

.topbar,
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--primary-glow);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    margin: 0;
}

.display-title,
h1 {
    font-size: clamp(2.6rem, 8vw, 5rem);
    line-height: 1.02;
    font-weight: 950;
    letter-spacing: 0;
    font-family: "HubDisplay", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    background: linear-gradient(to bottom, #fff 30%, #a5f3fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(0, 198, 255, 0.52));
}

h2 {
    font-size: clamp(1.45rem, 4vw, 2.2rem);
}

.top-copy {
    max-width: 520px;
    margin: 12px 0 0;
    color: var(--text-muted);
    line-height: 1.7;
}

.glass-panel,
.auth-card,
.game-card,
.admin-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.32);
}

.glass-panel::before,
.auth-card::before,
.game-card::before,
.admin-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
}

.gate {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 22px;
    align-items: start;
    padding: 26px;
    margin-bottom: 22px;
}

.gate p,
.profile-main p,
.game-card p,
.admin-card p,
.form-hint {
    color: var(--text-muted);
    line-height: 1.7;
}

.auth-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.auth-card,
.admin-card {
    padding: 18px;
}

.auth-card h3 {
    margin-bottom: 12px;
}

input,
textarea,
select {
    width: 100%;
    min-height: 42px;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 0;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    border-radius: 8px 8px 0 0;
    color: #fff;
    background: rgba(0,0,0,0.3);
}

textarea {
    min-height: 86px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-bottom-color: var(--primary-glow);
    background: rgba(0,0,0,0.5);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    font-weight: 900;
    cursor: pointer;
    text-align: center;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35); }
.btn-gold { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35); }
.btn-neutral { background: rgba(255,255,255,0.12); }
.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); }

.user-box {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-height: 48px;
}

.account-menu {
    position: relative;
}

.account-trigger {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    color: #fff;
    background: rgba(255,255,255,0.08);
    cursor: pointer;
}

.account-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 15;
    display: none;
    min-width: 168px;
    padding: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.96);
    box-shadow: 0 12px 32px rgba(0,0,0,0.38);
}

.account-dropdown.is-open {
    display: grid;
    gap: 6px;
}

.menu-item {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    color: #dbeafe;
    text-align: left;
    background: transparent;
    cursor: pointer;
}

.menu-item:hover {
    background: rgba(255,255,255,0.08);
}

.mini-avatar,
.avatar-wrap {
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}

.mini-avatar {
    width: 42px;
    height: 42px;
}

.mini-avatar img,
.avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 180px 180px;
    gap: 16px;
    align-items: center;
    padding: 20px;
    margin-bottom: 22px;
}

.profile-page {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.profile-card {
    padding: 22px;
    text-align: center;
}

.profile-avatar-button {
    display: grid;
    place-items: center;
    width: 132px;
    height: 132px;
    margin: 0 auto 16px;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.16);
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    cursor: pointer;
}

.profile-avatar-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-actions {
    display: grid;
    gap: 18px;
}

.avatar-wrap {
    width: 88px;
    height: 88px;
}

.profile-main h2 {
    margin-bottom: 4px;
}

.profile-form {
    display: grid;
    gap: 8px;
}

.profile-form input {
    margin: 0;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.game-card {
    display: grid;
    min-height: 220px;
    padding: 20px;
}

.game-card h3 {
    font-size: 1.45rem;
}

.game-card .status {
    justify-self: start;
    padding: 4px 9px;
    border-radius: 999px;
    color: #bbf7d0;
    font-size: 0.78rem;
    font-weight: 900;
    background: rgba(16, 185, 129, 0.18);
}

.game-card.disabled .status {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.18);
}

.game-card .actions {
    align-self: end;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.9fr);
    gap: 18px;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-align: left;
    vertical-align: middle;
}

.table th {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.inline-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline-row select,
.inline-row input {
    margin: 0;
}

.settings-grid {
    display: grid;
    gap: 10px;
    margin: 12px 0;
}

.check-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #cbd5e1;
}

.check-row input {
    width: auto;
    min-height: auto;
    margin: 0;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 22px;
    z-index: 20;
    display: none;
    max-width: min(420px, calc(100% - 32px));
    padding: 10px 14px;
    border: 1px solid rgba(0, 198, 255, 0.25);
    border-radius: 12px;
    color: #bae6fd;
    text-align: center;
    background: rgba(15, 23, 42, 0.94);
    box-shadow: 0 8px 28px rgba(0,0,0,0.35);
    transform: translateX(-50%);
}

.toast.is-visible {
    display: block;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: none;
    place-items: center;
    padding: 20px;
    background: rgba(0,0,0,0.68);
    backdrop-filter: blur(8px);
}

.modal.is-open {
    display: grid;
}

.modal-card {
    width: min(390px, 100%);
    padding: 22px;
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.94);
    box-shadow: 0 20px 50px rgba(0,0,0,0.48);
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    font-size: 1.35rem;
    background: rgba(255,255,255,0.1);
    cursor: pointer;
}

.tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.tab {
    min-height: 38px;
    border: 0;
    border-radius: 10px;
    color: #cbd5e1;
    font-weight: 900;
    background: rgba(255,255,255,0.08);
    cursor: pointer;
}

.tab.active {
    color: #fff;
    background: linear-gradient(135deg, #10b981, #059669);
}

.auth-form {
    display: grid;
}

[hidden] {
    display: none !important;
}

@media (max-width: 820px) {
    .topbar,
    .section-head,
    .gate,
    .profile-panel,
    .profile-page,
    .admin-grid {
        grid-template-columns: 1fr;
        display: grid;
    }

    .auth-grid {
        grid-template-columns: 1fr;
    }

    .profile-form {
        grid-template-columns: 1fr;
    }

    .user-box {
        justify-content: flex-start;
    }
}
