/* =========================================
   TAMATOWN CSS - INHALTSVERZEICHNIS
   1. Globals & Typografie (Schriftarten)
   2. Layout & Container
   3. Navigation (Menü)
   4. Karussell & Split-Dashboard (News & Releases)
   5. Content Elemente (Bilder, Buttons, Text)
   6. Tamagotchi Galerie
   7. Dekorationen & Disclaimer
   8. Globale Responsive Anpassungen
   9. Detailseite (Tamagotchi Infos)
   10. Detailseite Wiki & Icons
   11. Eigene Sammlung
   ========================================= */

/* --- 1. GLOBALS & TYPOGRAFIE --- */
@font-face {
  font-family: 'Madimi One';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url('/fonts/madimi.woff2') format('woff2'); 
}

* {
    box-sizing: border-box; 
}

html, body {
    /* 1. Das Hintergrundbild einbinden */
    background-image: url('/images/pattern.png');
    
    /* 2. Das Bild endlos nach links, rechts, oben und unten wiederholen */
    background-repeat: repeat; 
    
    /* 3. Eine Fallback-Farbe, falls das Bild mal einen Moment zum Laden braucht */
    background-color: #c3dfdf; 
    
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #697779;
    margin: 0;
    padding: 5px;
    line-height: 1.5;
    background-attachment: fixed;
}

/* Schriftarten-Zuweisung (Google Fonts 'Madimi One') */
h1, h2, h3, .carousel-header, .intro-text {
    font-family: 'Madimi One', cursive;
    font-weight: 400; 
}

h1 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 0.5em;
    color: #697779;
    font-size: 2.2em;
}

h2, h3 {
    color: #697779;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

/* --- 2. LAYOUT & CONTAINER --- */
.page-container {
    background-color: #F2f1e7;
    max-width: 1400px; 
    margin: 0 auto;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
    position: relative;
    z-index: 10; 
    width: 100%;
}

.content-wrapper {
    display: flow-root; 
    margin-top: 20px;
}

.section-title {
    color: #697779;
    font-size: 1.8em;
    margin: 40px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #697779;
    text-align: left;
}

/* --- 3. NAVIGATION (MENÜ) --- */
.main-nav {
    max-width: 1400px; 
    margin: 0 auto 20px auto;
    background-color: #F2f1e7;
    border-radius: 8px;
    padding: 15px 40px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    width: 100%;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center; 
}

.main-nav li {
    margin: 0 25px;
}

.main-nav a {
    font-family: 'Madimi One', cursive;
    color: #697779 !important;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 16px;
    transition: color 0.3s ease;
    text-decoration: none;
}

.main-nav a:hover {
    color: #9c755a !important;
}

/* Hamburger Menü Button */
.menu-toggle {
    display: none; 
    font-family: 'Madimi One', cursive;
    cursor: pointer;
    font-weight: 400;
    color: #697779;
    text-transform: uppercase;
    align-items: center;
    justify-content: center;
}

.hamburger {
    margin-right: 10px;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #697779;
    margin: 4px 0;
    transition: 0.3s ease; 
}

/* Navigation Smartphone Anpassungen */
@media (max-width: 768px) {
    .main-nav {
        padding: 15px; 
    }
    .menu-toggle {
        display: flex; 
    }
    .main-nav ul {
        display: none; 
        flex-direction: column;
        width: 100%;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid #ddd; 
    }
    .main-nav ul.active {
        display: flex; 
        gap: 15px;
    }
    .main-nav li {
        margin: 0;
        text-align: center; 
    }
}

/* --- 4. KARUSSELL & SPLIT-DASHBOARD (NEWS & RELEASES) --- */
.top-dashboard {
    display: flex;
    gap: 30px;
    margin-bottom: 3em;
    align-items: stretch;
}

.news-column {
    flex: 1; 
    min-width: 0; 
}

.releases-column {
    flex: 1; 
    min-width: 0;
    background: #fbfaf0;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.releases-list {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto; 
}

/* --- DESIGN DER EINZELNEN RELEASES --- */
.release-item {
    display: flex;
    gap: 15px;
    align-items: center; 
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.release-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.release-img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.release-info h4 {
    margin: 0 0 5px 0;
    font-size: 1.2em;
    color: #697779;
}

.release-date {
    display: inline-block;
    font-size: 0.8em;
    color: #fff;
    background: #9c755a; 
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 8px;
    font-weight: bold;
}

.release-info p {
    margin: 0;
    font-size: 0.9em;
    color: #697779;
    line-height: 1.4;
}

/* Das Karussell in der neuen Box */
.carousel-container {
    position: relative;
    max-width: 100%;
    margin-bottom: 0;
    height: 100%; 
    min-height: 450px; 
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.carousel-header {
    background: #f2f1e7; 
    color: #697779; 
    padding: 12px 15px;
    text-align: center;
    font-weight: bold;
    font-size: 1.2em;
    text-transform: uppercase;
    letter-spacing: 1px; 
    position: relative;
    z-index: 10;
}

.carousel-slide { 
    display: none; 
    height: calc(100% - 48px); 
}

.carousel-slide.active { display: block; }
.carousel-slide img { 
    width: 100%; 
    height: calc(100% - 130px); 
    object-fit: contain; 
    background-color: #fbfaf0; 
    padding: 15px; 
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fbfaf0;
    color: #697779;
    padding: 20px 40px;
    text-align: left;
}

.carousel-thumbs {
    position: absolute;
    bottom: 15px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.thumb {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border: 2px solid transparent;
    cursor: pointer;
    border-radius: 4px;
}

.thumb.active { border-color: #4c4c4c; }

/* Dashboard Smartphone Anpassungen */
@media (max-width: 900px) {
    .top-dashboard {
        flex-direction: column;
    }
    .carousel-container {
        height: auto; 
        min-height: 0; 
    }
}

@media (max-width: 768px) {
    .carousel-slide {
        height: auto; 
    }
    .carousel-slide.active {
        display: flex;
        flex-direction: column;
    }
    .carousel-slide img { 
        width: 100%; 
        height: 100%; 
        object-fit: contain; 
        background-color: #fbfaf0; 
}
    .carousel-caption {
        position: relative;
        width: 100%;
        padding: 15px; 
        background: #fbfaf0; 
        color: #333;
    }
    .carousel-caption h3 {
        font-size: 1.1em;
        margin-top: 0;
        margin-bottom: 5px;
        color: #9c755a;
    }
    .carousel-caption p {
        display: -webkit-box;
        -webkit-line-clamp: 2; 
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin: 0;
        font-size: 0.9em;
    }
    .carousel-thumbs {
        display: none; 
    }
    .prev, .next {
        position: absolute !important; 
        top: 120px; 
        transform: translateY(-50%);
        z-index: 10; 
        background: rgba(0, 0, 0, 0.6); 
        color: #fff; 
        width: 40px; 
        height: 40px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%; 
        font-size: 16px;
        border: 2px solid rgba(255, 255, 255, 0.3); 
        box-shadow: 0 4px 10px rgba(0,0,0,0.3); 
    }
    .prev { left: 5px; }
    .next { right: 5px; }
}

/* --- 5. CONTENT ELEMENTE (Bilder, Buttons, Text) --- */
.intro-text, .intro-section {
    font-size: 18px;
    color: #697779;
    font-weight: 600;
    text-align: center;
    margin-bottom: 2.5em;
}

.side-image {
    float: left;
    width: 600px; 
    max-width: 100%;
    margin-right: 30px;
    margin-bottom: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

a {
    color: #9c755a;
    text-decoration: none;
    font-weight: 500;
}

.discord-button, 
.tama-button {
    background-color: #9c755a;
    color: #F2f1e7 !important;
    padding: 16px 35px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: bold;
    display: inline-block;
    transition: all 0.3s ease;
    margin-top: 20px;
    text-decoration: none;
    
    /* Browsermüll bei echten Buttons löschen */
    border: none;
    outline: none;
    box-shadow: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

/* Der Effekt beim Drübergehen mit der Maus */
.discord-button:hover, 
.tama-button:hover {
    background-color: #7d5e48; /* Wird einfach nur elegant etwas dunkler */
    color: #F2f1e7 !important;
    text-decoration: none;
}

.content-wrapper h2:first-of-type {
    margin-top: 0;
}

/* --- 6. TAMAGOTCHI GALERIE --- */
.tama-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.tama-card {
    background: #fbfaf0;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tama-card:hover {
    transform: translateY(-10px);
}

.tama-image {
    height: 200px;
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.tama-image img {
    max-width: 100%;
    max-height: 100%;
}

/* --- 7. DEKORATIONEN & DISCLAIMER --- */
.side-decor {
    position: fixed;
    z-index: 1;
    width: 180px;
    left: 50%;
}

.side-decor img {
    width: 100%;
    height: auto;
    opacity: 0.9;
}

.disclaimer {
    margin-top: 40px;
    padding-top: 20px;
    font-size: 0.85em;
    font-style: italic;
    text-align: center;
    color: #888;
}

/* --- 8. GLOBALE RESPONSIVE ANPASSUNGEN --- */
@media (max-width: 1850px) { 
    .side-decor {
        display: none; 
    }
}

@media (max-width: 768px) {
    .page-container {
        padding: 20px;
    }
    .side-image {
        float: none;
        display: block;
        width: 100%;
        margin: 0 auto 25px auto;
    }
}

.tama-name {
    display: flex;
    flex-direction: column; 
    gap: 5px; 
    font-weight: bold;
}

.tama-year {
    font-size: 0.85em; 
    color: #9c755a; 
    font-weight: normal;
}

/* --- 9. DETAILSEITE (Tamagotchi Infos) --- */
.detail-container {
    display: flex;
    gap: 40px;
    margin-top: 20px;
}

.detail-content {
    flex: 2; 
}

.detail-infobox {
    flex: 1; 
    background-color: #fbfaf0;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    height: fit-content;
}

.infobox-img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9em;
}

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

.info-label {
    font-weight: bold;
    color: #9c755a;
}

@media (max-width: 900px) {
    .detail-container {
        flex-direction: column;
    }
}

/* --- 10. DETAILSEITE WIKI & ICONS --- */
.bg-comparison-img {
    width: 250px;
    height: auto;
}

.function-list {
    margin-top: 20px;
}

.function-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.function-item:last-child {
    border-bottom: none;
}

.function-icon {
    width: 60px;
    height: auto;
    flex-shrink: 0;
    image-rendering: pixelated; 
    border: 1px solid #ddd;
    padding: 5px;
    border-radius: 5px;
}

.function-text {
    font-size: 0.95em;
    line-height: 1.6;
    color: #697779;
}

.function-text strong {
    display: block;
    color: #9c755a;
    font-size: 1.1em;
    margin-bottom: 5px;
}

/* --- 11. EIGENE SAMMLUNG --- */
/* Das Raster passt sich jetzt vollautomatisch der Bildschirmgröße an */
/* --- 11. EIGENE SAMMLUNG --- */

/* Das Raster passt sich jetzt vollautomatisch der Bildschirmgröße an */
.collection-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr); 
    gap: 15px; /* Etwas enger zusammen (vorher 20px) */
}

/* Ab größeren Smartphones / kleinen Tablets: 2 Kacheln nebeneinander */
@media (min-width: 480px) {
    .collection-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Ab normalen Tablets und kleineren Monitoren: 3 Kacheln nebeneinander */
@media (min-width: 768px) {
    .collection-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Auf großen Desktop-Bildschirmen (ab 1200px): 5 Kacheln nebeneinander */
@media (min-width: 1200px) {
    .collection-grid { grid-template-columns: repeat(5, 1fr); }
}

/* KOMPAKTERE KACHELN FÜR DEN PC */
.collection-card {
    background: #fbfaf0;
    border-radius: 12px; /* Ecken minimal schärfer */
    padding: 12px; /* Weniger toter Raum am Rand (vorher 15px) */
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease;
}

.collection-card:hover {
    transform: translateY(-5px); 
}

.collection-img-wrapper {
    height: 140px; /* DEUTLICH kompakter (vorher 200px) */
    background: #f2f1e7;
    border-radius: 8px;
    margin-bottom: 10px; /* Vorher 15px */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    padding: 5px; /* Bild füllt den Platz besser aus */
}

.collection-img-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.collection-name {
    font-family: 'Madimi One', cursive;
    color: #697779;
    font-size: 1.1em; /* Minimal kleiner (vorher 1.2em) */
    margin: 0 0 6px 0;
}

/* Preis Wrapper & Badges */
.collection-price-wrapper {
    display: flex;
    gap: 5px; /* Näher aneinander */
    flex-wrap: wrap;
    margin-bottom: 8px; /* Vorher 12px */
}

.collection-price {
    display: inline-block;
    background: #cce0e5; 
    color: #697779; 
    font-weight: bold;
    font-size: 0.75em; /* Vorher 0.8em */
    padding: 3px 8px; /* Vorher 4px 12px */
    border-radius: 10px;
    margin: 0;
    width: fit-content;
}

.collection-price.wert {
    background: #e8d8cd;
    color: #697779;
}

.collection-note {
    font-size: 0.85em; /* Vorher 0.9em */
    color: #888;
    line-height: 1.4;
    margin: 0;
    flex-grow: 1; 
}

/* Gesamtwert Box (Ganz oben) */
.collection-total-box {
    background-color: #cce0e5;
    border: 2px solid #697779;
    border-radius: 12px;
    padding: 25px 40px;
    text-align: center;
    margin: 0 auto 50px auto;
    width: fit-content;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.collection-total-title {
    margin: 0 0 15px 0;
    color: #697779;
    font-size: 1.6em;
    font-family: 'Madimi One', cursive;
}

.collection-total-flex {
    display: flex;
    gap: 40px;
    justify-content: center;
    flex-wrap: wrap;
}

.collection-total-label {
    font-size: 0.85em;
    color: #888;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
}

.collection-total-value {
    font-size: 2.2em;
    font-weight: bold;
    line-height: 1.1;
}

.collection-total-value.ek {
    color: #697779;
}

.collection-total-value.wert {
    color: #697779;
}

.collection-total-divider {
    width: 2px;
    background-color: #9c755a;
    opacity: 0.3;
    border-radius: 2px;
}

/* --- RESPONSIVE ANPASSUNGEN FÜR DIE SAMMLUNG (Handy-Ansicht) --- */
@media (max-width: 768px) {
    /* Gesamtwert-Box: Linie ausblenden und Werte perfekt untereinander zentrieren */
    .collection-total-divider {
        display: none;
    }
    
    .collection-total-flex {
        flex-direction: column;
        gap: 15px; /* Etwas weniger Abstand, wenn sie untereinander stehen */
        align-items: center;
    }

    /* Karten: Name und Preis-Buttons zentrieren */
    .collection-name {
        text-align: center;
    }
    
    .collection-price-wrapper {
        justify-content: center;
    }
}

/* --- IMPRESSIONEN GALERIE --- */
.collection-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 50px;
}

.collection-gallery img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.collection-gallery img:hover {
    transform: scale(1.02);
}

@media (max-width: 768px) {
    .collection-gallery {
        grid-template-columns: 1fr; /* Auf dem Handy Bilder untereinander */
    }
}

/* --- LIGHTBOX MODAL --- */
.modal {
    display: none; /* Standardmäßig versteckt */
    position: fixed;
    z-index: 1000; /* Ganz nach vorne über alles andere */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Dunkler, transparenter Hintergrund */
    backdrop-filter: blur(5px); /* Macht den Hintergrund hinter dem Bild unscharf */
    align-items: center;
    justify-content: center;
}

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 4px 25px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease; /* Weiche Zoom-Animation */
}

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

.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #9c755a;
}

/* --- MOBILE ZENTRIERUNG FÜR SEITEN-BILDER --- */
@media (max-width: 768px) {
    .side-image {
        float: none !important;
        display: block !important;
        margin: 0 auto 25px auto !important;
        max-width: 100%;
    }
}

/* --- ZENTRIERUNG FÜR BILDER (Desktop & Mobile) --- */
.side-image {
    display: block !important;    /* Macht das Bild zum Block-Element */
    float: none !important;       /* Verhindert, dass Text daneben fließt */
    margin: 0 auto 30px auto !important; /* Zentriert das Bild und gibt Abstand nach unten */
    max-width: 100%;              /* Verhindert, dass das Bild über den Rand ragt */
    height: auto;
    width: 500px;                 /* Deine gewünschte Standardbreite für das Baustellen-Bild */
}

/* Auf kleinen Handys darf es natürlich schmaler werden */
@media (max-width: 600px) {
    .side-image {
        width: 100%;
    }
}

/* Styling für die Checkbox-Flächen neben den Admin-Buttons */
.admin-checkbox-flat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #fff;     /* Weißer Hintergrund passend zu den Inputs */
    padding: 10px 15px;         /* Gleiches Padding wie die Buttons */
    border-radius: 8px;         /* Passende Eckenabrundung */
    font-size: 0.9em;
    font-weight: bold;
    color: #697779;
    box-sizing: border-box;
    height: 39px;               /* Erzwingt exakt dieselbe Höhe wie die Buttons */
    cursor: pointer;
    user-select: none;
}

/* Macht die Checkboxen und Labels klickbar */
.admin-checkbox-flat input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
}

.admin-checkbox-flat label {
    cursor: pointer;
    line-height: 1;
}

/* ==========================================================================
   Tamagotchi Sammlung & Wunschliste (Ausgelagert aus sammlung.php)
   ========================================================================== */

/* Seiten-Hintergrund für die Sammlung */
body.sammlung-page {
    background-color: #c3dfdf;
}

/* Status- und Fehlermeldungen */
.status-message {
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    color: #9c755a;
    margin-bottom: 15px;
}

/* Admin-Leiste (Buttons) */
.admin-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-controls .discord-button, 
#addForm .discord-button,
.edit-form-container .discord-button { 
    padding: 10px 20px; 
    font-size: 0.9em; 
    min-width: auto;
    border: none;
    box-shadow: none;
    outline: none;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
}

/* "Hinzufügen"-Formular */
.hidden-form { 
    display: none; 
    background: #fbfaf0; 
    padding: 20px; 
    border-radius: 15px; 
    margin-top: 20px; 
    margin-bottom: 30px; 
    border: 2px dashed #9c755a; 
}

#addForm h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

#addForm form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* --- HINZUFÜGEN-FORMULAR: ÄRA & CHECKBOXEN (Profi-Layout) --- */
.form-era-row {
    display: flex;
    gap: 15px;
    align-items: flex-start; /* Oben bündig! */
    flex-wrap: wrap;
}

.era-dropdown-col {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
}

.era-dropdown-col label {
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 5px;
    display: block;
    color: #697779;
}

.era-help-link {
    font-size: 0.85em; 
    color: #7289da; 
    text-decoration: underline; 
    margin-top: 5px; 
    display: inline-block; 
    cursor: pointer; 
    font-family: 'Madimi One', cursive;
}

.era-help-link:hover {
    color: #5b6eae;
}

.era-checkbox-col {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
}

/* DER PROFI-TRICK: Ein unsichtbarer CSS-Platzhalter, der exakt so groß ist wie das Label links */
.era-checkbox-col::before {
    content: "\00a0"; /* Unsichtbares Leerzeichen */
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 5px;
    display: block;
    visibility: hidden;
}

.era-checkbox-col .form-checkbox-group {
    margin: 0;
    width: 100%;
    min-height: 41px; 
}

/* Mobile Anpassung */
@media (max-width: 650px) {
    .form-era-row {
        gap: 10px; 
    }
    /* Auf dem Handy schalten wir den Platzhalter ab, da die Boxen untereinander stehen */
    .era-checkbox-col::before {
        display: none;
    }
}

.form-group-era label,
.form-file-upload label {
    font-weight: bold;
    font-size: 0.9em;
    display: block;
    margin-bottom: 5px;
}

#addForm select,
#addForm input[type="text"],
#addForm textarea {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-family: inherit;
    box-sizing: border-box;
    background: #fff;
}

#addForm select {
    background: #fff;
    width: 100%;
}

.form-file-upload input[type="file"] {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
}

/* Verwaltungselemente auf den Kacheln (Stift & Mülltonne) */
.checkbox-container { 
    display: none; 
    position: absolute; 
    top: 10px; 
    right: 10px; 
    z-index: 10; 
    background: rgba(255,255,255,0.95); 
    border-radius: 5px; 
    padding: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    gap: 12px;
    align-items: center;
}

.edit-trigger-btn { 
    background: none; 
    border: none; 
    cursor: pointer; 
    font-size: 1.1em; 
    padding: 0; 
    margin: 0; 
    display: block; 
    line-height: 1; 
    transition: transform 0.1s; 
}

.edit-trigger-btn:hover { 
    transform: scale(1.15); 
}

/* Inline Bearbeiten-Formular */
.edit-form-container {
    display: none;
    background: #fdfaf7;
    border-top: 1px dashed #ccc;
    margin-top: 10px;
    padding-top: 10px;
    text-align: left;
}

.edit-form-heading {
    font-weight: bold;
    font-size: 0.8em;
    margin-bottom: 5px;
    color: #9c755a;
}

.edit-form-container input, 
.edit-form-container textarea, 
.edit-form-container select {
    width: 100%;
    padding: 6px;
    margin-bottom: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.85em;
    box-sizing: border-box;
}

.edit-form-container label {
    font-size: 0.75em;
    font-weight: bold;
    display: block;
}

.edit-form-container .form-checkbox-group {
    margin-bottom: 8px;
    padding: 4px 8px;
}

.edit-form-container .btn-save-edit {
    padding: 5px 10px;
    font-size: 0.8em;
    width: 100%;
    text-align: center;
}

/* Checkboxen & Badges */
.form-checkbox-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
    background: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    min-height: 41px;
    height: auto;
    box-sizing: border-box;
}

.form-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
    cursor: pointer;
    color: #555;
    white-space: nowrap; 
}

.form-checkbox-group input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Radio-Gruppe (Sammlung vs Wunschliste) */
.form-radio-group {
    display: flex;
    flex-direction: column; 
    gap: 12px; 
    background: #fff; 
    padding: 12px; 
    border-radius: 8px; 
    border: 1px solid #ddd;
    margin-bottom: 5px;
}

.form-radio-group label {
    font-weight: bold; 
    cursor: pointer; 
    display: grid;
    grid-template-columns: auto auto 1fr; 
    align-items: center; 
    gap: 8px;
    font-size: 0.9em; 
    color: #697779;
}

.form-radio-group .radio-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

/* Eingabereihen */
.form-inputs-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.form-inputs-row input {
    flex: 1;
    min-width: 140px; 
    padding: 10px; 
    border-radius: 8px; 
    border: 1px solid #ccc;
    box-sizing: border-box;
}

/* Statistiken Banner */
.stats-banner {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.stat-box {
    background: #fbfaf0;
    padding: 12px 20px;
    border-radius: 12px;
    border: 2px solid #697779;
    font-size: 0.95em;
    font-weight: bold;
    color: #697779;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.stat-box span {
    color: #9c755a;
    font-family: 'Madimi One', cursive;
    font-size: 1.1em;
}

/* Tabs Navigation */
.tabs-wrapper {
    display: flex;
    justify-content: center;
    margin: 30px 0 15px 0;
}

.tabs-container {
    display: inline-flex;
    background: #e4e2d5; 
    padding: 5px;
    border-radius: 30px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.08);
}

.tab-btn {
    font-family: 'Madimi One', cursive;
    background: transparent;
    border: none;
    padding: 8px 25px;
    border-radius: 25px;
    cursor: pointer;
    color: #697779;
    font-size: 0.95em;
    transition: all 0.25s ease;
}

.tab-btn:hover {
    color: #9c755a;
}

.tab-btn.active {
    background: #9c755a; 
    color: #fff;
    box-shadow: 0 2px 8px rgba(156, 117, 90, 0.3);
}

.tab-content {
    display: none;
}

/* Platzhalter / Karten-Designs */
.empty-collection-notice {
    text-align: center; 
    background: #fff; 
    padding: 20px; 
    border-radius: 12px; 
    margin-top: 20px;
}

.collection-card {
    position: relative;
}

.collection-card.wishlist-card {
    border: 1px dashed #9c755a; 
    background: #fbfaf0;
}

.collection-img-fallback {
    width: 100%; 
    height: 100%; 
    background: #e0e0e0; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: #777; 
    font-size: 0.9em;
}

.collection-price.price-target {
    background: #e5e5e5;
}

.collection-price.price-collector {
    background: #f2e3d5;
}

/* Footer-Versionierung */
.version-tracker {
    text-align: center; 
    font-size: 0.75em; 
    opacity: 0.5; 
    margin-top: 10px; 
    margin-bottom: 25px; 
    font-weight: bold; 
    font-family: 'Segoe UI', sans-serif; 
    color: #697779;
}

/* Media Queries für Responsiveness */
@media (min-width: 650px) {
    .form-radio-group {
        flex-direction: row; 
        gap: 25px;
    }
}

@media (max-width: 768px) {
    #addForm input[type="text"],
    #addForm textarea,
    #addForm select,
    .edit-form-container input,
    .edit-form-container textarea,
    .edit-form-container select {
        font-size: 16px !important;
    }
}

@media (max-width: 480px) {
    .collection-price-wrapper {
        flex-direction: column;
        gap: 6px;
    }
    .collection-price {
        width: 100% !important;
        text-align: center;
        font-size: 0.75em !important;
        padding: 4px 8px !important;
    }
}

/* ==========================================================================
   Responsive Listenansicht (Exakt nach Finns Skizze & Linksbündig)
   ========================================================================== */

@media (max-width: 600px) {
    /* Macht aus dem Haupt-Grid eine saubere, fortlaufende Liste */
    .collection-grid {
        display: flex;
        flex-direction: column;
        gap: 10px; /* Weniger Abstand zwischen den Karten */
        padding: 0 5px;
    }

    /* NEU: Echtes, kompaktes Listen-Layout */
    .collection-card {
        display: grid;
        grid-template-columns: 75px 1fr; /* Bild links (75px), rechts der Rest */
        grid-template-areas:
            "img name"
            "img price"
            "note note"
            "edit edit";
        gap: 4px 12px; /* Abstände im Inneren drastisch reduziert */
        text-align: left;
        padding: 10px; /* Weniger toter Raum am Rand */
        border-radius: 10px;
    }

    /* 1. Reihe rechts: Titel rutscht NEBEN das Bild */
    .collection-name {
        grid-area: name;
        margin: 0;
        font-size: 1.05em; /* Minimal kleiner für mehr Platz */
        line-height: 1.2;
        text-align: left !important;
        padding-right: 35px; /* Schützt vor Überlagerung mit Stift/Mülltonne */
        align-self: end; /* Zieht den Namen nah an die Preise heran */
    }

    /* 2. Reihe links: BILD (Etwas kleiner) */
    .collection-img-wrapper {
        grid-area: img;
        width: 75px;
        height: 75px;
        margin: 0;
        border-radius: 8px;
        overflow: hidden;
    }
    
    /* Fallback, falls kein Bild da ist */
    .collection-img-fallback {
        font-size: 0.7em;
    }

    /* 2. Reihe rechts: Kaufpreis & Sammlerwert */
    .collection-price-wrapper {
        grid-area: price;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 4px; /* Preise enger zusammen */
        justify-content: start;
        align-self: start;
    }

    /* Preis-Badges linksbündig und kompakter */
    .collection-price {
        width: auto !important;
        text-align: left !important;
        font-size: 0.75em !important;
        padding: 3px 6px !important;
        display: inline-block;
    }

    /* 3. Reihe (Optional): NOTIZ */
    .collection-note {
        grid-area: note;
        margin: 4px 0 0 0;
        font-size: 0.8em;
        line-height: 1.3;
        text-align: left;
        background: rgba(156, 117, 90, 0.05);
        padding: 6px 10px; /* Etwas schlanker */
        border-radius: 6px;
    }

    /* Bearbeiten-Formular */
    .edit-form-container {
        grid-area: edit;
        margin-top: 8px;
        padding-top: 8px;
        text-align: left;
    }

    /* Steuerungselemente oben rechts anpassen */
    .checkbox-container {
        top: 8px;
        right: 8px;
        gap: 8px;
    }
    
    .edit-trigger-btn {
        font-size: 1em; /* Icons minimal verkleinern */
    }
}

/* ==========================================================================
   Bilder-Lupe (Modal Lightbox) - Perfekt zentriert mit Titelleiste
   ========================================================================== */

.zoomable-img {
    cursor: pointer;
    transition: transform 0.2s ease;
}
.zoomable-img:hover {
    transform: scale(1.02);
}

/* Das abdunkelnde Hintergrund-Overlay */
.modal {
    display: none; /* Wird per JS auf 'flex' gesetzt */
    position: fixed; 
    z-index: 9999; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0, 0, 0, 0.85); 
    backdrop-filter: blur(6px); 
    
    /* Erzeugt die perfekte Zentrierung im Totraum des Bildschirms */
    justify-content: center; 
    align-items: center; 
    padding: 20px;
    box-sizing: border-box;
}

/* Das eigentliche Vorschaufenster */
.modal-dialog {
    background-color: #fff;
    width: 100%;
    max-width: 500px; /* Schöne Box-Breite für Tamagotchis */
    border-radius: 12px;
    overflow: hidden; /* Schneidet die Ecken des braunen Balkens sauber ab */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    animation: zoomAnimation 0.2s ease-out;
}

@keyframes zoomAnimation {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Der braune Balken oben */
.modal-header {
    background-color: #9c755a; 
    padding: 12px 20px;
    display: flex;
    justify-content: space-between; /* Name links, X rechts */
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

/* Modellname im Balken */
.modal-title {
    color: #fff !important;
    font-family: 'Madimi One', cursive;
    font-size: 1.1em !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Schließen-Kreuz im Balken */
.close-modal {
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    user-select: none;
    margin-left: 15px;
}
.close-modal:hover {
    color: #e4e2d5;
}

/* Weißer Innenraum für das Bild */
.modal-body {
    padding: 25px; /* Dicker, gleichmäßiger weißer Rahmen um das Ei */
    background-color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Das Bild im Gehäuse */
.modal-content {
    max-width: 100%;
    max-height: 60vh; /* Verhindert das Herausragen auf kleinen Handys */
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.page-container {
    background-color: #F2f1e7;
}

/* ========================================================= */
/* NEWS-ARCHIV (news.php) RASTER & KACHELN */
/* ========================================================= */

/* Das Raster für die News (Grid-Layout) */
.news-grid {
    display: grid;
    /* Macht das Raster automatisch responsiv: Am PC nebeneinander, am Handy untereinander */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 25px;
    margin-top: 30px;
    margin-bottom: 40px;
}

/* Die einzelne News-Kachel */
.news-card {
    background: #fbfaf0;
    border-radius: 12px;
    overflow: hidden;
    /* Ein ganz weicher, moderner Kasten-Schatten passend zu deinem Flat-Design */
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease;
}

/* Der kleine Hüpf-Effekt beim Drübergehen mit der Maus */
.news-card:hover {
    transform: translateY(-5px); 
}

/* Das Cover-Bild oben in der Kachel */
.news-image {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
}

/* Der Textbereich unter dem Bild */
.news-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Schiebt den Button automatisch immer ans untere Ende der Kachel */
}

/* Das Datum */
.news-date {
    font-size: 0.85em;
    color: #888;
    margin-bottom: 8px;
    font-weight: bold;
}

/* Die Überschrift der News */
.news-title {
    color: #697779;
    font-size: 1.3em;
    margin-top: 0;
    margin-bottom: 20px;
    font-family: 'Madimi One', cursive;
    line-height: 1.3;
}

/* ========================================================= */
/* ARTIKEL LESE-ANSICHT (news_lesen.php) */
/* ========================================================= */

.news-article-view {
    background: #fbfaf0;
    padding: 40px;
    border-radius: 12px;
    border: 1px solid #eee;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 40px;
}

.article-title {
    color: #9c755a;
    font-size: 2.2em;
    margin-top: 0;
    margin-bottom: 10px;
    font-family: 'Madimi One', cursive;
}

.article-date {
    color: #888;
    font-weight: bold;
    margin-bottom: 30px;
    font-size: 1em;
    text-align: left;
}

.article-cover {
    width: 500px;       /* Deine absolute Wunschbreite für PCs */
    max-width: 100%;    /* Die magische Bremse fürs Handy! Niemals breiter als der Container. */
    height: auto;       /* Verhindert, dass das Bild gestaucht wird */
    display: block;
    margin: 0 auto 30px auto;
    border-radius: 12px;
    box-sizing: border-box; /* Zwingt den Browser, Ränder richtig zu berechnen */
}

/* Formatierung für den TinyMCE HTML-Code */
.article-content {
    line-height: 1.8;
    color: #444;
    font-size: 1.15em;
}

/* Zwingt ALLE Bilder aus dem Editor, im Rahmen zu bleiben! */
.article-content img {
    max-width: 100%;
    height: auto !important; /* Verhindert, dass Bilder verzerrt werden */
    border-radius: 8px;
    margin: 20px 0;
}

/* Zwingt eingebettete Videos, im Rahmen zu bleiben */
.article-content iframe {
    max-width: 100%;
    border-radius: 8px;
    margin: 20px 0;
}

/* Verschönert die Links im Text */
.article-content a {
    color: #9c755a;
    font-weight: bold;
    text-decoration: underline;
}

.article-content a:hover {
    color: #d9534f;
}

/* Automatische Handy-Optimierung für die News-Lese-Ansicht */
@media (max-width: 600px) {
    .news-article-view {
        padding: 15px; 
    }
    
    /* NEU: Bändigt die Überschrift auf dem Handy */
    .article-title {
        font-size: 1.5em; /* Macht die Schrift deutlich kompakter */
        line-height: 1.3; /* Zieht die Zeilen etwas schöner zusammen */
        text-align: left; /* Linksbündig liest sich bei vielen Wörtern viel besser! */
    }
}

/* --- Styling für die PC-Ansicht (strikt nebeneinander) --- */
.lang-switch {
    display: inline-flex !important;
    flex-direction: row !important; /* Das hier zwingt die Links nebeneinander */
    align-items: center;
    gap: 12px;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid rgba(105, 119, 121, 0.3);
    vertical-align: middle;
}
.lang-switch a {
    display: flex;
    align-items: center;
}

.lang-switch img {
    width: 24px;
    height: auto;
    border-radius: 2px;
    display: block;
}

/* --- Umstyling für die mobile Smartphone-Ansicht --- */
@media (max-width: 768px) {
    .lang-switch {
        display: flex !important; /* <-- Hier ist das wichtige Update! */
        justify-content: center;
        align-items: center;
        width: 100%;
        gap: 15px;
        
        /* Die PC-Abstände und den seitlichen Strich am Handy abschalten */
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        
        /* Dafür saubere Abstände unter dem Abmelden-Button erzeugen */
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid #ddd;
    }
}

/* ========================================================= */
/* TRACKER HEADER BANNER (mit Maskottchen) */
/* ========================================================= */
.tracker-header-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
    margin-bottom: 40px;
    flex-wrap: wrap; /* Erlaubt den Umbruch auf extrem schmalen Displays */
}

.tracker-header-text {
    text-align: center;
}

.tracker-header-text h1 {
    margin: 0;
    font-size: 2.2em; /* <-- Hier auf die normale Standard-Größe angepasst */
    line-height: 1.1;
}

.tracker-header-text .intro-text {
    margin: 5px 0 0 0;
}

.header-mascot {
    width: 90px;
    height: 90px; /* Zwingt alle Figuren auf exakt die gleiche Maximalhöhe */
    object-fit: contain; /* Verhindert Verzerrungen und passt das Bild perfekt in die 90x90 Box ein */
}

/* Automatische Anpassung für Smartphones */
@media (max-width: 600px) {
    .tracker-header-banner {
        flex-wrap: nowrap;
        gap: 10px;
    }
    .header-mascot {
        width: 55px;
        height: 55px; /* <-- Hier auch die feste Höhe ergänzen */
        flex-shrink: 0;
    }
    .tracker-header-text h1 {
        font-size: 1.5em;
    }
    .tracker-header-text .intro-text {
        font-size: 0.9em;
    }
}

/* Container für das neue Logo */
.logo-banner-container {
    text-align: center;
    padding: 20px;
    margin-bottom: 30px;
    background-color: #fbfaf0; /* Optional: Gleiche Hintergrundfarbe wie dein alter Banner? */
    border-radius: 15px;
}

/* Das Logo selbst */
.tamatown-logo {
    max-width: 100%; /* Verhindert, dass das Logo auf Smartphones abgeschnitten wird */
    height: auto;
    max-height: 350px; /* Hier kannst du begrenzen, wie riesig das Logo am PC maximal werden darf */
    display: inline-block;
}

/* Optionales Styling für den Text unter dem Logo (falls behalten) */
.logo-title {
    color: #9c755a;
    margin-top: 15px;
    margin-bottom: 5px;
}

.logo-subtitle {
    color: #697779;
    margin-top: 0;
}

@media (max-width: 768px) {
    html, body {
        background-image: none !important; /* Schaltet das Muster ab */
        background-color: #c3dfdf; /* Die normale, ruhige Farbe bleibt erhalten */
    }
}

/* ==========================================================================
   Videos auf Desktop verkleinern (app.php)
   ========================================================================== */
@media (min-width: 769px) { /* Wende dies nur an, wenn der Bildschirm breiter als 768px ist (Desktop) */
    .app-install-video {
        max-width: 60%;      /* Begrenze die Breite des Videos auf maximal 80% des Containers */
        margin: 0 auto;       /* Zentriere das Video horizontal innerhalb der Box */
        display: block;       /* Wichtig, damit margin: auto funktioniert */
    }
}