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

body {
    font-family: 'Comic Sans MS', 'Chalkboard', 'Arial Rounded MT Bold', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.screen.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hidden {
    display: none !important;
}

/* Start Screen */
.container {
    background: white;
    border-radius: 30px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideIn 0.5s ease;
}

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

h1 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    color: #888;
    font-size: 1.2em;
    margin-bottom: 20px;
}

.mascot {
    font-size: 80px;
    margin: 20px 0;
    animation: bounce 2s infinite;
}

.mascot-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 20px 0;
    animation: bounce 2s infinite;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.welcome-text {
    color: #555;
    font-size: 1.1em;
    margin-bottom: 30px;
}

.level-select h3 {
    color: #333;
    margin-bottom: 20px;
}

.level-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 20px;
    margin: 10px 0;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    border-radius: 15px;
    color: white;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.level-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(245, 87, 108, 0.4);
}

.level-btn:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.level-emoji {
    font-size: 40px;
    margin-bottom: 5px;
}

.level-name {
    font-size: 1.5em;
    font-weight: bold;
}

.level-desc {
    font-size: 0.9em;
    opacity: 0.9;
}

.warning {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
    color: #856404;
    font-size: 0.95em;
}

/* Game Screen */
#game-screen {
    flex-direction: column;
    padding: 0;
}

.game-header {
    background: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

#level-indicator {
    font-weight: bold;
    color: #667eea;
}

#progress {
    color: #888;
}

#score {
    font-weight: bold;
    color: #f5576c;
}

.game-container {
    flex: 1;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.replay-btn {
    background: #6c5ce7;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    margin-bottom: 20px;
    transition: transform 0.2s;
}

.replay-btn:hover {
    transform: scale(1.05);
}

.riddle-box {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

#riddle-text {
    font-size: 1.4em;
    color: #333;
    line-height: 1.8;
    text-align: center;
}

/* Easy Mode - Choices */
.choices-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.choice-btn {
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.choice-btn:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.choice-btn.correct {
    border-color: #00b894;
    background: #e8f8f5;
}

.choice-btn.wrong {
    border-color: #d63031;
    background: #ffe5e5;
    animation: shake 0.5s;
}

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

.choice-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 10px;
}

.choice-text {
    font-size: 1.1em;
    color: #333;
    font-weight: bold;
}

.choice-emoji {
    font-size: 60px;
    margin-bottom: 10px;
}

/* Medium Mode - Jumble */
.jumble-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
}

.answer-slots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    min-height: 60px;
}

.letter-slot {
    width: 50px;
    height: 60px;
    border: 3px dashed #ccc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    font-weight: bold;
    color: #667eea;
    background: #f8f9fa;
}

.letter-slot.filled {
    border-style: solid;
    border-color: #667eea;
    background: #e8eaf6;
}

.letter-pool {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.letter-tile {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.letter-tile:hover {
    transform: scale(1.1);
}

.letter-tile.used {
    opacity: 0.3;
    cursor: not-allowed;
}

.jumble-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.control-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    transition: transform 0.2s;
}

#check-btn {
    background: #00b894;
    color: white;
}

#reset-btn {
    background: #74b9ff;
    color: white;
}

.control-btn:hover {
    transform: scale(1.05);
}

.focus-reminder {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 10px;
    padding: 12px;
    margin-top: 20px;
    text-align: center;
    color: #856404;
    font-size: 0.95em;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: popIn 0.3s ease;
}

@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content h2 {
    color: #e17055;
    margin-bottom: 15px;
}

.modal-content ul {
    text-align: left;
    margin: 20px 0;
    padding-left: 30px;
    color: #555;
}

.modal-content li {
    margin: 10px 0;
}

.encourage {
    color: #00b894;
    font-weight: bold;
    margin: 20px 0;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.primary-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1em;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.danger-btn {
    background: #e17055;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1em;
    cursor: pointer;
}

.secondary-btn {
    background: #dfe6e9;
    color: #636e72;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1em;
    cursor: pointer;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* Feedback Screen */
#feedback-screen {
    justify-content: center;
    align-items: center;
}

.feedback-container {
    background: white;
    border-radius: 30px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.feedback-emoji {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

#feedback-title {
    color: #00b894;
    font-size: 2em;
    margin-bottom: 20px;
}

#feedback-title.wrong {
    color: #e17055;
}

.answer-reveal {
    margin: 30px 0;
}

#answer-img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 20px;
    margin-bottom: 15px;
    transition: opacity 0.3s ease;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
}

#answer-img[loading] {
    animation: pulse 1s infinite;
}

#answer-text {
    font-size: 1.5em;
    color: #333;
    font-weight: bold;
}

/* Confetti */
#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Store Screen */
#store-screen {
    justify-content: center;
    align-items: center;
}

.store-container {
    background: white;
    border-radius: 30px;
    padding: 40px;
    text-align: center;
    max-width: 600px;
    width: 100%;
}

.final-score {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-radius: 20px;
    padding: 30px;
    margin: 30px 0;
}

#final-score-val {
    font-size: 2em;
    font-weight: bold;
}

.star-rating {
    font-size: 30px;
    margin: 15px 0;
}

#rating-text {
    font-size: 1.2em;
    font-weight: bold;
}

.sticker-reward {
    margin: 30px 0;
}

.sticker-boxes {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin: 30px 0;
    min-height: 120px;
    align-items: center;
}

.mystery-box {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    animation: pulse 1.5s infinite;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    position: relative;
    flex-shrink: 0;
}

.mystery-box.opening {
    animation: boxShake 0.6s ease-in-out;
}

.mystery-box.opened {
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
    animation: none;
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(196, 69, 105, 0.4);
}

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

@keyframes boxShake {
    0%, 100% { transform: rotate(0deg) scale(1); }
    15% { transform: rotate(-15deg) scale(1.1); }
    30% { transform: rotate(15deg) scale(1.1); }
    45% { transform: rotate(-15deg) scale(1.1); }
    60% { transform: rotate(15deg) scale(1.1); }
    75% { transform: rotate(-10deg) scale(1.05); }
    90% { transform: rotate(10deg) scale(1.05); }
}

.sticker-reveal {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 20px;
}

.sticker-reveal h3 {
    margin-bottom: 15px;
    color: #333;
}

@keyframes stickerPop {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.4) rotate(15deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.sparkle {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    pointer-events: none;
    animation: sparklePop 0.6s ease-out forwards;
}

@keyframes sparklePop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(calc(-50% + var(--tx, 30px)), calc(-50% + var(--ty, -30px))) scale(0);
        opacity: 0;
    }
}

.sticker-reveal {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 20px;
}

.sticker-reveal h3 {
    margin-bottom: 15px;
    color: #333;
}

.sticker-results {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
    min-height: 80px;
}

.sticker-item {
    font-size: 60px;
    animation: popIn 0.5s ease;
}

/* Collection Screen */
#collection-screen {
    justify-content: center;
    align-items: center;
}

.collection-container {
    background: white;
    border-radius: 30px;
    padding: 40px;
    max-width: 700px;
    width: 100%;
    text-align: center;
}

.sticker-album {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 15px;
}

.album-slot {
    aspect-ratio: 1;
    background: white;
    border: 2px dashed #ddd;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    min-height: 60px;
}

.album-slot.empty::before {
    content: "?";
    color: #ddd;
    font-size: 30px;
}

.decorate-section {
    margin: 30px 0;
}

.profile-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 20px;
    margin-top: 20px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.profile-avatar {
    font-size: 50px;
}

.profile-name {
    color: white;
    font-size: 1.3em;
    font-weight: bold;
}

.profile-stickers {
    min-height: 60px;
    background: rgba(255,255,255,0.2);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
}

.profile-stickers .placeholder {
    color: rgba(255,255,255,0.7);
}

.profile-stickers .sticker-item {
    font-size: 36px;
    cursor: grab;
}

.collection-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* Responsive */
@media (max-width: 600px) {
    .choices-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .sticker-album {
        grid-template-columns: repeat(4, 1fr);
    }
    
    h1 {
        font-size: 1.8em;
    }
}
