/* Letter Join is a DOM board, not a canvas: the sum up top, four choices below. */

.lj-stage {
    background: linear-gradient(160deg, #fffaf0, #f4f7ff);
}
.lj-board {
    aspect-ratio: 4 / 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 24px;
    font-family: "Noto Sans Tamil", "Inter", system-ui, sans-serif;
}
.lj-ask {
    font-family: "Inter", sans-serif;
    font-weight: 600;
    color: var(--ink-soft);
}

/* ---------- the sum: மெய் + உயிர் = ? ---------- */
.lj-sum {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.6vw, 18px);
}
.lj-part {
    min-width: clamp(84px, 12vw, 128px);
    padding: 10px 14px 12px;
    border-radius: var(--r-md);
    background: var(--surface);
    border: 2px solid var(--line);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.lj-part b {
    white-space: nowrap;
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 700;
    line-height: 1.25;
}
.lj-part small {
    font-family: "DM Mono", monospace;
    font-size: 13px;
    color: var(--ink-soft);
}
.lj-tag {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-soft);
}
.lj-part.mei {
    border-color: #cfdcff;
}
.lj-part.uyir {
    border-color: #ffd9a8;
}
.lj-part.answer {
    border-style: dashed;
}
.lj-part.answer.done {
    border: 2px solid var(--teal);
    background: #e6fbf6;
}
.lj-part.answer.missed {
    border: 2px solid var(--coral);
    background: #fff1ec;
}
.lj-op {
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: clamp(26px, 3.4vw, 40px);
    font-weight: 800;
    color: var(--ink-soft);
}

/* ---------- the four choices ---------- */
.lj-choices {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: min(100%, 620px);
}
.lj-choice {
    position: relative;
    border: 2px solid var(--line);
    background: var(--surface);
    border-radius: var(--r-md);
    padding: 12px 0 10px;
    font-family: inherit;
    white-space: nowrap;
    font-size: clamp(28px, 3.8vw, 42px);
    font-weight: 700;
    line-height: 1.3;
    color: var(--ink);
    box-shadow: var(--shadow-card);
    transition: transform 0.12s, border-color 0.12s;
}
.lj-choice:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: var(--blue);
}
.lj-choice kbd {
    position: absolute;
    top: 6px;
    left: 8px;
    font-family: "DM Mono", monospace;
    font-size: 11px;
    font-weight: 500;
    color: var(--ink-soft);
}
.lj-choice:disabled {
    cursor: default;
    opacity: 0.55;
}
.lj-choice.right {
    opacity: 1;
    border-color: var(--teal);
    background: #e6fbf6;
}
.lj-choice.wrong {
    opacity: 1;
    border-color: var(--coral);
    background: #fff1ec;
    animation: lj-shake 0.35s;
}
@keyframes lj-shake {
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ---------- after answering ---------- */
.lj-feedback {
    font-family: "Inter", "Noto Sans Tamil", sans-serif;
    font-size: 16px;
    text-align: center;
    min-height: 3em;
}
.lj-feedback.good b {
    color: var(--teal);
}
.lj-feedback.bad {
    color: var(--ink);
}
.lj-feedback small {
    display: block;
    margin-top: 4px;
    font-size: 14px;
    color: var(--ink-soft);
}
.lj-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    min-height: 44px;
}
/* .btn-primary and .mini set their own display, which would beat [hidden] */
.lj-actions [hidden] {
    display: none;
}
.lj-actions kbd {
    font-family: "DM Mono", monospace;
    font-size: 11px;
    opacity: 0.7;
    margin-left: 6px;
}

/* ---------- the row of உயிர் on the overlay ---------- */
.lj-levels {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 18px auto 0;
    max-width: 380px;
}
.lj-levels button {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-family: "Noto Sans Tamil", sans-serif;
    font-size: 20px;
    font-weight: 700;
}
.lj-levels button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.24);
}
.lj-levels button[aria-current] {
    background: #fff;
    color: var(--ink);
}
.lj-levels button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ---------- the vowel-sign reference panel ---------- */
.lj-signs table {
    width: 100%;
    border-collapse: collapse;
    font-family: "Noto Sans Tamil", sans-serif;
    font-size: 18px;
    text-align: center;
}
.lj-signs td {
    padding: 3px 0;
    border-top: 1px solid var(--line);
}
.lj-signs tr:first-child td {
    border-top: 0;
}
.lj-signs td:last-child {
    font-weight: 700;
}

@media (max-width: 640px) {
    .lj-board {
        aspect-ratio: auto;
        padding: 20px 12px;
    }
    .lj-choices {
        grid-template-columns: repeat(2, 1fr);
    }
}
