* {
    box-sizing: border-box;
}

body {
    /* The native offline kid-font stack. Chalkboard SE for Apple, Comic Sans for PC */
    font-family: 'Chalkboard SE', 'Comic Sans MS', 'Comic Neue', sans-serif;
    background-color: #f0f8ff;
    text-align: center;
    margin: 0;
    padding: 0;
    touch-action: manipulation;
}

header {
    background-color: #ff9fb2;
    padding: 20px;
    color: white;
}

button {
    font-family: inherit;
    font-size: 20px;
    padding: 10px 15px;
    margin: 5px;
    border-radius: 15px;
    border: none;
    background-color: white;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.game-view {
    display: none;
    padding: 20px;
}

.game-view.active {
    display: block;
}

/* Soundboard Styles */
.grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.letter-card {
    width: 100px;
    height: 100px;
    background-color: #ffeb3b;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    color: #d32f2f;
    cursor: pointer;
    box-shadow: 0 6px 0 #fbc02d;
    transition: transform 0.1s;
}

.letter-card:active {
    transform: translateY(6px);
    box-shadow: 0 0 0 #fbc02d;
}

/* Match Game Styles */
.match-container {
    display: flex;
    justify-content: space-around;
    margin-top: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.match-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.match-item {
    width: 90px;
    height: 90px;
    background-color: white;
    border: 4px solid #ccc;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    cursor: pointer;
    transition: all 0.2s;
}

.match-item.selected {
    border-color: #4CAF50;
    background-color: #e8f5e9;
    transform: scale(1.1);
}

.match-item.matched {
    opacity: 0;
    pointer-events: none;
}

/* Memory Game Styles */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    padding: 0 20px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.memory-card {
    aspect-ratio: 1 / 1;
    width: 100%;
    background-color: #2196F3;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(30px, 8vw, 50px);
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    user-select: none;
    border: 3px solid transparent;
}

.memory-card.flipped {
    background-color: white;
    color: #333;
    border: 3px solid #2196F3;
}

.memory-card.matched {
    background-color: #8BC34A;
    color: white;
    border: 3px solid transparent;
    pointer-events: none;
}

/* Dictionary / Learn Styles */
.dictionary-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 600px;
    margin: 20px auto;
    text-align: left;
}

.dict-card {
    display: flex;
    align-items: center;
    background-color: white;
    border-radius: 15px;
    padding: 15px 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.1s;
}

.dict-card:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 rgba(0,0,0,0);
}

.dict-letter {
    font-size: 50px;
    color: #d32f2f;
    font-weight: bold;
    width: 70px;
    text-align: center;
}

.dict-info {
    flex-grow: 1;
    padding-left: 15px;
    border-left: 3px dashed #ff9fb2;
    margin-left: 10px;
}

.dict-bangla {
    font-size: 28px;
    color: #333;
    margin: 0;
}

.dict-english {
    font-size: 18px;
    color: #888; 
    margin: 5px 0 0 0;
}

.dict-visual {
    font-size: 50px;
    padding-left: 15px;
}

/* Toggle & Pagination UI */
.toggle-container {
    margin-bottom: 20px;
}

.toggle-btn {
    background-color: #e0e0e0;
    color: #555;
    border-radius: 20px;
    padding: 10px 30px;
}

.toggle-btn.active {
    background-color: #4CAF50;
    color: white;
    box-shadow: 0 4px 0 #388E3C;
    transform: translateY(-2px);
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding-bottom: 40px;
}

.pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

#page-indicator {
    font-size: 20px;
    font-weight: bold;
    color: #555;
}

/* Footer Styles */
footer {
    margin-top: 40px;
    padding: 20px;
    background-color: #fff;
    border-top: 1px solid #eee;
    font-size: 14px;
    color: #777;
}

footer p {
    margin: 5px 0;
}

footer a {
    color: #ff9fb2;
    text-decoration: none;
    font-weight: bold;
}

footer a:hover {
    text-decoration: underline;
}