:root {
    --bg-dark: #0f111a;
    --card-bg: #1a1d29;
    --accent: #00d4ff;
    --accent-hover: #008fb3;
    --text-main: #e0e0e0;
    --text-dim: #94a3b8;
    --danger: #ff4d4d;
    --success: #00ff88;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.game-ui {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.dashboard-container {
    width: 100%;
    max-width: 800px;
}

/* Header & Stats */
.user-header {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.welcome-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.highlight {
    color: var(--accent);
}

.stats-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 8px;
}

.label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.value {
    font-size: 1.5rem;
    font-weight: bold;
}

.value.money {
    color: var(--success);
}

/* Energy Bar */
.progress-bg {
    height: 6px;
    background: #333;
    border-radius: 10px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    transition: width 0.3s ease;
}

/* Jobs Section */
h3 {
    margin-bottom: 1rem;
    color: var(--text-dim);
    text-transform: uppercase;
    font-size: 0.9rem;
}

.jobs-grid {
    display: grid;
    gap: 12px;
}

.job-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s;
}

.job-card:hover {
    transform: translateX(5px);
    border-color: var(--accent);
}

.job-info {
    display: flex;
    flex-direction: column;
}

.job-name {
    font-weight: bold;
    font-size: 1.1rem;
}

.job-cost {
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* Button */
.work-btn {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.2s;
}

.work-btn:hover {
    background: var(--accent);
    color: var(--bg-dark);
}

.logout-link {
    color: var(--danger);
    text-decoration: none;
    font-size: 0.85rem;
}

.logout-link:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 600px) {
    .stats-bar { grid-template-columns: 1fr; }
    .job-card { flex-direction: column; align-items: flex-start; gap: 15px; }
    .work-btn { width: 100%; }
}

/* FULLSCREEN OVERLAY */
.modal {
    position: fixed; /* KEY: makes it float */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;

    background: rgba(0, 0, 0, 0.75);

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 9999; /* VERY IMPORTANT */
}

/* MODAL BOX */
.modal-content {
    background: #1a1a1a;
    padding: 25px;
    border-radius: 12px;
    width: 320px;
    max-width: 90%;

    color: #fff;
    text-align: center;

    box-shadow: 0 0 25px rgba(0,0,0,0.8);
    animation: popIn 0.2s ease;
}

/* SMALL POP ANIMATION */
@keyframes popIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.item-drop { margin-top: 15px; padding: 10px; background: #222; border-radius: 8px; display: flex; align-items: center; gap: 10px; justify-content: center; } .item-img { width: 40px !important; height: 40px !important; object-fit: contain; }

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.inv-item {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 10px;
    text-align: center;

    border: 1px solid rgba(255,255,255,0.05);

    transition: 0.2s;
}

.inv-item:hover {
    transform: scale(1.05);
}

.inv-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 5px;
}

.inv-name {
    font-size: 0.8rem;
    color: var(--text-main);
}

.inv-qty {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.common {
    box-shadow: none;
}

.uncommon {
    border-color: #00ff88;
    box-shadow: 0 0 8px rgba(0,255,136,0.4);
}

.rare {
    border-color: #00d4ff;
    box-shadow: 0 0 10px rgba(0,212,255,0.5);
}

.legendary {
    border-color: gold;
    box-shadow: 0 0 15px rgba(255,215,0,0.7);
}

grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));

.equipped-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.inventory-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.inv-list-item {
    background: var(--card-bg);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.inv-list-item:hover {
    transform: translateX(3px);
}

.list-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.list-img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.item-details {
    display: none;
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.inv-list-item.open .item-details {
    display: block;
}

/* BATTLE STATS GRID */
.battle-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

/* TOTAL STAT HIGHLIGHT */
.stat-card.total {
    border: 1px solid gold;
    box-shadow: 0 0 10px rgba(255,215,0,0.4);
}

.gym-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.gym-card {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
    transition: 0.2s;
}

.gym-card:hover {
    transform: scale(1.03);
    border-color: var(--accent);
}

.badge-big-glow {
    width: 45px;
    height: 45px;
    margin-left: 5px;
    filter: drop-shadow(0 0 1px gold);
    animation: badgeGlow 3.8s infinite ease-in-out;
    cursor: help;
    transition: transform 2.2s ease;
}

.badge-big-glow:hover {
    transform: scale(.90);
}

/* MOBILE FIX */
@media (max-width: 600px) {
    .badge-big-glow {
        width: 14px;
        height: 14px;
        margin-left: 3px;
    }
}

@keyframes badgeGlow {
    0% {
        filter: drop-shadow(0 0 2px gold);
    }
    50% {
        filter: drop-shadow(0 0 5px gold) drop-shadow(0 0 8px yellow);
    }
    100% {
        filter: drop-shadow(0 0 2px gold);
    }
}

/* LAYOUT */
.game-layout {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: 220px;
    background: #111;
    border-right: 2px solid #222;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* TITLE */
.sidebar-title {
    color: gold;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
}

/* NAV ITEM */
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    text-decoration: none;
    color: #ccc;
    background: #1a1a1a;
    transition: 0.2s;
}

/* ICON */
.nav-item img {
    width: 24px;
    height: 24px;
}

/* HOVER */
.nav-item:hover {
    background: #222;
    color: white;
}

/* ACTIVE PAGE */
.nav-item.active {
    background: #ffcc00;
    color: black;
    font-weight: bold;
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    padding: 20px;
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }

    .nav-item span {
        display: none;
    }

    .nav-item {
        justify-content: center;
    }
}

.nav-locked {
    opacity: 0.4;
    pointer-events: none;
}

.inv-grid {
    display:grid;
    grid-template-columns: repeat(3, 1fr);
    gap:12px;
}

.slot {
    background:#1a1a1a;
    padding:12px;
    border-radius:10px;
    min-height:150px;

    display:flex;
    flex-direction:column;
    justify-content:space-between;
}

.slot strong {
    font-size:14px;
    color:#aaa;
    letter-spacing:1px;
}

.slot .item-name {
    color:#4db8ff;
    cursor:pointer;
    font-weight:bold;
    margin-bottom:5px;
    display:block;
}

.slot .item-stats {
    font-size:13px;
    color:#ccc;
    margin-bottom:8px;
}

.slot form {
    margin-top:auto;
}

.slot button {
    width:100%;
    padding:6px;
    background:#222;
    border:1px solid #555;
    color:#fff;
    border-radius:6px;
    cursor:pointer;
}

.slot button:hover {
    background:#333;
}

select {
    width:100%;
    padding:6px;
    background:#111;
    color:#fff;
    border-radius:6px;
    margin-bottom:6px;
}

