:root {
    --primary: #FF8C00;
    /* Orange */
    --primary-dark: #FF7000;
    --secondary: #00BFFF;
    /* Deep Sky Blue */
    --secondary-dark: #009ACD;
    --accent: #32CD32;
    /* Lime Green */
    --danger: #FF6347;
    /* Tomato */
    --bg-gradient: linear-gradient(135deg, #FFF4E0 0%, #FFDAB9 100%);
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-main: #4A4A4A;
    --font-stack: 'Fredoka', 'Comic Sans MS', cursive, sans-serif;
    --shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    --radius-lg: 25px;
    --radius-md: 15px;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-stack);
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Container */
.app-container {
    width: 100%;
    max-width: 500px;
    /* Mobile focused centered layout */
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 20px;
}

.logo-text {
    font-size: 1.8rem;
    margin: 0;
    color: var(--secondary);
    text-shadow: 2px 2px 0px white;
}

.logo-text .highlight {
    color: var(--primary);
}

.icon-btn {
    background: white;
    border: none;
    font-size: 1.5rem;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

.icon-btn:active {
    transform: scale(0.9);
}

/* Screens */
.screen {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
}

.screen.hidden {
    display: none;
}

.screen.active {
    display: flex;
    animation: fadeIn 0.5s ease-out;
}

/* Cards */
.card,
.hero-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
    text-align: center;
    backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 255, 255, 0.5);
    margin: auto 0;
}

/* Mascot */
.mascot-area {
    margin-bottom: 20px;
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mascot-img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.15));
}

/* Buttons */
.btn {
    font-family: var(--font-stack);
    border: none;
    padding: 15px 30px;
    margin: 10px 0;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    top: 0;
}

.btn:active {
    top: 6px;
    box-shadow: 0 0 0 rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary);
}

.btn-secondary:hover {
    background: var(--secondary-dark);
}

.btn-accent {
    background: var(--accent);
}

.back-btn {
    background: none;
    border: none;
    font-family: var(--font-stack);
    color: var(--secondary);
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 10px;
    align-self: flex-start;
}

/* Inputs */
.input-group {
    margin: 15px 0;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--text-main);
}

input[type="text"] {
    width: 100%;
    padding: 15px;
    border-radius: var(--radius-md);
    border: 2px solid #E0E0E0;
    font-family: var(--font-stack);
    font-size: 1.1rem;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--secondary);
}

/* Game Screen Elements */
.game-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.badge {
    background: var(--secondary);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
}

.timer-box {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--danger);
}

.score-box {
    margin-top: 5px;
    font-weight: bold;
    color: var(--primary);
}

.game-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
}

.image-container {
    width: 100%;
    height: 250px;
    background: #FFFFFF;
    /* Pure white for better contrast */
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    border: 4px solid var(--secondary);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05);
}

/* #game-image removed */
.puzzle-text {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
    padding: 20px;
    line-height: 1.4;
    text-align: center;
    width: 100%;
}

.hint-label {
    font-weight: bold;
    color: var(--text-main);
}

.hint-content {
    color: var(--primary);
    font-weight: bold;
    font-size: 1.1rem;
}

.answer-area {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.answer-area input {
    flex: 1;
}

.answer-area button {
    width: auto;
    margin: 0;
    padding: 0 20px;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: bold;
    z-index: 10;
}

#correct-overlay {
    color: var(--accent);
}

#wrong-overlay {
    color: var(--danger);
}

/* Leaderboard */
.leaderboard-list {
    list-style: none;
    padding: 0;
    text-align: left;
}

.leaderboard-list li {
    padding: 10px;
    border-bottom: 2px solid #EEE;
    display: flex;
    justify-content: space-between;
}

.leaderboard-list li:first-child {
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: bold;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

.bounce-in {
    animation: fadeIn 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.pop-in {
    animation: fadeIn 0.4s ease-out;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .app-container {
        max-width: 700px;
    }

    .game-card {
        padding: 40px;
    }

    .image-container {
        height: 350px;
    }
}

/* Listening State */
.listening {
    background: var(--danger) !important;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}