/* ============================================================
   Kids Kingdom - Hindi Vyanjan Words Tracing (shared: ka/kha/etc.)
   Same row-based format as matra-words-tracing.css (4 word-boxes
   per row, no image/reference box), themed around each vyanjan
   consonant instead of a matra.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@100;300;400&display=swap');

.word-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px 50px;
}

/* ---------------- Toolbar (pen size + clear all) ---------------- */
.word-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    background: var(--color-bg);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 24px;
}

.word-toolbar label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--color-dark);
    font-weight: 600;
}

.word-toolbar input[type="range"] {
    width: 120px;
}

.word-btn-ghost {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.85rem;
    background: #fff;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    border-radius: 8px;
    padding: 9px 18px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
    margin-left: auto;
}

.word-btn-ghost:hover {
    background: var(--color-primary);
    color: #fff;
}

/* ---------------- Row: 4 word-boxes + 1 clear button ---------------- */
.word-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 14px;
}

.word-box {
    flex: 1;
    min-width: 0;
    background: #fff;
    border: 2px solid var(--color-bg);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.word-canvas {
    display: block;
    width: 100%;
    height: 100px;
    touch-action: none;
    cursor: crosshair;
    -webkit-user-select: none;
    user-select: none;
}

.word-row-actions {
    flex: 0 0 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.word-clear-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--color-bg);
    font-size: 0.9rem;
    color: #999;
    cursor: pointer;
}

.word-clear-btn:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

/* ================= MOBILE (< 768px) =================
   4 boxes don't comfortably fit one line on a phone - wrap to
   2 boxes per line (still the same logical row/word-group). */
@media (max-width: 767px) {
    .word-row {
        flex-wrap: wrap;
        gap: 8px;
    }
    .word-box {
        flex: 1 1 calc(50% - 4px);
        min-width: calc(50% - 4px);
    }
    .word-canvas {
        height: 84px;
    }
    .word-row-actions {
        flex-basis: 100%;
        justify-content: flex-end;
    }
    .word-toolbar {
        width: 100%;
    }
    .word-toolbar label {
        width: 100%;
    }
    .word-toolbar input[type="range"] {
        flex: 1;
    }
}
