/* Global Reset / Base ------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Baloo 2", system-ui, -apple-system, sans-serif;
    background: #F3F7FF;
    color: #333333;
}

/* Layout Container */
.page-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px;
}

/* Headings */
h1, h2, h3 {
    margin-top: 0;
    color: #222222;
}

h1 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

h2 {
    font-size: 1.5rem;
    margin: 1.5rem 0 0.75rem;
}

h3 {
    font-size: 1.2rem;
    margin: 1rem 0 0.5rem;
}

/* Links & Buttons ----------------------------------------------------- */
a {
    color: #03A9F4;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
    text-decoration: none;
}

.btn.primary {
    background: #4CAF50;
    color: #FFFFFF;
    box-shadow: 0 3px 0 #3A8C3C;
}

.btn.secondary {
    background: #03A9F4;
    color: #FFFFFF;
    box-shadow: 0 3px 0 #0277BD;
}

.btn.danger {
    background: #F44336;
    color: #FFFFFF;
    box-shadow: 0 3px 0 #C62828;
}

.btn.small {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 0 rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.2);
}

/* Cards / Boxen ------------------------------------------------------- */
.card {
    background: #FFFFFF;
    border-radius: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    padding: 16px 18px;
    margin-bottom: 16px;
}

/* Forms ---------------------------------------------------------------- */
label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #CCCCCC;
    font-size: 0.95rem;
    font-family: inherit;
    margin-bottom: 12px;
    background: #FFFFFF;
}

input[type="file"] {
    padding: 6px;
    background: #FAFAFA;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #03A9F4;
    box-shadow: 0 0 0 2px rgba(3,169,244,0.15);
}

/* Tabellen ------------------------------------------------------------- */
table {
    width: 100%;
    border-collapse: collapse;
    background: #FFFFFF;
    border-radius: 12px;
    overflow: hidden;
    font-size: 0.9rem;
}

table th, table td {
    padding: 8px 10px;
    border-bottom: 1px solid #EEEEEE;
}

table th {
    background: #E3F2FD;
    text-align: left;
}

table tr:last-child td {
    border-bottom: none;
}

table tr:nth-child(even) td {
    background: #FAFAFA;
}

/* Kleine Badges -------------------------------------------------------- */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    background: #E3F2FD;
    color: #0277BD;
}


/* Kinder-Dashboard ----------------------------------------------------- */
.child-dashboard h1 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.child-dashboard h1::after {
    content: "🚀";
    font-size: 1.5rem;
}

/* XP-Box */
.xp-box {
    background: linear-gradient(135deg, #4CAF50, #81C784);
    border-radius: 18px;
    padding: 14px 16px;
    color: #FFFFFF;
    margin: 12px 0 18px;
    box-shadow: 0 5px 12px rgba(76,175,80,0.3);
}

.xp-level {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.xp-progress {
    width: 100%;
    background: rgba(255,255,255,0.3);
    border-radius: 999px;
    height: 12px;
    overflow: hidden;
    margin-bottom: 4px;
}

.xp-bar {
    height: 100%;
    background: #FFD54F;
    border-radius: 999px;
    transition: width 0.3s ease;
}

.child-dashboard .dashboard-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

/* Kinder-Dashboard ----------------------------------------------------- */
.child-dashboard h1 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.child-dashboard h1::after {
    content: "🚀";
    font-size: 1.5rem;
}

/* XP-Box */
.xp-box {
    background: linear-gradient(135deg, #4CAF50, #81C784);
    border-radius: 18px;
    padding: 14px 16px;
    color: #FFFFFF;
    margin: 12px 0 18px;
    box-shadow: 0 5px 12px rgba(76,175,80,0.3);
}

.xp-level {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.xp-progress {
    width: 100%;
    background: rgba(255,255,255,0.3);
    border-radius: 999px;
    height: 12px;
    overflow: hidden;
    margin-bottom: 4px;
}

.xp-bar {
    height: 100%;
    background: #FFD54F;
    border-radius: 999px;
    transition: width 0.3s ease;
}

.child-dashboard .dashboard-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

/* Test-Listen ---------------------------------------------------------- */
.test-list h1 {
    margin-bottom: 0.5rem;
}

.test-cards {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.test-card {
    flex: 1 1 min(260px, 100%);
    background: #FFFFFF;
    border-radius: 16px;
    padding: 12px 14px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    border-left: 5px solid #4CAF50;
}

.test-card h3 {
    margin-bottom: 4px;
}

.test-card p {
    margin: 2px 0;
    font-size: 0.9rem;
    color: #555555;
}


/* Avatar --------------------------------------------------------------- */
.avatar-preview {
    width: 200px;
    height: 220px;
    margin: 0 auto 18px;
    position: relative;
    border-radius: 22px;
    background: radial-gradient(circle at top, #E3F2FD, #BBDEFB);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden;
}

.avatar-preview .layer {
    position: absolute;
    width: 200px;
    height: 200px;
    object-fit: contain;
}

.item-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.item {
    width: 90px;
    padding: 6px;
    border-radius: 12px;
    background: #FFFFFF;
    text-align: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.item img {
    width: 70px;
    height: 70px;
}

.item span {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
}

.item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Kleiner Avatar im Dashboard / Elternansicht */
.avatar-small {
    width: 100px;
    height: 110px;
    position: relative;
    margin: 0 auto 6px;
}

.avatar-small .layer {
    position: absolute;
    width: 100px;
    height: 100px;
    object-fit: contain;
}


/* Missionen ------------------------------------------------------------ */
.mission-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 10px 12px;
    margin-bottom: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.04);
    border-left: 5px solid #03A9F4;
}

.mission-card.completed {
    border-left-color: #4CAF50;
    background: #E8F5E9;
}

.mission-card h3 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.mission-card p {
    margin: 2px 0;
    font-size: 0.85rem;
}

.progress-bar {
    background: #EEEEEE;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    margin: 6px 0;
}

.progress-fill {
    background: linear-gradient(90deg, #03A9F4, #4CAF50);
    height: 100%;
    border-radius: 999px;
}

/* Sticker-Galerie ------------------------------------------------------ */
.stickers-grid,
.stickers-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sticker {
    width: 110px;
    padding: 8px;
    border-radius: 14px;
    text-align: center;
    font-size: 0.8rem;
}

.sticker.unlocked {
    background: #FFFDE7;
    border: 2px solid #FFC107;
    box-shadow: 0 3px 8px rgba(0,0,0,0.06);
}

.sticker.locked {
    background: #F5F5F5;
    border: 2px dashed #BDBDBD;
    opacity: 0.6;
}

.sticker img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}


/* Eltern-Dashboard ----------------------------------------------------- */
.parent-dashboard h1 {
    margin-bottom: 0.5rem;
}

.children-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.child-card {
    flex: 1 1 min(260px, 100%);
    background: #FFFFFF;
    border-radius: 18px;
    padding: 12px 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.child-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.child-card h3 {
    text-align: center;
    margin-bottom: 6px;
}

.child-card p {
    margin: 2px 0;
    font-size: 0.85rem;
    color: #555555;
}


.star-pop {
    animation: starPop 0.5s ease-out forwards;
}

@keyframes starPop {
    0%   { transform: scale(0.2); opacity: 0; }
    60%  { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); }
}

/* Eltern-Dashboard - Loading Spinner- */
.loader-wrap {
    width: 100%;
    text-align: center;
    padding: 30px 0;
}

.loader {
    border: 6px solid #EEE;
    border-top: 6px solid #4CAF50;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin: 0 auto;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


.dashboard-row {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    margin-top: 20px;
}

.avatar-column {
    flex: 0 0 150px;
    text-align: center;
}

.kid-avatar {
    width: 140px;
    height: 140px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.sticker-status-column {
    flex: 1;
    background: #fff;
    padding: 18px;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.10);
}

.dash-subtitle {
    margin-top: 0;
    font-size: 20px;
    margin-bottom: 8px;
}

.sticker-progress {
    margin: 0;
    font-size: 16px;
    color: #444;
}

.sticker-preview {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.sticker-mini {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: contain;
    background: #f3f3f3;
    padding: 4px;
}

.empty-stickers {
    color: #999;
    font-size: 14px;
}

/* --- Topbar Header --- */

.topbar {
    width: 100%;
    background: #ffffff;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #e8e8e8;
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar-left .logo img {
    height: 48px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toplink {
    font-size: 17px;
    font-weight: 600;
    text-decoration: none;
    color: #444;
    transition: color .2s;
}

.toplink:hover {
    color: #1e88e5;
}

.sep {
    color: #999;
    font-size: 18px;
}

/* Main content spacing */
.content {
    padding: 20px;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 25px 10px;
    border-top: 1px solid #ddd;
}

.site-footer p {
    margin: 0;
    font-size: 15px;
    color: #555;
}



@media (max-width: 480px) {
    .toplink {
        font-size: 15px;
    }
    .topbar-left .logo img {
        height: 40px;
    }
}
/* ------------------------------
   📱 MOBILE OPTIMIZATION
   ------------------------------ */
@media (max-width: 768px) {

    body {
        font-size: 18px;
        line-height: 1.4;
    }

    h1 { font-size: 26px; }
    h2 { font-size: 22px; }
    h3 { font-size: 20px; }

    /* Buttons größer */
    .btn, button, a.btn-start {
        font-size: 20px !important;
        padding: 16px 20px !important;
        border-radius: 14px !important;
    }

    /* Test Cards */
    .test-card {
        padding: 18px !important;
        font-size: 18px;
    }

    /* Mission grid → 1 Spalte statt 2 */
    .mission-grid {
        grid-template-columns: 1fr !important;
    }

    /* Sticker grid → größere Karten */
    .sticker-card {
        padding: 14px !important;
    }

    .sticker-card img {
        width: 85px !important;
        height: 85px !important;
    }

    /* Progress bar breiter & höher */
    .progressbar {
        height: 18px !important;
    }

    .progressbar .bar {
        height: 18px !important;
    }

    /* Antwortbuttons (Fragen) */
    .answer-btn {
        font-size: 20px !important;
        padding: 18px !important;
    }
}
