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

/* Visual index styles */
.visual-index {
    width: 100%;
    max-width: 980px;
    display: flex;
    gap: 14px;
    justify-content: center;
    align-items: flex-start;
    margin-bottom: 18px;
}
.index-item {
    background: rgba(255,255,255,0.95);
    border-radius: 10px;
    padding: 8px;
    width: 30%;
    max-width: 300px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease;
}
.index-item:hover { transform: translateY(-6px); box-shadow: 0 10px 26px rgba(0,0,0,0.12); }
.index-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}
.index-caption {
    margin-top: 8px;
    font-size: 13px;
    color: #111;
    padding: 4px 6px;
    width: 100%;
}

body {
    font-family: 'Special Elite', cursive;
    background: white;
    background-image: url('/mall-aisle.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    min-height: 100vh;
}

.play-button {
    min-width: 120px;
    height: 50px;
    background: black;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s;
    margin-bottom: 20px;
}

.play-button:active { opacity: 0.7; }

.play-icon {
    width: 0;
    height: 0;
    border-left: 12px solid white;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.pause-icon { display: flex; gap: 3px; }
.pause-icon span { width: 4px; height: 16px; background: white; }

.exercise-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 800px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.exercise-container h2 { margin-bottom: 20px; font-size: 20px; }

.exercise-text { line-height: 1.8; font-size: 15px; }
.exercise-text p { margin-bottom: 15px; }

.gap {
    border: none;
    border-bottom: 2px solid black;
    min-width: 120px;
    padding: 2px 4px;
    margin: 0 4px;
    font-family: 'Noto Sans', sans-serif;
    font-size: 15px;
    background: transparent;
    outline: none;
}

.gap:focus {
    border-bottom: 2px solid #4a90e2;
    background: rgba(74, 144, 226, 0.05);
}

.reveal-button, .restart-button {
    margin-top: 20px;
    padding: 12px 24px;
    background: black;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.reveal-button:active, .restart-button:active { opacity: 0.7; }

.controls-row { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }

.tf-questions { display: flex; flex-direction: column; gap: 20px; }

.tf-question { border-bottom: 1px solid #eee; padding-bottom: 15px; }
.tf-question:last-child { border-bottom: none; }
.tf-question p { margin-bottom: 10px; font-size: 15px; }

.tf-buttons { display: flex; gap: 10px; }

.tf-btn {
    padding: 8px 24px;
    background: white;
    color: black;
    border: 2px solid black;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Noto Sans', sans-serif;
}

.tf-btn:active { opacity: 0.7; }
.tf-btn.selected { background: black; color: white; }
.tf-btn.correct { background: #1db954; color: white; border-color: #1db954; }
.tf-btn.incorrect { background: #e74c3c; color: white; border-color: #e74c3c; }

/* Avatar / speaker */
.avatar-wrapper { display: flex; align-items: center; gap: 20px; margin-bottom: 14px; justify-content: center; width: 100%; }
.avatar { width: 120px; height: 120px; border-radius: 50%; background-size: cover; background-position: center; box-shadow: 0 6px 18px rgba(0,0,0,0.15); position: relative; flex: 0 0 120px; overflow: hidden; }

.speaker {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.08s linear;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
}

.speaker img { width: 80%; height: 80%; object-fit: contain; filter: none; }

.avatar-caption {
    max-width: 540px;
    font-size: 14px;
    color: #111;
    background: rgba(255,255,255,0.95);
    padding: 10px 14px;
    border-radius: 8px;
}

/* Overlay on uploaded image */
.image-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    background: #fff;
}
.overlay-image {
    width: 100%;
    display: block;
    height: auto;
    object-fit: cover;
    display: block;
}
.image-overlay {
    position: absolute;
    left: 50%;
    top: 12%;
    transform: translateX(-50%);
    color: #ffffff;
    background: rgba(0,0,0,0.55);
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 1px;
    text-align: center;
    pointer-events: none;
    mix-blend-mode: normal;
}
/* small responsive tweaks */
@media (max-width: 520px) {
    .exercise-container { padding: 18px; }
    .play-button { min-width: 100px; height: 44px; font-size: 14px; }
    .image-overlay { font-size: 16px; top: 10%; padding: 6px 10px; }
}