/* Reserve space for scrollbar to prevent content shifting */
html {
    scrollbar-gutter: stable;
}

@font-face {
    font-family: 'Cinzel Decorative';
    src: url('assets/fonts/Text/CinzelDecorative-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Baumans';
    src: url('assets/fonts/Text/Baumans-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'MedievalSharp';
    src: url('assets/fonts/Text/MedievalSharp-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Playfair Display';
    src: url('assets/fonts/Text/PlayfairDisplay-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Roboto';
    src: url('assets/fonts/Text/Roboto-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

html, body {
    height: 100%; /* Ensure html and body take full height */
    margin: 0 !important; /* Ensure no default margin */
    padding: 0 !important; /* Ensure no default padding */
}

body {
    font-family: var(--player-font, 'Cinzel Decorative'), cursive, Arial, sans-serif;
    background-color: #333333;
    color: #e0e0e0;
    text-align: center;
    line-height: 1; /* Ensure minimal line height for body text */
}

body.public-page {
    --player-font: 'Times New Roman';
    font-family: 'Times New Roman', Times, serif;
}

body.public-page .index-tagline {
    font-family: 'MedievalSharp', cursive, serif;
}
.container, .box { /* Combined for consistency across pages */
    background: rgba(30, 30, 30, 0.9); /* Darker, semi-transparent background for the frame */
    padding: 0px 25px 25px 25px; /* Further reduced top padding to 0 */
    border-radius: 12px; /* Slightly more rounded corners */
    width: 90%; /* Make it responsive */
    max-width: 600px; /* Set a max-width for desktop */
    margin: 0 auto; /* Set top margin to 0 */
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.7); /* More pronounced, darker shadow */
    border: 2px solid #4a4a4a; /* Darker, more defined border */
    position: relative;
    overflow: hidden;
    top: 0; /* Ensure it starts from the very top */
    text-align: center; /* Revert to center-align text within containers */
}

/*
 * Hibridinis SPA iš inventoriaus į pagrindinį: .container iškerpa apačią (žr. map_style —
 * .map-controls-row su mount/feed). Įjungiame overflow tik pagrindiniam žaidimo blokui.
 */
#app-view.container.spa-view-main {
    overflow: visible;
}

/* Responsive font sizing for smaller screens */
@media (max-width: 768px) {
    body {
        font-size: 14px; /* Slightly smaller base font size for mobile */
        display: flex; /* Re-add flexbox for mobile centering */
        justify-content: center; /* Center horizontally */
        align-items: flex-start; /* Align to the top vertically */
    }
    h1 {
        font-size: 24px;
    }
    h2 {
        font-size: 20px;
    }
    p {
        font-size: 14px;
    }
    .game-link, a, input[type="submit"], .register-link, .button-style, .race-selection button {
        font-size: 14px;
        padding: 10px 12px;
    }
    input[type="text"],
    input[type="email"],
    input[type="password"] {
        font-size: 14px;
        padding: 8px;
    }

} 

/* .container::before, .box::before removed to eliminate double borders */
h1, h2, h3, h4, h5, h6 { /* Combined for consistency across pages */
    color: #c0a060; /* Gold-like color for titles */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    margin-bottom: 20px;
    font-family: var(--player-font, 'Cinzel Decorative'), cursive, Arial, sans-serif;
}

.logo-text {
    font-family: var(--player-font, 'Cinzel Decorative'), cursive, Arial, sans-serif;
    font-size: 3em; /* Large font size for logo */
    color: #c0a060; /* Gold-like color for logo */
    text-shadow: 3px 3px 5px rgba(0,0,0,0.7); /* More pronounced shadow */
    margin: 20px 0;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: bold; /* Make the text bolder */
}

@media (max-width: 768px) {
    .logo-text {
        font-size: 2em; /* Adjust for smaller screens */
    }
}

.main-banner {
    border: 2px solid #c0a060; /* Golden border for banner images */
    box-shadow: 0 0 10px rgba(192, 160, 96, 0.7); /* Golden glow effect */
    border-radius: 8px; /* Slightly rounded corners for the banner */
    margin-bottom: 20px; /* Add some space below the banner */
    max-width: 100%; /* Ensure image scales down on smaller screens */
    height: auto; /* Maintain aspect ratio */
}

.index-hero-image {
    display: block;
    width: auto;
    max-width: min(320px, 85vw);
    height: auto;
    margin: 16px auto 12px;
}

p {
    color: #b0b0b0;
    line-height: 1.6;
    margin-bottom: 20px;
    font-family: var(--player-font, Arial, sans-serif);
}
.game-link, a, input[type="submit"], .register-link, .button-style, .race-selection button { /* Combined for consistency across pages */
    display: block; /* Changed to block for consistency */
    width: 50%; /* Reduce width by half */
    max-width: 250px; /* Set a max-width for consistent button size */
    padding: 12px 15px; /* Increased padding for buttons */
    margin: 15px auto 0 auto; /* Center buttons and add top margin */
    background: #4a3a2a; /* Dark brown/earthy tone for buttons */
    color: #e0e0e0;
    text-decoration: none;
    border-radius: 6px; /* Slightly rounded buttons */
    border: 1px solid #6a5a4a; /* Button border */
    box-shadow: 0 3px 5px rgba(0,0,0,0.4); /* Button shadow */
    transition: background 0.3s ease, transform 0.2s ease;
    font-weight: bold;
    font-family: var(--player-font, 'Cinzel Decorative'), cursive, Arial, sans-serif; /* Ensure consistent font */
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer; /* Ensure cursor is pointer for all clickable elements */
}

button {
    font-family: var(--player-font, 'Cinzel Decorative'), cursive, Arial, sans-serif;
}
.game-link:hover, a:hover, input[type="submit"]:hover, .register-link:hover, .button-style:hover, .race-selection button:hover { /* Combined for consistency across pages */
    background: #6a4a3a; /* Lighter brown on hover */
    transform: translateY(-2px); /* Slight lift effect */
    box-shadow: 0 5px 8px rgba(0,0,0,0.6);
}

.game-link:active, a:active, input[type="submit"]:active, .register-link:active, .button-style:active, .race-selection button:active { /* Combined for consistency across pages */
    transform: translateY(0);
    box-shadow: 0 2px 3px rgba(0,0,0,0.4);
}

/* Admin button override - uses chat-drawer-button base styles */
.admin-button {
    top: 80px; /* Lower the button from 50px to 80px */
}

@media (max-width: 768px) {
    .admin-button {
        top: 30%;
    }
}

/* Remove old admin-button-top-right styles - now using chat-drawer-button base styles */


.logout-button-top-left {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1000;
    padding: 5px 5px;
    display: flex; /* Changed to flex to center content */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
    width: auto;
    white-space: nowrap;
    background-color: #a03030; /* Changed background to red for logout */
    color: #eee;
    border: 1px solid #c04040; /* Darker red border */
    border-radius: 5px;
    text-decoration: none;
    font-family: var(--player-font, 'Cinzel Decorative'), serif;
    font-size: 0.9em;
    transition: background-color 0.3s ease, top 0.3s ease; /* Add top to transition */
}

.logout-button-top-left:hover {
    background-color: #c04040; /* Lighter red on hover */
}

.settings-button-top-right {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
    padding: 5px 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: auto;
    white-space: nowrap;
    background-color: #555;
    color: #eee;
    border: 1px solid #777;
    border-radius: 5px;
    text-decoration: none;
    font-family: var(--player-font, 'Cinzel Decorative'), serif;
    font-size: 0.9em;
    transition: background-color 0.3s ease, top 0.3s ease;
}

.settings-button-top-right:hover {
    background-color: #777;
}

/* Adjust button positions when mininfo bar is active */
body.mininfo-active .logout-button-top-left,
body.mininfo-active .settings-button-top-right {
    top: 30px; /* Move buttons down by the height of the mininfo bar */
}

.logout-icon-top-left,
.settings-icon-top-right {
    width: 20px; /* Adjust icon size as needed */
    height: 20px;
    /* Removed vertical-align and margin-right as flexbox handles centering */
}

input[type="text"],
input[type="email"],
input[type="password"] {
    display: block; /* Make inputs stack vertically */
    width: calc(100% - 22px); /* Full width minus padding and border */
    padding: 10px;
    border: 1px solid #6a5a4a; /* Darker border for inputs */
    border-radius: 4px;
    font-size: 16px;
    background-color: #2a2a2a; /* Dark background for inputs */
    color: #e0e0e0; /* Light text for inputs */
    margin: 15px auto 0 auto; /* Center inputs and add top margin */
    font-family: var(--player-font, Arial, sans-serif);
}

.register-turnstile {
    display: flex;
    justify-content: center;
    margin: 15px auto 0 auto;
}

.register-bot-shield {
    margin: 18px auto 0 auto;
    max-width: 420px;
    text-align: center;
}

.register-bot-shield__title {
    margin: 0 0 8px;
    color: #c0a060;
    font-size: 1.05em;
    font-weight: 700;
}

.register-bot-shield__hint {
    margin: 0 0 12px;
    color: #b8b0a0;
    font-size: 0.92em;
    line-height: 1.45;
}

.register-pending-user {
    margin: 0 auto 12px;
    max-width: 420px;
    text-align: center;
}

.register-pending-user__label {
    margin: 0 0 6px;
    color: #b8b0a0;
    font-size: 0.95em;
}

.register-pending-user__name {
    margin: 0;
    color: #f5e6c8;
    font-size: 1.65em;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
}

.register-back-wrap {
    text-align: center;
    margin: 12px 0 0;
}

.register-back-link.button-style {
    display: inline-block;
    width: auto;
    max-width: none;
    padding: 6px 12px;
    margin: 0;
    font-size: 14px;
}

.login-footer-nav {
    text-align: center;
}

.login-footer-nav__item {
    margin: 12px 0 0;
}

.login-footer-link.register-link,
.login-footer-link.button-style {
    display: inline-block;
    width: auto;
    max-width: none;
    padding: 6px 12px;
    margin: 0;
}

.login-footer-link--stacked {
    text-align: center;
    line-height: 1.35;
}

.login-footer-link__line {
    display: block;
}
.message {
    margin-top: 15px;
    color: #e0e0e0; /* Changed message color to light */
}

.textured-line {
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, transparent, #c0a060, transparent);
    margin: 10px auto;
    border: none;
    position: relative;
}

.textured-line::before,
.textured-line::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    background-color: #c0a060;
    border-radius: 50%;
    transform: translateY(-50%);
}

.textured-line::before {
    left: 0;
}

.textured-line::after {
    right: 0;
}
.race-selection {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 20px;
}

.race-selection-divider {
    margin: 14px auto;
    width: 100%;
}
.race-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    justify-content: center;
    flex-wrap: wrap;
}
.race-option .race-icons {
    display: flex;
    gap: 10px;
}
.race-option img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #6a5a4a;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.race-option-stats {
    max-width: 280px;
    margin: 4px auto 0;
    text-align: center;
}

.race-option-stats__title {
    display: block;
    margin-bottom: 4px;
    color: #b8b0a0;
    font-size: 0.82em;
    letter-spacing: 0.02em;
}

.race-option-stats__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 10px;
}

.race-option-stats__item {
    color: #d8d0c0;
    font-size: 0.85em;
    line-height: 1.35;
    white-space: nowrap;
}

.race-option-stats__item strong {
    color: #c0a060;
    font-weight: 700;
}

.selected-race-highlight {
    color: #c0a060; /* Gold-like color for highlighting */
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.location-display {
    margin-top: 0px;
    margin-bottom: 0px;
    color: #e0e0e0; /* Default color for "Dabartinė Lokacija:" */
    font-size: 1.1em; /* Slightly reduced font size */
    font-weight: normal;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    line-height: 1; /* Further reduced line height */
    padding-top: 0px; /* Removed top padding */
    vertical-align: top; /* Align to the top */
}

.location-display p {
    margin: 0 !important; /* Remove default paragraph margins and ensure precedence */
}

.location-display #currentLocationNameTop {
    color: #c0a060; /* Golden color for the actual location name */
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.golden-text {
    color: #c0a060;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.map-toggle-bar, .character-details-toggle-bar {
    display: flex;
    width: 50%;
    height: 13px;
    position: relative;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background: linear-gradient(to right, #a08040, #c0a060, #a08040);
    border: 1px solid #6a5a4a;
    border-radius: 8px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
    margin: 20px auto;
}

.action-info-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(30, 30, 30, 0.9);
    padding: 5px 8px;
    border-radius: 8px;
    border: 1px solid #4a4a4a;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
    width: fit-content;
    min-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.action-info-bar .action-bar {
    flex-grow: 1;
    height: 15px;
    background-color: #2a2a2a;
    border: 1px solid #6a5a4a;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.action-info-bar .decreasing-bar .action-fill {
    height: 100%;
    background-color: #a08040;
    transition: transform 0.1s linear;
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    transform-origin: right;
    transform: scaleX(0);
}

.action-info-bar .action-timer {
    font-family: var(--player-font, 'Cinzel Decorative'), cursive, Arial, sans-serif;
    color: #e0e0e0;
    font-size: 0.8em;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
    z-index: 1;
    position: relative;
}

.map-toggle-bar::before,
.map-toggle-bar::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    background-color: #c0a060;
    border: 1px solid #6a5a4a;
    transform: translateY(-50%) rotate(45deg);
    box-shadow: 0 0 2px rgba(0,0,0,0.4);
    border-radius: 2px;
    z-index: 2;
}

.map-toggle-bar::before {
    left: -5px;
}

.map-toggle-bar::after {
    right: -5px;
}

.map-toggle-content, .character-details-toggle-content {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 100%;
    width: 100%;
}

.map-toggle-icon, .character-details-toggle-icon {
    width: 25px;
    height: 25px;
    background: linear-gradient(to bottom right, #a08040, #e0c080, #a08040);
    border: 2px solid #6a5a4a;
    border-radius: 5px;
    color: #333333;
    font-size: 1.2em;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    box-shadow: 0 0 8px rgba(0,0,0,0.6), inset 0 0 3px rgba(255,255,255,0.4);
    text-shadow: 1px 1px 1px rgba(0,0,0,0.4);
}

.map-toggle-bar.active .map-toggle-icon,
.character-details-toggle-bar.active .character-details-toggle-icon {
    background: linear-gradient(to bottom right, #60a030, #80c050, #60a030); /* Green gradient when active */
    border-color: #4a7a2a; /* Darker green border */
    box-shadow: 0 0 8px rgba(0,0,0,0.6), inset 0 0 3px rgba(255,255,255,0.4);
}

.map-wrapper {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.5s ease-out, opacity 0.5s ease-out;
    opacity: 1;
    position: relative;
}

.map-wrapper.hidden {
    max-height: 0 !important; /* Force hide content */
    opacity: 0 !important; /* Force hide content */
    padding: 0;
    margin-top: 0;
    margin-bottom: 0;
    border: none;
    box-shadow: none;
}

.map-wrapper.hidden .map-container {
    display: none; /* Ensure content is not interactive when hidden */
}

.character-details-toggle-bar {
    width: 50%;
    height: 13px;
    margin: 20px auto;
}

.character-details-wrapper {
    max-height: 500px; /* Default max-height for transition */
    overflow: hidden;
    transition: max-height 0.5s ease-out, opacity 0.5s ease-out;
    opacity: 1;
    position: relative;
    margin-top: 0;
    margin-bottom: 0;
    padding: 0;
}

.character-details-wrapper.hidden {
    max-height: 0 !important;
    opacity: 0 !important;
    padding: 0;
    margin-top: 0;
    margin-bottom: 0;
    border: none;
    box-shadow: none;
}

.character-details-toggle-bar {
    cursor: pointer;
}

.character-details-content {
    background: rgba(30, 30, 30, 0.8);
    border-radius: 12px;
    border: 2px solid #4a4a4a;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
    padding: 15px;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
    max-width: 600px;
    min-height: 0;
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(5, 40px);
    grid-template-rows: repeat(2, 40px);
    gap: 5px;
    padding: 5px;
    border: 1px solid #6a5a4a;
    border-radius: 5px;
    background-color: #2a2a2a;
}

.character-grid-cell {
    width: 40px;
    height: 40px;
    background-color: #4a3a2a;
    border: 1px solid #6a5a4a;
    border-radius: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #e0e0e0;
    font-size: 0.8em;
}

.mininfo {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(30, 30, 30, 0.95);
    padding: 4px 8px;
    border-bottom: 1px solid #4a4a4a;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.3s ease-out;
    height: 25px;
}

.mininfo.visible {
    transform: translateY(0);
}

/* Announcement container styles */
.announcement-container {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.announcement-content {
    display: flex;
    align-items: center;
    white-space: nowrap;
    animation: scroll-text 20s linear infinite;
    --lw-ann-scroll-start: 100%;
    --lw-ann-scroll-end: -100%;
}

.announcement-text {
    color: #e0e0e0;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    padding: 0 50px;
}

/* Announcement type colors */
.announcement-text.info {
    color: #4CAF50;
}

.announcement-text.warning {
    color: #ff9800;
}

.announcement-text.success {
    color: #8BC34A;
}

.announcement-text.error {
    color: #f44336;
}

/* Scrolling animation */
@keyframes scroll-text {
    0% {
        transform: translateX(var(--lw-ann-scroll-start));
    }
    100% {
        transform: translateX(var(--lw-ann-scroll-end));
    }
}

/* Priority-based styling */
.mininfo.urgent {
    background: rgba(244, 67, 54, 0.95);
    border-bottom-color: #d32f2f;
}

.mininfo.urgent .announcement-text {
    color: #ffffff;
    animation-duration: 15s; /* Faster scroll for urgent */
}

.mininfo.normal {
    background: rgba(30, 30, 30, 0.95);
}

.mininfo.low {
    background: rgba(76, 175, 80, 0.95);
    border-bottom-color: #4CAF50;
}

.mininfo.low .announcement-text {
    color: #ffffff;
    animation-duration: 25s; /* Slower scroll for low priority */
}

#map-cell-tooltip {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.8);
    color: #e0e0e0;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9em;
    pointer-events: none;
    display: none;
    z-index: 10000;
    white-space: nowrap;
    border: 1px solid #c0a060;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

/* Utility class to hide elements */
.hidden {
    display: none !important;
}

/* Shared Navigation Bar for sub-pages */
.resource-nav-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 5px auto;
    width: 100%;
}

.resource-nav-bar .game-link {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 10px 20px !important;
    flex-shrink: 0;
}

.nav-icon-link {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 50px !important;
    height: 50px !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    background: transparent;
    border: none;
    border-radius: 8px;
    box-shadow: none;
    transition: all 0.3s ease;
}

.nav-icon-link:hover {
    background: rgba(192, 160, 96, 0.1);
    transform: translateY(-2px);
}

.nav-icon-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
}

.nav-placeholder {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

/* --- Server Connection Overlay --- */
#server-connection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    color: #ff4444;
    text-align: center;
    backdrop-filter: blur(5px);
}

#server-connection-overlay h2 {
    color: #ff4444;
    font-size: 2em;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

#server-connection-overlay p {
    color: #e0e0e0;
    font-size: 1.2em;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border-left-color: #ff4444;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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