/* ============================================================
   Infernal Wings — UI Design System (giao diện mới)
   Trích từ mockup. Tiền tố .iw- để không xung đột CSS cũ.
   Chỉ đổi giao diện — không đụng backend.
   ============================================================ */

:root {
    /* Nền */
    --iw-bg:          #080b12;   /* nền trang tối nhất */
    --iw-bg-2:        #0b1018;   /* topbar / sidebar */
    --iw-surface:     #111825;   /* card */
    --iw-surface-2:   #0e1420;   /* card phụ / input */
    --iw-elev:        #16202f;   /* hover / nổi */

    /* Viền */
    --iw-border:      #1c2636;
    --iw-border-2:    #263349;

    /* Cam thương hiệu */
    --iw-primary:     #f97316;
    --iw-primary-2:   #fb923c;
    --iw-primary-ink: #ffffff;
    --iw-primary-glow: rgba(249,115,22,.35);

    /* Trạng thái */
    --iw-online:      #22c55e;
    --iw-online-glow: rgba(34,197,94,.35);
    --iw-danger:      #ef4444;
    --iw-warning:     #eab308;
    --iw-info:        #3b82f6;
    --iw-vip:         #f5c451;

    /* Chữ */
    --iw-text:        #e8edf5;
    --iw-text-2:      #8a97ab;
    --iw-text-3:      #5b6b82;

    /* Bo góc + đổ bóng */
    --iw-r-sm: 8px;
    --iw-r:    12px;
    --iw-r-lg: 16px;
    --iw-shadow: 0 8px 30px rgba(0,0,0,.35);

    /* Kích thước khung */
    --iw-topbar-h: 64px;
    --iw-sidebar-w: 248px;
}

/* ---------- Reset nhẹ cho phạm vi giao diện mới ---------- */
body.iw {
    margin: 0;
    background:
        radial-gradient(1200px 600px at 80% -10%, rgba(249,115,22,.06), transparent 60%),
        var(--iw-bg);
    color: var(--iw-text);
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}
.iw *, .iw *::before, .iw *::after { box-sizing: border-box; }
.iw a { color: inherit; text-decoration: none; }
.iw img { max-width: 100%; display: block; }

/* Scrollbar */
.iw ::-webkit-scrollbar { width: 9px; height: 9px; }
.iw ::-webkit-scrollbar-track { background: transparent; }
.iw ::-webkit-scrollbar-thumb { background: var(--iw-border-2); border-radius: 6px; }
.iw ::-webkit-scrollbar-thumb:hover { background: #33425c; }

/* ============================================================
   BỐ CỤC KHUNG: topbar + sidebar + nội dung
   ============================================================ */
.iw-topbar {
    position: fixed; top: 0; left: 0; right: 0; height: var(--iw-topbar-h);
    display: flex; align-items: center; gap: 22px;
    padding: 0 22px; z-index: 1000;
    background: #0b1018;
    border-bottom: 1px solid var(--iw-border);
}
.iw-brand { display: flex; align-items: center; gap: 12px; min-width: var(--iw-sidebar-w); }
.iw-brand img { width: 38px; height: 38px; object-fit: contain; }
.iw-brand b { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 20px; letter-spacing: .5px; line-height: 1; }
.iw-brand b span { color: var(--iw-primary); }
.iw-brand small { display: block; font-size: 10px; letter-spacing: 2px; color: var(--iw-text-3); text-transform: uppercase; }

.iw-topnav { display: flex; align-items: center; gap: 4px; flex: 1; }
.iw-topnav a {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 14px; border-radius: var(--iw-r-sm);
    color: var(--iw-text-2); font-size: 14px; font-weight: 600;
    transition: .15s;
}
.iw-topnav a i { font-size: 14px; }
.iw-topnav a:hover { color: var(--iw-text); background: var(--iw-elev); }
.iw-topnav a.active { color: #fff; background: linear-gradient(135deg, rgba(249,115,22,.18), rgba(249,115,22,.06)); }
.iw-topnav a.active i { color: var(--iw-primary); }

.iw-search { position: relative; }
.iw-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--iw-text-3); font-size: 13px; }
.iw-search input {
    width: 220px; height: 40px; padding: 0 14px 0 34px;
    background: var(--iw-surface-2); border: 1px solid var(--iw-border);
    border-radius: 999px; color: var(--iw-text); font-size: 13px; outline: none;
}
.iw-search input:focus { border-color: var(--iw-border-2); }

.iw-user { display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 5px; border-radius: 999px; border: 1px solid var(--iw-border); background: var(--iw-surface-2); cursor: pointer; }
.iw-user img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.iw-user .nm { font-size: 13px; font-weight: 600; line-height: 1.1; }
.iw-user .iw-badge-vip { font-size: 9px; }

/* ---------- Sidebar ---------- */
.iw-sidebar {
    position: fixed; top: var(--iw-topbar-h); left: 0; bottom: 0; width: var(--iw-sidebar-w);
    background: var(--iw-bg-2); border-right: 1px solid var(--iw-border);
    padding: 18px 14px; overflow-y: auto; z-index: 900;
}
.iw-side-label { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--iw-text-3); font-weight: 700; margin: 18px 10px 8px; }
.iw-side-label:first-child { margin-top: 0; }
.iw-menu { list-style: none; margin: 0; padding: 0; }
.iw-menu a {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 12px; border-radius: var(--iw-r-sm);
    color: var(--iw-text-2); font-size: 14px; font-weight: 600; transition: .15s;
    margin-bottom: 2px; position: relative;
}
.iw-menu a i { width: 18px; text-align: center; font-size: 15px; }
.iw-menu a:hover { color: var(--iw-text); background: var(--iw-elev); }
.iw-menu a.active { color: #fff; background: linear-gradient(135deg, rgba(249,115,22,.2), transparent); }
.iw-menu a.active::before { content:''; position:absolute; left:0; top:8px; bottom:8px; width:3px; border-radius:3px; background: var(--iw-primary); }
.iw-menu a.active i { color: var(--iw-primary); }
.iw-menu-badge { margin-left: auto; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--iw-primary); color: #fff; }

/* Social links trong sidebar */
.iw-social a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--iw-r-sm); color: var(--iw-text-2); transition: .15s; }
.iw-social a:hover { background: var(--iw-elev); color: var(--iw-text); }
.iw-social a i { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; font-size: 14px; color: #fff; }
.iw-social .ic-discord i { background: #5865F2; }
.iw-social .ic-facebook i { background: #1877F2; }
.iw-social .ic-tiktok i { background: #010101; }
.iw-social .ic-youtube i { background: #FF0000; }
.iw-social a .t { font-size: 13px; font-weight: 600; line-height: 1.15; }
.iw-social a .s { font-size: 11px; color: var(--iw-text-3); }

/* Stat mini trong sidebar */
.iw-side-stats { display: grid; gap: 8px; }
.iw-side-stat { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--iw-surface-2); border: 1px solid var(--iw-border); border-radius: var(--iw-r-sm); }
.iw-side-stat i { color: var(--iw-primary); font-size: 15px; }
.iw-side-stat .v { font-weight: 700; font-size: 15px; }
.iw-side-stat .l { font-size: 11px; color: var(--iw-text-3); }

/* ---------- Vùng nội dung ---------- */
.iw-main { margin-left: var(--iw-sidebar-w); padding: calc(var(--iw-topbar-h) + 24px) 26px 40px; min-height: 100vh; }
.iw-container { max-width: 1360px; margin: 0 auto; }

/* ============================================================
   COMPONENTS
   ============================================================ */
/* Card */
.iw-card { background: var(--iw-surface); border: 1px solid var(--iw-border); border-radius: var(--iw-r); box-shadow: var(--iw-shadow); }
.iw-card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--iw-border); }
.iw-card-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.iw-card-title i { color: var(--iw-primary); }
.iw-card-body { padding: 18px; }
.iw-link { color: var(--iw-primary); font-size: 13px; font-weight: 600; }
.iw-link:hover { text-decoration: underline; }

/* Section label */
.iw-h { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 22px; letter-spacing: .3px; }

/* Tiêu đề trang (dùng chung) */
.iw-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.iw-page-head .iw-h i { color: var(--iw-primary); }
.iw-page-head p { color: var(--iw-text-2); margin: 4px 0 0; font-size: 14px; }

/* Cầu nối: restyle .card cũ (Bootstrap/style.css) theo token mới */
.iw .card { background: var(--iw-surface); border: 1px solid var(--iw-border); border-radius: var(--iw-r); box-shadow: var(--iw-shadow); }
.iw .card-header { background: transparent; border-bottom: 1px solid var(--iw-border); padding: 15px 18px; }
.iw .card-title { color: var(--iw-text); font-family: 'Rajdhani', sans-serif; font-weight: 700; }
.iw .card-title i, .iw .card-header i { color: var(--iw-primary); }

/* Cầu nối: restyle .page-header cũ (các trang chưa viết lại) theo phong cách mới */
.iw .page-header { margin-bottom: 18px; }
.iw .page-header h1 { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 24px; letter-spacing: .3px; margin: 0; display: flex; align-items: center; gap: 10px; color: var(--iw-text); }
.iw .page-header h1 i { color: var(--iw-primary); }
.iw .page-header p { color: var(--iw-text-2); margin: 5px 0 0; font-size: 14px; }

/* Buttons */
.iw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 12px 20px; border-radius: var(--iw-r-sm); font-weight: 700; font-size: 14px; cursor: pointer; border: 1px solid transparent; transition: .15s; white-space: nowrap; }
.iw-btn-primary { background: linear-gradient(135deg, var(--iw-primary-2), var(--iw-primary)); color: #fff; box-shadow: 0 6px 18px var(--iw-primary-glow); }
.iw-btn-primary:hover { filter: brightness(1.07); transform: translateY(-1px); }
.iw-btn-ghost { background: var(--iw-surface-2); border-color: var(--iw-border-2); color: var(--iw-text); }
.iw-btn-ghost:hover { background: var(--iw-elev); }

/* Badges */
.iw-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .3px; }
.iw-badge-online { background: rgba(34,197,94,.14); color: var(--iw-online); }
.iw-badge-online .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--iw-online); box-shadow: 0 0 0 3px var(--iw-online-glow); animation: iw-pulse 1.6s infinite; }
.iw-badge-vip { background: linear-gradient(135deg, #f5c451, #e0a020); color: #241a05; }
.iw-badge-live { background: rgba(239,68,68,.15); color: var(--iw-danger); }
.iw-badge-live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--iw-danger); animation: iw-pulse 1.2s infinite; }
@keyframes iw-pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* Stat tile (row) */
.iw-stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--iw-border); border: 1px solid var(--iw-border); border-radius: var(--iw-r); overflow: hidden; }
.iw-stat { background: var(--iw-surface); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.iw-stat .ic { color: var(--iw-text-3); font-size: 13px; display: flex; align-items: center; gap: 7px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.iw-stat .v { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 22px; }

/* Data table */
.iw-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.iw-table th { text-align: left; padding: 10px 14px; color: var(--iw-text-3); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; border-bottom: 1px solid var(--iw-border); }
.iw-table td { padding: 11px 14px; border-bottom: 1px solid var(--iw-border); }
.iw-table tbody tr:hover td { background: var(--iw-elev); }
.iw-table tbody tr:last-child td { border-bottom: none; }
.iw-rank-badge { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; font-size: 12px; font-weight: 700; background: var(--iw-surface-2); color: var(--iw-text-2); }
.iw-rank-badge.g1 { background: linear-gradient(135deg,#fde68a,#f59e0b); color:#3a2600; }
.iw-rank-badge.g2 { background: linear-gradient(135deg,#e2e8f0,#94a3b8); color:#1e293b; }
.iw-rank-badge.g3 { background: linear-gradient(135deg,#fdba74,#c2703a); color:#3a1e00; }
.iw-player-cell { display: flex; align-items: center; gap: 10px; }
.iw-player-cell img { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; }
.iw-ping.good { color: var(--iw-online); } .iw-ping.mid { color: var(--iw-warning); } .iw-ping.bad { color: var(--iw-danger); }

/* Copy field */
.iw-ip { display: inline-flex; align-items: center; gap: 12px; }
.iw-ip code { font-family: 'Rajdhani', monospace; font-weight: 700; font-size: 26px; color: var(--iw-primary); letter-spacing: .5px; }
.iw-copy { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--iw-surface-2); border: 1px solid var(--iw-border-2); color: var(--iw-text-2); cursor: pointer; transition: .15s; }
.iw-copy:hover { color: var(--iw-primary); border-color: var(--iw-primary); }

/* Grid helpers */
.iw-grid { display: grid; gap: 18px; }
.iw-grid-3 { grid-template-columns: 1.05fr 1.3fr 1fr; }
.iw-grid-5 { grid-template-columns: repeat(5, 1fr); }

/* ---------- Trang chủ: Banner (hero) ---------- */
.iw-banner {
    padding: 34px 38px; position: relative; overflow: hidden;
    min-height: 230px; display: flex; align-items: center;
    /* Họa tiết nền mặc định (không cần ảnh); thả ảnh thật bằng --iw-banner-img */
    background:
        var(--iw-banner-img, none),
        radial-gradient(700px 320px at 88% -10%, rgba(249,115,22,.14), transparent 60%),
        linear-gradient(120deg, var(--iw-surface), #0e1725 70%);
    background-size: cover; background-position: center;
}
/* Hero: chỉ 1 dòng tiêu đề trên ảnh nền */
.iw-banner-hero { position: relative; z-index: 1; }
.iw-banner-title { font-family:'Rajdhani',sans-serif; font-weight:700; font-size: clamp(36px, 5vw, 60px); line-height: 1; letter-spacing: 1px; margin: 0; text-transform: uppercase; text-shadow: 0 2px 20px rgba(0,0,0,.5); }
.iw-banner-title span { color: var(--iw-primary); }
.iw-banner-sub { margin: 12px 0 0; color: var(--iw-text); font-size: clamp(14px,1.6vw,18px); font-weight: 600; letter-spacing: 3px; text-transform: uppercase; opacity: .92; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.iw-banner::after { /* lớp phủ tối để chữ luôn đọc rõ khi có ảnh */
    content:''; position:absolute; inset:0; pointer-events:none;
    background: linear-gradient(90deg, rgba(9,13,20,.92) 0%, rgba(9,13,20,.6) 45%, transparent 85%);
}
/* Watermark CS2 mờ phía sau (nền phù hợp khi chưa có ảnh) */
.iw-banner-bg { position: absolute; top: 0; right: 34px; bottom: 40%; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; pointer-events: none; opacity: .9; }
.iw-banner-bg span { font-family:'Rajdhani',sans-serif; font-weight:700; font-size: clamp(56px, 7vw, 104px); line-height:.82; background: linear-gradient(135deg, rgba(255,255,255,.85), var(--iw-primary)); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; }
.iw-banner-bg small { letter-spacing: 5px; color: var(--iw-text-3); font-size: 12px; }
.iw-banner-main { position: relative; z-index: 1; max-width: 640px; }
.iw-banner-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.iw-banner-stats { position: relative; z-index: 1; margin-top: 20px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--iw-border); border: 1px solid var(--iw-border); border-radius: var(--iw-r); overflow: hidden; }
.iw-banner-stats .iw-stat { background: rgba(14,20,32,.85); }

/* ---------- Dải chữ chạy (marquee) dưới banner ---------- */
.iw-marquee {
    height: 35px; padding: 0; overflow: hidden; position: relative;
    background: linear-gradient(90deg, rgba(249,115,22,.12), rgba(14,20,32,.9) 45%, rgba(249,115,22,.12));
}
.iw-marquee::before, .iw-marquee::after { /* làm mờ 2 mép cho mượt */
    content: ''; position: absolute; top: 0; bottom: 0; width: 48px; z-index: 2; pointer-events: none;
}
.iw-marquee::before { left: 0;  background: linear-gradient(90deg, var(--iw-surface), transparent); }
.iw-marquee::after  { right: 0; background: linear-gradient(270deg, var(--iw-surface), transparent); }
.iw-marquee-track {
    /* absolute + width:max-content -> track rộng đúng bằng nội dung, không bị flex co lại */
    position: absolute; top: 0; left: 0; height: 100%;
    display: flex; align-items: center; flex-wrap: nowrap;
    width: max-content; white-space: nowrap;
    will-change: transform; animation: iw-marquee-run 20s linear infinite;
}
.iw-marquee:hover .iw-marquee-track { animation-play-state: paused; }
.iw-marquee-item {
    font-size: 13.5px; font-weight: 600; color: var(--iw-text);
    padding-right: 60px; display: flex; align-items: center; gap: 8px; flex: 0 0 auto;
}
.iw-marquee-item i { color: var(--iw-primary); }
/* Link cuối câu — dùng 2 class để thắng `.iw a { color: inherit }` */
.iw-marquee .iw-marquee-cta {
    color: var(--iw-online); font-weight: 700; text-decoration: underline;
    text-underline-offset: 3px; pointer-events: auto;
}
.iw-marquee .iw-marquee-cta:hover { color: #4ade80; }
@keyframes iw-marquee-run {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ---------- Info list ---------- */
.iw-info { display: flex; flex-direction: column; }
.iw-info > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--iw-border); font-size: 13.5px; }
.iw-info > div:last-child { border-bottom: none; }
.iw-info span { color: var(--iw-text-3); }
.iw-info b { font-weight: 600; text-align: right; }

/* ---------- Next map ---------- */
.iw-nextmap { height: 118px; border-radius: var(--iw-r-sm); background: linear-gradient(135deg,#1a2740,#0e1826); border: 1px solid var(--iw-border-2); display: flex; flex-direction: column; justify-content: flex-end; padding: 14px; position: relative; overflow: hidden; }
.iw-nextmap::before { content:''; position:absolute; inset:0; background: radial-gradient(400px 140px at 80% 0, rgba(249,115,22,.2), transparent 70%); }
.iw-nextmap-name { font-family:'Rajdhani',sans-serif; font-weight:700; font-size:22px; position: relative; }
.iw-nextmap-mode { font-size: 12px; color: var(--iw-text-2); position: relative; }

/* ---------- Announcement mini ---------- */
.iw-ann { display: flex; gap: 12px; }
.iw-ann-ic { width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; display: grid; place-items: center; font-size: 14px; }
.iw-ann-t { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.iw-ann-b { font-size: 12px; color: var(--iw-text-2); margin-top: 2px; }
.iw-ann-d { font-size: 11px; color: var(--iw-text-3); margin-top: 3px; }

/* ---------- Top player cards ---------- */
.iw-top { transition: .15s; }
.iw-top:hover { transform: translateY(-3px); border-color: var(--iw-border-2); }
.iw-top .iw-card-body { position: relative; }
.iw-top-1 { border-color: rgba(245,196,81,.4); box-shadow: 0 8px 30px rgba(245,196,81,.08); }
.iw-top-rank { position: absolute; top: 0; left: 0; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-weight: 700; font-size: 12px; background: var(--iw-surface-2); color: var(--iw-text-2); }
.iw-top-rank.g1 { background: linear-gradient(135deg,#fde68a,#f59e0b); color:#3a2600; }
.iw-top-rank.g2 { background: linear-gradient(135deg,#e2e8f0,#94a3b8); color:#1e293b; }
.iw-top-rank.g3 { background: linear-gradient(135deg,#fdba74,#c2703a); color:#3a1e00; }
.iw-top-av { width: 62px; height: 62px; border-radius: 50%; object-fit: cover; margin: 6px auto 10px; border: 2px solid var(--iw-border-2); }
.iw-top-1 .iw-top-av { border-color: var(--iw-vip); }
.iw-top-name { font-weight: 700; font-size: 14px; }
.iw-top-pts { color: var(--iw-primary); font-weight: 700; font-size: 13px; margin-top: 3px; }

@media (max-width: 1100px) {
    .iw-grid-3 { grid-template-columns: 1fr; }
    .iw-grid-5 { grid-template-columns: repeat(2, 1fr); }
    .iw-search input { width: 150px; }
    .iw-banner { grid-template-columns: 1fr; }
    .iw-banner-art { display: none; }
    .iw-banner-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
    .iw-sidebar { transform: translateX(-100%); transition: .25s; }
    .iw-sidebar.open { transform: none; }
    .iw-main { margin-left: 0; }
    .iw-topnav { display: none; }
    .iw-brand { min-width: 0; }
}
