:root {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}
body {
    margin: 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    background: linear-gradient(135deg, #FFE8D6 0%, #da8d8f 100%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: cover;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@700;800;900&display=swap');

h1 {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

header {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
#main-content,  
.main-container {
    width: 100%;
    max-width: 768px;
    margin: 0 auto;
}   
.card {
    border: 1px solid #e5e7eb;

    background: white;
    border-radius: 20px;
    padding: 16px;
    
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.beige-card {
    background: #f0d27b;
}

.pink-card {
    background: #ffe4e1;
}   

.row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    padding-top: 5px;
    padding-bottom: 5px;
}
button {
    padding: 0.6rem 1rem;
    border: 1px solid #111827;
    border-radius: 10px;
    background: #111827;
    color: white;
    cursor: pointer;
}

button.primary {
    background: #667eea;
    color: white;
}   
button.secondary {
    background: white;
    color: #111827;
}
button.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
}
.play-button {
        background: #667eea;
        color: white;
        border: none;
        border-radius: 10px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s;
}

.play-button:hover {
    background: #5568d3;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}
button:hover {
    transform: translateY(-2px);
}

.play-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}
.muted {
    color: #6b7280;
}
.english {
    font-size: 1.25rem;
}
input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 10px;
}
.level {
    font-size: 0.9rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
}
.pill {
    display: inline-block;
    margin-left: 0.5rem;
}
.result {
     white-space: pre-wrap;
}
.welcome-screen {
    text-align: center;
    margin-bottom: 2rem;
}
.spinner {
    display: none;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #111827;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.container-vertical-center {
    display: flex;
    /*justify-content: center;   */
    align-items: center;      /* vertical center */
}

#audio-container audio {
    margin-left: 5px;
    margin-right: 5px;
    height: 30px
}

.submenu {
    display: flex;
    /* Centers children vertically */
    align-items: center; 
    justify-content: space-between;
    width: 100%;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.audio-player {
    background: #16213e;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 400px;
}

.audio-player h3 {
    color: #fff;
    margin: 0 0 20px 0;
    text-align: center;
}

.play-pause {
    width: 60px;
    height: 60px;
    font-size: 24px;
    background-color: #667eea;
    border-radius: 30px;
    padding: 0;
}

audio {
    display: none;
}

/* Popup Overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1000;
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Popup Window */
.popup-hint {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transform: scale(0.7);
    transition: transform 0.3s;
    position: relative;
}

.popup-overlay.active .popup-hint {
    transform: scale(1);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.popup-title {
    font-size: 24px;
    color: #333;
    font-weight: 600;
}

.popup-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s, color 0.3s;
}

.popup-close:hover {
    background: #f0f0f0;
    color: #333;
}

.popup-content {
    color: #666;
    line-height: 1.6;
    font-size: 16px;
}

.popup-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    font-size: 30px;
}

.submenu > div {
  flex: 0 0 auto;
}

/* Tabs */
.tab-buttons {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid rgba(255,255,255,0.3);
    padding-bottom: 0;
}
.tab-button {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 0.5rem 1.25rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: black;
    border-radius: 0;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}
.tab-button:hover {
    color: #fff;
    border-bottom-color: rgba(255,255,255,0.5);
}
.tab-button.active {
    color: black;
    border-bottom-color: #fff;
    font-weight: 700;
}
.tab-pane {
    display: none;
}
.tab-pane.active {
    display: block;
}

/* Tablet and larger screens */
@media (min-width: 768px) {
    .card {
        padding: 20px;
    }
}

/* Start hidden */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Animate in when visible */
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}


.xp-bar-wrap {
    width: 100%;
    max-width: 400px;
    margin: 10px auto 4px;
}
.xp-bar-track {
    width: 100%;
    height: 20px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    display: flex;
}
.xp-bar-earned {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 999px 0 0 999px;
    transition: width 0.6s ease;
}
.xp-bar-earned.full { border-radius: 999px; }
.xp-bar-remaining {
    height: 100%;
    background: #ef4444;
    border-radius: 0 999px 999px 0;
    transition: width 0.6s ease;
}
.xp-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #6b7280;
    margin-top: 3px;
}