:root {
    --bg-color: #ffebf0;
    --primary-color: #ff6b9e;
    --primary-dark: #e84a84;
    --secondary-color: #ffd166;
    --text-color: #4a4a4a;
    --white: #ffffff;
    --shadow: 0 8px 16px rgba(255, 107, 158, 0.2);
    --border-radius: 24px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, #fff0f5 0%, #ffc1d3 100%);
    min-height: 100vh;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#app {
    width: 100%;
    max-width: 480px;
    height: 100vh;
    height: 100dvh;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 0 40px rgba(255, 107, 158, 0.3);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 20px 60px 20px;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    overflow-y: auto;
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.screen.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9);
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.title {
    font-family: 'Fredoka One', cursive;
    color: var(--primary-color);
    font-size: 3rem;
    text-align: center;
    text-shadow: 2px 2px 0px var(--white), 4px 4px 0px rgba(255, 107, 158, 0.3);
    margin-bottom: 30px;
}

.subtitle {
    font-size: 1.5rem;
    text-align: center;
    color: var(--primary-dark);
    margin-bottom: 20px;
}

.mascot-container {
    width: 200px;
    height: 200px;
    background: var(--white);
    border-radius: 50%;
    padding: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 6px solid var(--primary-color);
}

.mascot {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.btn-primary {
    background: linear-gradient(to bottom, #ff9ecd 0%, #ff6b9e 100%);
    color: var(--white);
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    box-shadow: 0 8px 0 var(--primary-dark), 0 15px 20px rgba(255, 107, 158, 0.4);
    cursor: pointer;
    transition: all 0.1s;
    letter-spacing: 2px;
}

.btn-primary:active {
    transform: translateY(8px);
    box-shadow: 0 0 0 var(--primary-dark), 0 5px 10px rgba(255, 107, 158, 0.4);
}

/* Game Screen Elements */
.top-bar {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 20px 0;
    position: absolute;
    top: 0;
}

#level-indicator {
    background: var(--white);
    color: var(--primary-color);
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 900;
    font-size: 1.2rem;
    box-shadow: var(--shadow);
}

.question-text {
    font-family: 'Fredoka One', cursive;
    color: var(--primary-dark);
    font-size: 2rem;
    margin-bottom: 20px;
    text-align: center;
    margin-top: 60px;
}

.rebus-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
    background: var(--white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 40px;
    width: 100%;
    border: 4px dashed #ffb6c1;
    min-height: 180px;
    flex-shrink: 0;
}

.rebus-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.rebus-img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    background: #fdfdfd;
    border-radius: 16px;
    box-shadow: inset 0 -4px 8px rgba(0,0,0,0.05);
    padding: 10px;
}

.rebus-plus {
    font-family: 'Fredoka One', cursive;
    font-size: 3rem;
    color: var(--secondary-color);
    text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 100%;
    padding: 0 10px;
}

.option-btn {
    background: var(--white);
    color: var(--primary-dark);
    border: 4px solid var(--white);
    padding: 20px 10px;
    font-size: 1.4rem;
    font-weight: 900;
    border-radius: var(--border-radius);
    box-shadow: 0 6px 0 rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Nunito', sans-serif;
}

.option-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(255, 107, 158, 0.2);
    border-color: #ffe4e1;
}

.option-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 rgba(0,0,0,0.05);
}

.option-btn.correct {
    background: #a8e6cf;
    color: #2b7a5f;
    border-color: #a8e6cf;
    box-shadow: 0 6px 0 #7ec4ab;
}

.option-btn.wrong {
    background: #ffaaaa;
    color: #c93838;
    border-color: #ffaaaa;
    box-shadow: 0 6px 0 #d97878;
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

/* Animations */
@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

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

.pulse {
    animation: pulse 2s infinite;
}

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

.bounce {
    animation: bounce 2s infinite ease-in-out;
}

@keyframes wobble {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.wobble {
    animation: wobble 1s infinite ease-in-out;
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--primary-dark);
    font-size: 1.2rem;
    font-family: 'Nunito', sans-serif;
    font-weight: bold;
    margin-top: 15px;
    cursor: pointer;
    text-decoration: underline;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-text:hover {
    opacity: 1;
}

.btn-text.hidden {
    display: none;
}

/* Responsive adjustments for margins on small smartphones */
@media (max-width: 400px) {
    .screen {
        padding: 10px 10px 60px 10px;
    }
    .rebus-container {
        padding: 15px 5px;
        gap: 8px;
    }
}
