/* =============================================================
   PUFFY TIERS — Premium / VIP theme
   Royal purple + champagne gold on a near-black base.

   Works on top of the existing index.ejs (Tailwind CDN + inline
   <style>). Selectors are prefixed with `body` where needed so
   they win over the inline styles without touching the HTML.
   This file only changes the look — not the layout or the JS.
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,700;1,800&display=swap');


/* -------------------------------------------------------------
   1. DESIGN TOKENS
   ------------------------------------------------------------- */
:root {
    --bg: #07060d;
    --surface-1: #0d0b15;
    --surface-2: #13101d;
    --surface-3: #1a1627;

    --purple-300: #d8b4fe;
    --purple-400: #c084fc;
    --purple-500: #a855f7;
    --purple-600: #9333ea;
    --purple-700: #7c3aed;

    --gold-100: #fbf0c9;
    --gold-200: #f6e3a1;
    --gold-300: #f0cf6e;
    --gold-400: #e6b94a;
    --gold-500: #d4a437;
    --gold-600: #a97c1f;

    --text-hi: #f7f5ff;
    --text-mid: #aaa4c2;
    --text-low: #6e6887;

    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}


/* -------------------------------------------------------------
   2. BASE
   ------------------------------------------------------------- */
html {
    color-scheme: dark;
    scroll-behavior: smooth;
    scrollbar-color: rgba(168, 85, 247, 0.55) #09070f;
}

body {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body[class] {
    background-color: var(--bg);
    color: var(--text-hi);
    min-height: 100vh;
}

/* Ambient glow behind the whole page */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(900px 520px at 10% -8%, rgba(124, 58, 237, 0.22), transparent 60%),
        radial-gradient(700px 420px at 94% 0%, rgba(212, 164, 55, 0.10), transparent 60%),
        radial-gradient(1000px 600px at 50% 118%, rgba(147, 51, 234, 0.16), transparent 60%);
}

::selection {
    background: rgba(168, 85, 247, 0.5);
    color: #ffffff;
}

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #09070f; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #7c3aed, #a855f7);
    border-radius: 10px;
    border: 2px solid #09070f;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #a855f7, #d8b4fe); }

/* Keyboard focus */
:focus-visible {
    outline: 2px solid rgba(240, 207, 110, 0.85);
    outline-offset: 2px;
}
body .nav-btn:focus-visible {
    outline: 2px solid rgba(240, 207, 110, 0.85) !important;
    outline-offset: 2px;
}


/* -------------------------------------------------------------
   3. TOP NAVIGATION BAR
   (the fixed bar: logo, server IP, Home, Join Us, search)
   ------------------------------------------------------------- */
.fixed.top-0 {
    background: linear-gradient(180deg, rgba(17, 13, 28, 0.88), rgba(9, 7, 15, 0.80));
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* Gold -> purple hairline under the bar */
.fixed.top-0::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(240, 207, 110, 0.75) 25%, rgba(168, 85, 247, 0.85) 65%, transparent);
}

/* Logo */
.fixed.top-0 a.gap-3 {
    transition: transform 0.25s var(--ease);
}
.fixed.top-0 a.gap-3:hover {
    transform: translateY(-1px);
}
.fixed.top-0 a.gap-3 > img {
    filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.55)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
    transition: transform 0.35s var(--ease), filter 0.35s ease;
}
.fixed.top-0 a.gap-3:hover > img {
    transform: rotate(-6deg) scale(1.08);
    filter: drop-shadow(0 0 16px rgba(240, 207, 110, 0.55)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}
.fixed.top-0 a.gap-3 > span > span:first-child {
    background: linear-gradient(100deg, #c084fc 0%, #a855f7 35%, #f1e4ff 52%, #a855f7 68%, #9333ea 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: logoShine 8s ease-in-out infinite;
}
.fixed.top-0 a.gap-3 > span > span:last-child {
    color: #ffffff;
    text-shadow: 0 0 22px rgba(255, 255, 255, 0.18);
}

/* Server IP box */
.fixed.top-0 [class*="md:flex"] {
    background: linear-gradient(135deg, rgba(240, 207, 110, 0.08), rgba(168, 85, 247, 0.08));
    border: 1px solid rgba(240, 207, 110, 0.24);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 6px 20px -8px rgba(0, 0, 0, 0.65);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.fixed.top-0 [class*="md:flex"]:hover {
    border-color: rgba(240, 207, 110, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 8px 26px -8px rgba(212, 164, 55, 0.35);
}
.fixed.top-0 [class*="md:flex"] img {
    filter: drop-shadow(0 0 6px rgba(240, 207, 110, 0.55));
}
.fixed.top-0 [class*="md:flex"] span.select-all {
    background: linear-gradient(90deg, var(--gold-100), var(--gold-300));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* Home / Join Us / Information buttons: smooth + light sweep */
body .home-nav-btn,
body .discord-nav-btn,
body .info-nav-btn {
    position: relative;
    overflow: hidden;
    transition: transform 0.25s var(--ease), box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}
body .home-nav-btn::after,
body .discord-nav-btn::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 40%;
    pointer-events: none;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: skewX(-20deg);
    transition: left 0.65s var(--ease);
}
body .home-nav-btn:hover::after,
body .discord-nav-btn:hover::after {
    left: 130%;
}
body .info-nav-btn:hover,
body .info-nav-btn[aria-expanded="true"] {
    border-color: rgba(240, 207, 110, 0.55);
    box-shadow: 0 10px 28px -8px rgba(212, 164, 55, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Search */
#playerSearch {
    background: rgba(255, 255, 255, 0.035);
    border-color: rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
#playerSearch:focus {
    background: rgba(255, 255, 255, 0.055);
    border-color: rgba(192, 132, 252, 0.85);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.18), 0 10px 30px -10px rgba(168, 85, 247, 0.5);
}
.fixed.top-0 span.font-mono {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-mid);
}


/* -------------------------------------------------------------
   4. GAMEMODE TABS
   ------------------------------------------------------------- */
body .nav-btn {
    border-radius: 14px;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}
body .nav-btn:hover {
    background: rgba(168, 85, 247, 0.08);
}
body .nav-btn.active {
    background: linear-gradient(180deg, rgba(168, 85, 247, 0.18), rgba(168, 85, 247, 0.04));
    border-color: rgba(192, 132, 252, 0.38);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 -22px 30px -22px rgba(168, 85, 247, 0.45);
    border-bottom: 3px solid var(--gold-400) !important;
}
body .nav-btn .nav-icon {
    transition: transform 0.25s var(--ease), filter 0.25s ease;
}
body .nav-btn:hover .nav-icon {
    transform: scale(1.12);
}
body .nav-btn.active .nav-icon {
    filter: drop-shadow(0 0 8px rgba(192, 132, 252, 0.7));
}
body .nav-btn.active span {
    color: var(--gold-200);
}


/* -------------------------------------------------------------
   5. MAIN PANEL + OVERALL TABLE
   ------------------------------------------------------------- */
body .mctier-table-wrapper {
    position: relative;
    background: linear-gradient(180deg, rgba(168, 85, 247, 0.06), transparent 180px), #0c0a14;
    border-color: rgba(190, 160, 255, 0.13);
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.85), 0 0 70px -25px rgba(168, 85, 247, 0.3);
}
body .mctier-table-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(240, 207, 110, 0.6) 30%, rgba(168, 85, 247, 0.7) 70%, transparent);
}

body .inner-content-box {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent 200px), var(--surface-1);
    border-color: rgba(255, 255, 255, 0.06);
}

/* Column headers (#, Player, Region, Tiers) */
#overallView > .grid > div {
    color: var(--text-low);
}

/* Switching views fades in softly */
#overallView,
#gamemodeView {
    animation: viewIn 0.45s var(--ease) backwards;
}

/* Rows */
body .player-row {
    position: relative;
    border-bottom-color: rgba(255, 255, 255, 0.05);
    transition: background 0.25s ease;
}
body .player-row:hover {
    background: linear-gradient(90deg, rgba(168, 85, 247, 0.15), rgba(168, 85, 247, 0.04) 45%, transparent 85%);
}
body .player-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(180deg, var(--purple-400), var(--purple-600));
    transition: opacity 0.25s ease;
}
body .player-row:hover::before {
    opacity: 1;
}

/* Top 3: gold / silver / bronze */
body .player-row[data-rank="1"] {
    background: linear-gradient(90deg, rgba(240, 207, 110, 0.15), rgba(240, 207, 110, 0.04) 38%, transparent 75%);
}
body .player-row[data-rank="1"]:hover {
    background: linear-gradient(90deg, rgba(240, 207, 110, 0.24), rgba(240, 207, 110, 0.07) 42%, transparent 80%);
}
body .player-row[data-rank="1"]::before {
    background: linear-gradient(180deg, var(--gold-200), var(--gold-500));
}

body .player-row[data-rank="2"] {
    background: linear-gradient(90deg, rgba(203, 213, 225, 0.11), rgba(203, 213, 225, 0.03) 38%, transparent 75%);
}
body .player-row[data-rank="2"]:hover {
    background: linear-gradient(90deg, rgba(203, 213, 225, 0.19), rgba(203, 213, 225, 0.05) 42%, transparent 80%);
}
body .player-row[data-rank="2"]::before {
    background: linear-gradient(180deg, #f1f5f9, #94a3b8);
}

body .player-row[data-rank="3"] {
    background: linear-gradient(90deg, rgba(234, 152, 84, 0.12), rgba(234, 152, 84, 0.03) 38%, transparent 75%);
}
body .player-row[data-rank="3"]:hover {
    background: linear-gradient(90deg, rgba(234, 152, 84, 0.2), rgba(234, 152, 84, 0.05) 42%, transparent 80%);
}
body .player-row[data-rank="3"]::before {
    background: linear-gradient(180deg, #f0b27a, #c2793a);
}

/* Rank box */
body .rank-box {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
body .player-row[data-rank="1"] .rank-box { filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.4)); }
body .player-row[data-rank="2"] .rank-box { filter: drop-shadow(0 0 10px rgba(203, 213, 225, 0.25)); }
body .player-row[data-rank="3"] .rank-box { filter: drop-shadow(0 0 10px rgba(234, 152, 84, 0.3)); }
body .player-row:not([data-rank="1"]):not([data-rank="2"]):not([data-rank="3"]) .rank-box {
    background-color: rgba(255, 255, 255, 0.03);
    box-shadow: inset 3px 0 0 rgba(168, 85, 247, 0.5);
    color: var(--text-mid);
}

/* Player head */
body .player-row .bust-render {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.55));
    transition: transform 0.3s var(--ease);
}
body .player-row:hover .bust-render {
    transform: translateY(-2px) scale(1.07);
}

/* Name + title/points */
body .player-row > div:nth-child(2) > div:first-child {
    letter-spacing: 0.01em;
}
body .player-row[data-rank="1"] > div:nth-child(2) > div:first-child {
    background: linear-gradient(90deg, #fff6d6, var(--gold-300) 45%, var(--gold-500));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 12px rgba(240, 207, 110, 0.25));
}
body .player-row[data-rank="2"] > div:nth-child(2) > div:first-child {
    background: linear-gradient(90deg, #ffffff, #cbd5e1 55%, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
body .player-row[data-rank="3"] > div:nth-child(2) > div:first-child {
    background: linear-gradient(90deg, #ffe6cf, #e8a96b 55%, #c2793a);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
body .player-row .combat-title {
    color: var(--text-mid);
}
body .player-row .combat-title + span {
    color: var(--text-low);
}
body .player-row .combat-icon {
    filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.35));
}

/* Region badge */
body .region-badge {
    letter-spacing: 0.06em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 10px rgba(0, 0, 0, 0.35);
}

/* Tier chips */
body .tier-item {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    border-color: rgba(255, 255, 255, 0.09);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s var(--ease);
}
body .tier-item:hover {
    border-color: rgba(192, 132, 252, 0.6);
    box-shadow: 0 6px 18px -6px rgba(168, 85, 247, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
}
body .tier-icon {
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.55));
}
body .tier-label.ht {
    color: var(--gold-300) !important;
    text-shadow: 0 0 10px rgba(240, 207, 110, 0.4);
}
body .tier-label.lt {
    color: #b9b3d0 !important;
}
body .tier-slot-empty {
    border-color: rgba(168, 85, 247, 0.4);
    background: rgba(255, 255, 255, 0.012);
}


/* -------------------------------------------------------------
   6. GAMEMODE VIEW (Tier 1-5 columns)
   ------------------------------------------------------------- */
#tierColumns {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(190, 160, 255, 0.14);
    box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.85);
}
#tierColumns > div {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 140px), var(--surface-1);
}
#tierColumns > div > div:first-child {
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
#tierColumns > div:nth-child(1) > div:first-child {
    background: linear-gradient(180deg, #8a5d12, #5a3a08);
    color: var(--gold-200);
    box-shadow: inset 0 1px 0 rgba(255, 236, 170, 0.35);
}
#tierColumns > div:nth-child(2) > div:first-child {
    background: linear-gradient(180deg, #5b6472, #3b424e);
    color: #f1f5f9;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
#tierColumns > div:nth-child(3) > div:first-child {
    background: linear-gradient(180deg, #8a4a1d, #53290f);
    color: #fcd3a8;
    box-shadow: inset 0 1px 0 rgba(255, 200, 150, 0.3);
}
#tierColumns > div:nth-child(4) > div:first-child {
    background: linear-gradient(180deg, #2c2447, #1a1530);
    color: var(--purple-300);
    box-shadow: inset 0 1px 0 rgba(216, 180, 254, 0.18);
}
#tierColumns > div:nth-child(5) > div:first-child {
    background: linear-gradient(180deg, #1f1b2e, #13111d);
    color: var(--text-mid);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
#tierColumns .text-center {
    color: var(--text-low);
}

body .gamemode-player-card {
    background: rgba(255, 255, 255, 0.018);
    border-bottom-color: rgba(255, 255, 255, 0.045);
}
body .gamemode-player-card:hover {
    background: linear-gradient(90deg, rgba(168, 85, 247, 0.18), rgba(168, 85, 247, 0.05));
}
body .gamemode-player-card img {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}


/* -------------------------------------------------------------
   7. INFORMATION DROPDOWN
   ------------------------------------------------------------- */
body #infoDropdown {
    background: linear-gradient(180deg, rgba(25, 19, 40, 0.97), rgba(12, 9, 20, 0.97));
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-color: rgba(168, 85, 247, 0.3);
    border-radius: 16px;
    box-shadow: 0 30px 70px -10px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(240, 207, 110, 0.06), 0 0 50px -15px rgba(168, 85, 247, 0.38);
    animation: dropIn 0.22s var(--ease) backwards;
}
#infoDropdown > div:first-child {
    background: rgba(5, 4, 10, 0.55);
    border-bottom-color: rgba(255, 255, 255, 0.07);
}
#infoDropdown button {
    border-radius: 10px;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
#infoDropdown #tabTitles[class*="bg-[#21262d]"],
#infoDropdown #tabPoints[class*="bg-[#21262d]"] {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.4), rgba(168, 85, 247, 0.18));
    border-color: rgba(192, 132, 252, 0.5);
}
#contentPoints span[class*="bg-[#21262d]"] {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.1);
}


/* -------------------------------------------------------------
   8. PLAYER MODAL
   ------------------------------------------------------------- */
body #playerModalOverlay {
    background: radial-gradient(circle at 50% 30%, rgba(124, 58, 237, 0.2), transparent 60%), rgba(4, 3, 8, 0.84);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease backwards;
}

body .modal-content {
    background:
        radial-gradient(420px 220px at 50% 0%, rgba(168, 85, 247, 0.2), transparent 70%) padding-box,
        linear-gradient(#0f0c19, #0b0913) padding-box,
        linear-gradient(145deg, rgba(240, 207, 110, 0.8), rgba(168, 85, 247, 0.55) 45%, rgba(240, 207, 110, 0.2)) border-box;
    border: 1px solid transparent;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.9), 0 0 70px -20px rgba(168, 85, 247, 0.4);
    animation: modalIn 0.32s var(--ease) backwards;
}

body .modal-bust {
    border-color: rgba(212, 164, 55, 0.85);
    background: radial-gradient(circle at 50% 35%, #231a3a, #120e1d);
    box-shadow: 0 0 0 5px rgba(212, 164, 55, 0.12), 0 14px 34px rgba(0, 0, 0, 0.55), 0 0 36px rgba(168, 85, 247, 0.3);
}

body #modalName {
    background: linear-gradient(180deg, #ffffff, #d9cdf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body .modal-rank-badge {
    background: linear-gradient(135deg, rgba(240, 207, 110, 0.18), rgba(212, 164, 55, 0.06));
    border-color: rgba(240, 207, 110, 0.7);
    color: var(--gold-300);
    box-shadow: 0 0 20px -6px rgba(240, 207, 110, 0.5);
}

.modal-content .h-12 {
    background: linear-gradient(90deg, rgba(240, 207, 110, 0.13), rgba(168, 85, 247, 0.06));
    border-color: rgba(240, 207, 110, 0.22);
}
body .modal-rank-slant {
    background: linear-gradient(180deg, var(--gold-200), var(--gold-500) 60%, var(--gold-600));
}

.modal-content h3 {
    color: var(--text-low);
}
body .modal-tier-grid {
    background: rgba(255, 255, 255, 0.025);
    border-color: rgba(255, 255, 255, 0.07);
}

body .modal-close {
    transition: color 0.2s ease, transform 0.3s var(--ease);
}
body .modal-close:hover {
    color: var(--gold-300);
    transform: rotate(90deg);
}


/* -------------------------------------------------------------
   9. ANIMATIONS
   ------------------------------------------------------------- */
@keyframes logoShine {
    0%, 100% { background-position: 100% 0; }
    50%      { background-position: 0 0; }
}
@keyframes viewIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to   { opacity: 1; transform: none; }
}
@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}