* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    background:
        radial-gradient(circle at top left, #fff7a8, transparent 32%),
        radial-gradient(circle at top right, #bdefff, transparent 30%),
        linear-gradient(180deg, #eaf9ff, #fff8e5);
    color: #1c3154;
    user-select: none;
}

button,
select {
    font: inherit;
}

button {
    touch-action: manipulation;
}

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

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

.logo-bubble {
    width: 120px;
    height: 120px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 50%;
    background: white;
    font-size: 68px;
    box-shadow: 0 10px 30px rgba(20, 60, 100, 0.14);
}

h1 {
    margin: 0;
    font-size: clamp(38px, 6vw, 64px);
    text-align: center;
}

.subtitle {
    margin: 8px 0 26px;
    font-size: 20px;
    font-weight: 700;
}

.setup-box {
    width: min(560px, 100%);
    padding: 28px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 40px rgba(20, 60, 100, 0.16);
}

.setup-box label {
    display: block;
    margin: 12px 0 6px;
    font-size: 18px;
    font-weight: 800;
}

.setup-box select {
    width: 100%;
    min-height: 62px;
    padding: 0 18px;
    border: 3px solid #d7e7f2;
    border-radius: 16px;
    background: white;
    font-size: 22px;
    font-weight: 700;
}

.big-button {
    width: 100%;
    min-height: 72px;
    margin-top: 24px;
    border: 0;
    border-radius: 22px;
    background: #22b573;
    color: white;
    font-size: 26px;
    font-weight: 900;
    box-shadow: 0 8px 0 #16844f;
    cursor: pointer;
}

.big-button:active {
    transform: translateY(4px);
    box-shadow: 0 4px 0 #16844f;
}

.big-button:disabled {
    opacity: 0.4;
    cursor: default;
}

.error {
    min-height: 24px;
    font-weight: 700;
    color: #c0392b;
}

#game-screen {
    justify-content: flex-start;
}

.game-header {
    width: min(1100px, 100%);
    margin: 0 auto 18px;
}

.player-name {
    margin-bottom: 10px;
    text-align: center;
    font-size: 20px;
    font-weight: 900;
}

.progress-track {
    width: 100%;
    height: 22px;
    overflow: hidden;
    border: 4px solid white;
    border-radius: 999px;
    background: #d6e9f6;
    box-shadow: 0 4px 12px rgba(20, 60, 100, 0.12);
}

.progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #45c96c, #ffd84f);
    transition: width 0.35s ease;
}

.question-card {
    width: min(1100px, 100%);
    margin: auto;
    padding: clamp(20px, 3vw, 38px);
    border-radius: 34px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 50px rgba(20, 60, 100, 0.16);
}

.category-badge {
    display: table;
    margin: 0 auto 10px;
    padding: 8px 16px;
    border-radius: 999px;
    background: #e7f5ff;
    font-size: 15px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.prompt-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.prompt-row h2 {
    margin: 12px 0;
    text-align: center;
    font-size: clamp(28px, 4.5vw, 52px);
    line-height: 1.08;
}

.speak-button {
    flex: 0 0 auto;
    width: 70px;
    height: 70px;
    border: 0;
    border-radius: 50%;
    background: #ffd84f;
    font-size: 34px;
    box-shadow: 0 6px 0 #d6a800;
    cursor: pointer;
}

.speak-button:active {
    transform: translateY(3px);
    box-shadow: 0 3px 0 #d6a800;
}

.question-picture {
    min-height: 0;
    margin: 4px 0 16px;
    text-align: center;
    font-size: clamp(54px, 10vw, 110px);
}


.question-picture img {
    display: block;
    width: auto;
    max-width: min(100%, 700px);
    max-height: 290px;
    margin: 0 auto;
    object-fit: contain;
    user-select: none;
    pointer-events: none;
}

.answer-button img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 165px;
    margin: 0 auto;
    object-fit: contain;
    user-select: none;
    pointer-events: none;
}

.answer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(14px, 2vw, 24px);
}

.answer-button {
    min-height: clamp(130px, 20vh, 210px);
    padding: 14px;
    overflow: hidden;
    border: 5px solid #d7e8f5;
    border-radius: 28px;
    background: #ffffff;
    font-size: clamp(58px, 9vw, 100px);
    box-shadow: 0 8px 0 #bed5e5;
    cursor: pointer;
    transition:
        transform 0.12s ease,
        border-color 0.12s ease,
        background 0.12s ease;
}

.answer-button:hover {
    border-color: #7bc7ed;
}

.answer-button:active {
    transform: translateY(4px);
    box-shadow: 0 4px 0 #bed5e5;
}

.answer-button.wrong {
    animation: shake 0.34s ease;
    background: #fff0f0;
    border-color: #ff8d8d;
}

.answer-button.correct {
    animation: pop 0.35s ease;
    background: #eaffef;
    border-color: #55d77a;
}

.feedback {
    min-height: 46px;
    margin-top: 18px;
    text-align: center;
    font-size: 26px;
    font-weight: 900;
}

.feedback.good {
    color: #14924b;
}

.feedback.try {
    color: #e48200;
}

.result-character {
    font-size: clamp(110px, 20vw, 220px);
    line-height: 1;
}

.result-score {
    margin-top: 18px;
    font-size: clamp(62px, 12vw, 120px);
    font-weight: 900;
}

.result-detail {
    margin-top: 8px;
    font-size: 22px;
    font-weight: 800;
}

#result-screen .big-button {
    max-width: 480px;
}

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

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

@media (max-width: 700px) {
    .screen {
        padding: 14px;
    }

    .question-card {
        border-radius: 24px;
    }

    .answer-grid {
        gap: 12px;
    }

    .answer-button {
        min-height: 125px;
        border-width: 4px;
        border-radius: 22px;
    }

    .speak-button {
        width: 60px;
        height: 60px;
        font-size: 29px;
    }
}
