@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Background layers */
    --bg-abyss:    #08060f;
    --bg-deep:     #0e0b1a;
    --bg-surface:  #161225;
    --bg-elevated: #1e1832;
    --bg-glass:    rgba(14, 11, 26, 0.7);

    /* Purple spectrum */
    --purple-100:  #e8dff5;
    --purple-200:  #c4b5fc;
    --purple-300:  #a78bfa;
    --purple-400:  #8b5cf6;
    --purple-500:  #7c3aed;
    --purple-600:  #6d28d9;
    --purple-glow: rgba(139, 92, 246, 0.15);

    /* Accent */
    --accent-pink: #d946ef;
    --accent-blue: #818cf8;
    --accent-cyan: #22d3ee;

    /* Text */
    --text-primary: #ede9fe;
    --text-body:    #a5a0b8;
    --text-muted:   #5c566e;

    /* Status */
    --tag-new:  #d946ef;
    --tag-upd:  #a78bfa;
    --tag-hot:  #f43f5e;

    /* Timing */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --dur-fast: 0.15s;
    --dur-normal: 0.2s;

    /* Fonts */
    --font-body: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Cascadia Code', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background-color: var(--bg-abyss);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    position: relative;
}

/* ═══════ ANIMATED BACKGROUND ═══════ */

body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}
body::before {
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2), transparent 70%);
    top: -200px; left: -100px;
    animation: drift1 20s ease-in-out infinite alternate;
}
body::after {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(217, 70, 239, 0.15), transparent 70%);
    bottom: -150px; right: -100px;
    animation: drift2 25s ease-in-out infinite alternate;
}

@keyframes drift1 {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(80px, 60px) scale(1.1); }
}
@keyframes drift2 {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-60px, -40px) scale(1.15); }
}

/* ═══════ LAYOUT ═══════ */

.container {
    max-width: 1100px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* ═══════ HEADER ═══════ */

header {
    text-align: center;
    padding: 36px 20px 20px;
    flex-shrink: 0;
    z-index: 10;
    margin-bottom: 12px;
    position: relative;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--purple-500), var(--purple-400), var(--purple-500), transparent);
}

h1 {
    font-family: var(--font-body);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--purple-200), var(--purple-400), var(--accent-pink));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 6s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

h1 span {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Meta chips */
.brand-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-body);
    padding: 4px 14px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 100px;
    background: rgba(139, 92, 246, 0.06);
    backdrop-filter: blur(8px);
    letter-spacing: 0.03em;
}

.meta-divider {
    width: 3px; height: 3px;
    background: var(--purple-500);
    border-radius: 50%;
    opacity: 0.5;
}

.pulse-dot {
    width: 6px; height: 6px;
    background: var(--purple-400);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%  { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0.6); }
    70% { box-shadow: 0 0 0 5px rgba(167, 139, 250, 0); }
    100% { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0); }
}

/* ═══════ CONTROLS ═══════ */

.controls-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    margin-bottom: 6px;
}

.search-bar {
    width: 100%;
    max-width: 420px;
    padding: 9px 18px 9px 38px;
    border-radius: 10px;
    border: 1px solid rgba(139, 92, 246, 0.15);
    background: rgba(22, 18, 37, 0.8);
    backdrop-filter: blur(12px);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    outline: none;
    transition: border-color var(--dur-normal), box-shadow var(--dur-normal);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' fill='%235c566e' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 13px center;
}
.search-bar:focus {
    border-color: var(--purple-400);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1), 0 0 20px rgba(139, 92, 246, 0.05);
}
.search-bar::placeholder { color: var(--text-muted); font-weight: 400; }

.filter-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.filter-btn {
    background: transparent;
    border: 1px solid rgba(139, 92, 246, 0.1);
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: all var(--dur-fast) ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.filter-icon { width: 13px; height: 13px; }

.filter-btn:hover {
    border-color: rgba(139, 92, 246, 0.3);
    color: var(--purple-200);
    background: rgba(139, 92, 246, 0.05);
}

.filter-btn.active {
    background: rgba(139, 92, 246, 0.12);
    color: var(--purple-200);
    border-color: var(--purple-400);
}

/* ═══════ SCROLL ═══════ */

.scroll-content {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 6px;
    padding-bottom: 16px;
    scrollbar-gutter: stable;
}
.scroll-content::-webkit-scrollbar { width: 4px; }
.scroll-content::-webkit-scrollbar-track { background: transparent; }
.scroll-content::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.2); border-radius: 2px; }
.scroll-content::-webkit-scrollbar-thumb:hover { background: rgba(139, 92, 246, 0.4); }

/* ═══════ ROLE SECTIONS ═══════ */

.role-section {
    background: transparent;
    border: none;
    margin-bottom: 4px;
    overflow: hidden;
}

.section-header {
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    background: transparent;
    border-bottom: 1px solid rgba(139, 92, 246, 0.06);
    transition: background var(--dur-fast);
}
.section-header:hover { background: rgba(139, 92, 246, 0.03); }

.section-title {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.18em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.role-icon { width: 15px; height: 15px; color: var(--purple-400); opacity: 0.5; }

.toggle-icon {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform var(--dur-normal) var(--ease-out);
    opacity: 0.4;
}
.role-section.collapsed .champ-grid { display: none; }
.role-section.collapsed .toggle-icon { transform: rotate(-90deg); }

/* ═══════ CHAMPION GRID ═══════ */

.champ-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 8px;
    padding: 14px;
}

/* ═══════ CHAMPION CARDS ═══════ */

@keyframes cardReveal {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.champ-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-surface);
    border: 1px solid rgba(139, 92, 246, 0.06);
    display: flex;
    flex-direction: column;
    animation: cardReveal 0.35s var(--ease-out) both;
    transition:
        transform var(--dur-fast) var(--ease-out),
        box-shadow 0.25s ease,
        border-color 0.25s ease;
    transform-style: preserve-3d;
    perspective: 600px;
}

/* Shimmer line at top */
.champ-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--purple-400), var(--accent-pink), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 3;
}

/* Glow backdrop */
.champ-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(139, 92, 246, 0.08) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 1;
    pointer-events: none;
}

.champ-card:hover {
    transform: translateY(-6px);
    border-color: rgba(139, 92, 246, 0.25);
    box-shadow:
        0 8px 24px rgba(139, 92, 246, 0.12),
        0 0 0 1px rgba(139, 92, 246, 0.08);
}
.champ-card:hover::before { opacity: 1; }
.champ-card:hover::after { opacity: 1; }

.champ-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    filter: brightness(0.75) saturate(0.85);
    transition: filter 0.3s ease, transform 0.4s var(--ease-out);
    position: relative;
    z-index: 2;
}
.champ-card:hover .champ-img {
    filter: brightness(1) saturate(1.1);
    transform: scale(1.08);
}

.champ-name {
    padding: 5px 4px 7px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    letter-spacing: 0.02em;
    transition: color var(--dur-normal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 2;
}
.champ-card:hover .champ-name { color: var(--purple-200); }

/* ═══════ BADGES ═══════ */

.badge {
    position: absolute;
    top: 5px; right: 5px;
    font-family: var(--font-body);
    font-size: 0.55rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.06em;
    z-index: 4;
    text-transform: uppercase;
    color: white;
}
.badge.new {
    background: rgba(217, 70, 239, 0.9);
    box-shadow: 0 0 12px rgba(217, 70, 239, 0.4);
}
.badge.upd {
    background: rgba(139, 92, 246, 0.9);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
}
.badge.hot {
    background: rgba(244, 63, 94, 0.9);
    box-shadow: 0 0 12px rgba(244, 63, 94, 0.3);
}

/* Persistent glow for tagged cards */
.champ-card:has(.badge.new) { border-color: rgba(217, 70, 239, 0.2); }
.champ-card:has(.badge.upd) { border-color: rgba(139, 92, 246, 0.2); }
.champ-card:has(.badge.hot) { border-color: rgba(244, 63, 94, 0.2); }

/* ═══════ MODAL ═══════ */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(8, 6, 15, 0.85);
    backdrop-filter: blur(16px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: rgba(14, 11, 26, 0.95);
    backdrop-filter: blur(24px);
    width: 90%;
    max-width: 520px;
    border: 1px solid rgba(139, 92, 246, 0.12);
    border-radius: 14px;
    position: relative;
    padding: 0;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow:
        0 0 0 1px rgba(139, 92, 246, 0.05),
        0 24px 64px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(139, 92, 246, 0.06);
    opacity: 0;
}

.modal-content.animate-entry {
    animation: modalEnter 0.25s var(--ease-out) forwards;
}

/* Purple gradient line at top of modal */
.modal-content::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--purple-500), var(--accent-pink), var(--purple-500));
    z-index: 2;
}

.modal-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.08);
    position: relative;
    overflow: hidden;
}

.modal-header::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.06), transparent);
    animation: shimmer 0.8s ease 0.15s forwards;
}

#modalChampImg {
    width: 56px; height: 56px;
    border-radius: 10px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.1);
    object-fit: cover;
    z-index: 2;
}

#modalTitle {
    font-family: var(--font-body);
    color: var(--purple-200);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.close-modal {
    position: absolute;
    top: 12px; right: 16px;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    transition: color var(--dur-fast);
    z-index: 10;
    line-height: 1;
}
.close-modal:hover { color: var(--purple-300); }

.modal-body { padding: 20px 24px; }

.log-entry {
    margin-bottom: 18px;
    border-left: 2px solid var(--purple-500);
    padding-left: 14px;
}

.log-meta {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--purple-400);
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
}

.log-list { list-style: none; }
.log-list li {
    font-size: 0.8rem;
    color: var(--text-body);
    margin-bottom: 3px;
    position: relative;
    padding-left: 12px;
    line-height: 1.5;
}
.log-list li::before {
    content: "";
    width: 4px; height: 4px;
    background: var(--purple-400);
    border-radius: 50%;
    position: absolute;
    left: 0;
    top: 8px;
}

.no-logs-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 30px;
    text-align: center;
}
.no-logs-message p { color: var(--text-muted); font-size: 0.85rem; line-height: 1.5; }
.no-logs-message i { font-size: 1.4rem; color: var(--purple-400); }

/* ═══════ ANIMATIONS ═══════ */

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes modalEnter {
    from { opacity: 0; transform: scale(0.97) translateY(6px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes shimmer {
    0%   { left: -100%; }
    100% { left: 200%; }
}

/* ═══════ SCROLLBAR (Firefox) ═══════ */
.scroll-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.2) transparent;
}
