@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Lato:wght@400;700&display=swap');

/* --- StreamQuest Fantasy RPG Theme --- */

/* 1. Root Variables & Global Styles
----------------------------------------------------- */
:root {
    --background-dark: #0a0a0a;
    --panel-bg: #1a1a1a;
    --border-gold: #c89b3c;
    --border-gold-translucent: rgba(200, 155, 60, 0.5);
    --text-light: #e0e0e0;
    --text-muted: #8a8a8a;
    --glow-gold: rgba(200, 155, 60, 0.6);
    --player-highlight: #f0e68c;
    --font-primary: 'Cinzel', serif;
    --font-secondary: 'Lato', sans-serif;
    --transition-smooth: all 0.3s ease-in-out;
}

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

/* Entfernt alle Scrollbars vollständig */
::-webkit-scrollbar {
    display: none;
}

* {
    -ms-overflow-style: none;  /* Internet Explorer 10+ */
    scrollbar-width: none;  /* Firefox */
}

/* Optimiert Panel-Scrolling ohne sichtbare Scrollbars */
#left-panel, #tile-info-panel, #bottom-left-panel, #bottom-right-panel {
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#left-panel::-webkit-scrollbar,
#tile-info-panel::-webkit-scrollbar,
#bottom-left-panel::-webkit-scrollbar,
#bottom-right-panel::-webkit-scrollbar {
    display: none;
}

html, body {
    height: 100vh;
    overflow: hidden; /* Entfernt alle Scrollbars */
}

body {
    font-family: var(--font-secondary);
    background-color: var(--background-dark);
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(200, 155, 60, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(200, 155, 60, 0.02) 0%, transparent 50%),
        linear-gradient(45deg, rgba(0,0,0,0.02) 25%, transparent 25%, transparent 75%, rgba(0,0,0,0.02) 75%);
    background-size: 400px 400px, 300px 300px, 60px 60px;
    color: var(--text-light);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

h1, h2, h3 {
    font-family: var(--font-primary);
    color: var(--border-gold);
    text-shadow: 0 0 5px var(--glow-gold);
    font-weight: 700;
}

/* 2. Main Layout & Panels
----------------------------------------------------- */
.panel {
    background-color: var(--panel-bg);
    border: 2px solid var(--border-gold);
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: 0 0 15px rgba(0,0,0,0.6), 0 0 10px var(--glow-gold) inset;
    width: 100%;
    max-width: 1200px;
    transition: var(--transition-smooth);
}

.panel:hover {
    box-shadow: 0 0 25px rgba(0,0,0,0.8), 0 0 15px var(--glow-gold) inset;
}

#main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#main-header h1 {
    font-size: 1.5rem;
}

#profile-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#status-panel {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.95rem;
}

#status-panel b {
    color: var(--player-highlight);
    font-weight: 700;
}

/* Enhanced MP Counter Styling */
.mp-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.mp-bar-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(200, 155, 60, 0.1);
    border: 1px solid var(--border-gold-translucent);
    border-radius: 12px;
    padding: 0.4rem 0.8rem;
    min-width: 120px;
}

.mp-visual-bar {
    width: 60px;
    height: 8px;
    background: rgba(200, 155, 60, 0.2);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.mp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--border-gold), #f0e68c);
    border-radius: 4px;
    transition: width 0.3s ease-in-out;
    box-shadow: 0 0 8px var(--glow-gold);
}

.mp-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--border-gold);
    min-width: 45px;
    text-align: right;
}

.mp-regenerating {
    animation: mp-pulse 2s infinite ease-in-out;
}

@keyframes mp-pulse {
    0%, 100% { 
        box-shadow: 0 0 8px var(--glow-gold);
        opacity: 1; 
    }
    50% { 
        box-shadow: 0 0 15px var(--glow-gold);
        opacity: 0.8; 
    }
}

.mp-bonus-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(145deg, #28a745, #20c997);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    animation: bonus-pop 0.5s ease-out;
}

@keyframes bonus-pop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Layout for dashboard content: 5-panel grid layout */
#dashboard-content {
    display: grid;
    grid-template-columns: 1.2fr 2fr 1.2fr;
    grid-template-rows: 2fr 1fr;
    gap: 0.5rem;
    padding: 0.5rem;
    height: calc(100vh - 120px);
    grid-template-areas: 
        "left-panel map-container tile-info-panel"
        "bottom-left-panel map-container bottom-right-panel";
}

#left-panel {
    grid-area: left-panel;
    min-width: 240px;
    max-height: 65vh;
    overflow-y: auto;
}

#map-container {
    grid-area: map-container;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 300px;
    margin: 0 0.5rem;
}

#bottom-left-panel {
    grid-area: bottom-left-panel;
    min-width: 240px;
    max-height: 28vh;
    overflow-y: auto;
}

#bottom-right-panel {
    grid-area: bottom-right-panel;
    min-width: 240px;
    max-height: 28vh;
    overflow-y: auto;
}

#tile-info-panel {
    grid-area: tile-info-panel;
    min-width: 240px;
    max-height: 65vh;
    overflow-y: auto;
}

#tile-info-panel .tile-info-header {
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#tile-info-panel .tile-info-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
}

#tile-info-panel .current-position-badge {
    background: var(--accent-color);
    color: var(--bg);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    margin-left: auto;
}

#tile-info-panel .tile-info-content {
    max-height: 70vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

#tile-info-panel .tile-info-section {
    margin-top: 1rem;
}

#tile-info-panel .tile-info-section h4 {
    font-size: 1rem;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.25rem;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.tile-resources-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.current-position-resource {
    background: rgba(50,50,60,0.5);
    border-radius: 8px;
    padding: 0.75rem;
    flex: 1 1 calc(50% - 1rem);
    min-width: 140px;
}

.tile-resource-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tile-resource-icon {
    font-size: 1.5rem;
}

.tile-resource-details h5 {
    margin: 0;
    font-size: 1rem;
}

.tile-resource-meta span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.tile-resource-status {
    margin-top: 0.5rem;
    text-align: center;
}

/* 3. Map Styling
----------------------------------------------------- */
#map-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    gap: 3px; /* smaller gap */
    width: 70vmin; /* smaller map size */
    max-width: 70vmin;
    aspect-ratio: 1 / 1;
    margin: 0.5rem auto;
}

.map-tile {
    aspect-ratio: 1 / 1;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem; /* smaller icons */
    padding: 0.25rem; /* less padding */
}

.map-tile:hover {
    transform: scale(1.08); /* moderate hover scale */
}

.map-tile.player-position, 
.map-tile.current-position, 
.map-tile.tile-current {
    background-color: rgba(240, 230, 140, 0.2) !important;
    border: 4px solid var(--player-highlight) !important;
    box-shadow: 
        0 0 25px var(--player-highlight), 
        0 0 15px var(--player-highlight) inset,
        0 0 5px rgba(255, 255, 255, 0.3) !important;
    z-index: 10 !important;
    animation: pulse-player 2s infinite ease-in-out;
    transform: scale(1.05);
}

/* Player icon using pseudo-element */
.map-tile.player-position::after,
.map-tile.current-position::after, 
.map-tile.tile-current::after {
    content: '👤' !important;
    color: var(--player-highlight) !important;
    font-size: 1.8rem !important;
    line-height: 1;
    text-shadow: 
        0 0 10px var(--player-highlight),
        0 0 5px rgba(255, 255, 255, 0.8) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

@keyframes pulse-player {
    0%, 100% { 
        box-shadow: 0 0 20px var(--player-highlight), 0 0 10px var(--player-highlight) inset;
        opacity: 1; 
    }
    50% { 
        box-shadow: 0 0 30px var(--player-highlight), 0 0 15px var(--player-highlight) inset;
        opacity: 0.8; 
    }
}

@keyframes tileGlow {
    from { 
        box-shadow: 0 0 20px var(--player-highlight), 0 0 10px var(--player-highlight) inset;
    }
    to { 
        box-shadow: 0 0 30px var(--player-highlight), 0 0 15px var(--player-highlight) inset;
    }
}

/* 4. Resource Panel Styling
----------------------------------------------------- */
#resource-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

/* New Resource Summary Styling */
.resource-summary-item {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    background: rgba(42, 42, 42, 0.8);
    border-left: 4px solid var(--text-muted);
    transition: var(--transition-smooth);
    backdrop-filter: blur(5px);
}

.resource-summary-item.has-available {
    border-left-color: var(--border-gold);
    background: rgba(200, 155, 60, 0.1);
}

.resource-summary-item.all-depleted {
    opacity: 0.6;
    border-left-color: #666;
}

.resource-summary-content {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
}

.resource-icon {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    min-width: 24px;
}

.resource-name {
    font-weight: 600;
    color: var(--text-light);
    min-width: 80px;
}

.resource-counts {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: auto;
    font-weight: 700;
}

.available-count {
    color: var(--border-gold);
    font-size: 1.1rem;
}

.count-separator {
    color: var(--text-muted);
}

.total-count {
    color: var(--text-muted);
}

.next-respawn {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(108, 117, 125, 0.1);
    border-radius: 4px;
    border-left: 3px solid #6c757d;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
}

/* Animation for available resources */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

#resource-legend h3 {
    margin-bottom: 0.75rem;
}

.legend-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.legend-icon {
    font-size: 1.2em;
}

/* 5. Info Panel & Buttons
----------------------------------------------------- */
#tile-info-panel h3 {
    margin-bottom: 1rem;
}
#tile-info-panel p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-light);
}
#tile-lore, #tile-resources {
    min-height: 1.5em; /* Prevent layout shift */
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-style: italic;
}

button, .admin-btn {
    background: linear-gradient(145deg, #c89b3c, #a17a2f);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-family: var(--font-secondary);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

button:hover, .admin-btn:hover {
    background: linear-gradient(145deg, #d4a647, #b88b35);
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    transform: translateY(-2px);
}

/* 6. Effects & Animations (from inline style)
----------------------------------------------------- */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(200, 155, 60, 0.4); /* Gold ripple */
    transform: scale(0);
    animation: rippleEffect 0.6s linear;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.loading-container {
    text-align: center;
    padding: 2rem;
}

.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-left-color: var(--border-gold);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Smooth Loading and Animation Styles */
@keyframes smooth-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.smooth-loading-indicator {
    animation: smooth-spin 1s linear infinite;
}

/* Smooth transitions for tile info updates */
.tile-resource-item {
    transition: box-shadow 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

.tile-resource-item:hover {
    transform: translateY(-1px);
}

.resource-status-badge {
    transition: all 0.3s ease;
}

.next-respawn {
    transition: opacity 0.2s ease, color 0.3s ease;
}

.tile-info-section {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tile-image {
    transition: opacity 0.3s ease;
}

/* Highlight animation for status changes */
.tile-resource-item.status-changed {
    animation: resource-status-highlight 0.5s ease;
}

@keyframes resource-status-highlight {
    0% { box-shadow: 0 0 0 rgba(200, 155, 60, 0); }
    50% { box-shadow: 0 0 15px rgba(200, 155, 60, 0.5); }
    100% { box-shadow: 0 0 0 rgba(200, 155, 60, 0); }
}

/* Fade in animation for new sections */
.fade-in {
    animation: fade-in 0.3s ease;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Subtle pulse for updated elements */
.element-updated {
    animation: subtle-pulse 0.4s ease;
}

@keyframes subtle-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* 7. Responsive Design
----------------------------------------------------- */
@media (max-width: 992px) {
    #dashboard-content {
        flex-direction: column;
    }
    #map-container,
    #tile-info-panel {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

@media (max-width: 1200px) {
    #dashboard-content {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
        grid-template-areas: 
            "left-panel tile-info-panel"
            "map-container map-container"
            "bottom-left-panel bottom-right-panel";
    }
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
        gap: 1rem;
    }
    #main-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    #status-panel {
        font-size: 1rem;
    }
    .panel {
        padding: 1rem;
    }
    button, .admin-btn {
        padding: 0.5rem 1rem;
    }
    
    #dashboard-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto auto;
        grid-template-areas: 
            "map-container"
            "tile-info-panel"
            "left-panel"
            "bottom-left-panel"
            "bottom-right-panel";
    }
}

/* 8. Additional Components for Login & Home Pages
----------------------------------------------------- */
.auth-message {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border-left: 4px solid;
    font-size: 0.9rem;
}

.error-message {
    background-color: rgba(220, 53, 69, 0.1);
    border-left-color: #dc3545;
    color: #dc3545;
}

.info-message {
    background-color: rgba(13, 202, 240, 0.1);
    border-left-color: #0dcaf0;
    color: #0dcaf0;
}

.home-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.home-link:hover {
    color: var(--border-gold);
    text-decoration: underline;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-gold);
    color: var(--border-gold);
}

.btn-outline:hover {
    background: var(--border-gold);
    color: var(--background-dark);
}

.list-group-flush {
    list-style: none;
    padding: 0;
}

.list-group-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.text-success { color: #28a745 !important; }
.text-warning { color: #ffc107 !important; }
.text-info { color: #17a2b8 !important; }

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
}

.col, .col-md-4, .col-md-6 {
    flex: 1;
    padding: 0 0.75rem;
    margin-bottom: 1.5rem;
}

.col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

.d-grid {
    display: grid;
}

.d-md-flex {
    display: flex;
}

.justify-content-md-center {
    justify-content: center;
}

.gap-2 {
    gap: 0.5rem;
}

.h-100 {
    height: 100%;
}

/* Admin Badge Styling */
.admin-badge {
    background: linear-gradient(145deg, var(--border-gold), #a17a2f);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.admin-crown {
    font-size: 1rem;
}

/* Floating Harvest Text */
.floating-harvest-text {
    position: fixed;
    left: 50%;
    top: 60%;
    transform: translate(-50%, 0);
    z-index: 9999;
    font-size: 1.6em;
    color: var(--border-gold);
    font-weight: 700;
    pointer-events: none;
    opacity: 0;
    background: rgba(0, 0, 0, 0.8);
    padding: 0.5em 1em;
    border-radius: 8px;
    border: 1px solid rgba(200, 155, 60, 0.3);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

/* MP Status Colors */
.mp-bar-container.mp-low {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.mp-bar-container.mp-low .mp-fill {
    background: linear-gradient(90deg, #dc3545, #ff6b7a);
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.6);
}

.mp-bar-container.mp-medium {
    border-color: #ffc107;
    background: rgba(255, 193, 7, 0.1);
}

.mp-bar-container.mp-medium .mp-fill {
    background: linear-gradient(90deg, #ffc107, #ffdc5e);
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.6);
}

/* Enhanced Respawn Information */
.respawn-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: rgba(108, 117, 125, 0.1);
    border-radius: 6px;
    border-left: 3px solid #6c757d;
}

.respawn-icon {
    font-size: 1.1rem;
    margin-right: 0.5rem;
}

.respawn-text {
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.respawn-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.25rem;
    line-height: 1.4;
}

/* Enhanced Harvest Button */
.harvest-button {
    background: linear-gradient(145deg, var(--border-gold), #a17a2f);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.harvest-button:hover {
    background: linear-gradient(145deg, #d4af37, var(--border-gold));
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.harvest-button:active {
    transform: translateY(0);
}

/* Improved Tile Resource Layout */
.tile-resource-status {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

.resource-status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.resource-status-badge.available {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid #28a745;
}

.resource-status-badge.depleted {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
    border: 1px solid #6c757d;
}

.mp-bar-container.mp-high {
    border-color: var(--border-gold);
    background: rgba(200, 155, 60, 0.1);
}

.mp-bar-container.mp-high .mp-fill {
    background: linear-gradient(90deg, var(--border-gold), #f0e68c);
    box-shadow: 0 0 8px var(--glow-gold);
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .col-md-4, .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .d-md-flex {
        display: block;
    }
    
    .gap-2 {
        gap: 1rem;
    }
}

/* Additional TileInfoPanel internals styling */
#tile-info-panel .tile-info-loading,
#tile-info-panel .tile-click-hint {
    background: rgba(40,40,50,0.6);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    color: var(--text-primary);
}
#tile-info-panel .loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 4px solid var(--text-muted);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0.5rem auto;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
#tile-info-panel .terrain-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
#tile-info-panel .terrain-detail {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}
#tile-info-panel .terrain-detail-label {
    font-weight: 600;
    color: var(--text-secondary);
}
#tile-info-panel .terrain-detail-value {
    color: var(--text-primary);
}
#tile-info-panel .lore-section .lore-text {
    font-style: italic;
    color: var(--text-secondary);
}
#tile-info-panel .tile-info-section p,
#tile-info-panel .tile-info-section .lore-text {
    line-height: 1.4;
    margin-top: 0.5rem;
}

/* Responsive layout for TileInfoPanel */
#tile-info-panel {
    width: 100%;
    max-width: 100%;
    margin: 0; /* fill container */
}

@media (min-width: 768px) {
    #tile-info-panel .tile-info-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    #tile-info-panel .tile-info-section.resources-section,
    #tile-info-panel .tile-info-section.landmarks-section {
        grid-column: 1 / -1;
    }
}

/* =================================================================
   PLACEHOLDER PANELS STYLING
   ================================================================= */

/* General placeholder styling */
.panel-placeholder {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.coming-soon {
    text-align: center;
    margin-top: 0.5rem;
    padding: 0.5rem;
    border: 1px dashed rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    background: rgba(255, 215, 0, 0.05);
}

.coming-soon p {
    color: var(--accent-color);
    font-style: italic;
    margin: 0;
}

/* Inventory Panel Styling */
.placeholder-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    transition: all 0.2s ease;
}

.placeholder-item:hover {
    background: rgba(255, 215, 0, 0.15);
    border-color: rgba(255, 215, 0, 0.3);
    transform: translateY(-1px);
}

.item-icon {
    font-size: 1.2rem;
    min-width: 1.5rem;
    text-align: center;
}

.item-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-color);
}

.item-count {
    font-size: 0.9rem;
    color: var(--accent-color);
    font-weight: bold;
    background: rgba(255, 215, 0, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Combat Panel Styling */
.combat-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: rgba(0, 255, 0, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(0, 255, 0, 0.2);
}

.status-label {
    font-weight: bold;
    color: var(--text-color);
}

.status-peaceful {
    color: #28a745;
    font-weight: 500;
}

.combat-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.stat-icon {
    font-size: 1.1rem;
    min-width: 1.5rem;
    text-align: center;
}

.stat-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-color);
}

.stat-value {
    font-weight: bold;
    color: var(--accent-color);
    background: rgba(255, 215, 0, 0.15);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Quest Panel Styling */
.quest-item {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    transition: all 0.2s ease;
}

.quest-item:hover {
    border-color: rgba(255, 215, 0, 0.4);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.quest-item.active {
    border-color: var(--accent-color);
    background: rgba(255, 215, 0, 0.1);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.quest-item.completed {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
    opacity: 0.8;
}

.quest-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.quest-icon {
    font-size: 1.1rem;
    min-width: 1.5rem;
    text-align: center;
}

.quest-name {
    font-weight: 600;
    color: var(--text-color);
    flex: 1;
}

.quest-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.progress-text {
    color: rgba(255, 255, 255, 0.8);
    flex: 1;
}

.progress-count {
    font-weight: bold;
    color: var(--accent-color);
    background: rgba(255, 215, 0, 0.15);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    min-width: 3rem;
    text-align: center;
}

.quest-item.completed .progress-count {
    color: #28a745;
    background: rgba(40, 167, 69, 0.15);
}

/* =================================================================
   INVENTORY TAB SYSTEM STYLING
   ================================================================= */

/* Tab Header Styling */
.inventory-tabs {
    margin-bottom: 0.5rem;
}

.tab-slider {
    position: relative;
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 4px;
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.5rem 0.7rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 6px;
    position: relative;
    z-index: 2;
}

.tab-btn.active {
    color: var(--bg);
    font-weight: 600;
}

.tab-btn:hover:not(.active) {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
}

.tab-icon {
    font-size: 1.1rem;
}

.tab-text {
    font-size: 0.9rem;
}

/* Animated Tab Indicator */
.tab-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    right: 50%;
    bottom: 4px;
    background: var(--accent-color);
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.tab-indicator.equipment {
    left: 50%;
    right: 4px;
}

/* Tab Content */
.tab-content {
    position: relative;
    min-height: 300px;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =================================================================
   EQUIPMENT SYSTEM STYLING
   ================================================================= */

.equipment-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.equipment-slots {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.equipment-slot {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 8px;
    border: 2px solid rgba(255, 215, 0, 0.2);
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    min-height: 55px;
}

.equipment-slot.equipped {
    border-color: var(--accent-color);
    background: rgba(255, 215, 0, 0.1);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.equipment-slot.empty {
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.02);
}

.equipment-slot:hover {
    border-color: var(--accent-color);
    background: rgba(255, 215, 0, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.slot-icon {
    font-size: 1.5rem;
    min-width: 2rem;
    text-align: center;
    opacity: 0.8;
}

.equipment-slot.equipped .slot-icon {
    opacity: 1;
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.5));
}

.slot-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.equipped-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
}

.equipped-stats {
    font-size: 0.8rem;
    color: var(--accent-color);
    font-weight: 500;
}

.slot-placeholder {
    flex: 1;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    font-size: 0.9rem;
}

/* Equipment Stats Summary */
.equipment-stats {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.equipment-stats h4 {
    margin: 0 0 0.75rem 0;
    color: var(--accent-color);
    font-size: 1rem;
    text-align: center;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.stat-value {
    font-weight: bold;
    color: var(--accent-color);
    background: rgba(255, 215, 0, 0.15);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    min-width: 3rem;
    text-align: center;
}

/* Responsive adjustments for tabs */
@media (max-width: 768px) {
    .tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .tab-icon {
        font-size: 1rem;
    }
    
    .equipment-slots {
        grid-template-columns: 1fr;
    }
    
    .equipment-slot {
        min-height: 60px;
    }
}

/* =================================================================
   END INVENTORY TAB SYSTEM STYLING
   ================================================================= */

/* =================================================================
   TILE IMAGE DISPLAY STYLING
   ================================================================= */

/* Tile Image Section */
.tile-image-section {
    margin-bottom: 1rem;
}

.tile-image-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.tile-image {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tile-image.loaded {
    opacity: 1;
}

.tile-image-error {
    padding: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.tile-image-error .error-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.tile-image-error p {
    margin: 0;
    font-size: 0.9rem;
}

.tile-image-toggle {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.tile-image-toggle button {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: var(--text-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tile-image-toggle button:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: var(--accent-color);
}

/* =================================================================
   END TILE IMAGE DISPLAY STYLING
   ================================================================= */

/* Resource Auto-Refresh Animations */
@keyframes resource-available-celebration {
    0% { 
        background: rgba(76, 175, 80, 0.1);
        transform: scale(1);
    }
    50% { 
        background: rgba(76, 175, 80, 0.3);
        transform: scale(1.05);
    }
    100% { 
        background: rgba(76, 175, 80, 0.1);
        transform: scale(1);
    }
}

@keyframes resource-depleted-effect {
    0% { 
        background: rgba(244, 67, 54, 0.1);
        transform: scale(1);
    }
    50% { 
        background: rgba(244, 67, 54, 0.2);
        transform: scale(0.95);
    }
    100% { 
        background: transparent;
        transform: scale(1);
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.auto-refresh-indicator {
    display: inline-block;
}

.next-respawn {
    transition: all 0.3s ease;
}

.tile-resource-item {
    transition: all 0.3s ease;
}

/* --- Cookie Banner & DSGVO Compliance --- */

/* Cookie Banner - Fixed Bottom */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.98) 0%, rgba(16, 16, 16, 0.98) 100%);
    backdrop-filter: blur(20px);
    border-top: 2px solid var(--border-gold);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.8), 0 0 20px var(--glow-gold) inset;
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1.5rem;
    display: none;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.cookie-banner-text {
    flex: 1;
    min-width: 300px;
}

.cookie-banner-text h3 {
    font-family: var(--font-primary);
    color: var(--border-gold);
    text-shadow: 0 0 5px var(--glow-gold);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.cookie-banner-text p {
    color: var(--text-light);
    line-height: 1.5;
    font-size: 0.95rem;
}

.cookie-banner-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Cookie Button Styles */
.cookie-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-family: var(--font-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-width: 120px;
    text-align: center;
}

.cookie-btn-primary {
    background: linear-gradient(135deg, var(--border-gold) 0%, #d4af37 100%);
    color: #000;
    box-shadow: 0 4px 15px rgba(200, 155, 60, 0.3);
}

.cookie-btn-primary:hover {
    background: linear-gradient(135deg, #d4af37 0%, var(--border-gold) 100%);
    box-shadow: 0 6px 20px rgba(200, 155, 60, 0.5);
    transform: translateY(-2px);
}

.cookie-btn-secondary {
    background: transparent;
    color: var(--text-light);
    border: 2px solid var(--border-gold);
}

.cookie-btn-secondary:hover {
    background: rgba(200, 155, 60, 0.1);
    box-shadow: 0 0 15px var(--glow-gold);
    transform: translateY(-1px);
}

.cookie-btn-minimal {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--text-muted);
}

.cookie-btn-minimal:hover {
    color: var(--text-light);
    border-color: var(--text-light);
    background: rgba(255, 255, 255, 0.05);
}

/* Cookie Settings Modal */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cookie-modal.show {
    opacity: 1;
}

.cookie-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.cookie-modal-content {
    position: relative;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.98) 0%, rgba(16, 16, 16, 0.98) 100%);
    backdrop-filter: blur(20px);
    border: 2px solid var(--border-gold);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 30px var(--glow-gold) inset;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-modal.show .cookie-modal-content {
    transform: scale(1);
}

.cookie-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-gold-translucent);
}

.cookie-modal-header h2 {
    font-family: var(--font-primary);
    color: var(--border-gold);
    text-shadow: 0 0 5px var(--glow-gold);
    margin: 0;
    font-size: 1.5rem;
}

.cookie-modal-close {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.cookie-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--border-gold);
}

.cookie-modal-body {
    padding: 1.5rem;
}

.cookie-category {
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(200, 155, 60, 0.2);
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.cookie-category-header h3 {
    font-family: var(--font-primary);
    color: var(--border-gold);
    text-shadow: 0 0 3px var(--glow-gold);
    margin: 0;
    font-size: 1.1rem;
}

.cookie-description {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.cookie-details {
    color: var(--text-muted);
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.75rem;
    border-radius: 4px;
    border-left: 3px solid var(--border-gold-translucent);
}

/* Cookie Toggle Switch */
.cookie-toggle {
    position: relative;
    display: inline-block;
}

.cookie-toggle input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    background-color: #444;
    border-radius: 24px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border: 1px solid var(--border-gold-translucent);
}

.toggle-label::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background-color: var(--text-light);
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.cookie-toggle input[type="checkbox"]:checked + .toggle-label {
    background-color: var(--border-gold);
    box-shadow: 0 0 10px var(--glow-gold);
}

.cookie-toggle input[type="checkbox"]:checked + .toggle-label::after {
    transform: translateX(26px);
    background-color: #000;
}

.cookie-toggle input[type="checkbox"]:disabled + .toggle-label {
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-legal-info {
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border-left: 3px solid var(--border-gold);
}

.cookie-legal-info h4 {
    font-family: var(--font-primary);
    color: var(--border-gold);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.cookie-legal-info p {
    color: var(--text-light);
    line-height: 1.5;
    font-size: 0.9rem;
}

.cookie-legal-info a {
    color: var(--border-gold);
    text-decoration: none;
    border-bottom: 1px dotted var(--border-gold);
    transition: all 0.3s ease;
}

.cookie-legal-info a:hover {
    color: #d4af37;
    border-bottom-color: #d4af37;
    text-shadow: 0 0 5px var(--glow-gold);
}

.cookie-modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-gold-translucent);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Responsive Cookie Banner */
@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .cookie-banner-actions {
        justify-content: center;
        width: 100%;
    }
    
    .cookie-btn {
        flex: 1;
        min-width: 100px;
    }
    
    .cookie-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .cookie-modal-footer {
        flex-direction: column;
    }
    
    .cookie-modal-footer .cookie-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .cookie-banner {
        padding: 1rem;
    }
    
    .cookie-banner-actions {
        flex-direction: column;
    }
    
    .cookie-btn {
        width: 100%;
    }
}