.classroom-button {
    color: #fff;
    border-color: transparent;
    background: #1f6f70;
    box-shadow: 0 8px 18px rgba(31, 111, 112, .2);
}

.classroom-button:hover { color: #fff; background: #173f46; }

.classroom-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(16, 42, 46, .55);
    backdrop-filter: blur(12px);
}

.classroom-overlay.open { display: flex; }

.classroom-dialog {
    width: min(820px, 100%);
    max-height: min(860px, calc(100dvh - 40px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #193b40;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 28px;
    background: #fffdf7;
    box-shadow: 0 36px 100px rgba(12, 34, 38, .35);
}

.classroom-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    color: #fff;
    background:
        radial-gradient(circle at 80% 0, rgba(240, 189, 79, .34), transparent 15rem),
        #173f46;
}

.classroom-dialog-title { display: flex; align-items: center; gap: 12px; }
.classroom-dialog-title span:first-child {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #173f46;
    background: #f0bd4f;
    font-weight: 900;
}
.classroom-dialog-title strong { display: block; font-size: 17px; }
.classroom-dialog-title small { display: block; color: rgba(255,255,255,.66); font-size: 11px; }

.classroom-close {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    color: #fff;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 14px;
    background: rgba(255,255,255,.08);
    cursor: pointer;
    font-size: 24px;
}

.classroom-content {
    min-height: 370px;
    overflow-y: auto;
    padding: 24px;
    scrollbar-width: thin;
}

.classroom-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 22px;
    align-items: center;
    margin-bottom: 24px;
    padding: 24px;
    border: 1px solid rgba(31, 111, 112, .13);
    border-radius: 22px;
    background: linear-gradient(135deg, #e8f1ee, #fff9eb);
}

.classroom-intro h2 { margin: 0 0 8px; font-size: clamp(22px, 4vw, 32px); line-height: 1.2; }
.classroom-intro p { margin: 0; color: #637675; }
.classroom-intro-mark { color: rgba(31, 111, 112, .18); font-size: 92px; font-weight: 950; text-align: center; }

.classroom-form { display: grid; gap: 14px; max-width: 560px; margin: 0 auto; }
.classroom-form-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; }
.classroom-form-row-single { grid-template-columns: 1fr; }
.classroom-field label { display: block; margin: 0 0 6px 3px; color: #637675; font-size: 12px; font-weight: 750; }
.classroom-field input {
    width: 100%;
    min-height: 50px;
    padding: 10px 14px;
    color: #193b40;
    border: 1px solid rgba(25, 59, 64, .16);
    border-radius: 14px;
    outline: none;
    background: #fff;
    font-size: 16px;
}
.classroom-field input:focus { border-color: #1f6f70; box-shadow: 0 0 0 4px rgba(31,111,112,.1); }
.classroom-code-input { letter-spacing: .2em; font-weight: 850; }

.classroom-primary, .classroom-secondary {
    min-height: 50px;
    padding: 10px 18px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 800;
}
.classroom-primary { color: #fff; border: 0; background: #e86f43; box-shadow: 0 10px 22px rgba(232,111,67,.2); }
.classroom-primary:hover { background: #ce5b34; }
.classroom-primary:disabled { opacity: .55; cursor: wait; }
.classroom-secondary { color: #173f46; border: 1px solid rgba(25,59,64,.16); background: #fff; }

.classroom-error, .classroom-notice {
    margin: 14px 0;
    padding: 12px 14px;
    border-radius: 13px;
    font-size: 13px;
}
.classroom-error { color: #8d332f; background: #fff0eb; }
.classroom-notice { color: #285d59; background: #e7f2ef; }

.classroom-statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    padding: 12px 15px;
    border-radius: 15px;
    background: #f8f5ed;
    font-size: 13px;
}
.classroom-statusbar strong { color: #e86f43; }
.classroom-live { color: #1f6f70; font-weight: 800; }
.classroom-live::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #36a779; box-shadow: 0 0 0 5px rgba(54,167,121,.12); }

.classroom-waiting { min-height: 370px; display: grid; place-items: center; text-align: center; }
.classroom-waiting-orbit { width: 96px; height: 96px; display: grid; place-items: center; margin: 0 auto 20px; border: 1px dashed rgba(31,111,112,.35); border-radius: 50%; color: #1f6f70; font-size: 34px; animation: classroomPulse 2s ease-in-out infinite; }
.classroom-waiting h2 { margin: 0 0 8px; }
.classroom-waiting p { margin: 0; color: #637675; }
@keyframes classroomPulse { 50% { transform: scale(1.05); background: #e7f2ef; } }

.classroom-progress { display: flex; gap: 7px; overflow-x: auto; margin-bottom: 18px; padding: 2px; }
.classroom-progress button { min-width: 40px; height: 40px; color: #637675; border: 1px solid rgba(25,59,64,.13); border-radius: 12px; background: #fff; cursor: pointer; font-weight: 800; }
.classroom-progress button.active { color: #fff; border-color: #1f6f70; background: #1f6f70; }
.classroom-progress button.done { color: #235a52; background: #e0f0eb; }

.classroom-question {
    padding: clamp(18px, 4vw, 28px);
    border: 1px solid rgba(25,59,64,.13);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(30,58,53,.07);
}
.classroom-question + .classroom-question { margin-top: 18px; }
.classroom-question-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; color: #637675; font-size: 12px; font-weight: 780; }
.classroom-question h3 { margin: 0 0 20px; font-size: clamp(18px, 3vw, 23px); line-height: 1.55; }
.classroom-option-list { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.classroom-option {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 14px;
    color: #193b40;
    border: 1px solid rgba(25,59,64,.14);
    border-radius: 16px;
    background: #fffdf7;
    cursor: pointer;
    text-align: left;
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.classroom-option:hover:not(:disabled) { transform: translateY(-2px); border-color: #1f6f70; background: #edf5f2; }
.classroom-option:disabled { cursor: default; }
.classroom-option-key { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: #1f6f70; background: #dcebe8; font-weight: 900; }
.classroom-option-copy { min-width: 0; flex: 1; }
.classroom-option-copy img { width: 100%; max-height: 210px; display: block; object-fit: contain; margin-top: 10px; border-radius: 10px; background: #fff; }
.classroom-option.selected { color: #fff; border-color: #1f6f70; background: #1f6f70; }
.classroom-option.selected .classroom-option-key { color: #173f46; background: #f0bd4f; }
.classroom-option.correct { border-color: #278a69; background: #e3f4ed; }
.classroom-option.wrong { border-color: #c95f4d; background: #fff0eb; }

.classroom-lock { margin: 16px 0 0; color: #637675; font-size: 12px; }
.classroom-review { margin-top: 18px; padding: 16px; border-left: 4px solid #f0bd4f; border-radius: 4px 14px 14px 4px; background: #fff9e9; }
.classroom-review strong { display: block; margin-bottom: 5px; color: #8b5a13; }
.classroom-review p { margin: 0; }

@media (max-width: 700px) {
    .classroom-overlay { align-items: flex-end; padding: 0; }
    .classroom-dialog { width: 100%; max-height: 94dvh; border-radius: 24px 24px 0 0; }
    .classroom-dialog-header { padding: 14px 16px; }
    .classroom-content { padding: 16px; }
    .classroom-intro { grid-template-columns: 1fr; padding: 20px; }
    .classroom-intro-mark { display: none; }
    .classroom-option-list { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
    .classroom-form-row { grid-template-columns: 1fr; }
    .classroom-button .btn-label { display: none; }
    .classroom-statusbar { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    .classroom-waiting-orbit { animation: none; }
}
