/* ===================== */
/* 🌍 GLOBAL */
/* ===================== */

*{ box-sizing:border-box; }

body{
    background-color:#000;
    color:white;
    font-family:'Georgia', serif;
    margin:0;
    padding:15px 10px;
    position:relative;

    opacity:0;
    transition:opacity 0.25s ease;
}

body::before{
    content:"";
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.55);
    z-index:0;
    pointer-events:none;
}

body.loaded{ opacity:1; }
body.fade-out{ opacity:0; }

/* BACKGROUND GLOW */
body::after{
    content:"";
    position:fixed;
    inset:0;
    background:
        radial-gradient(circle at 50% 20%, rgba(255,200,80,0.25), transparent 25%),
        radial-gradient(circle at 20% 70%, rgba(255,150,50,0.12), transparent 30%),
        radial-gradient(circle at 80% 80%, rgba(255,220,120,0.08), transparent 30%);
    animation:bgGlowMove 12s ease-in-out infinite alternate;
    pointer-events:none;
    z-index:0;
}

@keyframes bgGlowMove{
    from{ transform:translateY(0px); }
    to{ transform:translateY(-15px); }
}

/* Kad turinys būtų virš fono sluoksnių */
.top,
.box,
.btn,
.btn-small,
.bar,
.currency-combo,
.city-box,
.chat-box,
.inventory-grid,
.item-card,
.mob,
.title,
.death-screen,
.chat-input{
    position:relative;
    z-index:1;
}

/* ===================== */
/* 📦 LAYOUT */
/* ===================== */

.box{
    background:#111;
    padding:12px;
    margin:10px 0;
    border-radius:12px;
    border:1px solid #333;
}

.title{
    padding:10px;
    font-size:18px;
    text-align:center;
}

.top{
    background:#111;
    padding:12px;
    border-bottom:2px solid #333;
    border-radius:12px;
    margin-bottom:10px;
    text-align:center;
}

/* ===================== */
/* 🔘 BUTTONS */
/* ===================== */

.btn{
    display:block;
    width:100%;
    padding:12px;
    margin:8px 0;
    border-radius:12px;
    border:1px solid rgba(255,215,0,0.2);
    background:linear-gradient(145deg, rgba(20,20,20,0.95), rgba(5,5,5,0.95));
    color:#e6c36a;
    font-weight:bold;
    text-align:center;
    text-decoration:none;
    transition:0.25s;
}

.btn:hover{
    color:#ffd700;
    border-color:rgba(255,215,0,0.6);
    box-shadow:0 0 15px rgba(255,215,0,0.3);
    transform:scale(1.03);
}

.btn:active{
    transform:scale(0.97);
}

.btn-small{
    display:inline-block;
    padding:5px 8px;
    border-radius:8px;
    font-size:11px;
}

/* ===================== */
/* ❤️ BARS */
/* ===================== */

.bar{
    background:#1a1a1a;
    border-radius:10px;
    height:14px;
    overflow:hidden;
    margin:6px 0;
}

.bar-fill{
    height:100%;
    transition:0.4s ease;
}

/* HP */
.bar-hp .bar-fill{
    background:linear-gradient(90deg,#4caf50,#00ff88);
    box-shadow:0 0 10px #4caf50;
}

/* XP */
.bar-xp .bar-fill{
    background:linear-gradient(90deg,#2196f3,#00e5ff);
    box-shadow:0 0 10px #2196f3;
}

/* ===================== */
/* 💬 CHAT */
/* ===================== */

.chat-box{
    background:#0f1629;
    border:1px solid #333;
    border-radius:12px;
    padding:10px;
    max-height:220px;
    overflow-y:auto;
}

.chat-msg{
    font-size:13px;
    margin-bottom:6px;
}

.chat-user{
    color:#ff7a00;
    font-weight:bold;
}

.chat-time{
    font-size:10px;
    opacity:0.6;
}

.chat-input{
    width:100%;
    padding:10px;
    border-radius:10px;
    border:none;
    margin-top:8px;
}

/* ===================== */
/* 🎒 INVENTORY */
/* ===================== */

.inventory-grid{
    display:grid;
    grid-template-columns:repeat(5,1fr);
    gap:10px;
}

.item-card{
    background:#0f1629;
    border:1px solid #333;
    border-radius:10px;
    padding:6px;
    text-align:center;
    transition:0.2s;
}

.item-card:hover{
    transform:scale(1.05);
    border-color:#ff7a00;
}

/* ===================== */
/* ⚔️ FIGHT */
/* ===================== */

.mob{
    background:#0f1629;
    border:1px solid #333;
    border-radius:12px;
    padding:10px;
}

.win{
    color:gold;
    animation:glow 1s infinite alternate;
}

@keyframes glow{
    from{ text-shadow:0 0 5px gold; }
    to{ text-shadow:0 0 20px gold; }
}

/* ===================== */
/* 🏙 CITY */
/* ===================== */

.city-box{
    position:relative;
    height:140px;
    border-radius:18px;
    overflow:hidden;
    margin:15px 0;
    border:1px solid rgba(255,215,0,0.2);
}

.city-bg{
    position:absolute;
    inset:0;
    background:center/cover;
    filter:brightness(0.4);
}

.city-content{
    position:absolute;
    inset:0;
    display:flex;
    justify-content:center;
    align-items:center;
    flex-direction:column;
}

.city-name{
    font-size:22px;
    color:#ffd700;
    text-shadow:0 0 15px gold;
}

.city-desc{
    font-size:12px;
    color:#ccc;
}

/* ===================== */
/* 💰 CURRENCY */
/* ===================== */

.currency-combo{
    display:flex;
    width:70%;
    margin:12px auto;
    border-radius:16px;
    overflow:hidden;
}

.currency-half{
    flex:1;
    display:flex;
    justify-content:center;
    align-items:center;
    padding:6px;
    font-weight:bold;
}

.gold{
    background:linear-gradient(90deg,#3f2f00,#facc15);
}

.crystal{
    background:linear-gradient(90deg,#1e3a8a,#38bdf8);
}

/* ===================== */
/* 💀 DEATH SCREEN */
/* ===================== */

.death-screen{
    position:fixed;
    inset:0;
    background:black;
    display:flex;
    justify-content:center;
    align-items:center;
}

.death-text{
    font-size:42px;
    color:red;
    text-shadow:0 0 20px red;
}

/* ===================== */
/* ⚡ EFFECTS */
/* ===================== */

.particle{
    position:fixed;
    width:4px;
    height:4px;
    background:gold;
    border-radius:50%;
    animation:floatUp 1s linear forwards;
    z-index:1;
}

@keyframes floatUp{
    from{ transform:translateY(0); opacity:1; }
    to{ transform:translateY(-120px); opacity:0; }
}

/* ===================== */
/* 📱 MOBILE */
/* ===================== */

@media(max-width:600px){
    .inventory-grid{
        grid-template-columns:repeat(2,1fr);
    }
}