/* ============================================================
   Base
   ============================================================ */
h1:focus, h2:focus, h3:focus {
    outline: none;
}

.materials-dots-background {
    background-color: rgb(243 244 246);
    background-image: radial-gradient(circle, rgb(100 116 139 / 38%) 1px, transparent 1.25px);
    background-size: 16px 16px;
}

.scrollbar-hidden {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.scrollbar-hidden::-webkit-scrollbar {
    display: none;
}

/* Fokus keyboard yang jelas di seluruh aplikasi */
:focus-visible {
    outline: 3px solid #818cf8; /* indigo-400 */
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   Font Jepang (tanpa internet)
   Semua class font-['Noto_Sans_JP',sans-serif] di aplikasi memakai
   nama "Noto Sans JP". Blok ini memetakan nama itu ke font Jepang
   yang sudah terpasang di perangkat, jadi aplikasi tetap bisa
   dipakai offline. Kalau kamu menaruh font Noto Sans JP sendiri di
   wwwroot/fonts, hapus blok ini dan ganti dengan @font-face
   yang mengarah ke file font tersebut.
   ============================================================ */
@font-face {
    font-family: "Noto Sans JP";
    font-weight: 100 600;
    src: local("Noto Sans JP"), local("NotoSansJP-Regular"), local("Noto Sans CJK JP"), local("Hiragino Sans"), local("Hiragino Kaku Gothic ProN"), local("Yu Gothic UI"), local("Yu Gothic"), local("Meiryo");
}

@font-face {
    font-family: "Noto Sans JP";
    font-weight: 700 900;
    src: local("Noto Sans JP Bold"), local("NotoSansJP-Bold"), local("Noto Sans CJK JP Bold"), local("Hiragino Sans W6"), local("Hiragino Sans Bold"), local("Yu Gothic UI Bold"), local("Yu Gothic Bold"), local("Meiryo Bold");
}

/* ============================================================
   Blazor Error UI
   Tampilan kartunya diatur lewat class Tailwind di index.html.
   Blazor mengubah display menjadi "block" saat terjadi error,
   jadi dikembalikan ke flex agar tata letak kartu tetap benar.
   ============================================================ */
#blazor-error-ui[style*="display: block"] {
    display: flex !important;
}

@media (max-width: 640px) {
    .quiz-question-panel {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .quiz-question-panel > :not([hidden]) ~ :not([hidden]) {
        margin-top: 0;
    }

    .quiz-question-card {
        padding: 1.5rem 1rem;
    }

    .quiz-question-text {
        font-size: clamp(1.75rem, 8vw, 3rem);
    }

    .quiz-option {
        min-height: 4rem;
    }

    .quiz-option > span:nth-child(2) {
        font-size: 1.125rem;
    }
}

#quiz-play-shell:fullscreen {
    box-sizing: border-box;
    display: flex;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    margin: 0;
    padding: 0.75rem;
    background-color: rgb(243 244 246);
    background-image: radial-gradient(circle, rgb(100 116 139 / 38%) 1px, transparent 1.25px);
    background-size: 16px 16px;
}

#quiz-play-shell:fullscreen > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0;
}

#quiz-play-shell:fullscreen > section {
    flex-shrink: 0;
}

#quiz-play-shell:fullscreen .quiz-question-panel {
    display: flex;
    min-height: 0;
    flex: 1 0 auto;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
}

#quiz-play-shell:fullscreen .quiz-question-panel > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0;
}

#quiz-play-shell:fullscreen .quiz-question-card {
    padding: clamp(1rem, 3vh, 2rem) 1rem;
}

#quiz-play-shell:fullscreen .quiz-question-text {
    font-size: clamp(1.75rem, 7vh, 4rem);
}

#quiz-play-shell:fullscreen .quiz-options-grid {
    gap: 0.5rem;
}

#quiz-play-shell:fullscreen .quiz-option {
    min-height: 3.5rem;
    gap: 0.5rem;
    padding: 0.75rem;
}

#quiz-play-shell:fullscreen .quiz-option > span:nth-child(2) {
    font-size: clamp(0.9rem, 2.5vh, 1.25rem);
    line-height: 1.25;
}

#quiz-play-shell:fullscreen .quiz-option > span:first-child {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
}

@media (max-width: 640px) {
    #quiz-play-shell:fullscreen .quiz-options-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #quiz-play-shell:fullscreen .quiz-question-panel {
        padding: 0.75rem;
    }

    #quiz-play-shell:fullscreen .quiz-question-text {
        font-size: clamp(1.5rem, 5vh, 2.5rem);
    }

    #quiz-play-shell:fullscreen > section:first-child p:first-child {
        font-size: 1.125rem;
    }

    #quiz-play-shell:fullscreen > section:first-child {
        padding: 0.75rem;
    }
}