@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&family=Nunito:wght@400;600;700;800&display=swap');

html, body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f1f5f9;
    color: #1e293b;
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-family: 'Fredoka', 'Nunito', sans-serif;
}

.cursor-pointer {
    cursor: pointer;
}

.transition-all {
    transition: all 0.25s ease-in-out;
}

.hover-scale:hover {
    transform: translateY(-4px) scale(1.02);
}

.locked-card {
    filter: grayscale(85%);
    pointer-events: none;
    background-color: #f1f5f9 !important;
}

/* Vláčik a vagóny */
.train-track {
    background: #e2e8f0;
    border-radius: 1.5rem;
    border-bottom: 8px solid #94a3b8;
    position: relative;
    padding: 1.5rem;
}

.wagon {
    min-width: 110px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.wagon:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.wagon-active {
    transform: translateY(-8px) scale(1.08) !important;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.6) !important;
    border: 3px solid #3b82f6 !important;
    background-color: #f0fdf4 !important;
}

.wagon-slot {
    animation: pulse-slow 2s infinite;
}

@keyframes pulse-slow {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

.animate-pulse {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.animate-bounce {
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Tlačidlá a karty */
.btn-primary {
    background-color: #4f46e5;
    border-color: #4338ca;
}
.btn-primary:hover {
    background-color: #4338ca;
    border-color: #3730a3;
}

.bg-indigo {
    background-color: #312e81 !important;
}

.backdrop-blur {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Blazor error UI */
#blazor-error-ui {
    background: #fef08a;
    color: #854d0e;
    bottom: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.75rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 10000;
    font-weight: 600;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.75rem;
}

/* =========================================
   ROZPRÁVKOVÝ WASM LOADER SCREEN
   ========================================= */
.wasm-loader-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #312e81 0%, #1e1b4b 75%, #0f172a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    color: white;
    text-align: center;
    font-family: 'Fredoka', 'Nunito', sans-serif;
    user-select: none;
}

.wasm-loader-card {
    display: flex;
    flex-column: column;
    align-items: center;
    padding: 2.5rem;
    max-width: 480px;
    width: 90%;
}

.wasm-logo-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.wasm-loader-logo {
    width: 130px;
    height: 130px;
    border-radius: 28px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 30px rgba(250, 204, 21, 0.3);
    animation: floatLogo 3s ease-in-out infinite;
    position: relative;
    z-index: 2;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.wasm-logo-glow {
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    background: radial-gradient(circle, rgba(250, 204, 21, 0.4) 0%, rgba(99, 102, 241, 0) 70%);
    border-radius: 40px;
    animation: glowPulse 2s ease-in-out infinite;
    z-index: 1;
}

.wasm-loader-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #facc15;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin: 0 0 0.5rem 0;
}

.wasm-loader-subtitle {
    font-size: 1.05rem;
    color: #cbd5e1;
    margin: 0 0 2rem 0;
    opacity: 0.9;
}

.wasm-progress-container {
    width: 100%;
    max-width: 280px;
    margin-bottom: 1rem;
}

.wasm-progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.wasm-progress-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #f59e0b, #facc15, #38bdf8, #f59e0b);
    background-size: 200% 100%;
    border-radius: 9999px;
    animation: shimmer 1.5s infinite linear;
}

.wasm-percentage-text {
    font-size: 0.95rem;
    color: #94a3b8;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.wasm-percentage-text:after {
    content: var(--blazor-load-percentage-text, "Načítavanie...");
}

@keyframes floatLogo {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(1deg);
    }
}

@keyframes glowPulse {
    0%, 100% {
        transform: scale(0.95);
        opacity: 0.4;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes shimmer {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

/* =========================================
   RESPONZÍVNY DIZAJN (TABLET & MOBIL)
   ========================================= */

/* Zaistenie plynulého scrollovania a bezpečných dotykových plôch */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Mobilné a tabletové vylepšenia */
@media (max-width: 991.98px) {
    /* Top-row lišta v MainLayout */
    .top-row {
        height: auto !important;
        min-height: auto !important;
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }

    /* Karty a nápisy */
    h1, .display-5 {
        font-size: 1.85rem !important;
    }
    h2, .display-6 {
        font-size: 1.5rem !important;
    }
    h3 {
        font-size: 1.3rem !important;
    }

    /* Optimalizácia minihry: Vláčik */
    .train-track {
        padding: 1rem !important;
        gap: 0.75rem !important;
    }
    .wagon {
        min-width: 95px !important;
        padding: 0.75rem !important;
    }
    .wagon .fs-2 {
        font-size: 1.5rem !important;
    }
    .wagon .fs-5 {
        font-size: 1.05rem !important;
    }
}

@media (max-width: 575.98px) {
    /* Mobilná obrazovka (telefóny) */
    article.content {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        padding-top: 1rem !important;
    }

    /* Príbehový banner kráľovstva na mobile */
    .home-container .card {
        padding: 1.25rem !important;
    }

    /* Zmenšenie paddingov v minihrách na úsporu miesta */
    .card {
        border-radius: 1rem !important;
    }

    /* Tlačidlá na celú šírku alebo flex wrap */
    .btn-lg {
        font-size: 1.05rem !important;
        padding: 0.65rem 1.25rem !important;
    }

    /* Vláčik na mobile */
    .wagon {
        min-width: 80px !important;
        padding: 0.5rem !important;
    }
    .wagon .fs-2 {
        font-size: 1.35rem !important;
    }
    .wagon .fs-5 {
        font-size: 0.95rem !important;
    }
    .locomotive {
        padding: 0.6rem 0.9rem !important;
        font-size: 0.85rem !important;
    }

    /* Prepínač skladieb v hornej lište */
    .voice-settings-bar select {
        max-width: 140px !important;
    }
}