/* ============================================
   Chillys Dschungelwelt – Gemeinsame Basis-Styles
   Wird von allen Seiten per <link> eingebunden.
   Seiten-eigene <style>-Bloecke ergaenzen/ueberschreiben
   nur noch die individuellen Abweichungen.
   ============================================ */

:root {
    --color-border: #66aa66;
    --color-accent: #ffeb3b;
    --color-accent-orange: #ff9900;
    --color-btn-green: #4caf50;
    --color-btn-green-hover: #45a049;
    --color-btn-gray: #555;
    --color-btn-gray-hover: #666;
    --color-btn-gray-border: #777;
}

/* GRUNDGERUEST: Dschungel-Hintergrund + Flex-Layout, auf allen Seiten identisch */
body {
    margin: 0;
    font-family: 'Arial', sans-serif;
    background-image: url('jungle_bg.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* KARTEN-CHROME: Grundgeruest fuer Info-Banner (Titel-Boxen) */
.header-banner {
    background-color: rgba(44, 76, 44, 0.92);
    border: 3px solid var(--color-border);
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    text-align: center;
}

/* LEGAL-SEITEN: Impressum, Datenschutz, Eltern teilen sich denselben Container */
.imprint-container,
.privacy-container,
.parents-container {
    background-color: rgba(30, 50, 30, 0.96);
    border: 2px solid var(--color-border);
    border-radius: 15px;
    padding: 35px;
    margin: 40px 20px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
}

.imprint-container h1,
.privacy-container h1,
.parents-container h1 {
    color: var(--color-accent);
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 10px;
    margin-top: 0;
    text-shadow: 1px 1px 3px #000;
}

.imprint-container h2,
.privacy-container h2,
.parents-container h2 {
    color: var(--color-accent);
    font-size: 20px;
    margin-top: 25px;
    margin-bottom: 10px;
}

.imprint-container p, .imprint-container li,
.privacy-container p, .privacy-container li,
.parents-container p, .parents-container li {
    font-size: 15px;
    line-height: 1.6;
    color: #e0e0e0;
}

.privacy-container ul,
.parents-container ul {
    padding-left: 20px;
}

/* ZURUECK-BUTTON: Farbe/Rahmen/Hover ueberall gleich, Groesse bleibt pro Seite lokal */
.back-btn, .back-home-btn {
    background-color: var(--color-btn-gray);
    color: white;
    border: 2px solid var(--color-btn-gray-border);
    border-radius: 25px;
    cursor: pointer;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: background 0.2s, transform 0.1s;
}
.back-btn:hover, .back-home-btn:hover {
    background-color: var(--color-btn-gray-hover);
    transform: scale(1.05);
}

/* FOOTER: identisch auf index.html und ausmalbilder.html */
footer {
    margin-top: auto;
    background-color: rgba(0, 0, 0, 0.75);
    width: 100%;
    padding: 15px 0;
    text-align: center;
    font-size: 14px;
    border-top: 2px solid rgba(255,255,255,0.1);
}

footer a {
    color: var(--color-border);
    text-decoration: none;
    margin: 0 15px;
    transition: color 0.2s;
}

footer a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

/* SPIELE-GITTER: Kachel-Uebersicht, genutzt von spiele.html und spielwelt.html */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    width: 92vw;
    max-width: 1100px;
    margin-bottom: 40px;
}

.game-card {
    background-color: rgba(0, 0, 0, 0.75);
    border: 3px solid var(--color-border);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    text-decoration: none;
    color: white;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 260px;
}

.game-card:hover {
    transform: scale(1.05);
    border-color: var(--color-accent);
    box-shadow: 0 12px 25px rgba(255, 235, 59, 0.3);
}

.game-icon {
    font-size: 55px;
    margin-bottom: 15px;
}

.game-card h2 {
    margin: 0 0 10px 0;
    font-size: 22px;
    color: var(--color-accent);
}

.game-card p {
    margin: 0 0 20px 0;
    font-size: 14px;
    line-height: 1.4;
    color: #ccc;
}

.play-btn {
    background-color: var(--color-btn-green);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 16px;
    transition: background 0.2s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.game-card:hover .play-btn {
    background-color: var(--color-btn-green-hover);
}

/* SPIELWELT: generische Szene + Charakter-Leiste, von jeder Raum-Seite genutzt */
.scene-wrapper {
    width: 92vw;
    max-width: 900px;
    margin: 10px auto;
}

.scene {
    position: relative;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    border: 4px solid var(--color-border);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    overflow: hidden;
    touch-action: none;
}

.placed-character {
    position: absolute;
    cursor: grab;
    filter: drop-shadow(2px 6px 6px rgba(0,0,0,0.5));
    animation: spielwelt-idle 2.4s ease-in-out infinite;
    touch-action: none;
    user-select: none;
    transition: width 0.05s linear;
}

.placed-character.dragging {
    cursor: grabbing;
    animation: none;
    transform: scale(1.08);
    z-index: 50;
}

/* Ein Bild pro Charakter (rechtsschauend); nach links wird es gespiegelt,
   damit die Groesse in beide Richtungen garantiert identisch bleibt */
.character-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 0.15s ease;
}

.character-image.facing-left {
    transform: scaleX(-1);
}

.placed-character.highlight {
    animation: spielwelt-highlight 0.6s ease-in-out 2;
}

@keyframes spielwelt-idle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6%); }
}

@keyframes spielwelt-highlight {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.25); }
}

.character-tray {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    background: rgba(0,0,0,0.5);
    padding: 12px;
    border-radius: 15px;
    margin: 10px auto 20px auto;
    max-width: 900px;
    width: 92vw;
    box-sizing: border-box;
}

.tray-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 10px;
    transition: opacity 0.2s, transform 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.tray-icon img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    filter: drop-shadow(1px 3px 4px rgba(0,0,0,0.4));
}

.tray-icon span {
    font-size: 12px;
    font-weight: bold;
    color: white;
    margin-top: 2px;
}

.tray-icon:hover {
    transform: scale(1.08);
    background-color: rgba(255,255,255,0.1);
}

.tray-icon.in-use {
    opacity: 0.35;
}
