:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --primary: #dc2626;
    --primary-soft: #fee2e2;
    --accent: #f59e0b;
    --border: rgba(15, 23, 42, 0.08);
    --shadow: 0 24px 80px rgba(15, 23, 42, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, #fee2e2 0%, #fef2f2 50%, #ffffff 100%);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

.topbar{
    position:sticky;
    top:0;
    z-index:9999;
    background:#dc2626;
    padding:15px 20px;
}

.brand{
    font-size:24px;
    font-weight:bold;
    color:#fff;
    margin-bottom:12px;
}

.user-nav{
    display:flex;
    gap:10px;
    overflow-x:auto;
    white-space:nowrap;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
}

.user-nav::-webkit-scrollbar{
    display:none;
}

.user-nav a{
    flex:0 0 auto;
    display:inline-block;
    padding:10px 18px;
    border-radius:999px;
    background:rgba(255,255,255,.15);
    color:#fff;
    font-weight:600;
}
.user-nav a:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

.page-shell,
.dashboard-shell,
.auth-shell {
    width: min(1200px, 100%);
    margin: 0 auto;
}

.hero {
    padding: 64px 32px 32px;
}

.hero-content {
    display: grid;
    gap: 24px;
    padding: 40px;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.55);
}

.hero-content h1 {
    margin: 0;
    font-size: clamp(2.4rem, 3vw, 3.4rem);
    line-height: 1.05;
}

.hero-content p {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
    max-width: 720px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.button {
    border: none;
    border-radius: 999px;
    padding: 16px 26px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    font-weight: 700;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 18px 36px rgba(220, 38, 38, 0.18);
}

.button-secondary {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.notice-bar {
    display: flex;
    justify-content: center;
    padding: 20px 32px;
}

.notice-content {
    width: 100%;
    max-width: 900px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 18px 24px;
    color: var(--primary);
    font-weight: 700;
    text-align: center;
}

.info-panel {
    padding: 0 32px 64px;
}

.card,
.form-card,
.info-card,
.leaderboard-card,
.user-card,
.pvp-card {
    background: #ffffff;
    border-radius: 32px;
    box-shadow: var(--shadow);
    padding: 32px;
    margin-top: 24px;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.section-head h2 {
    margin: 0;
    font-size: 1.85rem;
}

.section-head p {
    margin: 0;
    color: var(--muted);
}

.stats-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
    background: linear-gradient(180deg, #ffffff 0%, #f7f7f8 100%);
    border-radius: 28px;
    padding: 28px;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.stat-card strong {
    font-size: 2rem;
}

.panel-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.panel-card {
    padding: 28px;
    border-radius: 32px;
    background: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.panel-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 42px rgba(15, 23, 42, 0.08);
}

.panel-card h3 {
    margin-top: 0;
}

.news-card {
    background: #fafafa;
    padding: 28px;
}

.auth-shell {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 32px;
}

.auth-card {
    width: min(520px, 100%);
    background: #ffffff;
    border-radius: 32px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.auth-card h1 {
    margin-top: 0;
    font-size: 2rem;
}

.auth-card label {
    display: block;
    margin: 22px 0 10px;
    font-weight: 600;
}

.auth-card input,
.auth-card select,
.form-card input,
.form-card select,
.info-card input,
.info-card select {
    width: 100%;
    padding: 16px 18px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 16px;
    background: #f8fafc;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

thead {
    background: transparent;
}

th,

td {
    padding: 18px 16px;
    text-align: left;
    border: none;
}

tbody tr {
    background: #ffffff;
    border-radius: 22px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

tbody tr td {
    border-bottom: none;
}

.leaderboard-table tbody tr {
    transition: transform 0.2s ease;
}

.leaderboard-table tbody tr:hover {
    transform: translateY(-2px);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-weight: 700;
    color: #111827;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1);
}

.rank-1 {
    background: linear-gradient(135deg, #fbbf24, #f97316);
    color: #111827;
}

.rank-2 {
    background: linear-gradient(135deg, #d1d5db, #9ca3af);
}

.rank-3 {
    background: linear-gradient(135deg, #fde68a, #f59e0b);
}

.rank-default {
    background: #f3f4f6;
}

.request-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.request-list li {
    background: #f7f7f8;
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 12px;
}

.alert {
    padding: 16px 20px;
    border-radius: 18px;
    background: #fff4f4;
    border: 1px solid rgba(193, 31, 39, 0.15);
    color: #9a1d23;
    margin-bottom: 20px;
}

.alert.success {
    background: #eefaf1;
    border-color: rgba(23, 100, 41, 0.15);
    color: #176429;
}

.link-text {
    color: var(--muted);
    margin-top: 18px;
}

.link-text a {
    color: var(--primary);
    font-weight: 700;
}

@media (max-width: 900px) {
    .topbar,
    .hero,
    .notice-bar,
    .info-panel {
        padding-left: 20px;
        padding-right: 20px;
    }

    .user-nav {
        justify-content: center;
    }
}

@media (max-width:760px){

    .topbar{
        padding:12px;
        display:flex;
        flex-direction:column;
        align-items:center;
    }

    .brand{
        text-align:center;
        margin-bottom:10px;
    }

    .user-nav{
        width:100%;
        justify-content:flex-start;
        overflow-x:auto;
        flex-wrap:nowrap;
        white-space:nowrap;
        -webkit-overflow-scrolling:touch;
    }

    .user-nav a{
        flex:0 0 auto;
    }

    .page-shell,
    .dashboard-shell,
    .auth-shell{
        width:100%;
    }

    .hero{
        padding:32px 20px 24px;
    }

    .hero-content,
    .auth-card,
    .card,
    .form-card,
    .info-card,
    .news-card{
        padding:24px;
        border-radius:26px;
    }

    th,
    td{
        padding:14px 12px;
    }

    .admin-btn{
        background:#ff9800;
        color:#fff !important;
        padding:8px 16px;
        border-radius:8px;
        font-weight:bold;
        transition:.3s;
    }

    .admin-btn:hover{
        background:#ffb74d;
        transform:translateY(-2px);
    }
}
