/* FrenchPing - Main Styles */
:root {
    --primary-color: #FF69B4;
    --secondary-color: #87CEEB;
    --accent-color: #FFD700;
    --success-color: #32CD32;
    --danger-color: #FF6B6B;
    --text-dark: #2C3E50;
    --text-light: #FFFFFF;
    --bg-gradient: linear-gradient(135deg, #FF69B4, #87CEEB, #FFD700);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --border-radius: 20px;
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

body {
    font-family: 'Fredoka', cursive;
    background: var(--bg-gradient);
    background-size: 400% 400%;
    animation: gradientShift 8s ease-in-out infinite;
    min-height: 100vh;
    overflow-x: hidden;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Screen Management */
.screen {
    display: none;
    padding: 20px;
    min-height: 100vh;
    animation: fadeIn 0.5s ease-in-out;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loading Screen */
#loading-screen {
    align-items: center;
    justify-content: center;
    background: var(--bg-gradient);
}

#loading-screen.active {
    display: flex;
}

.loading-content {
    text-align: center;
    color: var(--text-light);
}

.teenieping-loader {
    margin: 20px 0;
}

.bounce-ball {
    width: 60px;
    height: 60px;
    background: var(--accent-color);
    border-radius: 50%;
    margin: 0 auto;
    animation: bounce 1s infinite ease-in-out;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.1); }
}

.loading-content h1 {
    font-size: 3em;
    font-weight: 700;
    margin: 10px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Menu Styles */
.menu-header {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-light);
}

.menu-header h1 {
    font-size: 3.5em;
    font-weight: 700;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
}

.menu-header p {
    font-size: 1.2em;
    font-weight: 400;
    opacity: 0.9;
}

/* Doctor Monziu hero block */
.monziu-hero {
    display: flex;
    flex-direction: column; /* stack image & text */
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 20px;
    max-width: 640px; /* narrower for centered appearance */
    margin: 50px auto 40px auto;
    padding: 30px 35px 35px;
    background: rgba(255,255,255,0.9);
    border-radius: 36px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.18);
    backdrop-filter: blur(8px);
    position: relative;
}

.monziu-hero:before, .monziu-hero:after {
    content: '';
    position: absolute;
    width: 90px;
    height: 90px;
    background: radial-gradient(circle at 30% 30%, var(--accent-color), transparent 70%);
    opacity: 0.35;
    filter: blur(6px);
    animation: floatPulse 6s ease-in-out infinite;
}
.monziu-hero:before { top: -25px; left: -25px; }
.monziu-hero:after { bottom: -25px; right: -25px; animation-delay: 3s; }

@keyframes floatPulse {
    0%,100% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.15) translateY(-8px); }
}

.monziu-img-wrap {
    width: 170px;
    height: 170px;
    border-radius: 26px;
    background: linear-gradient(135deg,#ffffff,#f9e4ff);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    overflow: hidden;
    position: relative;
}

.monziu-img-wrap:after {
    content: '';
    position: absolute;
    inset: 0;
    border: 4px solid rgba(255,105,180,0.25);
    border-radius: 26px;
    pointer-events: none;
}

.monziu-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: scale(0.9);
    transition: transform .6s var(--transition);
}

.monziu-hero:hover .monziu-img {
    transform: scale(1.0) rotate(-2deg);
}

.monziu-speech {
    background: #fff;
    padding: 20px 24px 24px;
    border-radius: 22px;
    border: 3px solid var(--secondary-color);
    font-size: 1.08em;
    line-height: 1.4;
    color: var(--text-dark);
    position: relative;
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    max-width: 520px;
}

/* Remove side speech arrow in centered layout */
.monziu-speech:before, .monziu-speech:after { display:none; }

@media (max-width: 820px) {
    .monziu-hero { flex-direction: column; text-align: center; gap: 20px; }
    .monziu-speech:before, .monziu-speech:after { display:none; }
    .monziu-img-wrap { width: 150px; height: 150px; }
}

/* New centered grid for main menu */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    max-width: 900px;
    margin: 0 auto 60px auto;
    padding: 0 20px;
    justify-items: center;
}

.menu-grid .menu-button {
    width: 100%;
    max-width: 260px;
}

@media (max-width: 600px) {
    .menu-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 15px;
    }
    .menu-grid .menu-button {
        padding: 20px;
    }
    .button-icon { font-size: 2.2em; }
}

.player-info {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 20px auto 10px auto;
    max-width: 430px; /* reduced size similar to original */
    text-align: center;
    box-shadow: var(--card-shadow);
}

/* Integrated XP + Monziu layout */
.player-info .player-core {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
}

.monziu-inline {
    display: flex;
    flex-direction: row; /* avatar left, bubble right */
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: nowrap;
    margin: 8px auto 24px auto; /* tighter to reduce total height */
    max-width: 760px;
}

.monziu-avatar-wrap {
    width: 68px; /* slightly smaller */
    height: 68px;
    border-radius: 18px;
    background: linear-gradient(135deg,#ffffff,#f5fbff);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    position: relative;
    overflow: hidden;
    border: 2px solid #9ad1ff; /* refined clear border */
}

/* removed extra overlay border for cleaner look */

.monziu-avatar {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: scale(.92); /* static scale */
}

/* Hover zoom removed for calmer UI */

.monziu-bubble {
    background: linear-gradient(135deg,#ecf6ff,#d7ecff); /* light blue rectangle */
    padding: 16px 22px 20px;
    border-radius: 18px;
    border: 2px solid #9ad1ff;
    font-size: .96em;
    line-height: 1.4;
    color: var(--text-dark);
    position: relative;
    max-width: 520px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

/* Left-pointing arrow (bubble to right of avatar) */
.monziu-bubble:before {
    content: '';
    position: absolute;
    left: -18px;
    top: 50%;
    transform: translateY(-50%);
    width: 0; height: 0;
    border-top: 14px solid transparent;
    border-bottom: 14px solid transparent;
    border-right: 18px solid #9ad1ff; /* border color */
}
.monziu-bubble:after {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 0; height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-right: 16px solid #ecf6ff; /* inner fill */
}

@media (max-width: 680px) {
    .player-info { padding: 18px 16px 22px; max-width: 95%; }
    .monziu-inline { flex-direction: column; gap: 14px; margin: 10px auto 20px auto; }
    .monziu-avatar-wrap { width: 58px; height: 58px; border-radius: 16px; }
    .monziu-bubble { font-size: .9em; padding: 14px 16px 16px; }
    /* Switch arrow to top for vertical stack */
    .monziu-bubble:before { left: calc(50% - 14px); top: -18px; transform:none; border-left:14px solid transparent; border-right:14px solid transparent; border-bottom:18px solid #9ad1ff; border-top:none; border-right-color: transparent; border-bottom-color:#9ad1ff; border-top:0; border-bottom-width:18px; border-right:14px solid transparent; }
    .monziu-bubble:after { left: calc(50% - 12px); top: -16px; transform:none; border-left:12px solid transparent; border-right:12px solid transparent; border-bottom:16px solid #ecf6ff; border-top:none; border-right-color: transparent; }
    .monziu-bubble:before, .monziu-bubble:after { border-right: none; }
}

/* Slightly tone down old standalone hero when integrated (if still present elsewhere) */
.monziu-hero { opacity: 0.0; height:0; overflow:hidden; padding:0; margin:0; }

.xp-bar {
    background: #E0E0E0;
    border-radius: 25px;
    height: 30px;
    position: relative;
    margin-bottom: 15px;
    overflow: hidden;
}

.xp-fill {
    background: linear-gradient(90deg, var(--success-color), var(--accent-color));
    height: 100%;
    border-radius: 25px;
    transition: width 1s ease-in-out;
    width: 0%;
}

#xp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9em;
}

.level-badge {
    background: var(--primary-color);
    color: var(--text-light);
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    display: inline-block;
}

.menu-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.menu-button {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: var(--border-radius);
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-family: inherit;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--card-shadow);
    text-align: center;
}

.menu-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 1);
}

.menu-button:active {
    transform: translateY(-2px);
}

.menu-button.test-button {
    border: 2px dashed #ffa500;
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
}

.menu-button.test-button:hover {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
}

.button-icon {
    font-size: 2.5em;
    line-height: 1;
}

.button-text {
    font-size: 1.2em;
    font-weight: 700;
    margin: 5px 0;
}

.button-subtitle {
    font-size: 0.9em;
    opacity: 0.7;
    font-weight: 400;
}

.menu-btn {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: var(--border-radius);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-family: inherit;
    font-size: 1.2em;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--card-shadow);
}

.menu-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 1);
}

.menu-btn:active {
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 2em;
    background: var(--bg-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: gradientShift 3s ease-in-out infinite;
}

/* Screen Headers */
.screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
}

/* Redesigned Back Button */
.back-btn {
    --btn-bg: linear-gradient(135deg,#ff7bbd,#ff5aa5);
    --btn-bg-hover: linear-gradient(135deg,#ff6fb6,#ff4f9e);
    background: var(--btn-bg);
    color:#fff;
    border:none;
    padding:12px 22px 12px 58px; /* left space for arrow circle */
    border-radius: 40px;
    font-size:16px;
    font-weight:600;
    letter-spacing:.5px;
    cursor:pointer;
    position:relative;
    display:inline-flex;
    align-items:center;
    gap:10px;
    line-height:1;
    transition:all .25s ease;
    box-shadow:0 4px 12px rgba(255,105,180,.35);
}
.back-btn .back-label { pointer-events:none; }
.back-btn .back-arrow {
    position:absolute;
    left:14px; top:50%; transform:translateY(-50%);
    width:34px; height:34px;
    border-radius:50%;
    background:rgba(255,255,255,.25);
    display:flex; align-items:center; justify-content:center;
}
.back-btn .back-arrow:before {
    content:'';
    width:14px; height:14px;
    border-top:4px solid #fff; border-left:4px solid #fff;
    transform:translateX(2px) rotate(-45deg);
    border-radius:2px;
}
.back-btn:hover { background:var(--btn-bg-hover); box-shadow:0 6px 18px rgba(255,105,180,.45); transform:translateY(-2px); }
.back-btn:active { transform:translateY(0); }
.back-btn:focus-visible { outline:none; box-shadow:0 0 0 4px rgba(255,105,180,.4),0 0 0 2px #fff inset; }
@media (max-width:700px){
  .back-btn { padding:12px 14px 12px 48px; }
  .back-btn .back-label { display:none; }
  .back-btn { padding:12px; width:56px; justify-content:center; }
  .back-btn .back-arrow { position:static; transform:none; margin:0; }
}

.screen-header h2 {
    font-size: 2em;
    font-weight: 600;
    color: var(--text-dark);
}

.progress, .score, .collection-stats, .game-score {
    background: var(--secondary-color);
    color: var(--text-light);
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
}

/* Quiz Results Overlay (previously inline styles moved here) */
.quiz-results {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.4s ease;
}

.quiz-results .results-content {
    background: #fff;
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    max-width: 520px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    position: relative;
}

.quiz-results .results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.quiz-results .results-actions button {
    background: #FF69B4;
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: background .3s, transform .2s;
}
.quiz-results .results-actions button:hover { background:#E555A0; transform:translateY(-3px); }
.quiz-results .results-actions button:active { transform:translateY(0); }

@keyframes fadeIn { from {opacity:0;} to {opacity:1;} }

/* Center audio quiz header title group */
#audio-quiz-screen .screen-header { gap: 16px; }
#audio-quiz-screen .screen-header { justify-content: flex-start; position: relative; }
#audio-quiz-screen .screen-header .quiz-audio-title { position: absolute; left: 50%; transform: translateX(-50%); margin: 0; }
#audio-quiz-screen .screen-header .header-spacer { flex:1; }
#audio-quiz-screen .screen-header .header-right-group { display:flex; align-items:center; gap:12px; }

/* Center image quiz header title similarly */
#image-quiz-screen .screen-header { gap:16px; justify-content:flex-start; position:relative; }
#image-quiz-screen .screen-header .quiz-image-title { position:absolute; left:50%; transform:translateX(-50%); margin:0; }
#image-quiz-screen .screen-header .header-spacer { flex:1; }
#image-quiz-screen .screen-header .header-right-group { display:flex; align-items:center; gap:12px; }

/* Center collection header title */
#collection-screen .screen-header { gap:16px; justify-content:flex-start; position:relative; }
#collection-screen .screen-header .collection-title { position:absolute; left:50%; transform:translateX(-50%); margin:0; }
#collection-screen .screen-header .header-spacer { flex:1; }
#collection-screen .screen-header .header-right-group { display:flex; align-items:center; gap:12px; }
/* Maze screen header centering */
#maze-game-screen .screen-header { gap:16px; justify-content:flex-start; position:relative; }
#maze-game-screen .screen-header h2 { position:absolute; left:50%; transform:translateX(-50%); margin:0; }
#maze-game-screen .screen-header .header-spacer { flex:1; }
#maze-game-screen .screen-header .header-right-group { display:flex; align-items:center; gap:12px; }
/* Maze central word popup */
#maze-word-popup { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%) scale(0.6); z-index:10; pointer-events:none; opacity:0; transition:opacity .25s, transform .35s cubic-bezier(.34,1.56,.4,1); }
#maze-word-popup.visible { opacity:1; transform:translate(-50%,-50%) scale(1); }
#maze-word-popup .maze-word-inner { background:rgba(255,255,255,0.92); padding:28px 38px; border-radius:40px; box-shadow:0 10px 35px rgba(0,0,0,0.25); display:flex; flex-direction:column; align-items:center; gap:10px; font-size:1.8em; font-weight:700; position:relative; }
#maze-word-popup .maze-word-inner:before { content:''; position:absolute; inset:0; border-radius:40px; padding:2px; background:linear-gradient(135deg,#ff7bbd,#6a9bff); -webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite:xor; mask-composite:exclude; }
#maze-word-popup .fr { font-size:0.7em; letter-spacing:1px; color:#ff2f87; text-shadow:0 2px 4px rgba(0,0,0,0.15); }
#maze-word-popup .jp { font-size:0.45em; color:#555; font-weight:500; }
/* Conversation game */
#conversation-game-screen .screen-header { gap:16px; justify-content:flex-start; position:relative; }
#conversation-game-screen .screen-header h2 { position:absolute; left:50%; transform:translateX(-50%); margin:0; }
#conversation-game-screen .screen-header .header-spacer { flex:1; }
#conversation-game-screen .screen-header .header-right-group { display:flex; align-items:center; gap:12px; }

/* Flashcard Styles */
.flashcard-container {
    display: flex;
    justify-content: center;
    margin: 40px 0;
    perspective: 1000px;
}

.flashcard {
    width: 350px;
    height: 250px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
}

.flashcard.flipped {
    transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--card-shadow);
    padding: 20px;
}

.flashcard-front {
    background: rgba(255, 255, 255, 0.95);
}

.flashcard-back {
    background: var(--secondary-color);
    color: var(--text-light);
    transform: rotateY(180deg);
}

.word-display {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
    text-align: center;
}

.word-icon {
    font-size: 4em;
    line-height: 1;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

.translation {
    font-size: 2em;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

.audio-btn, .big-audio-btn {
    background: var(--accent-color);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.5em;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.audio-btn.playing {
    animation: pulse 1s infinite;
    opacity: 0.8;
}
.audio-btn:disabled {
    cursor: not-allowed;
    filter: grayscale(30%);
    opacity: 0.6;
}

.big-audio-btn {
    width: 100px;
    height: 100px;
    font-size: 2em;
    border-radius: var(--border-radius);
    margin: 20px 0;
}

.audio-btn:hover, .big-audio-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.teenieping-helper {
    text-align: center;
}

.teenieping-helper img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 10px;
    border: 3px solid var(--text-light);
}

.flashcard-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.control-btn {
    background: var(--primary-color);
    color: var(--text-light);
    border: none;
    padding: 15px 25px;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.control-btn:hover {
    background: #E555A0;
    transform: translateY(-2px);
}

.flip-btn {
    background: var(--accent-color);
    color: var(--text-dark);
}

.flip-btn:hover {
    background: #E6C200;
}

/* Quiz Styles */
.quiz-container {
    max-width: 600px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--card-shadow);
}

.quiz-instruction {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--card-shadow);
}

.instruction-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.instruction-icon {
    font-size: 3em;
    animation: bounce 2s infinite;
}

.instruction-text {
    font-size: 1.3em;
    font-weight: 600;
}

.big-play-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.big-play-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.big-play-btn.playing {
    animation: pulse 1s infinite;
    background: rgba(255, 255, 255, 0.4);
}

.visual-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.visual-option-card {
    background: white;
    border: 3px solid transparent;
    border-radius: var(--border-radius);
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
    text-align: center;
}

.visual-option-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.option-image-container {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 10px;
}

.option-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

img.word-placeholder {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.option-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.french-text {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--primary-color);
}

.english-text {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
}

/* Fallback error state for quiz when questions fail to load */
.quiz-error {
    background: rgba(255,255,255,0.85);
    border: 2px dashed var(--primary-color);
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    font-weight: 600;
    animation: pulse-soft 2s infinite;
}
.maze-wrapper { display:flex; flex-direction:column; align-items:center; gap:12px; padding:10px; position:relative; }
#maze-canvas { background:#fff; border:4px solid var(--primary-color); border-radius:16px; box-shadow:0 6px 18px rgba(0,0,0,0.15); max-width:100%; height:auto; }
.maze-controls { display:flex; gap:12px; }
.maze-hint { font-weight:600; color:var(--primary-color); min-height:1.2em; transition:transform .25s; }
.maze-hint.pop { transform:scale(1.15); }
.maze-overlay { position:absolute; top:0; left:0; width:100%; height:100%; display:flex; align-items:center; justify-content:center; backdrop-filter:blur(4px); z-index:5; background:rgba(255,255,255,0.6); }
.maze-overlay[hidden] { display:none !important; pointer-events:none; }
.maze-win { background:rgba(255,255,255,0.95); padding:30px 40px; border-radius:24px; text-align:center; font-size:1.3em; font-weight:700; box-shadow:0 8px 30px rgba(0,0,0,0.25); }
.maze-win button { margin-top:15px; background:var(--primary-color); color:#fff; border:none; padding:12px 24px; border-radius:30px; font-size:0.9em; cursor:pointer; }
.maze-win button:hover { filter:brightness(1.1); }
/* Conversation Game */
.conversation-wrapper { display:flex; gap:20px; flex-wrap:wrap; }
.conversation-characters { flex:0 0 160px; display:flex; flex-direction:column; gap:12px; max-height:70vh; overflow:auto; padding-right:4px; }
.conversation-characters button { background:#fff; border:3px solid var(--secondary-color); border-radius:18px; padding:8px 10px; cursor:pointer; display:flex; align-items:center; gap:8px; font-weight:600; font-size:0.85em; box-shadow:0 4px 14px rgba(0,0,0,0.12); transition:var(--transition); }
.conversation-characters button.active, .conversation-characters button:hover { border-color:var(--primary-color); transform:translateY(-3px); }
.conversation-characters img { width:38px; height:38px; border-radius:50%; object-fit:cover; border:2px solid var(--accent-color); }
.conversation-main { flex:1; min-width:280px; display:flex; flex-direction:column; gap:14px; }
.conversation-log { background:rgba(255,255,255,0.9); backdrop-filter:blur(4px); border-radius:22px; padding:18px 20px; box-shadow:0 6px 20px rgba(0,0,0,0.12); height:340px; overflow-y:auto; display:flex; flex-direction:column; gap:12px; scroll-behavior:smooth; }
.conv-line { display:flex; gap:10px; align-items:flex-start; animation:fadeIn .35s ease; }
.conv-line.player { flex-direction:row-reverse; }
.conv-avatar { width:54px; height:54px; border-radius:50%; background:#fff; box-shadow:0 2px 8px rgba(0,0,0,0.15); display:flex; align-items:center; justify-content:center; overflow:hidden; }
.conv-avatar img { width:100%; height:100%; object-fit:cover; }
.conv-bubble { max-width:70%; padding:12px 16px; border-radius:22px; line-height:1.25; font-weight:500; position:relative; background:linear-gradient(135deg,#fff,#f4f9ff); border:2px solid var(--secondary-color); box-shadow:0 3px 10px rgba(0,0,0,0.08); }
.conv-line.player .conv-bubble { background:linear-gradient(135deg,#fff,#ffeaf6); border-color:var(--primary-color); }
.conv-bubble .bubble-meta { display:block; font-size:0.65em; opacity:0.55; margin-top:6px; font-weight:600; letter-spacing:.5px; }
.conversation-actions { display:flex; gap:10px; flex-wrap:wrap; }
.conversation-actions .control-btn.primary { background:linear-gradient(45deg,var(--primary-color),var(--secondary-color)); color:#fff; font-weight:700; }
.conversation-actions button[disabled] { opacity:0.45; cursor:not-allowed; }
.conversation-hints { background:rgba(255,255,255,0.85); padding:10px 14px; border-radius:18px; font-size:0.9em; font-weight:500; }
.conversation-hints .hint-word { background:#fff; padding:4px 10px; margin:0 4px; border-radius:16px; display:inline-block; border:1px solid var(--secondary-color); cursor:pointer; transition:var(--transition); }
.conversation-hints .hint-word:hover { background:var(--secondary-color); color:#fff; }
.conversation-status { min-height:1.2em; font-size:0.85em; font-weight:600; color:var(--primary-color); }
.conversation-fallback { margin-top:16px; background:#fff3cd; padding:14px 18px; border-radius:18px; font-weight:600; border:2px dashed #ffca2c; }
.hidden { display:none !important; }
@media (max-width:900px){ .conversation-wrapper{ flex-direction:column; } .conversation-characters{ flex-direction:row; flex-wrap:wrap; max-height:unset; } .conversation-characters button{ flex:1 1 calc(50% - 10px); } .conversation-log{ height:280px; } }
.quiz-error button {
    margin-top: 12px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.95em;
}
.quiz-error button:hover { filter: brightness(1.1); }

.visual-option-card.correct-choice {
    border-color: #28a745;
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    animation: correctPulse 0.6s ease;
}

.visual-option-card.incorrect-choice {
    border-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    animation: shake 0.6s ease;
}

.visual-option-card.show-correct {
    border-color: #28a745;
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    animation: highlightCorrect 1s ease;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes highlightCorrect {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Visual Quiz Styles for Non-Readers */
.visual-quiz-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.quiz-instruction {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--card-shadow);
}

.instruction-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.instruction-icon {
    font-size: 3em;
    animation: bounce 2s infinite;
}

.instruction-text {
    font-size: 1.3em;
    font-weight: 600;
}

.big-play-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.big-play-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.big-play-btn.playing {
    animation: pulse 1s infinite;
    background: rgba(255, 255, 255, 0.4);
}

.visual-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.visual-option-card {
    background: white;
    border: 3px solid transparent;
    border-radius: var(--border-radius);
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
    text-align: center;
}

.visual-option-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.option-image-container {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 10px;
}

.option-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.option-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.french-text {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--primary-color);
}

.english-text {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
}

.visual-option-card.correct-choice {
    border-color: #28a745;
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    animation: correctPulse 0.6s ease;
}

.visual-option-card.incorrect-choice {
    border-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    animation: shake 0.6s ease;
}

.visual-option-card.show-correct {
    border-color: #28a745;
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    animation: highlightCorrect 1s ease;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes highlightCorrect {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.quiz-question {
    text-align: center;
    margin-bottom: 30px;
}

.quiz-question h3 {
    font-size: 1.5em;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.quiz-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.quiz-option {
    background: var(--secondary-color);
    color: var(--text-light);
    border: none;
    padding: 20px;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.quiz-option:hover {
    background: #6BB6D6;
    transform: translateY(-2px);
}

.quiz-option.correct {
    background: var(--success-color);
    animation: correctAnswer 0.5s ease-in-out;
}

.quiz-option.incorrect {
    background: var(--danger-color);
    animation: incorrectAnswer 0.5s ease-in-out;
}

@keyframes correctAnswer {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes incorrectAnswer {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.quiz-image {
    text-align: center;
    margin-bottom: 30px;
}

.quiz-image img {
    max-width: 200px;
    max-height: 200px;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
}

/* Snake Game Styles */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--card-shadow);
    max-width: 500px;
    margin: 0 auto;
}

#snake-canvas {
    border: 3px solid var(--primary-color);
    border-radius: var(--border-radius);
    background: #F0F8FF;
}

.game-word {
    font-size: 1.5em;
    font-weight: 600;
    color: var(--text-dark);
    margin: 20px 0;
    padding: 10px 20px;
    background: var(--accent-color);
    border-radius: 20px;
}

.control-instructions {
    text-align: center;
    color: var(--text-dark);
}

.control-instructions p {
    margin: 5px 0;
    font-weight: 500;
}

/* Collection Styles */
.collection-container {
    max-width: 1000px;
    margin: 0 auto;
}

.teenieping-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.teenieping-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    cursor: pointer;
}

.teenieping-card:hover {
    transform: translateY(-5px);
}

.teenieping-card.locked {
    background: rgba(200, 200, 200, 0.5);
    color: #999;
}

.teenieping-card.locked img {
    filter: grayscale(100%) brightness(0.5);
}

.teenieping-card img {
    width: 130px;
    height: 130px;
    margin-bottom: 14px;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transition: transform .35s ease;
}

.teenieping-card:hover img {
        transform: scale(1.07) rotate(2deg);
}

@media (max-width: 680px) {
    .teenieping-card img { width: 110px; height: 110px; }
}

.teenieping-card h4 {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.teenieping-card p {
    font-size: 0.9em;
    color: #666;
    line-height: 1.3;
}

.teenieping-card.new {
    animation: newTeenieping 1s ease-in-out;
}

@keyframes newTeenieping {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Popup Styles */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000; /* base popup layer */
    animation: fadeIn 0.3s ease-in-out;
}

/* Ensure achievement popup can appear above overlays like snake game over (also 1000) */
#achievement-popup {
    z-index: 1500;
}

.popup.hidden {
    display: none;
}

.popup-content {
    background: var(--text-light);
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
    max-width: 400px;
    box-shadow: var(--card-shadow);
    animation: popupSlide 0.3s ease-in-out;
}

@keyframes popupSlide {
    from { transform: scale(0.8) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.popup-content h3 {
    color: var(--text-dark);
    font-size: 1.8em;
    margin-bottom: 20px;
}

.achievement-teenieping img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    margin-bottom: 18px;
    border: 6px solid var(--accent-color);
    box-shadow: 0 8px 18px rgba(0,0,0,0.25);
    animation: teenieBounce 650ms ease;
    background: radial-gradient(circle at 35% 30%, #fff, #ffe6f3 60%, #ffc2e4 100%);
}

@keyframes teenieBounce {
    0% { transform: scale(0.4) rotate(-10deg); opacity: 0; }
    50% { transform: scale(1.15) rotate(4deg); opacity: 1; }
    70% { transform: scale(0.95) rotate(-2deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.achievement-teenieping h4 {
    color: var(--text-dark);
    font-size: 1.3em;
    margin-bottom: 10px;
}

.achievement-teenieping p {
    color: #666;
    margin-bottom: 20px;
}

.popup-btn {
    background: var(--primary-color);
    color: var(--text-light);
    border: none;
    padding: 15px 30px;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-weight: 600;
    font-size: 1.1em;
    cursor: pointer;
    transition: var(--transition);
}

.popup-btn:hover {
    background: #E555A0;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .menu-buttons {
        grid-template-columns: 1fr;
    }
    
    .screen {
        padding: 10px;
    }
    
    .menu-header h1 {
        font-size: 2.5em;
    }
    
    .flashcard {
        width: 300px;
        height: 200px;
    }
    
    .word-display {
        font-size: 2em;
    }
    
    .translation {
        font-size: 1.5em;
    }
    
    .quiz-options {
        grid-template-columns: 1fr;
    }
    
    .teenieping-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .menu-header h1 {
        font-size: 2em;
    }
    
    .flashcard {
        width: 280px;
        height: 180px;
    }
    
    .word-display {
        font-size: 1.8em;
    }
    
    .translation {
        font-size: 1.3em;
    }
    
    .popup-content {
        padding: 20px;
        margin: 20px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .bounce-ball {
        animation: none;
    }
    
    body {
        animation: none;
        background-position: 0% 50%;
    }
}

/* Focus states for accessibility */
button:focus-visible,
.menu-btn:focus-visible,
.quiz-option:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #C41E3A;
        --secondary-color: #2E86C1;
        --accent-color: #F39C12;
        --text-dark: #000000;
        --text-light: #FFFFFF;
    }
}

/* ULTIMATE NOTIFICATION SYSTEM - Enhanced for 5 Seasons */
.xp-notification,
.level-up-notification,
.achievement-notification,
.season-unlock-notification,
.multi-unlock-notification,
.daily-challenge-notification,
.streak-notification,
.daily-reward-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 350px;
    border-left: 5px solid var(--primary-color);
}

.xp-notification.show,
.level-up-notification.show,
.achievement-notification.show,
.season-unlock-notification.show,
.multi-unlock-notification.show,
.daily-challenge-notification.show,
.streak-notification.show,
.daily-reward-notification.show {
    transform: translateX(0);
}

/* XP Notification */
.xp-notification {
    border-left-color: #4CAF50;
    background: linear-gradient(135deg, #E8F5E8, #F1F8E9);
}

.xp-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.xp-icon {
    font-size: 24px;
    animation: sparkle 0.5s ease;
}

.xp-text {
    font-size: 18px;
    font-weight: bold;
    color: #2E7D32;
}

.xp-total {
    font-size: 12px;
    color: #666;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Level Up Notification */
.level-up-notification {
    border-left-color: #FFD700;
    background: linear-gradient(135deg, #FFFDE7, #FFF9C4);
}

.level-up-content {
    text-align: center;
}

.level-up-content h3 {
    color: #F57F17;
    margin-bottom: 10px;
    font-size: 20px;
}

.new-level {
    font-size: 28px;
    font-weight: bold;
    color: #FF8F00;
    margin: 10px 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* Achievement Notification */
.achievement-notification {
    border-left-color: #9C27B0;
    background: linear-gradient(135deg, #F3E5F5, #E1BEE7);
}

.achievement-content {
    text-align: center;
}

.achievement-content h3 {
    color: #7B1FA2;
    margin-bottom: 8px;
    font-size: 18px;
}

.achievement-content h4 {
    color: #4A148C;
    margin-bottom: 5px;
    font-size: 16px;
}

.achievement-content p {
    color: #666;
    font-size: 12px;
    margin-bottom: 10px;
}

.achievement-reward {
    background: #9C27B0;
    color: white;
    padding: 5px 10px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 12px;
}

/* Season Unlock Notification */
.season-unlock-notification {
    border-left-color: #FF6B9D;
    background: linear-gradient(135deg, #FCE4EC, #F8BBD9);
}

.season-unlock-content {
    text-align: center;
}

.season-unlock-content h3 {
    color: #C2185B;
    margin-bottom: 10px;
    font-size: 18px;
}

.season-unlock-content h4 {
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: bold;
}

.season-unlock-content p {
    color: #666;
    font-size: 12px;
    margin-bottom: 5px;
}

/* Multi-Unlock Notification */
.multi-unlock-notification {
    border-left-color: #FF5722;
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
}

.multi-unlock-content {
    text-align: center;
}

.multi-unlock-content h3 {
    color: #D84315;
    margin-bottom: 10px;
    font-size: 18px;
}

.unlocked-characters {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}

.mini-character {
    text-align: center;
}

.mini-character img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #FF5722;
}

.mini-character span {
    display: block;
    font-size: 10px;
    color: #666;
    margin-top: 2px;
}

.more-count {
    background: #FF5722;
    color: white;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
}

/* Daily Challenge Notification */
.daily-challenge-notification {
    border-left-color: #2196F3;
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
}

.daily-challenge-content {
    text-align: center;
}

.daily-challenge-content h3 {
    color: #1565C0;
    margin-bottom: 10px;
    font-size: 18px;
}

.daily-challenge-content p {
    color: #666;
    margin-bottom: 10px;
    font-size: 14px;
}

.challenge-reward {
    background: #2196F3;
    color: white;
    padding: 8px 12px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 12px;
}

/* Streak Notification */
.streak-notification {
    border-left-color: #FF5722;
    background: linear-gradient(135deg, #FFF3E0, #FFCC80);
}

.streak-content {
    text-align: center;
}

.streak-content h3 {
    color: #E65100;
    margin-bottom: 10px;
    font-size: 18px;
}

.streak-count {
    font-size: 32px;
    font-weight: bold;
    color: #FF5722;
    margin: 10px 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* Daily Reward Notification */
.daily-reward-notification {
    border-left-color: #4CAF50;
    background: linear-gradient(135deg, #E8F5E8, #C8E6C9);
}

.daily-reward-content {
    text-align: center;
}

.daily-reward-content h3 {
    color: #2E7D32;
    margin-bottom: 10px;
    font-size: 18px;
}

.reward-amount {
    font-size: 24px;
    font-weight: bold;
    color: #4CAF50;
    margin: 10px 0;
}

.daily-reward-content p {
    color: #666;
    font-size: 12px;
}

/* Stacking Notifications */
.xp-notification:nth-child(n+2),
.level-up-notification:nth-child(n+2),
.achievement-notification:nth-child(n+2),
.season-unlock-notification:nth-child(n+2),
.multi-unlock-notification:nth-child(n+2),
.daily-challenge-notification:nth-child(n+2),
.streak-notification:nth-child(n+2),
.daily-reward-notification:nth-child(n+2) {
    top: 100px;
}

.xp-notification:nth-child(n+3),
.level-up-notification:nth-child(n+3),
.achievement-notification:nth-child(n+3),
.season-unlock-notification:nth-child(n+3),
.multi-unlock-notification:nth-child(n+3),
.daily-challenge-notification:nth-child(n+3),
.streak-notification:nth-child(n+3),
.daily-reward-notification:nth-child(n+3) {
    top: 180px;
}

/* Mobile responsive notifications */
@media (max-width: 768px) {
    .xp-notification,
    .level-up-notification,
    .achievement-notification,
    .season-unlock-notification,
    .multi-unlock-notification,
    .daily-challenge-notification,
    .streak-notification,
    .daily-reward-notification {
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100%);
    }
    
    .xp-notification.show,
    .level-up-notification.show,
    .achievement-notification.show,
    .season-unlock-notification.show,
    .multi-unlock-notification.show,
    .daily-challenge-notification.show,
    .streak-notification.show,
    .daily-reward-notification.show {
        transform: translateY(0);
    }
    
    .unlocked-characters {
        flex-wrap: wrap;
    }
    
    .mini-character img {
        width: 30px;
        height: 30px;
    }
}

    /* ==== Revised Collection Layout (side stats) ==== */
    .collection-layout { display:flex; align-items:flex-start; gap:34px; max-width:1600px; padding:0 30px; margin:0 auto 50px; }
    .collection-layout .teenieping-grid { flex:1; }
    .collection-side { width:320px; display:flex; flex-direction:column; gap:24px; }
    .collection-side .side-stats { background:rgba(255,255,255,0.92); padding:18px 20px; border-radius:22px; box-shadow:var(--card-shadow); }
    .collection-side h3 { margin:0 0 10px; font-size:1.1em; }
    .collection-side .overall-progress { margin-bottom:18px; }
    .collection-side .progress-bar { height:12px; border-radius:6px; overflow:hidden; background:#eee; margin:6px 0 4px; }
    .collection-side .progress-fill { background:linear-gradient(90deg,#FF69B4,#87CEEB); height:100%; width:0; transition:width .6s ease; }
    .collection-side .stat-line { display:flex; justify-content:space-between; font-size:.85em; margin-bottom:4px; }
    .collection-side .season-mini { margin-top:14px; }
    .collection-side .season-mini-item { display:flex; align-items:center; justify-content:space-between; font-size:.8em; padding:6px 0; border-bottom:1px solid #eee; }
    .collection-side .season-mini-item:last-child { border-bottom:none; }
    .collection-side .season-color { width:14px; height:14px; border-radius:4px; margin-right:6px; display:inline-block; }

    @media (max-width: 1100px) { 
        .collection-layout { flex-direction:column; }
        .collection-side { width:100%; order:-1; }
    }

/* === Collection Refinements for aligned cards === */
.teenieping-grid, .season-grid, #teenieping-grid { align-items:stretch; width:100%; }

/* Wider cards per row on large screens */
@media (min-width:1400px){
    .season-grid, #teenieping-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important; }
}

/* Consistent season header height (avoid pushing grid) */
.season-header { display:flex; flex-wrap:nowrap; align-items:center; justify-content:center; gap:8px; min-height:72px; }
.season-header-season1 { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.season-header .season-count { flex:0 0 auto; }

.teenieping-card {
    display: flex;
    flex-direction: column;
    height: 450px; /* fixed uniform height */
    position: relative;
}

.teenieping-image-container { flex: 0 0 160px; }

.teenieping-info { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: flex-start; }

/* Reserve consistent vertical space for name (1-2 lines) */
.teenieping-name { 
    display:-webkit-box; 
    -webkit-line-clamp:2; line-clamp:2; 
    -webkit-box-orient:vertical; 
    overflow:hidden; 
    min-height:48px; 
    line-height:1.2; 
}

/* Ensure emotion line occupies space even if empty */
.teenieping-emotion { min-height:20px; }

.teenieping-description {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 54px; /* space reserved */
}

.teenieping-meta { margin-top: auto; gap:8px; }
.season-badge, .xp-reward { white-space:nowrap; }

.teenieping-card > .unlocked-indicator,
.teenieping-card > .locked-indicator {
    flex: 0 0 48px; /* reserve vertical space */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 14px;
    margin-top: 12px;
    padding: 6px 12px;
    line-height: 1.1;
}

.unlocked-indicator {
    background:linear-gradient(180deg,#e5f9e5,#d2f0d2);
    color:#185c18;
}

.locked-indicator {
    background:linear-gradient(180deg,#f9e5e5,#f0d2d2);
    color:#7a1d1d;
}

/* Hover lift only if space allows */
.teenieping-card:hover { transform: translateY(-4px); }

@media (max-width: 900px) {
        .teenieping-card { height: 430px; }
    .teenieping-image-container { flex:0 0 140px; }
}

@media (max-width: 600px) {
        .teenieping-card { height: 410px; }
        .teenieping-description { -webkit-line-clamp: 4; line-clamp:4; min-height: 64px; }
}

/* === FINAL OVERRIDES: Uniform Teenieping Card Layout & Visible Indicators === */
.season-grid .teenieping-card,
#teenieping-grid .teenieping-card {
    display:flex !important;
    flex-direction:column;
    align-items:stretch;
    height:520px; /* expanded for indicator */
    overflow:visible; /* allow internal shadows */
}

.teenieping-card .card-header { flex:0 0 42px; display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.teenieping-card .teenieping-image-container { flex:0 0 170px; display:flex; align-items:center; justify-content:center; margin-bottom:10px; }
.teenieping-card .teenieping-info { flex:1 1 auto; display:flex; flex-direction:column; }
.teenieping-card .teenieping-name { min-height:44px; }
.teenieping-card .teenieping-emotion { min-height:20px; }
.teenieping-card .teenieping-description { min-height:56px; }
.teenieping-card .teenieping-meta { margin-top:auto; padding-top:6px; }

.teenieping-card > .unlocked-indicator,
.teenieping-card > .locked-indicator { flex:0 0 50px; margin-top:12px; }

@media (max-width: 900px){
        .season-grid .teenieping-card, #teenieping-grid .teenieping-card { height:500px; }
    .teenieping-card .teenieping-image-container { flex:0 0 150px; }
}
@media (max-width: 600px){
        .season-grid .teenieping-card, #teenieping-grid .teenieping-card { height:480px; }
    .teenieping-card .teenieping-image-container { flex:0 0 140px; }
}
