/* ============================================
   SECTIONS — All Homepage Section Styles
   ============================================ */

/* === SERVER STATUS BAR (transparent, overlay on hero bottom) === */
.server-status-bar {
    background: transparent;
    padding: var(--space-md) 0;
}

.server-status-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2xl);
    flex-wrap: wrap;
}

.server-status-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    font-family: var(--font-body);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.server-status-item .label {
    color: var(--color-text-muted);
    font-weight: var(--font-weight-medium);
    font-size: 10px;
    letter-spacing: 2px;
}

.server-status-item .value {
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
}

.status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.online {
    background: var(--color-online);
    box-shadow: 0 0 8px var(--color-online);
    animation: dotPulse 1.5s ease-in-out infinite;
}

.status-dot.offline {
    background: var(--color-offline);
}

@keyframes dotPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* ============ PORTAL — NEWS + LOGIN ============ */
.portal {
    padding: 80px 48px;
    max-width: var(--container-max);
    margin: 0 auto;
    position: relative;
}

.portal-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
    align-items: start;
}

/* ============ PANEL BASE ============ */
.panel {
    background: linear-gradient(180deg, rgba(23,23,26,0.82), rgba(17,17,19,0.92));
    border: 1px solid var(--color-line);
    position: relative;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Gold corner accents */
.panel::before {
    content: '';
    position: absolute;
    top: -1px; left: -1px;
    width: 22px; height: 22px;
    border-top:  2px solid var(--color-gold-primary);
    border-left: 2px solid var(--color-gold-primary);
    pointer-events: none;
    z-index: 1;
}

.panel::after {
    content: '';
    position: absolute;
    bottom: -1px; right: -1px;
    width: 22px; height: 22px;
    border-bottom: 2px solid var(--color-gold-primary);
    border-right:  2px solid var(--color-gold-primary);
    pointer-events: none;
    z-index: 1;
}

.panel-head {
    padding: 20px 28px;
    border-bottom: 1px solid var(--color-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.panel-title {
    font-family: var(--font-body);
    font-size: 11px;
    letter-spacing: 1.5px;
    color: var(--color-gold-primary);
    text-transform: uppercase;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-title::before {
    content: '';
    width: 7px; height: 7px;
    background: var(--color-blood-bright);
    box-shadow: 0 0 8px var(--color-blood-bright);
    transform: rotate(45deg);
    flex-shrink: 0;
}

/* ============ NEWS PANEL ============ */
.news-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.news-tab {
    padding: 5px 12px;
    font-family: var(--font-body);
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--color-text-muted);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s var(--ease-out);
}

.news-tab:hover { color: var(--color-text-primary); }

.news-tab.active {
    color: var(--color-gold-primary);
    border-color: var(--color-gold-dark);
    background: rgba(201, 169, 97, 0.08);
}

.news-list {
    list-style: none;
    padding: 6px 28px 12px;
    min-height: 320px;
}

.news-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px dashed var(--color-line-soft);
    transition: all 0.3s var(--ease-out);
    text-decoration: none;
    color: inherit;
    opacity: 0;
    transform: translateY(8px);
    animation: newsItemIn 0.5s var(--ease-out) forwards;
}

.news-item:nth-child(1) { animation-delay: 0.05s; }
.news-item:nth-child(2) { animation-delay: 0.10s; }
.news-item:nth-child(3) { animation-delay: 0.15s; }
.news-item:nth-child(4) { animation-delay: 0.20s; }
.news-item:nth-child(5) { animation-delay: 0.25s; }
.news-item:nth-child(6) { animation-delay: 0.30s; }

@keyframes newsItemIn {
    to { opacity: 1; transform: translateY(0); }
}

.news-item:last-child { border-bottom: none; }

.news-item:hover { padding-left: 6px; }
.news-item:hover .news-item-title { color: var(--color-gold-primary); }

.news-item-badge {
    font-family: var(--font-body);
    font-size: 10px;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
    min-width: 44px;
    text-align: center;
}

.news-item-badge.hot  { background: var(--color-blood); color: #fff; }
.news-item-badge.new  { background: rgba(201,169,97,0.12); color: var(--color-gold-primary); border: 1px solid var(--color-gold-dark); }
.news-item-badge.event { background: rgba(220,30,53,0.12); color: var(--color-blood-bright); border: 1px solid var(--color-blood); }
.news-item-badge.std  { background: var(--color-bg-tertiary); color: var(--color-text-secondary); border: 1px solid var(--color-line); }

.news-item-title {
    font-size: 13.5px;
    color: var(--color-text-primary);
    transition: color 0.25s;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-item-date {
    font-family: var(--font-body);
    font-size: 10px;
    color: var(--color-text-muted);
    letter-spacing: 1px;
    flex-shrink: 0;
}

.news-footer {
    padding: 14px 28px;
    border-top: 1px solid var(--color-line);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-viewall {
    font-family: var(--font-body);
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--color-gold-primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.3s var(--ease-out);
}

.news-viewall:hover {
    gap: 14px;
    color: var(--color-gold-bright);
}

/* ============ LOGIN PANEL ============ */
.login-body {
    padding: 24px 28px 20px;
}

.login-intro {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: 20px;
    line-height: 1.7;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Floating label input */
.input-group {
    position: relative;
}

.input-label {
    position: absolute;
    top: 50%; left: 14px;
    transform: translateY(-50%);
    font-family: var(--font-body);
    font-size: 10px;
    color: var(--color-text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    pointer-events: none;
    transition: all 0.3s var(--ease-out);
    background: var(--color-bg-secondary);
    padding: 0 4px;
}

.input-field {
    width: 100%;
    padding: 13px 14px;
    background: rgba(10, 10, 11, 0.6);
    border: 1px solid var(--color-line);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    transition: all 0.3s var(--ease-out);
    outline: none;
    box-sizing: border-box;
}

.input-field:focus {
    border-color: var(--color-gold-dark);
    background: rgba(10, 10, 11, 0.9);
    box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.07);
}

.input-field:focus + .input-label,
.input-field:not(:placeholder-shown) + .input-label {
    top: 0;
    font-size: 9px;
    color: var(--color-gold-primary);
}

.input-field::placeholder { color: transparent; }

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--color-text-muted);
    margin: 2px 0 6px;
}

.login-options label {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
}

.login-options input[type="checkbox"] {
    accent-color: var(--color-blood);
    cursor: pointer;
}

.login-options a {
    color: var(--color-gold-dark);
    text-decoration: none;
    font-size: 11px;
    font-family: var(--font-body);
    letter-spacing: 1px;
    transition: color 0.2s;
}

.login-options a:hover { color: var(--color-gold-primary); }

.login-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 8px;
}

/* Blood-red download button */
.login-download {
    width: 100%;
    padding: 16px;
    margin-top: 10px;
    background: linear-gradient(135deg, var(--color-blood-deep), var(--color-blood));
    border: 1px solid var(--color-gold-dark);
    color: #fff;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--ease-out);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
}

.login-download::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: left 0.6s var(--ease-out);
}

.login-download:hover::before { left: 100%; }
.login-download:hover {
    box-shadow: 0 0 32px rgba(220, 30, 53, 0.5);
    transform: translateY(-2px);
    color: #fff;
}

/* Logged-in welcome state */
.login-welcome {
    text-align: center;
    padding: 28px 28px 16px;
}

.login-welcome-name {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--color-gold-primary);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.login-welcome-sub {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: 20px;
}

/* Server info row at panel bottom */
.server-info-row {
    padding: 14px 28px;
    border-top: 1px solid var(--color-line);
    background: rgba(10, 10, 11, 0.4);
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
    font-size: 11px;
}

.server-info-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-secondary);
    font-family: var(--font-body);
    letter-spacing: 1px;
}

.server-info-status strong {
    color: var(--color-text-primary);
    font-weight: 600;
}

.server-info-version {
    font-family: var(--font-body);
    color: var(--color-text-muted);
    letter-spacing: 2px;
    font-size: 10px;
}

/* ============ SECTION BASE ============ */
.section {
    padding: 100px 48px;
    position: relative;
    max-width: var(--container-max);
    margin: 0 auto;
}

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

.section-head-left { max-width: 640px; }

.section-eyebrow {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 2px;
    color: var(--color-gold-primary);
    text-transform: uppercase;
    margin-bottom: 16px;
    padding-left: 28px;
    position: relative;
}

.section-eyebrow::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    width: 18px; height: 1px;
    background: var(--color-gold-primary);
}

.section-title {
    font-family: 'Noto Serif SC', serif;
    font-weight: 700;
    font-size: clamp(30px, 3.5vw, 48px);
    line-height: 1.15;
    color: var(--color-text-heading);
    letter-spacing: -0.01em;
}

.section-title .accent { color: var(--color-blood-bright); }

.section-desc {
    color: var(--color-text-secondary);
    font-size: 15px;
    line-height: 1.8;
    max-width: 420px;
    margin-top: 16px;
}

/* section-header defined in layout.css — only override what differs here */
.section-header h2 {
    font-family: 'Noto Serif SC', serif;
    font-size: var(--font-size-3xl);
    color: var(--color-text-heading);
    letter-spacing: 0.02em;
    margin-bottom: var(--space-md);
}

/* ============ FACTIONS GRID ============ */
.section-factions {
    padding: 100px 0;
    max-width: var(--container-max);
    margin: 0 auto;
}

.factions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--color-line);
    border: 1px solid var(--color-line);
}

.faction-card {
    background: var(--color-bg-secondary);
    padding: 36px 28px;
    transition: all 0.4s var(--ease-out);
    position: relative;
    cursor: pointer;
    overflow: hidden;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-decoration: none;
    color: inherit;
}

.faction-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(184,24,42,0.18), transparent 65%);
    opacity: 0;
    transition: opacity 0.5s var(--ease-out);
}

.faction-card::after {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    width: 0; height: 2px;
    background: var(--color-gold-primary);
    transform: translateX(-50%);
    transition: width 0.5s var(--ease-out);
}

.faction-card:hover::before { opacity: 1; }
.faction-card:hover::after  { width: 100%; }
.faction-card:hover         { background: var(--color-bg-tertiary); transform: translateY(-4px); }
.faction-card > *           { position: relative; z-index: 1; }

.faction-hanzi {
    font-family: 'Noto Serif SC', serif;
    font-size: 80px;
    font-weight: 900;
    color: var(--color-blood-deep);
    line-height: 1;
    margin-bottom: 20px;
    transition: all 0.5s var(--ease-out);
}

.faction-card:hover .faction-hanzi {
    color: var(--color-blood-bright);
    transform: translateY(-4px);
    text-shadow: 0 0 24px rgba(220, 30, 53, 0.5);
}

.faction-label {
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: var(--color-gold-primary);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.faction-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text-heading);
    margin-bottom: 12px;
    font-family: 'Noto Serif SC', serif;
}

.faction-desc {
    font-size: 13.5px;
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
    flex: 1;
}

.faction-more {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 10px;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    padding: 4px 10px;
    border: 1px solid var(--color-line);
    text-transform: uppercase;
    font-weight: 500;
    transition: all 0.3s var(--ease-out);
}

.faction-card:hover .faction-more {
    color: var(--color-gold-primary);
    border-color: var(--color-gold-dark);
}

/* ============ RANKINGS SECTION ============ */
.section-rankings {
    padding: 100px 48px;
    max-width: var(--container-max);
    margin: 0 auto;
}

.rankings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

/* Title của mỗi ranking card */
.ranking-card-title {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-gold-bright);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Cột số thứ tự — cố định nhỏ */
.col-rank {
    width: 36px;
    text-align: center;
}

/* Cột cấp độ */
.col-level {
    width: 52px;
    text-align: center;
}

/* Dữ liệu màu vàng (tổng nạp, thời gian) */
.col-gold {
    color: var(--color-gold-bright);
    font-weight: var(--font-weight-medium);
}

/* Số thứ hạng */
.ranking-num {
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
}

/* Không có dữ liệu */
.no-data {
    text-align: center;
    color: var(--color-text-muted);
    padding: var(--space-xl) 0;
    font-size: var(--font-size-sm);
    font-style: italic;
}

/* Nút xem thêm */
.rankings-more {
    margin-top: var(--space-xl);
    text-align: center;
}

/* Responsive — tablet */
@media (max-width: 960px) {
    .rankings-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    .section-rankings {
        padding: 60px 24px;
    }
}

/* Responsive — mobile */
@media (max-width: 600px) {
    .section-rankings {
        padding: 48px 16px;
    }
}

/* ============ DOWNLOAD CTA SECTION ============ */
.section-download {
    padding: 100px 48px;
    max-width: var(--container-max);
    margin: 0 auto;
    text-align: center;
}

.download-title {
    font-family: 'Noto Serif SC', serif;
    font-size: clamp(28px, 3.5vw, 44px);
    color: var(--color-text-heading);
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
}

.download-desc {
    font-size: 15px;
    color: var(--color-text-secondary);
    max-width: 520px;
    margin: 0 auto var(--space-md);
    line-height: 1.8;
}

.download-specs {
    display: flex;
    justify-content: center;
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
    flex-wrap: wrap;
}

.download-spec { text-align: center; }

.download-spec .spec-label {
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.download-spec .spec-value {
    font-size: var(--font-size-base);
    color: var(--color-gold-primary);
    font-weight: var(--font-weight-semibold);
    margin-top: var(--space-xs);
}

/* ============ ORNAMENTAL DIVIDER ============ */
.divider-ornate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
}

.divider-ornate::before,
.divider-ornate::after {
    content: '';
    flex: 1;
    max-width: 180px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-gold-dark), transparent);
}

.divider-ornate .diamond {
    width: 8px; height: 8px;
    background: var(--color-blood);
    transform: rotate(45deg);
    flex-shrink: 0;
    box-shadow: 0 0 8px var(--color-blood);
}

/* ============ REVEAL ANIMATIONS ============ */
.reveal {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.reveal.in { opacity: 1; transform: translateY(0); }

.reveal-left {
    opacity: 0;
    transform: translateX(-36px);
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.reveal-left.in { opacity: 1; transform: translateX(0); }

.reveal-right {
    opacity: 0;
    transform: translateX(36px);
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.reveal-right.in { opacity: 1; transform: translateX(0); }

/* Stagger children */
.stagger > * {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.stagger.in > * { opacity: 1; transform: translateY(0); }
.stagger.in > *:nth-child(1) { transition-delay: 0.05s; }
.stagger.in > *:nth-child(2) { transition-delay: 0.12s; }
.stagger.in > *:nth-child(3) { transition-delay: 0.19s; }
.stagger.in > *:nth-child(4) { transition-delay: 0.26s; }
.stagger.in > *:nth-child(5) { transition-delay: 0.33s; }
.stagger.in > *:nth-child(6) { transition-delay: 0.40s; }

/* Legacy classes kept for compatibility */
.section-news { padding: var(--space-4xl) 0; }
.stagger-children > * { transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
.fade-in-up { opacity: 0; transform: translateY(24px); animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}
