/* ============================================
   LESSON GAME - end of lesson mini challenge
   Rendered by assets/js/lesson-game/mount.js
   ============================================ */
.lesson-game {
    margin: 0 auto 26px;
    max-width: 640px;
    background: rgba(13, 17, 23, 0.35);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 20px;
    padding: 22px 20px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

.lg-kicker {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #34d399;
    margin-bottom: 8px;
}

.lg-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #e2e8f0;
    margin-bottom: 8px;
}

.lg-text {
    color: rgba(226, 232, 240, 0.75);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 16px;
}

.lg-best {
    display: inline-block;
    margin-bottom: 14px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    color: #fcd34d;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.35);
}

.lg-play {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 700;
    color: #04241a;
    background: linear-gradient(135deg, #10b981, #14b8a6);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.lg-play:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(16, 185, 129, 0.35); }

.lg-skip {
    display: block;
    margin: 12px auto 0;
    padding: 6px 12px;
    background: none;
    border: none;
    color: rgba(226, 232, 240, 0.55);
    font-size: 0.85rem;
    text-decoration: underline;
    cursor: pointer;
}

/* ---- resting state: board dealt, waiting for Play ---- */
.lg-stage {
    position: relative;
}

.lg-preview {
    opacity: 0.62;
    pointer-events: none;
    user-select: none;
}

.lg-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.lg-overlay-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    max-width: 30rem;
    padding: 18px 22px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(9, 13, 20, 0.88);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

.lg-overlay-panel .lg-text { margin-bottom: 2px; }
.lg-overlay-panel .lg-best { margin-bottom: 0; }

/* ---- running state ---- */
.lg-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.lg-dots { display: flex; gap: 8px; }

.lg-dot {
    width: 26px;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.15);
}

.lg-dot.is-active { background: #34d399; }
.lg-dot.is-done { background: rgba(52, 211, 153, 0.45); }

.lg-score {
    font-weight: 800;
    font-size: 1.1rem;
    color: #fcd34d;
    min-width: 3ch;
    text-align: right;
}

.lg-round-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #5eead4;
    padding: 26px 0;
}

.lg-counter {
    font-size: 0.8rem;
    color: rgba(226, 232, 240, 0.5);
    margin-bottom: 6px;
}

.lg-prompt {
    font-size: 1.05rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 14px;
}

.lg-replay, .lg-record {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 9px 20px;
    border-radius: 999px;
    border: 1px solid rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.12);
    color: #e2e8f0;
    font-size: 0.95rem;
    white-space: nowrap;
    cursor: pointer;
}

.lg-record { border-color: rgba(244, 63, 94, 0.45); background: rgba(244, 63, 94, 0.12); }
.lg-record:disabled { opacity: 0.5; cursor: default; }

.lg-icon {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lg-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.lg-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 8px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.lg-option:hover:not(:disabled) { transform: translateY(-2px); border-color: rgba(16, 185, 129, 0.5); }
.lg-option-letter { font-size: 2.2rem; font-family: 'Times New Roman', serif; line-height: 1.1; }
.lg-option-name { font-size: 0.85rem; color: rgba(226, 232, 240, 0.7); }

.lg-option.is-right, .lg-yes.is-right, .lg-no.is-right {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.22);
}

.lg-option.is-wrong, .lg-yes.is-wrong, .lg-no.is-wrong {
    border-color: #f43f5e;
    background: rgba(244, 63, 94, 0.18);
    opacity: 0.75;
}

/* ---- match round ---- */
.lg-match {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.lg-card {
    min-height: 62px;
    padding: 8px 4px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
    font-size: 0.9rem;
    cursor: pointer;
}

.lg-card--letter { font-size: 1.9rem; font-family: 'Times New Roman', serif; }
.lg-card.is-picked { border-color: #5eead4; background: rgba(94, 234, 212, 0.15); }
.lg-card.is-wrong { border-color: #f43f5e; background: rgba(244, 63, 94, 0.18); }
.lg-card.is-matched { opacity: 0.35; border-color: #10b981; cursor: default; }

/* ---- speed round ---- */
.lg-big-letter {
    font-size: 4.5rem;
    font-family: 'Times New Roman', serif;
    line-height: 1.1;
    color: #e2e8f0;
    margin: 6px 0 14px;
}

.lg-timer {
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    margin-bottom: 16px;
}

.lg-timer-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #10b981, #fcd34d);
}

/* recording: thicker and red, so the countdown reads at a glance */
.lg-timer--rec {
    height: 9px;
    max-width: 260px;
    margin: 0 auto 14px;
    background: rgba(244, 63, 94, 0.18);
}

.lg-timer--rec .lg-timer-fill {
    background: linear-gradient(90deg, #f43f5e, #fb7185);
}

.lg-yesno { display: flex; gap: 10px; justify-content: center; }

.lg-yes, .lg-no {
    flex: 1 1 0;
    max-width: 190px;
    padding: 13px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.lg-hidden { display: none; }
.lg-status { min-height: 22px; font-size: 0.9rem; color: rgba(226, 232, 240, 0.7); margin-bottom: 10px; }

/* ---- results ---- */
.lg-stars { font-size: 2rem; color: #fcd34d; letter-spacing: 4px; margin-bottom: 8px; }
.lg-final-score { font-size: 1.8rem; font-weight: 800; color: #34d399; margin-bottom: 4px; }

@media (max-width: 600px) {
    .lesson-game { padding: 18px 14px; border-radius: 16px; }
    .lg-match { grid-template-columns: repeat(2, 1fr); }
    .lg-big-letter { font-size: 3.6rem; }
    .lg-option-letter { font-size: 1.9rem; }
}

/* ---- longer material -------------------------------------------------
   The default type is sized for one letter. Lessons whose items are
   sequences, syllables with a name, words or Torah phrases set a size class
   on the section so the same board keeps working without a second layout. */
.lesson-game.lg-size--word .lg-option-letter { font-size: 1.6rem; line-height: 1.35; }
.lesson-game.lg-size--word .lg-card--letter { font-size: 1.4rem; line-height: 1.35; }
.lesson-game.lg-size--word .lg-big-letter { font-size: 2.8rem; line-height: 1.3; }

.lesson-game.lg-size--phrase .lg-options { grid-template-columns: 1fr; }
.lesson-game.lg-size--phrase .lg-option { padding: 12px 10px; }
.lesson-game.lg-size--phrase .lg-option-letter { font-size: 1.35rem; line-height: 1.6; }
.lesson-game.lg-size--phrase .lg-match { grid-template-columns: repeat(2, 1fr); }
.lesson-game.lg-size--phrase .lg-card--letter { font-size: 1.15rem; line-height: 1.6; }
.lesson-game.lg-size--phrase .lg-big-letter { font-size: 1.9rem; line-height: 1.6; }

/* names get long once they are readings ("Bet + Chataf-Patach"), so the
   cards grow with their text instead of clipping it */
.lesson-game.lg-size--word .lg-card,
.lesson-game.lg-size--phrase .lg-card { height: auto; padding: 10px 6px; overflow-wrap: anywhere; }
.lesson-game.lg-size--word .lg-option-name,
.lesson-game.lg-size--phrase .lg-option-name { font-size: 0.8rem; overflow-wrap: anywhere; }

@media (max-width: 600px) {
    .lesson-game.lg-size--word .lg-option-letter { font-size: 1.35rem; }
    .lesson-game.lg-size--word .lg-big-letter { font-size: 2.3rem; }
    .lesson-game.lg-size--phrase .lg-option-letter { font-size: 1.15rem; }
    .lesson-game.lg-size--phrase .lg-card--letter { font-size: 1rem; }
    .lesson-game.lg-size--phrase .lg-big-letter { font-size: 1.6rem; }
}
