* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', sans-serif; background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #ffeaa7 100%); min-height: 100vh; display: flex; justify-content: center; align-items: center; padding: 20px; }
#mainSection { display: block; width: 100%; max-width: 800px; }
.header { text-align: center; color: white; margin-bottom: 20px; }
.word-count { text-align: left; margin-bottom: 15px; font-weight: bold; color: #A67B7B; font-size: 1rem; }
.progress-container { background: rgba(255,255,255,0.2); border-radius: 20px; height: 35px; margin-bottom: 25px; position: relative; overflow: hidden; }
.progress-fill { background: #4ade80; height: 100%; width: 0%; transition: width 0.3s ease; display: flex; align-items: center; padding-left: 15px; color: white; font-weight: bold; }
.card-container { perspective: 1500px; height: 50vh; max-height: 450px; min-height: 300px; margin-bottom: 20px; position: relative; width: 100%; }
.card { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.6s; cursor: pointer; }
.card.flipped { transform: rotateY(180deg); }
.card-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; border-radius: 25px; background: white; box-shadow: 0 10px 40px rgba(0,0,0,0.3); display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 30px; text-align: center; }
.card-back { transform: rotateY(180deg); }
.card-face > div { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; }
.word-text { 
    font-size: clamp(2.2rem, 8vw, 4rem) !important;
    color: #000000; 
    font-weight: bold; 
    text-align: center;
    word-break: break-all;
    max-width: 90%; 
}
.speaker-btn { 
    margin-left: 0 !important;
    margin-top: 50px !important; 
    background: #ff9a9e; 
    color: white; 
    border: none; 
    border-radius: 50%; 
    width: 55px; 
    height: 55px; 
    font-size: 24px; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    flex-shrink: 0;
}
.def-box { width: 100%; background: #f8f9fa; padding: 20px; border-radius: 15px; border-left: 5px solid #667eea; margin-bottom: 15px; text-align: left; }

.controls { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr);
    gap: 10px; 
    justify-content: center; 
    width: 100%;
}

.btn { 
    padding: 15px 5px; 
    border: none; 
    border-radius: 12px; 
    color: white; 
    font-weight: bold; 
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    cursor: pointer; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); 
    width: 100%;
    white-space: nowrap;
}

@media (min-width: 600px) {
    .controls {
        grid-template-columns: repeat(4, 1fr);
    }
}

h1 { 
    font-size: clamp(1.5rem, 7vw, 2.8rem) !important; 
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: keep-all;
}

.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    align-items: center;
}

main, .content {
    flex: 1; 
}

.footer-copy {
    width: 100%;
    margin-top: 50px;
    padding: 30px 15px;
    text-align: center;
    color: #ffffff;
    font-size: clamp(0.75rem, 3vw, 0.9rem);
    line-height: 1.6;
    word-break: keep-all;
    clear: both;
}

.footer-copy p {
    margin: 5px 0;
}

@media (max-width: 360px) {
    .footer-copy {
        padding: 20px 10px;
        font-size: 11px;
    }
}

.btn-prev { background: #4db450; } 
.btn-shuffle { background: #f59e0b; } 
.btn-auto { background: #10b981; } 
.btn-next { background: #667eea; }
.btn-auto.active { background: #ef4444; }
