:root {
    --bg-dark: #0f1115;
    --bg-card: #161b22;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --accent: #58a6ff;
    --accent-glow: rgba(88, 166, 255, 0.4);
    --border: #30363d;
    --danger: #da3633;
    --success: #238636;

    --slot-size: 80px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

/* Background & Animation */
@keyframes aurora {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    height: 100vh;
    overflow: hidden;
    /* subtle texture overlay */
    background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
}

/* Utils */
.hidden {
    display: none !important;
}

.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 10px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 15px var(--accent-glow);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* Loading */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-dark);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Login Screen - Cinematic */
#login-screen {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1a0b0b 0%, #000000 100%);
    /* Dark warm void to match logo */
    position: relative;
    overflow: hidden;
}

#canvas-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.hero {
    text-align: center;
    max-width: 1000px;
    padding: 20px;
    z-index: 10;
    position: relative;
    /* No box background - let it float */
}

.guild-logo {
    max-width: 600px;
    /* Massive */
    width: 90vw;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 30px rgba(255, 91, 91, 0.4));
    /* Warm glow */
    animation: floatLogo 6s ease-in-out infinite;
}

@keyframes floatLogo {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 2rem;
    line-height: 1.1;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
}

.hero .highlight {
    margin-bottom: 2rem;
}

.discord-icon {
    width: 24px;
    height: 24px;
}

/* Dashboard */
#dashboard-screen {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.navbar {
    height: 60px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo {
    height: 40px;
    width: auto;
    margin-right: 10px;
    filter: drop-shadow(0 0 5px rgba(88, 166, 255, 0.3));
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #333;
    background-size: cover;
}

.username {
    font-weight: 600;
}

.nav-center {
    display: flex;
    gap: 20px;
}

.nav-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    padding: 5px 0;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -18px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
}

main {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.tab-content {
    position: absolute;
    inset: 0;
    padding: 20px;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.tab-content.active {
    opacity: 1;
    pointer-events: all;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.user-details-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-dark {
    padding: 8px 12px;
    background: #0d1117;
    border: 1px solid var(--border);
    color: white;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.2s;
}

.input-dark:focus {
    border-color: var(--accent);
}

/* Profile Loadout */
.loadout-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    height: calc(100vh - 160px);
}

.selection-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.asset-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.filter-btn {
    flex: 1;
    padding: 8px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
}

.filter-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.asset-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 10px;
    padding-right: 5px;
    align-content: start;
}

/* Draggable Items */
.draggable-item {
    width: 70px;
    height: 80px;
    background: #222;
    border-radius: 6px;
    cursor: grab;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 5px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.draggable-item:hover {
    border-color: var(--accent);
    background: #2a3038;
}

.draggable-item img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    pointer-events: none;
}

.draggable-item span {
    font-size: 10px;
    text-align: center;
    margin-top: 4px;
    line-height: 1.1;
    color: #ccc;
}

.draggable-item.dragging {
    opacity: 0.5;
}

.slots-panel {
    padding: 10px;
    overflow-y: auto;
}

.slot-group {
    margin-bottom: 30px;
}

.slot-group h3 {
    margin-bottom: 15px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.slot-row {
    display: flex;
    gap: 20px;
}

.slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    max-width: 800px;
}

.slot {
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px dashed var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s;
}

.slot:hover {
    border-color: var(--text-secondary);
}

.slot.drag-over {
    border-color: var(--accent);
    background: rgba(88, 166, 255, 0.1);
    transform: scale(1.05);
}

.slot .placeholder {
    font-size: 11px;
    color: #444;
}

/* Item inside slot */
.slot-item {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.slot-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.slot-item .remove-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.slot-item:hover .remove-btn {
    opacity: 1;
}


/* Planner */
.planner-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
    height: calc(100vh - 160px);
}

.roster-sidebar {
    background: var(--bg-card);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

#roster-search {
    width: 100%;
    padding: 8px;
    background: #0d1117;
    border: 1px solid var(--border);
    color: white;
    border-radius: 4px;
    margin: 10px 0;
    outline: none;
}

.user-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #21262d;
    border-radius: 4px;
    cursor: grab;
    user-select: none;
    border: 1px solid transparent;
}

.user-card:hover {
    border-color: var(--text-secondary);
}

.card-left {
    position: relative;
    width: 30px;
    height: 30px;
}

.card-left img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    pointer-events: none;
}

.role-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: black;
    font-weight: bold;
    cursor: pointer;
    border: 1px solid white;
}

.user-info {
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
}

.user-details {
    font-size: 10px;
    color: #8b949e;
    display: flex;
    gap: 5px;
}

.mini-icon {
    width: 12px;
    height: 12px;
}

.groups-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    overflow-y: auto;
}

.group-column {
    background: rgba(22, 27, 34, 0.5);
    border-radius: 8px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.group-header {
    padding: 15px;
    font-weight: 800;
    text-align: center;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
}

.zerg-header {
    color: #ff7b72;
    border-bottom-color: rgba(255, 123, 114, 0.3);
}

.kill-header {
    color: #d2a8ff;
    border-bottom-color: rgba(210, 168, 255, 0.3);
}

.jungle-header {
    color: #7ee787;
    border-bottom-color: rgba(126, 231, 135, 0.3);
}

.group-body {
    flex: 1;
    padding: 10px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.group-body.drag-over {
    background: rgba(255, 255, 255, 0.05);
}

/* Admin */
.admin-panel {
    max-width: 600px;
}

.add-admin-box,
.admin-list-box {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.input-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

select {
    flex: 1;
    padding: 8px;
    background: #0d1117;
    color: white;
    border: 1px solid var(--border);
    border-radius: 4px;
}