/* ===================================================
   RPG ŽAIDIMO DIZAINAS: Finalinė Versija
   =================================================== */

:root {
    --primary-font: 'Roboto', sans-serif;
    --title-font: 'Cinzel Decorative', cursive;
    --dark-bg: #2c303a;
    --overlay-bg: rgba(44, 48, 58, 0.75);
    --card-bg: rgba(62, 68, 81, 0.5);
    --primary-glow-color: #a46cff;
    --secondary-glow-color: #ffc700;
    --text-color: #e0e0e0;
    --text-muted: #b0b8c4;
}

/* ===================================================
   Pagrindiniai Stiliai (Base & Body)
   =================================================== */

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    background-color: var(--dark-bg);
    color: var(--text-color);
    font-family: var(--primary-font);
    margin: 0;
    font-weight: 300;
}

body:not(.game-body) {
    background-image: linear-gradient(rgba(44, 48, 58, 0.5), rgba(44, 48, 58, 0.5)), url('../images/main-background.png');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
}

/* ===================================================
   Bendriniai Elementai
   =================================================== */

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

h2 {
    font-family: var(--title-font);
    color: white;
    font-size: 3em;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 0 15px var(--primary-glow-color);
}

.section-intro {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 60px auto;
    font-size: 1.1em;
    color: var(--text-muted);
}

.cta-button {
    display: inline-block;
    font-family: var(--title-font);
    background: var(--secondary-glow-color);
    color: var(--dark-bg) !important;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(255, 199, 0, 0.5), inset 0 0 5px rgba(255, 255, 255, 0.5);
}

.cta-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(255, 199, 0, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.7);
}

/* ===================================================
   Pagrindinio Puslapio Stiliai (ne žaidimo)
   =================================================== */

body:not(.game-body) header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    background: linear-gradient(to bottom, rgba(44, 48, 58, 0.9), rgba(44, 48, 58, 0));
    padding: 15px 0;
    transition: background 0.3s ease;
}

body:not(.game-body) header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

body:not(.game-body) header .game-logo img {
    height: 50px;
    width: auto;
    display: block;
    transition: transform 0.3s ease;
}

body:not(.game-body) header .game-logo:hover img {
    transform: scale(1.05);
}

body:not(.game-body) header nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 30px;
}

body:not(.game-body) header nav ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1em;
    transition: color 0.3s, text-shadow 0.3s;
}

body:not(.game-body) header nav ul li a:hover {
    color: white;
    text-shadow: 0 0 8px var(--primary-glow-color);
}

main > section {
    padding: 100px 20px;
}

#hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding: 0;
}

.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(44, 48, 58, 0.3) 0%, rgba(44, 48, 58, 0.9) 100%);
    z-index: -1;
}

.game-title {
    font-family: var(--title-font);
    font-size: 6em;
    margin: 0;
    color: white;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
}

.tagline {
    font-size: 1.5em;
    color: var(--text-color);
    margin: 20px 0 40px 0;
}

.content-section {
    position: relative;
}

.content-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-bg);
    z-index: -1;
}

.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background: var(--card-bg);
    border: 1px solid rgba(164, 108, 255, 0.3);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-glow-color);
    box-shadow: 0 0 20px rgba(164, 108, 255, 0.3);
}

.card-image {
    width: 100%;
    height: 250px;
    margin-bottom: 20px;
    background-size: cover;
    background-position: center;
    border-radius: 5px;
}
.card-image.archetype-warrior { background-image: url('../images/karys.png'); }
.card-image.archetype-mage { background-image: url('../images/magas.png'); }
.card-image.archetype-craftsman { background-image: url('../images/amatininkas.png'); }

.card h3 {
    font-family: var(--title-font);
    font-size: 1.8em;
    color: var(--secondary-glow-color);
    margin: 0 0 10px 0;
}

/* ===================================================
   Registracijos Proceso Stiliai
   =================================================== */

#archetype-selection-section,
#race-selection-section,
#registration-section {
    padding: 120px 20px 60px 20px;
    background-color: transparent;
    min-height: calc(100vh - 180px);
}

.archetype-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    max-width: 900px;
    margin: 0 auto;
}

.archetype-card {
    display: flex;
    align-items: center;
    gap: 30px;
    background: var(--card-bg);
    border: 1px solid rgba(164, 108, 255, 0.2);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-color);
    padding: 30px;
    transition: all 0.3s ease;
}
.archetype-card:hover {
    transform: scale(1.03);
    border-color: var(--primary-glow-color);
    box-shadow: 0 0 25px rgba(164, 108, 255, 0.3);
}
.archetype-image img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}
.archetype-content h3 {
    font-family: var(--title-font);
    font-size: 2em;
    color: var(--secondary-glow-color);
    margin: 0 0 10px 0;
}
.archetype-content p {
    margin: 0;
    color: var(--text-muted);
}

.race-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.race-card {
    background: var(--card-bg);
    border: 1px solid rgba(164, 108, 255, 0.2);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-color);
    overflow: hidden;
    transition: all 0.3s ease;
}
.race-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-glow-color);
    box-shadow: 0 0 25px rgba(164, 108, 255, 0.3);
}
.race-card img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}
.race-card h3 {
    font-family: var(--title-font);
    font-size: 1.8em;
    color: var(--secondary-glow-color);
    margin: 15px 0 10px 0;
    text-align: center;
}
.race-card > p {
    padding: 0 20px;
    font-size: 0.9em;
    color: var(--text-muted);
    margin-bottom: 15px;
    text-align: center;
}
.race-card ul {
    list-style: none;
    padding: 0 20px 20px 20px;
    margin: 0;
    font-weight: bold;
    text-align: left;
}
.race-card li { padding: 2px 0; }
.race-card li.bonus { color: #7edc7e; }
.race-card li.penalty { color: #ff6b6b; }
.race-card li.neutral { color: var(--text-muted); }

.back-button {
    color: var(--text-color);
    text-decoration: none;
    font-weight: bold;
    border: 1px solid var(--text-muted);
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s ease;
}
.back-button:hover {
    background-color: var(--secondary-glow-color);
    color: var(--dark-bg);
    border-color: var(--secondary-glow-color);
}

.form-container {
    width: 100%;
    max-width: 800px;
    padding: 40px;
    background: rgba(12, 11, 16, 0.85);
    border: 1px solid rgba(164, 108, 255, 0.3);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    margin: 0 auto;
}

.race-summary {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background-color: rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.race-summary img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
}
.summary-content h3 {
    font-family: var(--title-font);
    color: var(--secondary-glow-color);
    margin-top: 0;
    margin-bottom: 10px;
}
.summary-content p { font-size: 0.9em; color: var(--text-muted); margin-top: 0; margin-bottom: 15px; }
.summary-content ul { list-style: none; padding: 0; margin: 0; font-weight: bold; }
.summary-content li { padding: 2px 0; }

.form-divider {
    border: none;
    height: 1px;
    background-color: rgba(164, 108, 255, 0.2);
    margin: 30px 0;
}

.form-container h2 {
    font-size: 1.8em;
    margin-bottom: 20px;
    text-shadow: none;
    text-align: center;
}

.input-group { margin-bottom: 20px; }
.input-group label { display: block; margin-bottom: 8px; font-weight: bold; font-size: 0.9em; }
.input-group input, .input-group select {
    width: 100%;
    padding: 12px;
    background-color: rgba(0,0,0,0.3);
    border: 1px solid #555;
    border-radius: 5px;
    color: var(--text-color);
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.input-group input:focus, .input-group select:focus {
    outline: none;
    border-color: var(--primary-glow-color);
    box-shadow: 0 0 10px var(--primary-glow-color);
}

.cta-button.form-button { width: 100%; font-size: 1.2em; margin-top: 10px; }

.message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
}
.message.error { background-color: #5d1a1a; border: 1px solid #d44c4c; color: #ffc8c8; }
.message.success { background-color: #1a5d2d; border: 1px solid #4cd47c; color: #c8ffe0; }


/* ===================================================
   ŽAIDIMO SĄSAJOS (GUI) STILIAI
   =================================================== */

.game-body {
    background: #1a1c23;
}

.game-container {
    display: grid;
    grid-template-columns: 80px 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "sidebar header"
        "sidebar main"
        "sidebar footer";
    height: 100vh;
    width: 100vw;
}

.game-header {
    grid-area: header;
    background-color: rgba(10, 10, 15, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
    padding: 8px 30px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.header-main-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-group {
    display: flex;
    align-items: center;
    gap: 15px; /* Tarpas tarp lygio ženkliuko ir vardo/XP bloko */
}

.player-vitals {
    display: flex;
    flex-direction: column; /* Svarbiausia taisyklė: išdėsto elementus vertikaliai */
    align-items: flex-start;
    gap: 4px; /* Mažas tarpelis tarp vardo ir XP juostos */
}

.player-name {
    font-weight: bold;
}

.xp-bar {
    display: flex;
    align-items: center;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.level-badge {
    width: 40px; height: 40px; background: linear-gradient(to top, #3c1053, #ad5389);
    border-radius: 50%; border: 2px solid var(--primary-glow-color);
    box-shadow: 0 0 10px var(--primary-glow-color); display: flex;
    justify-content: center; align-items: center; flex-shrink: 0;
}
.level-number {
    color: white; font-family: var(--title-font); font-size: 1.4em;
    font-weight: 700; text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.xp-bar { display: flex; align-items: center; gap: 8px; }
.xp-label { font-weight: bold; font-size: 0.9em; color: var(--text-muted); }
.progress-bar-background {
    position: relative; width: 200px; height: 12px;
    background-color: rgba(0,0,0,0.5); border-radius: 6px; overflow: hidden;
}
.xp-progress { height: 100%; background: linear-gradient(to right, #6a3093, #a044ff); border-radius: 6px; }
.xp-value {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 0.7em; color: white; font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7); white-space: nowrap;
}

.currency-info { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
.currency-info i { color: var(--secondary-glow-color); }
.header-button { background: none; border: none; color: var(--text-muted); font-size: 1.2em; cursor: pointer; padding: 0; line-height: 1; flex-shrink: 0; }
.system-buttons { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }

.game-sidebar {
    grid-area: sidebar;
    background-color: #111318;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 10px;
    width: 80px;
    transition: width 0.3s ease-in-out;
    z-index: 20;
    position: relative;
}
.game-sidebar:hover { width: 220px; }

.game-logo-small img { width: 50px; margin: 0 auto 30px 15px; display: block; }

.main-nav ul { list-style: none; padding: 0; margin: 0; }
.main-nav .nav-item a {
    color: var(--text-muted); text-decoration: none; display: flex;
    align-items: center; height: 60px; white-space: nowrap; overflow: hidden;
}
.main-nav .nav-item a i {
    font-size: 1.8em; min-width: 80px; text-align: center; flex-shrink: 0;
}
.main-nav .nav-item a span { font-weight: bold; padding-left: 10px; }
.main-nav .nav-item:hover a, .main-nav .nav-item.active a {
    color: white; background-color: rgba(164, 108, 255, 0.1);
}

.game-footer {
    grid-area: footer;
    display: flex;
    align-items: center;
    padding: 0 30px;
    background-color: rgba(10, 10, 15, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}

.status-bars { flex-grow: 1; display: flex; gap: 20px; }
.bar { display: flex; align-items: center; gap: 10px; width: 250px; }
.progress-bar-container { position: relative; flex-grow: 1; height: 15px; background-color: rgba(0,0,0,0.5); border-radius: 8px; }
.bar-value {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 0.8em; color: white; font-weight: bold; text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}
.hp-bar { height: 100%; background: linear-gradient(to right, #d32f2f, #ff6659); border-radius: 8px; }
.mp-bar { height: 100%; background: linear-gradient(to right, #1976d2, #63a4ff); border-radius: 8px; }
.chat-window { flex-basis: 50%; color: var(--text-muted); }

#main-content {
    grid-area: main;
    padding: 30px;
    overflow-y: auto;
}
.game-view { display: none; }
.game-view.active { display: block; }
.game-view h2 { text-align: left; margin: 0 0 30px 0; }

.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.action-card {
    background: var(--card-bg); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
    padding: 30px; text-align: center; cursor: pointer; transition: all 0.3s ease;
}
.action-card:hover { transform: translateY(-5px); border-color: var(--primary-glow-color); }
.action-card h3 { margin: 0 0 10px 0; color: var(--secondary-glow-color); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===================================================
   Naujienų Skilties Stiliai
   =================================================== */

#news .container {
    max-width: 800px; /* Padarome naujienų bloką šiek tiek siauresnį */
}

.news-item {
    display: flex;
    align-items: baseline;
    padding: 20px;
    border-bottom: 1px solid rgba(164, 108, 255, 0.2);
    transition: background-color 0.3s;
}

.news-item:first-of-type {
    border-top: 1px solid rgba(164, 108, 255, 0.2);
}

.news-item:hover {
    background-color: rgba(164, 108, 255, 0.05);
}

.news-date {
    color: var(--text-muted);
    margin-right: 30px;
    font-weight: 700;
    flex-shrink: 0;
}

.news-title {
    font-size: 1.2em;
}

.news-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.news-title a:hover {
    color: var(--primary-glow-color);
}
footer {
    background-color: #1f2229;
    color: var(--text-muted);
    padding: 40px 20px;
    text-align: center;
    font-size: 0.9em;
}

.footer-content p {
    margin: 5px 0;
}
/* ===================================================
   ADAPTYVUS DIZAINAS (RESPONSIVE)
   =================================================== */

.mobile-bottom-nav { display: none; }
.mobile-nav-toggle {
    display: none;
}
/* Valiutos atvaizdavimo patobulinimai */
.currency-item {
    display: flex;
    align-items: center;
    gap: 6px; /* Mažesnis tarpas tarp skaičiaus ir ikonos */
    cursor: help; /* Rodo klaustuko ikoną užvedus pelę, sufleruoja apie title */
}

.currency-amount {
    font-weight: bold;
}

@media (min-width: 851px) { .game-body { overflow: hidden; } }
@media (min-width: 851px) {
    .mobile-nav-toggle {
        display: none !important;
    }
}
@media (max-width: 850px) {

    h2 { font-size: 2.2em; }
    .container { padding: 0 15px; }

    .mobile-nav-toggle { display: block; }
    body:not(.game-body) .desktop-only { display: none; }
    body:not(.game-body) .mobile-only { display: block; }

    .game-body {
        padding-bottom: 60px;
    }
    /* Įdėkite arba pakeiskite šias taisykles @media (max-width: 850px) bloko viduje */

    .inventory-layout {
        flex-direction: column; /* Išdėsto sąrašą ir detales vertikaliai */
        height: auto; /* Leidžia turiniui nustatyti aukštį */
    }

    .inventory-list-container {
        flex: 1 1 auto; /* Leidžia sąrašui užimti reikiamą vietą */
        width: 100%;
    }

    .item-details-panel {
        display: none; /* Pagal nutylėjimą detalės paslėptos */
        width: 100%;
        margin-top: 15px;
    }

    .item-details-panel.mobile-active {
        display: block; /* Parodome detales, kai aktyvuota su JS */
    }

    /* Mygtukas "Grįžti" detalių lange */
    .details-back-button {
        display: inline-block;
        margin-bottom: 15px;
        cursor: pointer;
        color: var(--text-muted);
        font-weight: bold;
    }
    .details-back-button:hover {
        color: white;
    }

    body:not(.game-body) header nav ul {
        display: none;
    }

    /* Parodome hamburger meniu mygtuką */
    body:not(.game-body) .mobile-nav-toggle {
        display: block;
    }

    .header-status-bars .xp-bar {
        display: flex; /* Parodo XP juostą mobiliajame vaizde */
    }
    /* Kai meniu atidarytas (valdoma su JS), jį parodome ir stilizuojame */
    body:not(.game-body) header nav ul[data-visible="true"] {
        display: flex;
        position: fixed;
        z-index: 1000;
        inset: 0 0 0 30%; /* Išvažiuoja iš dešinės */
        flex-direction: column; /* Išdėsto elementus vertikaliai */
        padding: min(20vh, 10rem) 2rem;
        gap: 2rem;
        background: rgba(12, 11, 16, 0.98);
        backdrop-filter: blur(1rem);
    }

    /* Mobilaus meniu mygtukų stilius */
    .nav-button-item {
        margin-top: 15px;
    }
    .nav-button-item a {
        text-align: center;
        display: block; /* Padaro, kad mygtukas užimtų visą plotį */
    }
    .game-container {
        min-height: 100vh; height: auto; display: block;
    }
    .game-sidebar { display: none; }

    .game-header {
        flex-direction: column;
        gap: 10px;
        position: sticky;
        top: 0;
        background-color: #111318;
        padding: 10px 15px;
    }

    .header-main-row {
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }


    .header-status-bars {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    .status-bars, .bar { width: 100%; }

    .game-footer {
        display: block;
        padding: 10px 15px;
        background-color: #111318;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    .game-footer .status-bars { display: none; }

    .chat-window {
        display: block;
        text-align: center;
        font-size: 0.9em;
    }
    .chat-window p { margin: 0; }

    #main-content { padding: 20px; }

    .mobile-bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
        background-color: #111318;
        border-top: 1px solid rgba(255,255,255,0.1);
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        z-index: 1000;
    }
    .mobile-bottom-nav .nav-item {
        display: flex; flex-direction: column; align-items: center; gap: 4px;
        text-decoration: none; color: var(--text-muted); font-size: 0.7em; transition: color 0.2s ease;
    }
    .mobile-bottom-nav .nav-item i { font-size: 1.6em; }
    .mobile-bottom-nav .nav-item.active { color: var(--secondary-glow-color); }

    .archetype-card, .race-summary { flex-direction: column; text-align: center; }
    .form-container { padding: 20px; }
    .form-container h1 { font-size: 2em; }
    .modal-actions {
        flex-direction: column; /* Išdėsto mygtukus vertikaliai */
        gap: 15px;
    }

    .modal-actions .cta-button,
    .modal-actions .cta-button-outline {
        width: 100%; /* Mygtukai užima visą plotį */
        box-sizing: border-box; /* Užtikrina, kad padding nepridėtų pločio */
    }
}

/* ===================================================
   PRISIJUNGIMO MODALINIO LANGO STILIAI
   =================================================== */
.mobile-nav-toggle {
    display: block; /* Padaro matomu */
    position: absolute;
    z-index: 2000;
    right: 1.5rem;
    top: 1.5rem;
    background: transparent; /* Svarbu: pašalina baltą foną */
    border: 0; /* Svarbu: pašalina rėmelį */
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
}

.mobile-nav-toggle[aria-expanded="true"] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M6 6l18 18M24 6L6 24'/%3e%3c/svg%3e");
}

/* Naujas mygtukų konteineris headeryje */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Prisijungimo mygtuko stilius (permatomas) */
.cta-button-outline {
    font-family: var(--title-font);
    background: transparent;
    color: var(--secondary-glow-color) !important;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 700;
    border: 2px solid var(--secondary-glow-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.cta-button-outline:hover {
    background: var(--secondary-glow-color);
    color: var(--dark-bg) !important;
    box-shadow: 0 0 15px rgba(255, 199, 0, 0.5);
}

/* Modalinis langas */
.modal {
    display: none; /* Pagal nutylėjimą paslėptas */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex; /* Parodome, kai aktyvuotas */
}

.modal-content {
    /* Pernaudojame .form-container stilių */
    width: 100%;
    max-width: 500px;
    padding: 40px;
    background: rgba(12, 11, 16, 0.9);
    border: 1px solid rgba(164, 108, 255, 0.3);
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    position: relative;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: white;
}

.modal-content h2 {
    font-size: 1.8em;
    text-shadow: none;
    text-align: center;
    margin-top: 0;
}

.modal-content p {
    text-align: center;
    font-size: 1.1em;
    color: var(--text-muted);
    margin: 20px 0 30px 0;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* ===================================================
   HEROJAUS LANGO STILIAI
   =================================================== */

.hero-view-grid {
    display: grid;
    grid-template-columns: 300px 1fr; /* Kairysis stulpelis portretui, dešinysis - statistikai */
    gap: 30px;
}

.hero-visuals {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.character-portrait {
    width: 100%;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.equipment-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
}

.equipment-slot {
    width: 100%;
    aspect-ratio: 1 / 1; /* Užtikrina, kad langelis visada bus kvadratinis */
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px dashed var(--text-muted);
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2em;
    color: var(--primary-glow-color);
    cursor: help;
}

.hero-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stats-group {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-group h3 {
    font-family: var(--title-font);
    color: var(--secondary-glow-color);
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.stats-group dl {
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
}

.stats-group dt {
    color: var(--text-muted);
    font-weight: bold;
}

.stats-group dd {
    margin: 0;
    text-align: right;
    font-size: 1.1em;
}

/* Pataisymas mobiliesiems */
@media (max-width: 850px) {
    .hero-view-grid {
        grid-template-columns: 1fr; /* Viskas eina viena po kitu */
    }
}

/* ===================================================
   INVENTORIAUS LANGO STILIAI
   =================================================== */

.inventory-container {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.inventory-grid {
    display: grid;
    /* 10 stulpelių tinklelis */
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
}

.inventory-slot {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.inventory-slot.item {
    border-style: solid;
    cursor: pointer;
    transition: all 0.2s ease;
}

.inventory-slot.item:hover {
    background-color: rgba(164, 108, 255, 0.2);
    border-color: var(--primary-glow-color);
}

.item-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2em;
    color: var(--text-color);
}

.item-quantity {
    position: absolute;
    bottom: 2px;
    right: 5px;
    font-size: 0.8em;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.item-equipped-icon {
    position: absolute;
    top: 3px;
    left: 4px;
    color: var(--secondary-glow-color);
    font-size: 0.8em;
}

.inventory-expand {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.inventory-expand p {
    margin: 0;
    color: var(--text-muted);
    font-weight: bold;
}

.inventory-expand .cta-button {
    font-size: 0.9em;
    padding: 8px 16px;
}

/* Pataisymas mobiliesiems */
@media (max-width: 850px) {
    .inventory-grid {
        /* Mobiliesiems rodome mažiau stulpelių */
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ===================================================
   NAUJAS INVENTORIAUS DIZAINAS
   =================================================== */
.inventory-layout {
    display: flex;
    gap: 20px;
    height: calc(100vh - 220px); /* Apytikslis aukštis, galite koreguoti */
}
.inventory-list-container {
    flex: 0 0 350px; /* Fiksuotas sąrašo plotis */
    display: flex;
    flex-direction: column;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
}
.inventory-list {
    list-style: none;
    margin: 0;
    padding: 10px;
    overflow-y: auto;
    flex-grow: 1;
}
.inventory-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 5px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.2s, border-color 0.2s;
    position: relative;
}
.inventory-item:hover {
    background-color: rgba(255,255,255,0.05);
}
.inventory-item.selected {
    background-color: rgba(164, 108, 255, 0.15);
    border-color: var(--primary-glow-color);
}
.inventory-item img {
    width: 48px;
    height: 48px;
    margin-right: 15px;
    object-fit: contain;
}
.item-info {
    display: flex;
    flex-direction: column;
}
.item-name {
    font-weight: bold;
}
.item-quantity {
    font-size: 0.9em;
    color: var(--text-muted);
}
.equipped-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--secondary-glow-color);
}
.inventory-footer {
    padding: 10px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9em;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.item-details-panel {
    flex-grow: 1;
    background: var(--card-bg);
    border-radius: 8px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.details-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
}
.details-placeholder i {
    font-size: 3em;
    margin-bottom: 20px;
}
.item-details-header {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}
.item-details-header img {
    width: 80px;
    height: 80px;
}
.item-details-header h3 {
    margin: 0;
    font-family: var(--title-font);
    font-size: 2em;
}
.item-details-description {
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 25px;
}
.item-details-stats h4 {
    margin-bottom: 10px;
    color: var(--secondary-glow-color);
}
.item-details-stats dl {
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.item-details-stats dt {
    font-weight: bold;
}
/* ===================================================
   INVENTORIAUS SKIRTUKŲ STILIAI
   =================================================== */

.inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.inventory-header h2 {
    margin: 0;
}

.inventory-tabs {
    display: flex;
    gap: 10px;
    background-color: rgba(0,0,0,0.2);
    padding: 5px;
    border-radius: 8px;
}

.tab-link {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--primary-font);
    font-weight: bold;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-link.active,
.tab-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.tab-content {
    display: none; /* Pagal nutylėjimą paslėptas */
}

.tab-content.active {
    display: block; /* Rodome tik aktyvų skirtuką */
}

/* Kategorijų vaizdo stiliai */
.inventory-list-container.full-width {
    flex: 1; /* Išplečiame per visą plotį */
}

.category-header {
    font-family: var(--title-font);
    color: var(--secondary-glow-color);
    font-size: 1.2em;
    margin-top: 20px;
    margin-bottom: 5px;
    padding: 5px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.category-header:first-child {
    margin-top: 0;
}

/* ===================================================
   INVENTORIAUS KATEGORIJŲ STILIAI
   =================================================== */

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.category-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.category-card:hover {
    border-color: var(--primary-glow-color);
    transform: translateY(-5px);
}

.category-card .icon {
    font-size: 2.5em;
    color: var(--secondary-glow-color);
    margin-bottom: 10px;
}

.category-card h4 {
    margin: 0 0 5px 0;
    font-family: var(--title-font);
}

.category-card .item-count {
    color: var(--text-muted);
    font-size: 0.9em;
}

/* Mygtukas "Grįžti į kategorijas" */
.inventory-back-button {
    margin-bottom: 15px;
    display: inline-block;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: bold;
}
.inventory-back-button:hover {
    color: white;
}

/* Veiksmų langų stiliai */
.action-view-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}
.action-view-container p {
    color: var(--text-muted);
    font-size: 1.1em;
}
.action-view-container .cta-button {
    padding: 15px 40px;
    font-size: 1.5em;
    margin: 20px 0;
}
.action-log {
    margin-top: 20px;
    padding: 15px;
    min-height: 24px;
    border-radius: 5px;
    background-color: rgba(0,0,0,0.2);
}
.action-log p {
    margin: 0;
    font-weight: bold;
}
.log-success { color: #7edc7e; }
.log-error { color: #ff6b6b; }

.resource-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}
.resource-item {
    display: flex;
    align-items: center;
    background-color: rgba(0,0,0,0.2);
    padding: 10px;
    border-radius: 5px;
}
.resource-item img {
    width: 48px;
    height: 48px;
    margin-right: 15px;
}
.resource-info {
    flex-grow: 1;
}
.resource-info h4 { margin: 0 0 5px 0; }
.resource-info span { font-size: 0.9em; color: var(--text-muted); }
.mine-button:disabled {
    background: #555;
    cursor: not-allowed;
    box-shadow: none;
}
.user-skill-level {
    color: var(--secondary-glow-color);
    font-size: 1.2em;
}

/* Pridėkite į CSS failo pabaigą */
.log-levelup {
    color: var(--secondary-glow-color);
    font-weight: bold;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.loader {
    border: 8px solid #f3f3f3;
    border-top: 8px solid var(--primary-glow-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===================================================
   ATNAUJINTI VEIKSMŲ LANGŲ STILIAI
   =================================================== */

.action-panel-centered {
    max-width: 700px;
    margin: 0 auto;
    padding: 30px;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.action-panel-centered h2 {
    text-align: center;
}

.skill-progress-bar {
    margin-bottom: 25px;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: var(--text-muted);
}

.user-skill-level {
    color: var(--secondary-glow-color);
    font-size: 1.1em;
}

.resource-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.resource-item {
    display: flex;
    align-items: center;
    background-color: rgba(0,0,0,0.2);
    padding: 10px;
    border-radius: 5px;
    border: 1px solid transparent;
    transition: border-color 0.3s;
}

.resource-item:has(button:disabled) {
    opacity: 0.6;
}

.resource-item img {
    width: 40px;
    height: 40px;
    margin-right: 15px;
}
.resource-info {
    flex-grow: 1;
}
.resource-info h4 { margin: 0 0 5px 0; font-size: 1.1em; }
.resource-info span { font-size: 0.9em; color: var(--text-muted); }

.mine-button {
    padding: 8px 20px !important;
    font-size: 0.9em !important;
    flex-shrink: 0;
}

.mine-button:disabled {
    background: #555;
    cursor: not-allowed;
    box-shadow: none;
}

/* ===================================================
   KASIMO REZULTATŲ LANGO STILIAI
   =================================================== */

/* Konteineris, kuris centruoja kortelę */
#view-mining-result {
    padding: 20px;
    box-sizing: border-box;
}

/* Nauja taisyklė, kuri prideda flex tik aktyviam langui */
#view-mining-result.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.result-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 30px 40px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    /* Įvažiavimo animacija */
    opacity: 0;
    transform: translateY(20px);
    animation: slide-in 0.5s forwards;
}

@keyframes slide-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-card h2 {
    font-size: 2.5em;
    margin-top: 0;
}

/* Iškastos rūdos blokas */
.result-reward {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

.result-reward img {
    width: 64px;
    height: 64px;
    /* Daikto atsiradimo animacija */
    transform: scale(0);
    animation: pop-in 0.5s 0.2s forwards;
}

@keyframes pop-in {
    to {
        transform: scale(1);
    }
}

.result-reward .item-name {
    font-size: 1.2em;
    font-weight: bold;
}

/* XP informacijos blokas */
.result-xp-gain {
    font-size: 1.1em;
    color: #7edc7e;
    margin-bottom: 25px;
}

/* XP juostos animacija */
.skill-progress-bar .xp-progress {
    transition: width 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.result-card .cta-button {
    margin-top: 30px;
}
.cooldown-timer {
    height: 5px;
    background-color: var(--secondary-glow-color);
    border-radius: 5px;
    margin-top: 20px;
    width: 100%;
    /* Animacijos pradžia */
    animation: cooldown-progress linear forwards;
    animation-duration: var(--duration, 5s);
}

@keyframes cooldown-progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}