.tool-card,
.game-card,
.word-list-card{

    background:#fff;

    border-radius:18px;

    padding:24px;

    margin-bottom:25px;

    box-shadow:
    0 6px 20px rgba(0,0,0,.05);

}



.tool-grid{

    display:grid;

    grid-template-columns:
    repeat(auto-fit,minmax(180px,1fr));

    gap:16px;

    margin-bottom:20px;

}

.tool-item{

    display:flex;
    flex-direction:column;
    gap:8px;

}

.tool-item label{

    font-size:14px;
    font-weight:600;
    color:#31475d;

}

.tool-item select{

    appearance:none;
    -webkit-appearance:none;
    -moz-appearance:none;

    width:100%;

    padding:
    12px 42px 12px 14px;

    border-radius:12px;

    border:2px solid #dbeafe;

    background:
    #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='%234f8cff' d='M5.5 7.5L10 12l4.5-4.5' stroke='%234f8cff' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat
    right 12px center;

    font-size:15px;

    font-weight:600;

    color:#31475d;

    cursor:pointer;

    transition:.25s;

    box-sizing:border-box;

}

.tool-item select:hover{

    border-color:#93c5fd;

    box-shadow:
    0 4px 12px rgba(79,140,255,.08);

}

.tool-item select:focus{

    outline:none;

    border-color:#4f8cff;

    box-shadow:
    0 0 0 4px rgba(79,140,255,.12);

}



.tool-buttons{

    display:flex;

    flex-wrap:wrap;

    gap:12px;

    align-items:center;

}

.btn-main{

    background:
    linear-gradient(
    135deg,
    #4f8cff,
    #2f7de1);

    color:#fff;

    border:none;

    padding:12px 20px;

    border-radius:12px;

    cursor:pointer;

}

.btn-secondary{

    background:#eef6ff;

    color:#2563eb;

    border:none;

    padding:12px 20px;

    border-radius:12px;

    cursor:pointer;

}

.select-all-wrap{

    display:flex;

    align-items:center;

    gap:6px;

}







.word-grid{

    display:grid;

    grid-template-columns:
    repeat(auto-fill,minmax(240px,1fr));

    gap:18px;

}

.word-card{

    background:#f8fbff;

    border-radius:16px;

    padding:16px;

    border:2px solid transparent;

    transition:.25s;

}

.word-card.selected{

    border-color:#4f8cff;

    background:#eef6ff;

}

.word-card:hover{

    transform:translateY(-2px);

}



.card-top{

    display:flex;

    justify-content:space-between;

    align-items:center;

    margin-bottom:12px;

}



.icon-speaker{

    cursor:pointer;

    font-style:normal;

    font-size:18px;

}



.word-link{

    display:inline-block;

    font-size:22px;

    font-weight:700;

    color:#0b3d91;

    text-decoration:none;

}


.card-phonetic{

    color:#64748b;

    margin-bottom:10px;

}



.card-meaning{

    color:#334155;

    line-height:1.7;

    font-size:14px;

}



.tool-status{

    margin-top:15px;

}



#download-link{

    color:#2563eb;

    text-decoration:none;

}



@media(max-width:768px){

    .word-grid{

        grid-template-columns:1fr;

    }

    .tool-grid{

        grid-template-columns:1fr;

    }

    .tool-buttons{

        flex-direction:column;

        align-items:stretch;

    }

    .btn-main,
    .btn-secondary{

        width:100%;

    }

}


.unit-nav-card{

    background:#fff;

    border-radius:18px;

    padding:24px;

    margin-bottom:25px;

    box-shadow:
    0 6px 20px rgba(0,0,0,.05);

}

.unit-nav{

    display:flex;

    flex-wrap:wrap;

    gap:12px;

}

.unit-btn{

    padding:10px 18px;

    border-radius:999px;

    text-decoration:none;

    background:#eef6ff;

    color:#2563eb;

    font-size:15px;

    font-weight:600;

    transition:.25s;

}

.unit-btn:hover{

    background:#2563eb;

    color:#fff;

}

.unit-btn.active{

    background:
    linear-gradient(
        135deg,
        #4f8cff,
        #2f7de1
    );

    color:#fff;

}

@media(max-width:768px){

    .lesson-hero{

        padding:20px;

    }

    .lesson-hero h1{

        font-size:26px;

    }

    .unit-nav-card,
    .word-list-card{

        padding:18px;

    }

    .word-grid{

        grid-template-columns:
        repeat(2,1fr);

    }

}

.lesson-hero{

    background:
    linear-gradient(
        135deg,
        #e5f1ff,
        #d8ebff
    );

    border-radius:20px;

    padding:28px;

    margin-bottom:25px;

    box-shadow:
    0 8px 24px rgba(0,0,0,.08);

}

.lesson-hero h1{

    margin:0;

    font-size:34px;

    color:#0b3d91;

    font-weight:800;

}

.lesson-hero h1 span{

    color:#4f8cff;

}

.lesson-meta{

    display:flex;

    flex-wrap:wrap;

    gap:12px;

    margin-top:16px;

}

.lesson-meta span{

    background:#fff;

    border-radius:999px;

    padding:8px 14px;

    color:#35516d;

    font-size:14px;

}


.game-card{

    background:#fff;

    border-radius:18px;

    padding:24px;

    margin-bottom:25px;

    box-shadow:
    0 6px 20px rgba(0,0,0,.05);

}

.game-links{

    display:grid;

    grid-template-columns:repeat(4,1fr);

    gap:12px;

}

.game-links a{

    text-decoration:none;

    text-align:center;

    background:#f8fbff;

    padding:14px 16px;

    border-radius:12px;

    color:#31475d;

    font-size:15px;

    font-weight:600;

    border:2px solid transparent;

    transition:all .25s ease;

}


.game-links a:hover{

    background:#4f8cff;

    color:#fff;

    box-shadow:
    0 6px 18px rgba(79,140,255,.25);

}

.game-links a.active{

    background:
    linear-gradient(
        135deg,
        #4f8cff,
        #2f7de1
    );

    color:#fff;

    border-color:#2563eb;

    box-shadow:
    0 8px 20px rgba(79,140,255,.30);

    pointer-events:none;

}


@media(max-width:992px){

    .game-links{

        grid-template-columns:repeat(2,1fr);

    }

}

@media(max-width:768px){

    .game-card{

        padding:18px;

    }

    .game-links{

        grid-template-columns:repeat(2,1fr);

        gap:10px;

    }

    .game-links a{

        font-size:14px;

        padding:12px;

    }

}


@media(max-width:480px){

    .game-links a{

        min-width:
        calc(50% - 5px);

        font-size:13px;

        padding:12px 8px;

    }

}

.word-card.selected{

    border:2px solid #4f8cff;

    background:#eef5ff;

    box-shadow:
    0 8px 20px rgba(79,140,255,.15);

}
.icon-speaker{

    transition:.3s;

}

.icon-speaker.playing{

    color:#4f8cff;

    animation:
    speakerGlow 1s infinite;

}

@keyframes speakerGlow{

    0%{

        transform:scale(1);

        text-shadow:
        0 0 0 rgba(79,140,255,0);

    }

    50%{

        transform:scale(1.25);

        text-shadow:
        0 0 15px rgba(79,140,255,.8);

    }

    100%{

        transform:scale(1);

        text-shadow:
        0 0 0 rgba(79,140,255,0);

    }

}


.dictation-overlay{

    position:fixed;

    inset:0;

    background:
    rgba(15,23,42,.45);

    backdrop-filter:
    blur(6px);

    display:flex;

    align-items:center;

    justify-content:center;

    z-index:9999;

    opacity:0;

    visibility:hidden;

    transition:.25s;

}

.dictation-overlay.show{

    opacity:1;

    visibility:visible;

}

.dictation-modal{

    position:relative;

    width:min(90vw,520px);

    background:#fff;

    border-radius:24px;

    padding:30px;

    box-shadow:
    0 20px 60px
    rgba(0,0,0,.18);

    text-align:center;

    animation:
    popupShow .25s ease;

}

@keyframes popupShow{

    from{

        opacity:0;

        transform:
        translateY(15px)
        scale(.96);

    }

    to{

        opacity:1;

        transform:
        translateY(0)
        scale(1);

    }

}

.dictation-close{

    position:absolute;

    right:16px;

    top:16px;

    width:40px;

    height:40px;

    border:none;

    border-radius:50%;

    background:#f1f5f9;

    cursor:pointer;

    font-size:22px;

}

.dictation-close:hover{

    background:#e2e8f0;

}

.dictation-header{

    margin-bottom:15px;

}

#popup-progress{

    display:inline-block;

    background:#eff6ff;

    color:#2563eb;

    padding:6px 14px;

    border-radius:999px;

    font-size:14px;

    font-weight:600;

}

.popup-word{

    font-size:48px;

    font-weight:800;

    color:#0f172a;

    margin-top:15px;

    word-break:break-word;

}

.popup-phonetic{

    margin-top:12px;

    font-size:24px;

    color:#64748b;

}

.popup-meaning{

    margin-top:20px;

    font-size:28px;

    line-height:1.6;

    color:#334155;

    font-weight:600;

}


#tip-popup{

    position:fixed;

    top:30px;

    left:50%;

    transform:translateX(-50%);

    background:#2563eb;

    color:#fff;

    padding:12px 22px;

    border-radius:999px;

    z-index:10000;

    opacity:0;

    visibility:hidden;

    transition:.25s;

}

#tip-popup.show{

    opacity:1;

    visibility:visible;

}


.popup-word.playing{

    animation:
    wordPulse .8s infinite;

}

@keyframes wordPulse{

    0%{
        transform:scale(1);
    }

    50%{
        transform:scale(1.05);
    }

    100%{
        transform:scale(1);
    }

}


@media (max-width:768px){

    .dictation-modal{

        width:92vw;

        padding:24px;

    }

    .popup-word{

        font-size:38px;

    }

    .popup-phonetic{

        font-size:20px;

    }

    .popup-meaning{

        font-size:22px;

    }

}

.btn-main.stop{

    background:#ef4444;

}

.word-checkbox{

    appearance:none;
    -webkit-appearance:none;

    width:22px;
    height:22px;

    border:2px solid #cbd5e1;

    border-radius:50%;

    background:#fff;

    cursor:pointer;

    transition:.25s;

    position:relative;

    flex-shrink:0;

}

.word-checkbox:hover{

    border-color:#4f8cff;

    transform:scale(1.08);

}

.word-checkbox:checked{

    background:
    linear-gradient(
        135deg,
        #5a9bf8,
        #4a8ee0
    );

    border-color:#4a8ee0;

    box-shadow:
    0 0 0 4px rgba(90,155,248,.15);

}

.word-checkbox:checked::after{

    content:"✓";

    position:absolute;

    left:50%;
    top:50%;

    transform:
    translate(-50%,-50%);

    color:#fff;

    font-size:13px;
    font-weight:700;

}
.word-card.selected{

    border-color:#4f8cff;

    background:#f0f7ff;

}
.word-card.selected .word-checkbox{

    animation:
    checkboxPop .25s ease;
}
@keyframes checkboxPop{

    0%{
        transform:scale(.8);
    }

    70%{
        transform:scale(1.15);
    }

    100%{
        transform:scale(1);
    }

}

#dictation-popup{
    position:fixed;

    top:50%;
    left:50%;

    transform:
    translate(-50%,-50%);

    width:420px;
    max-width:90vw;

    padding:24px;

    border-radius:24px;

    background:
    linear-gradient(
        135deg,
        #e5f1ff,
        #d8ebff
    );

    box-shadow:
    0 20px 50px rgba(0,0,0,.18);

    z-index:9999;

    opacity:0;
    visibility:hidden;

    transition:.3s;
	position: fixed;

}

#popup-close {
    position: absolute;
    top: 12px;
    right: 12px;

    width: 28px;
    height: 28px;

    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.12);

    background: #fff;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 14px;
    line-height: 1;
    color: #666;

    cursor: pointer;
    user-select: none;

    box-shadow: 0 2px 8px rgba(0,0,0,0.12);

    transition: 0.2s ease;
}
#popup-close:hover {
    background: #f5f5f5;
    color: #000;
    transform: scale(1.05);
}

#dictation-popup.show{

    opacity:1;
    visibility:visible;

}

#popup-word{

    font-size:42px;

    font-weight:800;

    color:#0b3d91;

    text-align:center;

    margin-top:20px;

}

#popup-phonetic{

    text-align:center;

    font-size:22px;

    color:#35516d;

    margin-top:10px;

}

#popup-meaning{

    text-align:center;

    font-size:26px;

    color:#31475d;

    margin-top:15px;

}
.answer-hidden{

    filter:blur(12px);

    user-select:none;

}

.popup-progress-bar{

    margin-top:25px;

    height:10px;

    background:#c7def8;

    border-radius:999px;

    overflow:hidden;

}

#popup-progress-fill{

    display:block;

    height:100%;

    width:0;

    background:
    linear-gradient(
        90deg,
        #5a9bf8,
        #4a8ee0
    );

    border-radius:999px;

}

.hidden-answer{
    filter: blur(12px);
    user-select: none;
}
