/* =====================================
   FLASHCARD BASIC
   ===================================== */

.flashcard-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.flashcard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px;
}

.card {
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 18px 8px;
    text-align: center;
    font-size: 22px;
    background: #fff;
    cursor: pointer;
}

/* =====================================
   POPUP OVERLAY
   ===================================== */

#popup {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999999;
    display: none;
}

/* =====================================
   POPUP BOX (NO FLEX, NO HEIGHT BUG)
   ===================================== */

.popup-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: 90%;
    max-width: 320px;

    background: #fff;
    border-radius: 16px;
    padding: 20px;

    text-align: center;
}

/* popup content */
#popup-hanzi {
    font-size: 36px;
    margin-bottom: 6px;
}

#popup-pinyin {
    font-size: 18px;
    margin-bottom: 6px;
}

#popup-thai {
    font-size: 16px;
}

/* =====================================
   MOBILE GRID
   ===================================== */

@media (max-width: 768px) {
    .flashcard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .flashcard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}