:root {
    --primary: #00d2ff;
    --secondary: #3a7bd5;
    --accent: #ff0055;
    --bg-dark: #121212;
    --glass: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: white;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.screen {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    transition: opacity 0.5s;
}

.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

/* Auth / Login */
#login-screen {
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #2a2a2a, #000);
    transition: background 0.8s ease;
}

#login-screen.register-active {
    background: radial-gradient(circle at center, #30101a, #000);
}

.login-box {
    text-align: center;
    width: 80%;
    transition: transform 0.5s ease;
}

.login-box.register-mode h1 {
    color: var(--accent);
    text-shadow: 0 0 15px rgba(255, 0, 85, 0.4);
}

.login-box.register-mode button {
    background: linear-gradient(45deg, var(--accent), #ff6600);
    box-shadow: 0 4px 15px rgba(255, 0, 85, 0.4);
}

.login-box input {
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    border-radius: 25px;
    border: none;
    background: #333;
    color: white;
    font-size: 1.1rem;
    text-align: center;
}

.login-box button,
.action-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, var(--secondary), var(--primary));
    border: none;
    border-radius: 25px;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.4);
    margin-top: 10px;
}

/* HUD Top */
.hud-top {
    padding: 20px;
    background: var(--glass);
    backdrop-filter: blur(10px);
    z-index: 10;
    transition: padding 0.3s;
}

@media (max-width: 600px) {
    .hud-top {
        padding-top: 60px;
        /* Space for mobile status bar */
    }
}

.hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.user-details-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.username-text {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--primary);
    text-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
}

.level-badge {
    background: var(--accent);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9rem;
}

.btn-logout {
    background: rgba(255, 0, 85, 0.15);
    border: 1px solid var(--accent);
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-logout:hover {
    background: var(--accent);
    box-shadow: 0 0 15px var(--accent);
    transform: translateY(-2px);
}

.xp-bar-container {
    width: 100%;
    height: 8px;
    background: #444;
    border-radius: 4px;
    overflow: hidden;
}

.xp-bar {
    height: 100%;
    background: #00ff88;
    transition: width 0.5s ease;
}

/* Game View */
.game-view {
    flex: 1;
    position: relative;
    background: url('https://www.transparenttextures.com/patterns/cubes.png'), #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#scanner-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
    top: 0;
    animation: scan 3s infinite linear;
    opacity: 0.5;
}

@keyframes scan {
    0% {
        top: 0;
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

#message-area {
    color: #888;
    font-size: 0.9rem;
    position: absolute;
    bottom: 20px;
}

/* Spawning */
#spawn-container {
    position: absolute;
    width: 100%;
    height: 100%;
}

.spawn-item {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: absolute;
}

.rarity-comun {
    border-color: #aaa;
    box-shadow: 0 0 10px #aaa;
}

.rarity-raro {
    border-color: #00d2ff;
    box-shadow: 0 0 15px #00d2ff;
}

/* Capture Modal Specifics */
.capture-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    padding: 40px 30px;
    transition: all 0.5s ease;
}

/* Rarity Background Glows */
.modal-rarity-comun {
    box-shadow: 0 0 40px rgba(170, 170, 170, 0.2);
}

.modal-rarity-raro {
    box-shadow: 0 0 50px rgba(0, 210, 255, 0.3);
    border-color: var(--primary);
}

.modal-rarity-epico {
    box-shadow: 0 0 60px rgba(210, 0, 255, 0.4);
    border-color: #d200ff;
}

.modal-rarity-legendario {
    box-shadow: 0 0 80px rgba(255, 215, 0, 0.5);
    border-color: #ffd700;
}

.capture-icon-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.large-icon {
    font-size: 5rem;
    z-index: 2;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
    animation: floatingIcon 3s infinite ease-in-out;
}

@keyframes floatingIcon {

    0%,
    100% {
        transform: translateY(0) scale(1.1);
    }

    50% {
        transform: translateY(-10px) scale(1.2);
    }
}

.capture-shine {
    position: absolute;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.1), transparent 40%);
    animation: rotateShine 5s infinite linear;
    top: -50%;
    left: -50%;
    pointer-events: none;
}

@keyframes rotateShine {
    to {
        transform: rotate(360deg);
    }
}

#btn-capture {
    margin-top: 25px;
    background: linear-gradient(45deg, #00ff88, #00d2ff);
    color: #000;
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 20px rgba(0, 255, 136, 0.4);
}

.rarity-label {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

/* Inventory Styles */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 10px;
    max-height: 350px;
    overflow-y: auto;
}

.inventory-slot {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 10px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.2s;
}

.inventory-slot:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

.slot-icon {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.slot-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--primary);
    color: #000;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.slot-name {
    font-size: 0.7rem;
    color: #aaa;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Backpack Floating Icon */
.backpack-trigger {
    position: fixed;
    right: 20px;
    top: 150px;
    /* Below HUD */
    width: 60px;
    height: 60px;
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 50;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: floatBackpack 4s infinite ease-in-out;
}

.backpack-trigger:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px var(--primary);
}

@keyframes floatBackpack {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.rarity-border-comun {
    border-bottom: 3px solid #aaa;
}

.rarity-border-raro {
    border-bottom: 3px solid #00d2ff;
}

.rarity-border-epico {
    border-bottom: 3px solid #d200ff;
}

.rarity-border-legendario {
    border-bottom: 3px solid #ffd700;
}

.secondary-btn {
    border: 1px solid #555;
    background: transparent;
    color: #ccc;
    padding: 10px 20px;
    border-radius: 20px;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background: #222;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    width: 80%;
    border: 1px solid #444;
}

.large-icon {
    font-size: 4rem;
    margin: 20px 0;
    font-weight: bold;
    color: var(--primary);
}

.btn-close {
    margin-top: 10px;
    background: transparent;
    color: #888;
    border: none;
    text-decoration: underline;
}