/* ==========================================================================
   NEX-RO HICLASS — Red & Black aggressive theme
   ========================================================================== */

:root {
    --bg-black: #0a0505;
    --bg-panel: #150a0a;
    --bg-panel-2: #1c0e0e;
    --red-primary: #c2101c;
    --red-bright: #ff2130;
    --red-glow: #ff3b3b;
    --red-dark: #5c0b0f;
    --gold: #d4a94a;
    --text-main: #eae0d8;
    --text-muted: #a8918c;
    --border-red: #3d1215;
    --online: #35d16a;
    --offline: #ff3b3b;
    --font-display: 'Cinzel', 'Georgia', serif;
    --font-body: 'Kanit', 'Noto Sans Thai', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background-color: var(--bg-black);
    color: var(--text-main);
    font-family: var(--font-body);
    scroll-behavior: smooth;
}

body {
    background-image:
        linear-gradient(180deg, rgba(10,5,5,0.88) 0%, rgba(10,5,5,0.80) 40%, rgba(10,5,5,0.93) 100%),
        url('../img/bg.jpg');
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

::selection { background: var(--red-primary); color: #fff; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-black); }
::-webkit-scrollbar-thumb { background: var(--red-dark); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--red-primary); }

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------------- Top bar (status + discord) ---------------- */
.topbar {
    background: #000;
    border-bottom: 1px solid var(--border-red);
    font-size: 0.82rem;
    color: var(--text-muted);
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; height: 34px; flex-wrap: wrap; gap: 8px; }
.status-strip { display: flex; gap: 14px; align-items: center; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; box-shadow: 0 0 6px currentColor; }
.status-dot.online { background: var(--online); color: var(--online); animation: pulse 1.6s infinite; }
.status-dot.offline { background: var(--offline); color: var(--offline); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.topbar a.discord-link { color: #8ea1e1; }
.topbar a.discord-link:hover { color: #fff; }

/* ---------------- Header / Nav ---------------- */
header.site-header {
    background: linear-gradient(180deg, rgba(15,7,7,.97), rgba(15,7,7,.90));
    border-bottom: 2px solid var(--red-dark);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(3px);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: 74px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.5rem; letter-spacing: 2px; }
.brand .flame { color: var(--red-bright); text-shadow: 0 0 12px var(--red-glow); }
.brand small { display: block; font-family: var(--font-body); font-size: .62rem; letter-spacing: 3px; color: var(--text-muted); font-weight: 400; }

nav.main-nav { display: flex; align-items: center; gap: 2px; }
nav.main-nav > .nav-item { position: relative; }
nav.main-nav a.nav-link {
    display: block; padding: 10px 16px; font-weight: 500; font-size: .92rem;
    color: var(--text-main); border-radius: 4px; transition: all .15s;
}
nav.main-nav a.nav-link:hover, nav.main-nav .nav-item.active > a.nav-link {
    background: var(--red-primary); color: #fff; box-shadow: 0 0 14px rgba(194,16,28,.6);
}
.nav-item .dropdown {
    position: absolute; top: 100%; left: 0; background: var(--bg-panel);
    border: 1px solid var(--border-red); min-width: 190px; padding: 6px; border-radius: 6px;
    display: none; box-shadow: 0 10px 30px rgba(0,0,0,.6);
}
.nav-item:hover .dropdown { display: block; }
.dropdown a { display: block; padding: 8px 10px; font-size: .85rem; border-radius: 4px; color: var(--text-muted); }
.dropdown a:hover { background: var(--red-dark); color: #fff; }

.nav-auth { display: flex; align-items: center; gap: 10px; }
.btn {
    display: inline-block; padding: 9px 18px; border-radius: 5px; font-weight: 600;
    font-size: .85rem; border: 1px solid transparent; cursor: pointer; transition: all .15s;
}
.btn-primary { background: linear-gradient(180deg, var(--red-bright), var(--red-primary)); color: #fff; box-shadow: 0 0 16px rgba(255,33,48,.45); }
.btn-primary:hover { filter: brightness(1.15); }
.btn-outline { border-color: var(--red-primary); color: var(--text-main); background: transparent; }
.btn-outline:hover { background: var(--red-primary); color: #fff; }
.btn-gold { background: linear-gradient(180deg, #f0c869, var(--gold)); color: #241505; }
.btn-disabled { background: #2a2a2a; color: #777; cursor: not-allowed; border-color: #333; }
.btn-sm { padding: 6px 12px; font-size: .78rem; }
.btn-block { display: block; width: 100%; text-align: center; }

.burger { display: none; background: none; border: none; color: #fff; font-size: 1.6rem; cursor: pointer; }

/* ---------------- Hero / slider ---------------- */
.hero-slider { position: relative; height: 420px; overflow: hidden; border-bottom: 2px solid var(--red-dark); background: #000; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; }
.slide.active { opacity: 1; }
.slide img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.55) saturate(1.1); }
.slide .slide-caption {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 40px;
    background: linear-gradient(0deg, rgba(0,0,0,.85), transparent);
}
.slide .slide-caption h2 { font-family: var(--font-display); font-size: 1.8rem; color: var(--gold); margin: 0 0 6px; }
.slide .slide-caption p { margin: 0; color: var(--text-muted); max-width: 600px; }
.slider-dots { position: absolute; bottom: 14px; right: 24px; display: flex; gap: 8px; z-index: 5; }
.slider-dots button { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--red-bright); background: transparent; cursor: pointer; }
.slider-dots button.active { background: var(--red-bright); }
.slider-empty { display: flex; align-items: center; justify-content: center; height: 100%; flex-direction: column; gap: 10px; color: var(--text-muted); }

/* ---------------- Sections / cards ---------------- */
main { flex: 1; }
.section { padding: 46px 0; }
.section-title { font-family: var(--font-display); font-size: 1.6rem; color: var(--gold); margin: 0 0 22px; display: flex; align-items: center; gap: 10px; }
.section-title .bar { width: 5px; height: 24px; background: var(--red-bright); box-shadow: 0 0 10px var(--red-glow); display: inline-block; }

.panel {
    background: linear-gradient(180deg, rgba(28,14,14,.92), rgba(18,9,9,.92));
    border: 1px solid var(--border-red);
    border-radius: 10px;
    padding: 26px;
    box-shadow: 0 10px 30px rgba(0,0,0,.45);
}

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 1px solid var(--border-red); }
.tab-btn {
    background: none; border: none; color: var(--text-muted); padding: 10px 18px;
    font-weight: 600; font-size: .88rem; cursor: pointer; border-bottom: 3px solid transparent;
}
.tab-btn:hover { color: #fff; }
.tab-btn.active { color: var(--red-bright); border-color: var(--red-bright); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.post-item { padding: 14px 0; border-bottom: 1px solid var(--border-red); display: flex; justify-content: space-between; gap: 12px; }
.post-item:last-child { border-bottom: none; }
.post-item a.post-title { font-weight: 600; color: var(--text-main); }
.post-item a.post-title:hover { color: var(--red-bright); }
.post-meta { color: var(--text-muted); font-size: .78rem; white-space: nowrap; }
.badge { display: inline-block; padding: 2px 9px; font-size: .68rem; border-radius: 20px; font-weight: 700; letter-spacing: .5px; }
.badge-new { background: var(--red-primary); color: #fff; }
.badge-patch { background: var(--gold); color: #241505; }

table.rank-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.rank-table th { text-align: left; padding: 10px 12px; color: var(--gold); border-bottom: 2px solid var(--red-dark); font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; }
table.rank-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-red); }
table.rank-table tr:hover td { background: rgba(194,16,28,.08); }
.rank-no { font-family: var(--font-display); color: var(--text-muted); width: 40px; }
.rank-no.gold { color: #ffd76a; text-shadow: 0 0 8px #ffd76a; }
.rank-no.silver { color: #d7d7e0; }
.rank-no.bronze { color: #d08a53; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }

/* ---------------- Forms ---------------- */
.form-card { max-width: 440px; margin: 40px auto; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: .85rem; color: var(--text-muted); }
.form-control {
    width: 100%; padding: 11px 14px; background: #0d0606; border: 1px solid var(--border-red);
    border-radius: 5px; color: #fff; font-size: .95rem; font-family: var(--font-body);
}
.form-control:focus { outline: none; border-color: var(--red-bright); box-shadow: 0 0 0 3px rgba(255,33,48,.2); }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.captcha-box { display: flex; align-items: center; gap: 10px; }
.captcha-box .captcha-question { background: #000; border: 1px dashed var(--red-primary); padding: 10px 16px; border-radius: 6px; font-weight: 700; letter-spacing: 2px; }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: .9rem; }
.alert-success { background: rgba(53,209,106,.12); border: 1px solid var(--online); color: #b6f3cb; }
.alert-error { background: rgba(255,59,59,.12); border: 1px solid var(--offline); color: #ffc9c9; }
.alert-info { background: rgba(212,169,74,.12); border: 1px solid var(--gold); color: #f2dda4; }

/* ---------------- Footer ---------------- */
footer.site-footer { background: #000; border-top: 2px solid var(--red-dark); padding: 30px 0; margin-top: 40px; font-size: .85rem; color: var(--text-muted); }
footer.site-footer .foot-flex { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; align-items: center; }
footer.site-footer a:hover { color: var(--red-bright); }

/* ---------------- Music player ---------------- */
.music-player {
    position: fixed; right: 18px; bottom: 18px; z-index: 200;
    background: var(--bg-panel); border: 1px solid var(--red-primary); border-radius: 50px;
    display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 10px;
    box-shadow: 0 0 18px rgba(194,16,28,.5);
}
.music-player button {
    width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--red-primary);
    color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.music-player button:hover { background: var(--red-bright); }
.music-player .label { font-size: .74rem; color: var(--text-muted); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- Coming soon ---------------- */
.coming-soon { text-align: center; padding: 70px 20px; }
.coming-soon .flame-icon { font-size: 3rem; color: var(--red-bright); text-shadow: 0 0 20px var(--red-glow); }
.coming-soon h2 { font-family: var(--font-display); font-size: 2rem; color: var(--gold); margin: 16px 0 8px; }

/* ---------------- Utility ---------------- */
.text-muted { color: var(--text-muted); }
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}
.text-center { text-align: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

@media (max-width: 880px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    nav.main-nav { position: fixed; top: 74px; left: 0; right: 0; background: var(--bg-black); flex-direction: column;
        border-bottom: 2px solid var(--red-dark); align-items: stretch; padding: 10px; display: none; max-height: 80vh; overflow-y: auto; }
    nav.main-nav.open { display: flex; }
    .nav-item .dropdown { position: static; display: none; border: none; background: rgba(255,255,255,.03); }
    .nav-item.open .dropdown { display: block; }
    .burger { display: block; }
    .hero-slider { height: 260px; }
    .music-player .label { display: none; }
}
