/* === Kids Portal — lushka.tanazur.org === */

:root {
    --sky-top: #1a1a2e;
    --sky-bottom: #16213e;
    --card-train: #e74c3c;
    --card-nature: #27ae60;
    --card-science: #2980b9;
    --card-routes: #6950a1;
    --card-oldtrain: #f39c12;
    --text-light: #f0f0f0;
    --text-dark: #1a1a2e;
}

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

html, body {
    height: 100%;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text-light);
    overflow-x: hidden;
}

/* --- Animated sky background --- */
body {
    background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 40%, #0f3460 100%);
    position: relative;
    min-height: 100vh;
}

/* Stars layer */
.stars {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    width: 3px; height: 3px;
    background: #fff;
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.2; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.2); }
}

/* Clouds layer */
.clouds {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.cloud {
    position: absolute;
    background: rgba(255,255,255,0.06);
    border-radius: 50px;
    animation: drift linear infinite;
}

.cloud-1 { width: 200px; height: 50px; top: 8%; animation-duration: 45s; }
.cloud-2 { width: 160px; height: 40px; top: 15%; animation-duration: 55s; animation-delay: -10s; }
.cloud-3 { width: 240px; height: 55px; top: 22%; animation-duration: 65s; animation-delay: -25s; }

@keyframes drift {
    0% { transform: translateX(-300px); }
    100% { transform: translateX(calc(100vw + 300px)); }
}

/* Train running along bottom */
.train-track {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.train {
    position: absolute;
    bottom: 12px;
    font-size: 2rem;
    white-space: nowrap;
    animation: choo-choo 20s linear infinite;
}

@keyframes choo-choo {
    0% { transform: translateX(-200px); }
    100% { transform: translateX(calc(100vw + 200px)); }
}

.track-line {
    position: absolute;
    bottom: 8px;
    left: 0;
    width: 100%;
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        rgba(255,255,255,0.15) 0px,
        rgba(255,255,255,0.15) 20px,
        transparent 20px,
        transparent 30px
    );
}

/* --- Main content --- */
.page-wrap {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem 5rem;
}

/* Top bar */
.top-bar {
    width: 100%;
    max-width: 900px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.lang-toggle {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text-light);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}
.lang-toggle:hover { background: rgba(255,255,255,0.2); }

.parents-link {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.2s;
}
.parents-link:hover { color: rgba(255,255,255,0.8); }

/* Title */
.site-title {
    text-align: center;
    margin-bottom: 2.5rem;
}

.site-title h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 0.4rem;
    text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.site-title p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.7);
}

/* Cards grid */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    width: 100%;
    max-width: 900px;
}

.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2.5rem 1.5rem;
    border-radius: 20px;
    text-decoration: none;
    color: #fff;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    min-height: 220px;
    cursor: pointer;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    pointer-events: none;
}

.card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.card:active {
    transform: translateY(-2px) scale(0.98);
}

.card-train    { background: linear-gradient(135deg, var(--card-train), #c0392b); }
.card-nature   { background: linear-gradient(135deg, var(--card-nature), #1e8449); }
.card-science  { background: linear-gradient(135deg, var(--card-science), #1a5276); }
.card-loop     { background: linear-gradient(135deg, #8e44ad, #6c3483); }
.card-routes   { background: linear-gradient(135deg, var(--card-routes), #4a3580); }
.card-oldtrain { background: linear-gradient(135deg, var(--card-oldtrain), #d68910); }

.card-icon {
    font-size: 3.5rem;
    margin-bottom: 0.8rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.card-desc {
    font-size: 0.9rem;
    opacity: 0.85;
    line-height: 1.4;
}

/* Footer */
.footer {
    margin-top: 3rem;
    text-align: center;
    color: rgba(255,255,255,0.35);
    font-size: 0.75rem;
}

.footer a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
}
.footer a:hover { color: rgba(255,255,255,0.7); }

/* --- Responsive --- */
@media (max-width: 600px) {
    .site-title h1 { font-size: 1.8rem; }
    .site-title p { font-size: 0.95rem; }
    .cards { grid-template-columns: 1fr; gap: 1rem; }
    .card { min-height: 180px; padding: 2rem 1.2rem; }
    .card-icon { font-size: 2.8rem; }
    .page-wrap { padding: 1.5rem 1rem 4rem; }
}

@media (min-width: 601px) and (max-width: 900px) {
    .cards { grid-template-columns: repeat(2, 1fr); }
}
