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

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}



.scale-wrapper {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-container {
    width: 780px;
    height: 750px;
    border-radius: 20px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.screen {
    width: 100%;
    height: 100%;
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    gap: 50px
}

.screen.active {
    opacity: 1;
    pointer-events: all;
}

/* Start Screen */
.start-screen {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
    text-align: center;
}

.game-title {
    font-size: 48px;
    color: #fff;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.subtitle {
    font-size: 24px;
    color: #333;
    margin-bottom: 40px;
}

.start-btn {
    background: linear-gradient(45deg, #ff6b6b, #ff8e53);
    color: white;
    border: none;
    padding: 20px 40px;
    font-size: 24px;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.3s ease;
    box-shadow: 0 10px 20px rgba(255, 107, 107, 0.3);
}

.start-btn:hover {
    transform: translateY(-3px) scale(1.05);
}

/* Game Screen */
.game-screen {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    padding: 20px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 20px;
    margin-bottom: 30px;
}

.score {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    background: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    border-radius: 25px;
}

.lives {
    font-size: 24px;
    color: #e74c3c;
}

.home-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
}

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

.level-info {
    font-size: 20px;
    color: #333;
    margin-bottom: 15px;
}

.question {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: bold;
}

.shape-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 0 40px;
    gap: 30px;
}

.formula-section {
    flex: 1;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.formula-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.formula {
    font-size: 24px;
    color: #e74c3c;
    font-weight: bold;
    text-align: center;
    font-family: 'Times New Roman', serif;
}

.solve-section {
    display: none;
    /* hidden initially */
    flex: 1;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.show-answer-btn {
    display: block;
    margin: 15px auto;
    padding: 10px 20px;
    font-size: 18px;
    font-weight: bold;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s;
}

.show-answer-btn:hover {
    background: #2980b9;
}


.solve-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.solve-area {
    font-size: 20px;
    color: #2c3e50;
    text-align: center;
    line-height: 1.5;
}

/* 2D Shapes */
.shape {
    flex: 0 0 180px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 180px;
}

.square {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    border: 3px solid #333;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(255, 107, 107, 0.3);
    position: relative;
}

.square::after {
    content: attr(data-side);
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

.rectangle {
    width: 140px;
    height: 100px;
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    border: 3px solid #333;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(116, 185, 255, 0.3);
    position: relative;
}

.rectangle::after {
    content: attr(data-dimensions);
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

.circle {
    width: 120px;
    height: 120px;
    background: radial-gradient(circle at 30% 30%, #ffeaa7, #fdcb6e);
    border: 3px solid #333;
    border-radius: 50%;
    box-shadow: 0 8px 16px rgba(253, 203, 110, 0.3);
    position: relative;
}

.circle::after {
    content: 'r = ' attr(data-radius);
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

.triangle {
    width: 0;
    height: 0;
    border-left: 60px solid transparent;
    border-right: 60px solid transparent;
    border-bottom: 120px solid #e17055;
    position: relative;
    filter: drop-shadow(0 8px 16px rgba(225, 112, 85, 0.3));
}

.triangle::after {
    content: attr(data-dimensions);
    position: absolute;
    top: 130px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    font-weight: bold;
    color: #333;
    white-space: nowrap;
}

.answer-area {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.answer-btn {
    background: linear-gradient(45deg, #74b9ff, #0984e3);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 25px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.answer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(116, 185, 255, 0.4);
}

/* Feedback Screens */
.feedback-screen {
    text-align: center;
}

.correct-screen {
    background: linear-gradient(135deg, #56f000 0%, #a8ff78 100%);
}

.wrong-screen {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
}

.feedback-emoji {
    font-size: 120px;
    margin-bottom: 30px;
    animation: pulse 1s ease-in-out;
}

.feedback-message {
    font-size: 36px;
    color: white;
    font-weight: bold;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.continue-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 20px;
    cursor: pointer;
    font-weight: bold;
}

/* End Screen */
.end-screen {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    text-align: center;
    color: white;
}

.final-score {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.replay-btn {
    background: linear-gradient(45deg, #ff6b6b, #ff8e53);
    color: white;
    border: none;
    padding: 20px 40px;
    font-size: 24px;
    border-radius: 50px;
    cursor: pointer;
    margin: 10px;
}

/* Animations */
@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);
    }
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.star {
    position: absolute;
    color: gold;
    font-size: 24px;
    animation: sparkle 1s ease-out forwards;
}

@keyframes sparkle {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }

    50% {
        transform: scale(1) rotate(180deg);
        opacity: 1;
    }

    100% {
        transform: scale(0) rotate(360deg);
        opacity: 0;
    }
}