* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(to bottom, #ffecd2, #fcb69f);
    font-family: 'Noto Sans', sans-serif;
    padding: 15px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 25px;
}

header h1 {
    font-size: 2.5rem;
    color: #d35400;
    font-family: 'Noto Sans Gurmukhi', sans-serif;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

header p {
    font-size: 1.3rem;
    color: #e67e22;
    margin-top: 8px;
}

.chapter-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0 25px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    font-size: 1.1rem;
    background: #ffeaa7;
    border: 2px solid #fdcb6e;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    color: #2d3436;
    transition: all 0.3s;
}

.tab-btn:hover, .tab-btn.active {
    background: #fdcb6e;
    color: white;
    transform: scale(1.05);
}

.chapter-content {
    transition: opacity 0.3s;
}

/* Alphabet Grid */
.alphabet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 18px;
    margin-bottom: 30px;
}

.letter-card {
    background: white;
    border-radius: 18px;
    padding: 20px 10px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.2s;
    border: 2px solid #ffed4e;
}

.letter-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    border-color: #f0932b;
}

.gurmukhi-char {
    font-size: 3.5rem;
    margin: 12px 0;
    font-family: 'Noto Sans Gurmukhi', sans-serif;
    color: #2d3436;
}

.letter-name {
    font-size: 1.1rem;
    color: #636e72;
    margin-bottom: 8px;
}

.example-word {
    font-size: 1.4rem;
    font-family: 'Noto Sans Gurmukhi', sans-serif;
    background: #fdcb6e;
    display: inline-block;
    padding: 5px 12px;
    border-radius: 10px;
    margin-top: 8px;
}

.speak-btn {
    background: #00b894;
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
    margin-top: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.speak-btn:hover {
    background: #00a085;
    transform: scale(1.1);
}

/* Pair Bindi Cards */
.pair-bindi {
    border-color: #74b9ff !important;
    background: #e8f4fc;
}

.pair-bindi .gurmukhi-char {
    color: #0984e3 !important;
}

/* Matras */
.info-box {
    background: #e8f7f0;
    border-left: 4px solid #00b894;
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 0 12px 12px 0;
    font-family: 'Noto Sans Gurmukhi', sans-serif;
    text-align: center;
}

.base-char {
    font-size: 1.8rem;
    color: #2d3436;
}

.matra {
    font-size: 1.8rem;
    color: #e17055;
}

.combined {
    font-size: 2rem;
    color: #00b894;
    font-weight: bold;
}

.matra-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.matra-card {
    background: white;
    border-radius: 16px;
    padding: 18px 10px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border: 2px solid #a29bfe;
    transition: all 0.2s;
}

.matra-card:hover {
    transform: translateY(-4px);
    border-color: #6c5ce7;
}

.matra-symbol {
    font-size: 3rem;
    font-family: 'Noto Sans Gurmukhi', sans-serif;
    margin: 10px 0;
    color: #6c5ce7;
}

.matra-name {
    font-size: 1.1rem;
    color: #2d3436;
    margin-bottom: 8px;
}

.example-syllable {
    font-size: 2.2rem;
    font-family: 'Noto Sans Gurmukhi', sans-serif;
    color: #00b894;
    margin: 10px 0;
}

.sound-guide {
    font-size: 0.85rem;
    color: #636e72;
    font-style: italic;
}

/* Words & Sentences */
.section-title {
    text-align: center;
    font-size: 1.8rem;
    color: #d63031;
    margin: 30px 0 20px;
    font-family: 'Noto Sans Gurmukhi', sans-serif;
}

.words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.word-card {
    background: white;
    border-radius: 16px;
    padding: 20px 10px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 2px solid #55efc4;
}

.punjabi-word {
    font-size: 2.2rem;
    font-family: 'Noto Sans Gurmukhi', sans-serif;
    color: #2d3436;
    margin-bottom: 8px;
}

.syllable-break {
    font-size: 1.1rem;
    color: #00b894;
    font-weight: bold;
    margin-bottom: 8px;
}

.english-meaning {
    font-size: 1.2rem;
    color: #636e72;
}

.sentences-list {
    max-width: 700px;
    margin: 0 auto;
}

.sentence-card {
    background: #f8f9fa;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    border-left: 4px solid #74b9ff;
    position: relative;
}

.sentence-punjabi {
    font-size: 1.6rem;
    font-family: 'Noto Sans Gurmukhi', sans-serif;
    color: #2d3436;
    margin-bottom: 6px;
}

.sentence-english {
    font-size: 1.2rem;
    color: #636e72;
    font-style: italic;
}

.sentence-card .speak-btn {
    position: absolute;
    top: 15px;
    right: 15px;
}

.word-builder {
    background: #e8f4fc;
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    max-width: 500px;
    margin: 30px auto;
    border: 2px dashed #74b9ff;
}

#consonantSelect, #matraSelect {
    padding: 10px;
    margin: 10px;
    border-radius: 10px;
    border: 2px solid #a29bfe;
    font-size: 1.1rem;
}

.built-word {
    font-size: 3.5rem;
    font-family: 'Noto Sans Gurmukhi', sans-serif;
    color: #6c5ce7;
    margin: 20px 0;
    min-height: 60px;
}

#speakBuiltWord {
    margin-top: 10px;
}

/* Numbers & Colors */
.numbers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 18px;
    margin-bottom: 30px;
}

.number-card {
    background: white;
    border-radius: 16px;
    padding: 18px 10px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border: 2px solid #fdcb6e;
    transition: transform 0.2s;
}

.number-card:hover {
    transform: scale(1.05);
}

.digit {
    font-size: 2.2rem;
    font-weight: bold;
    color: #2d3436;
}

.gurmukhi-digit {
    font-size: 32px;
    font-weight: bold;
    font-family: 'Noto Sans Gurmukhi', sans-serif;
    color: #2d3436;
    margin-bottom: 8px;
}

.roman-digit {
    font-size: 16px;
    font-weight: normal;
    color: #636e72;
    font-family: 'Noto Sans', sans-serif;
}

.number-word {
    font-size: 1.8rem;
    font-family: 'Noto Sans Gurmukhi', sans-serif;
    color: #e17055;
    margin: 8px 0;
}

.number-example {
    font-size: 1.1rem;
    color: #636e72;
    font-style: italic;
}

.colors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.color-card {
    height: 140px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.2s;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

.color-card:hover {
    transform: scale(1.07);
}

.color-name {
    font-size: 1.4rem;
    font-family: 'Noto Sans Gurmukhi', sans-serif;
    margin-bottom: 4px;
}

.color-english {
    font-size: 0.95rem;
    opacity: 0.9;
}

.counting-game {
    background: #f8f9fa;
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    max-width: 600px;
    margin: 30px auto;
    border: 2px dashed #6c5ce7;
}

.game-controls {
    margin: 20px 0;
}

#numSelect, #colorSelect {
    padding: 10px;
    margin: 0 10px;
    border-radius: 10px;
    border: 2px solid #a29bfe;
    font-size: 1.1rem;
}

#showObjects {
    padding: 10px 20px;
    background: #6c5ce7;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    margin-top: 10px;
}

.object-display {
    min-height: 80px;
    margin-top: 20px;
    font-size: 2rem;
    font-family: 'Noto Sans Gurmukhi', sans-serif;
    color: #2d3436;
}

.circle {
    display: inline-block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin: 5px;
    vertical-align: middle;
}

/* Family & Routines */
.family-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.family-card {
    background: white;
    border-radius: 18px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 2px solid #ff7675;
    transition: all 0.2s;
}

.family-card:hover {
    transform: translateY(-5px);
    border-color: #d63031;
}

.family-word {
    font-size: 2rem;
    font-family: 'Noto Sans Gurmukhi', sans-serif;
    color: #d63031;
    margin-bottom: 8px;
}

.family-english {
    font-size: 1.2rem;
    color: #636e72;
    margin-bottom: 10px;
}

.family-role {
    font-size: 1rem;
    color: #2d3436;
    font-style: italic;
}

.routine-timeline {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    justify-content: center;
    margin-bottom: 40px;
}

.routine-card {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 20px;
    width: 220px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-left: 4px solid #00b894;
    position: relative;
}

.time-tag {
    display: inline-block;
    background: #00b894;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.activity-word {
    font-size: 1.6rem;
    font-family: 'Noto Sans Gurmukhi', sans-serif;
    color: #2d3436;
    margin: 8px 0;
}

.routine-sentence {
    font-size: 1.1rem;
    color: #636e72;
    font-style: italic;
}

.routine-card .speak-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
}

.sentence-builder {
    background: #e8f4fc;
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    max-width: 600px;
    margin: 30px auto;
    border: 2px dashed #74b9ff;
}

.sentence-builder p {
    font-size: 1.4rem;
    margin-bottom: 15px;
    font-family: 'Noto Sans Gurmukhi', sans-serif;
}

#activitySelect {
    padding: 10px;
    margin: 10px;
    border-radius: 10px;
    border: 2px solid #a29bfe;
    font-size: 1.1rem;
}

.sentence-builder label {
    margin: 0 15px;
    font-size: 1.1rem;
    color: #2d3436;
}

.built-sentence {
    font-size: 1.8rem;
    font-family: 'Noto Sans Gurmukhi', sans-serif;
    color: #6c5ce7;
    margin: 20px 0;
    min-height: 40px;
}

#speakSentenceBtn {
    margin-top: 10px;
}

/* Progress Dashboard */
.dashboard-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    min-width: 140px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-top: 4px solid #00b894;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: bold;
    color: #2d3436;
}

.stat-label {
    font-size: 1.1rem;
    color: #636e72;
    margin-top: 8px;
}

.progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.progress-item {
    text-align: center;
    padding: 12px 8px;
    border-radius: 12px;
    font-family: 'Noto Sans Gurmukhi', sans-serif;
    font-size: 1.8rem;
    transition: transform 0.2s;
}

.progress-item.practiced {
    background: #dfe6e9;
    color: #636e72;
}

.progress-item.mastered {
    background: #00b894;
    color: white;
    transform: scale(1.05);
}

.progress-item:hover {
    transform: scale(1.1);
}

.certificates {
    text-align: center;
    margin: 40px 0;
}

.reminders {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 25px;
    margin-top: 30px;
    border-left: 4px solid #74b9ff;
}

.reminders h3 {
    color: #0984e3;
    margin-bottom: 15px;
}

.btn {
    padding: 12px 24px;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    background: #636e72;
    color: white;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn.primary {
    background: #00b894;
}

/* Tracing Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 10px auto;
    padding: 20px;
    border-radius: 20px;
    width: 95%;
    max-width: 800px;
    position: relative;
    overflow: hidden;
    animation: modalPop 0.4s;
}

@keyframes modalPop {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    z-index: 10;
}

.close-btn:hover { color: #000; }

.tracing-header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px dashed #6c5ce7;
}

.big-letter {
    font-size: 8rem;
    font-family: 'Noto Sans Gurmukhi', sans-serif;
    color: #2d3436;
    margin-right: 25px;
    line-height: 1;
}

.letter-info {
    flex: 1;
}

.letter-name {
    font-size: 2rem;
    color: #e17055;
    margin-bottom: 10px;
}

.example-word {
    font-size: 2.5rem;
    font-family: 'Noto Sans Gurmukhi', sans-serif;
    background: #ffeaa7;
    display: inline-block;
    padding: 8px 16px;
    border-radius: 12px;
}

.stroke-demo {
    height: 120px;
    margin-bottom: 20px;
    position: relative;
    background: #f8f9fa;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stroke-path {
    position: absolute;
    stroke: #6c5ce7;
    stroke-width: 3;
    fill: none;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

#tracingCanvas {
    background: #f1f2f6;
    border-radius: 12px;
    width: 100%;
    height: 300px;
    cursor: pointer;
    touch-action: none;
}

.tracing-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

@keyframes fadeOut {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}

/* Responsive */
@media (max-width: 768px) {
    .alphabet-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .gurmukhi-char {
        font-size: 2.8rem;
    }
    
    .big-letter { font-size: 6rem; }
    .tracing-header { flex-direction: column; text-align: center; }
    .big-letter { margin-right: 0; margin-bottom: 15px; }
}

@media (max-width: 480px) {
    .alphabet-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    header h1 {
        font-size: 2rem;
    }
}