:root {
    --night-darkness: 0;
    --color-main: #f39c12;
}

body {
    font-family: Arial, sans-serif;
    background-color: #0a0a0a;
    color: #bdc3c7;
    margin: 0;
    padding: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

#screen-flash {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: white; z-index: 9999; pointer-events: none; opacity: 0;
}
.flash-anim { animation: flashScreen 0.5s ease-out; }
@keyframes flashScreen { 0% { opacity: 0; } 20% { opacity: 0.8; } 100% { opacity: 0; } }

#sidebar {
    width: 360px; background: #111; padding: 20px;
    border-right: 1px solid #333; box-shadow: 2px 0 15px rgba(255, 165, 0, 0.1);
    display: flex; flex-direction: column; z-index: 100;
}

#sidebar-scroll-area {
    flex-grow: 1; overflow-y: auto; overflow-x: hidden; padding-right: 5px; margin-bottom: 10px;
}
#sidebar-scroll-area::-webkit-scrollbar { width: 6px; }
#sidebar-scroll-area::-webkit-scrollbar-track { background: #111; }
#sidebar-scroll-area::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
#sidebar-scroll-area::-webkit-scrollbar-thumb:hover { background: #555; }

#header-area {
    display: flex; justify-content: space-between; align-items: flex-start;
    border-bottom: 1px solid #555; padding-bottom: 10px; margin-bottom: 15px;
}

h1 { color: white; margin: 0; font-size: 1.6em; }
.subtitle { margin: 5px 0 0 0; font-size: 0.75em; color: #7f8c8d; font-weight: normal; }
.subtitle a { color: var(--color-main); text-decoration: none; }
.subtitle a:hover { text-decoration: underline; }

#lang-btn, #btn-door {
    padding: 5px 10px; background-color: #333; color: white;
    border: 1px solid #555; font-size: 0.9em; cursor: pointer; border-radius: 4px;
}
#lang-btn:hover, #btn-door:hover { background-color: #555; }

#hero-stats {
    display: flex; justify-content: space-between; gap: 10px; margin-bottom: 15px;
    background: #1a1a1a; padding: 15px; border-radius: 8px; border: 1px solid #333;
}

.hero-box { display: flex; flex-direction: column; align-items: center; flex: 1; }
.hero-label { font-size: 0.9em; color: silver; text-transform: uppercase; letter-spacing: 1px; }
.hero-value { font-size: 2em; font-weight: bold; color: white; margin-top: 5px; text-align: center; }
.highlight { color: var(--color-main); text-shadow: 0 0 10px rgba(243, 156, 18, 0.4); }
.orange-val { color: var(--color-main); font-weight: bold; }

.stat-section { margin-bottom: 10px; background: #161616; border-radius: 6px; border: 1px solid #333; }
.stat-section summary {
    padding: 10px; cursor: pointer; color: var(--color-main); font-weight: bold; text-transform: uppercase; 
    font-size: 0.85em; list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.stat-section summary::-webkit-details-marker { display: none; }
.stat-section summary::after { content: '▼'; font-size: 0.9em; transition: transform 0.2s; color: #7f8c8d; }
.stat-section[open] summary::after { transform: rotate(180deg); }
.details-content { padding: 0 15px 15px 15px; }

.stat-header {
    display: grid; grid-template-columns: 50% 25% 25%;
    font-size: 0.8em; color: var(--color-main); border-bottom: 1px dashed #333;
    padding-bottom: 4px; margin: 10px 0 8px 0; text-transform: uppercase; font-weight: bold;
}
.stat-row-simple { display: flex; justify-content: space-between; font-size: 0.85em; margin-bottom: 6px; color: #95a5a6; }
.stat-row-simple span:last-child { color: #ecf0f1; font-weight: bold; }

.stat-row { display: grid; grid-template-columns: 50% 25% 25%; font-size: 0.85em; margin-bottom: 6px; color: #95a5a6; }
.stat-row span:nth-child(2) { text-align: right; color: #ecf0f1; font-weight: bold; }
.stat-row span:nth-child(3) { text-align: right; color: #7f8c8d; }

#info-text { padding-top: 10px; font-size: 0.85em; color: #7f8c8d; text-align: center; margin-bottom: 20px; }

#menu-buttons {
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding-bottom: 10px;
}
.menu-btn {
    background-color: transparent; color: #95a5a6;
    border: 1px solid #555; border-radius: 4px; padding: 6px 10px;
    font-size: 0.8em; cursor: pointer; transition: all 0.2s;
}
.menu-btn:hover { background-color: #222; color: #ecf0f1; }
.btn-red { color: #e74c3c; border-color: #e74c3c; }
.btn-red:hover { background-color: rgba(231, 76, 60, 0.1); color: #e74c3c; }

#game-world {
    flex-grow: 1; position: relative; cursor: crosshair; overflow: hidden;
    background-color: #0b1610; 
    background-image: 
        linear-gradient(135deg, transparent 35%, rgba(26, 75, 110, 0.3) 40%, rgba(26, 75, 110, 0.4) 50%, rgba(26, 75, 110, 0.3) 60%, transparent 65%),
        radial-gradient(circle at 15% 25%, rgba(5, 15, 5, 0.6) 0%, transparent 35%),
        radial-gradient(circle at 85% 75%, rgba(5, 15, 5, 0.6) 0%, transparent 35%),
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 100% 100%, 40px 40px, 40px 40px;
}

#game-world::after {
    content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: #020408; opacity: var(--night-darkness);
    pointer-events: none; transition: opacity 2s ease; z-index: 15;
}

#sky-indicator-container {
    position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center;
    z-index: 16; pointer-events: none;
}
#sky-indicator {
    font-size: 50px; opacity: 0.9;
    transition: opacity 1s, font-size 1s; filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.5));
}
#clock-indicator {
    font-family: monospace; font-size: 13px; color: #ecf0f1; font-weight: bold;
    background: rgba(0,0,0,0.6); padding: 2px 6px; border-radius: 4px;
    margin-top: -5px; border: 1px solid #333;
}

.world-entity { position: absolute; user-select: none; pointer-events: none; font-size: 24px; }
.item, .plant, .static, .gravestone, .weed, .bed, .hut { transition: left 0.3s ease, top 0.3s ease; }
.dragging { transition: none !important; opacity: 1 !important; filter: none !important; }

.hut { font-size: 48px !important; z-index: 16; filter: drop-shadow(0 0 5px rgba(255,255,255,0.2)); }
.glow-night { z-index: 16; filter: drop-shadow(0 0 10px rgba(243, 156, 18, calc(var(--night-darkness) * 0.9))); }
.glow-immune { z-index: 22; filter: drop-shadow(0 0 12px #f1c40f) brightness(1.2); }

.creature { transition: left 0.05s linear, top 0.05s linear; z-index: 20; border-radius: 50%; }

/* Wesen in Hütte leicht verkleinert und transparent darstellen, damit sie als 'geschützt' wahrgenommen werden */
.in-hut { transform: translate(-50%, -50%) scale(0.75) !important; opacity: 0.65 !important; z-index: 17; }

.world-entity.stage-child { font-size: 16px; } 
.stage-senior { filter: grayscale(100%) opacity(0.8); }
.enlightened { box-shadow: 0 0 15px 5px rgba(243, 156, 18, 0.6); }

.zombie-creature { filter: hue-rotate(80deg) saturate(2) brightness(0.9); }

.statue { font-size: 48px !important; z-index: 6; }
.player-avatar { font-size: 40px; z-index: 30; transition: left 0.05s linear, top 0.05s linear; }

.item { z-index: 10; }
.plant { z-index: 9; }
.static { z-index: 5; } 
.gravestone { z-index: 5; }
.weed { z-index: 4; }
.bed { z-index: 4; }
.berry-empty { filter: grayscale(100%) opacity(0.5); }

.firefly { z-index: 25; animation: fireflyPulse 1s infinite alternate; pointer-events: none; }
@keyframes fireflyPulse { 0% { filter: drop-shadow(0 0 5px #f1c40f) brightness(1); transform: translate(-50%, -50%) scale(1); } 100% { filter: drop-shadow(0 0 15px #f39c12) brightness(1.5); transform: translate(-50%, -50%) scale(1.2); } }

.weather-rain { z-index: 18; font-size: 12px; color: #3498db; opacity: 0.6; pointer-events: none; }

.hp-label {
    position: absolute; bottom: -12px; left: 50%; transform: translateX(-50%);
    font-size: 10px; color: var(--color-main); font-family: monospace; font-weight: bold;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000; white-space: nowrap;
}

.fx-pop { animation: popAnim 0.8s forwards; font-size: 20px; z-index: 100; font-weight: bold; color: #f1c40f; text-shadow: 1px 1px 2px #000; }
@keyframes popAnim { 0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; } 100% { transform: translate(-50%, -150%) scale(1.5); opacity: 0; } }
.fx-flash { animation: flashAnim 0.8s forwards; font-size: 50px; z-index: 100; }
@keyframes flashAnim { 0% { transform: translate(-50%, -50%) scale(1); opacity: 1; filter: brightness(2); } 100% { transform: translate(-50%, -50%) scale(3); opacity: 0; } }
.fx-swirl { animation: swirlAnim 0.8s forwards; font-size: 40px; z-index: 100; }
@keyframes swirlAnim { 0% { transform: translate(-50%, -50%) rotate(0deg) scale(1); opacity: 1; } 100% { transform: translate(-50%, -50%) rotate(720deg) scale(0); opacity: 0; } }

#tooltip {
    position: absolute; background-color: rgba(10, 10, 10, 0.95);
    color: #ecf0f1; padding: 10px 15px; border-radius: 6px;
    font-size: 0.9em; z-index: 1000; border: 1px solid var(--color-main); box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    white-space: pre-line; pointer-events: auto; cursor: pointer;
    transform: translate(-50%, 0); text-align: center;
}

/* Modals für Guide & Impressum */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.85); display: flex; justify-content: center; align-items: center; z-index: 2000;
}
.modal-scroll-content {
    background-color: #1a1a1a; padding: 30px; border-radius: 8px;
    border: 1px solid #555; max-width: 600px; max-height: 80vh; overflow-y: auto; text-align: left;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5); color: #ecf0f1; line-height: 1.6;
}
.modal-scroll-content::-webkit-scrollbar { width: 8px; }
.modal-scroll-content::-webkit-scrollbar-track { background: #111; }
.modal-scroll-content::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
.modal-scroll-content::-webkit-scrollbar-thumb:hover { background: #555; }

.modal-scroll-content h2, .modal-scroll-content h3 { color: var(--color-main); margin-top: 0; }
.modal-scroll-content p { font-size: 0.95em; }
.modal-scroll-content ul { font-size: 0.95em; padding-left: 20px; }
.modal-scroll-content li { margin-bottom: 8px; }

.modal-content {
    background-color: #1a1a1a; padding: 30px; border-radius: 8px;
    border: 1px solid #e74c3c; text-align: center; max-width: 400px; box-shadow: 0 4px 20px rgba(231, 76, 60, 0.3);
}
.modal-content p { color: #ecf0f1; font-size: 1.1em; line-height: 1.5; }
.modal-buttons { display: flex; justify-content: center; gap: 15px; margin-top: 25px; }

#offline-toast {
    position: fixed; bottom: 30px; right: 30px;
    background-color: rgba(10, 10, 10, 0.9); border: 1px solid var(--color-main);
    color: var(--color-main); padding: 12px 20px; border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5); font-weight: bold;
    z-index: 1100; transition: opacity 0.5s;
}

#cookie-banner {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background-color: #333333;
    color: white;
    padding: 25px 30px;
    text-align: center;
    z-index: 3000;
    border: 2px solid #cccccc;
    border-radius: 8px;
    max-width: 90%;
    width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.8);
}
#cookie-text {
    font-size: 1.1em;
    line-height: 1.6;
    margin-top: 0;
    margin-bottom: 20px;
}
.hidden { display: none !important; opacity: 0; pointer-events: none; }
