/* ADDED: Import the custom font at the very top */
@import url("https://fontsapi.zeoseven.com/92/main/result.css");

/* ========== General Styles ========== */
* {
    box-sizing: border-box;
    user-select: none;
}
body {
    /* MODIFIED: Set the new font for the entire page */
    font-family: "Smiley Sans Oblique", 'Segoe UI', 'PingFang SC', Roboto, 'Noto Sans', system-ui, sans-serif;
    font-weight: normal;
    background: linear-gradient(145deg, #fce4ec 0%, #f8bbd0 50%, #f48fb1 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 12px;
    position: relative;
    overflow: hidden;
}

/* ========== Background Animations ========== */
.bg-animal {
    position: fixed;
    pointer-events: none;
    z-index: 0;
    font-size: 2rem;
    opacity: 0.18;
    animation: bgFloat 8s ease-in-out infinite;
}
@keyframes bgFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg) scale(1); }
    25% { transform: translateY(-15px) rotate(10deg) scale(1.05); }
    50% { transform: translateY(-5px) rotate(-5deg) scale(0.98); }
    75% { transform: translateY(-20px) rotate(8deg) scale(1.03); }
}

/* ========== Game Container ========== */
.game-container {
    max-width: 750px;
    width: 100%;
    background: linear-gradient(180deg, #fff5f8 0%, #ffeef3 100%);
    border-radius: 70px 70px 60px 60px;
    box-shadow: 0 20px 40px rgba(233, 30, 99, 0.2), 0 6px 16px rgba(255, 182, 193, 0.3);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* ========== Header ========== */
.game-header {
    background: linear-gradient(135deg, #d4729a 0%, #c2547a 100%);
    padding: 22px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 4px solid #ffb6c1;
}

/* NEW: Styles for group score container */
.score-box-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.score-box {
    background: rgba(255,255,255,0.2);
    border-radius: 40px;
    padding: 6px 20px;
    font-weight: bold;
    font-size: 1.5rem; /* Adjusted for two boxes */
    color: #fff;
    box-shadow: inset 0 1px 3px rgba(255,255,255,0.3), 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
}
.score-box span:first-child {
    font-size: 0.8rem;
    color: #ffe0ec;
    margin-right: 8px;
    font-weight: normal;
}

/* Specific colors for group boxes */
#scoreBoxGroup1 {
    border: 2px solid #8ec5fc;
}
#scoreBoxGroup2 {
    border: 2px solid #f5b9b8;
}

.timer-area {
    background: rgba(255,255,255,0.2);
    border-radius: 40px;
    padding: 4px 16px;
    font-family: monospace; /* Keeping monospace for a digital clock look */
    font-size: 2.2rem;
    font-weight: bold;
    color: #fff;
    transition: color 0.3s, transform 0.2s;
}
.timer-area.urgent {
    color: #ffeb3b;
    animation: pulse 0.5s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ========== Kawaii Sparkle & Decoration Animations ========== */
@keyframes sparkle {
    0%, 100% { opacity: 0.3; transform: scale(0.7) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.2) rotate(15deg); }
}
@keyframes floatHeart {
    0%, 100% { transform: translateY(0px) scale(1); opacity: 0.6; }
    50% { transform: translateY(-8px) scale(1.1); opacity: 1; }
}
@keyframes twinkle {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}
@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes gentlePulse {
    0%, 100% { box-shadow: 0 10px 20px rgba(233, 30, 99, 0.15); }
    50% { box-shadow: 0 10px 25px rgba(233, 30, 99, 0.3); }
}

.sparkle-deco, .heart-deco, .star-deco, .header-sparkle, .animal-deco {
    position: absolute;
    pointer-events: none;
    z-index: 10;
}
.sparkle-deco { font-size: 1.2rem; animation: sparkle 2s ease-in-out infinite; }
.heart-deco { font-size: 1rem; animation: floatHeart 3s ease-in-out infinite; }
.star-deco { font-size: 0.9rem; animation: twinkle 2.5s ease-in-out infinite; }
.header-sparkle { display: inline-block; animation: sparkle 1.8s ease-in-out infinite; position: static; }
.animal-deco { font-size: 1.4rem; animation: animalWobble 3s ease-in-out infinite; }
@keyframes animalWobble {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-5px) rotate(8deg); }
    75% { transform: translateY(3px) rotate(-5deg); }
}

/* ========== Confetti & Rain Effects ========== */
.confetti-container, .rain-container {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}
.confetti-piece {
    position: absolute;
    top: -30px;
    font-size: 1.5rem;
    animation: confettiFall 2.5s ease-in forwards;
}
@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}
.rain-drop {
    position: absolute;
    top: -20px;
    font-size: 1.2rem;
    animation: rainFall 1.8s ease-in forwards;
}
@keyframes rainFall {
    0% { transform: translateY(0); opacity: 0.7; }
    100% { transform: translateY(110vh); opacity: 0; }
}

/* ========== Cheer Animal Sign ========== */
.cheer-animal {
    position: absolute;
    top: 10px;
    right: 15px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: cheerBounce 1.5s ease-in-out infinite;
}
.cheer-animal .animal-face { font-size: 2.8rem; line-height: 1; }
.cheer-animal .cheer-sign {
    background: #fff;
    border: 2px solid #f8bbd0;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: bold;
    color: #d4729a;
    white-space: nowrap;
    margin-top: 2px;
    box-shadow: 0 2px 6px rgba(233, 30, 99, 0.15);
}
@keyframes cheerBounce {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-8px) rotate(3deg); }
}

/* ========== Main Game Content ========== */
.game-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 900;
    color: #c2547a;
    padding: 18px 16px 4px;
    letter-spacing: 3px;
    text-shadow: 0 1px 2px rgba(233, 30, 99, 0.15);
}

.herb-showcase {
    background: linear-gradient(180deg, #fff0f5 0%, #ffe4ee 100%);
    border-radius: 40px;
    padding: 44px 22px;
    text-align: center;
    margin: 20px 22px 26px; /* Reduced top margin */
    box-shadow: inset 0 1px 8px rgba(233, 30, 99, 0.06), 0 8px 14px rgba(233, 30, 99, 0.08);
    animation: gentlePulse 4s ease-in-out infinite;
    position: relative; /* For cheer animal positioning */
}
.herb-img-box {
    width: 175px;
    height: 175px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 14px rgba(233, 30, 99, 0.12);
    border: 2px solid #f8bbd0;
    background: #ffffff;
    font-size: 5.5rem;
    animation: bounceIn 0.6s ease-out;
}
.herb-name {
    font-size: 3.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fce4ec, #f8bbd0);
    display: inline-block;
    padding: 0.15rem 1.2rem;
    border-radius: 50px;
    letter-spacing: 3px;
    margin-top: 2px;
    box-shadow: inset 0 1px 4px rgba(255,255,255,0.8), 0 3px 6px rgba(233, 30, 99, 0.1);
}
.target-char {
    display: inline-block;
    font-weight: 900;
    text-shadow: 0 0 1px white;
    background: rgba(255,240,245,0.6);
    padding: 0 4px;
    border-radius: 12px;
    border-bottom: 3px solid currentColor;
    transform: scale(1.02);
}
.color-hint {
    background: linear-gradient(135deg, #fce4ec, #f8bbd0);
    border-radius: 50px;
    padding: 26px 20px;
    margin: 0 22px 26px;
    text-align: center;
    box-shadow: inset 0 1px 4px rgba(233, 30, 99, 0.06);
}
.hint-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}
.hint-btn {
    background: linear-gradient(145deg, #f5a0ba, #f08aac);
    color: #5a2d42;
    border: 2px solid rgba(255, 182, 193, 0.5);
    font-size: 1.5rem;
    font-weight: bold;
    padding: 10px 22px;
    border-radius: 50px;
    min-width: 75px;
    cursor: default;
    box-shadow: 0 2px 5px rgba(233, 30, 99, 0.2), inset 0 1px 2px rgba(255,255,255,0.4);
    letter-spacing: 1px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hint-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(233, 30, 99, 0.3), inset 0 1px 2px rgba(255,255,255,0.4);
}

/* ========== Control Panel & Buttons ========== */
.control-panel {
    background: linear-gradient(135deg, #fce4ec, #f8d7e4);
    border-radius: 50px;
    padding: 24px;
    margin: 6px 22px 32px;
    text-align: center;
}
.verdict-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 10px 0;
}
.verdict-btn {
    font-size: 1.9rem;
    font-weight: bold;
    padding: 14px 40px;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    transition: 0.1s linear;
    box-shadow: 0 4px 0 rgba(0,0,0,0.15);
}
.verdict-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0,0,0,0.15);
}
.correct-btn { background-color: #66bb6a; color: white; }
.wrong-btn { background-color: #ef5350; color: white; }

.next-round-btn {
    background: linear-gradient(135deg, #f06292, #ec407a);
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 10px 26px;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    box-shadow: 0 3px 0 #c2185b;
    margin-top: 6px;
}
.next-round-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #c2185b;
}

.start-btn {
    background: linear-gradient(135deg, #f48fb1, #ec407a);
    color: white;
    border: none;
    font-size: 1.7rem;
    font-weight: bold;
    padding: 14px 34px;
    border-radius: 40px;
    cursor: pointer;
    margin: 10px auto;
    display: block;
    width: 75%;
    box-shadow: 0 4px 0 #c2185b;
}
.start-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #c2185b;
}
.result-msg {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    display: inline-block;
}
.result-correct { background: #c8e6c9; color: #2e7d32; }
.result-wrong { background: #ffcdd2; color: #c62828; }

/* NEW: Player info display */
.round-info {
    font-size: 1.3rem;
    color: #8e5572;
    margin-bottom: 12px;
    font-weight: bold;
}

/* ========== Summary & Final Screens ========== */
.summary-screen {
    text-align: center;
    padding: 28px 20px;
}
.summary-title {
    font-size: 2rem;
    font-weight: bold;
    color: #8e5572;
    margin-bottom: 12px;
}
.summary-body {
    font-size: 1.8rem;
    font-weight: bold;
    color: #c2547a;
    background: #fff0f5;
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 24px;
    display: inline-block;
}

.final-screen,
.final-result-screen {
    text-align: center;
    padding: 28px 20px;
}
.final-score-title {
    font-size: 1.6rem;
    color: #8e5572;
    margin-bottom: 6px;
}
#finalResultBody {
    font-size: 1.5rem;
    line-height: 1.8;
    color: #8e5572;
    margin-bottom: 24px;
}
#finalResultBody .winner-text {
    font-size: 2.2rem;
    font-weight: 900;
    margin-top: 16px;
    color: #d81b60;
}


.final-score-number {
    font-size: 4.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ec407a, #f48fb1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent; /* Standard property */
    margin-bottom: 5px;
}
.final-score-detail {
    font-size: 1rem;
    color: #a0678a;
    margin-bottom: 12px;
}

.replay-btn {
    background: linear-gradient(135deg, #f48fb1, #ec407a);
    color: white;
    border: none;
    font-size: 1.6rem;
    font-weight: bold;
    padding: 16px 44px;
    border-radius: 40px;
    cursor: pointer;
    box-shadow: 0 4px 0 #c2185b;
    margin-top: 10px;
}
.replay-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #c2185b;
}

.hidden {
    display: none;
}

/* ========== Media Queries for Responsiveness ========== */
@media (max-width: 550px) {
    .score-box { font-size: 1.1rem; padding: 4px 12px; }
    .herb-name { font-size: 1.8rem; padding: 0.2rem 1rem; }
    .verdict-btn { font-size: 1.2rem; padding: 8px 20px; }
    .hint-btn { font-size: 1rem; padding: 5px 12px; min-width: 60px; }
    .herb-img-box { width: 130px; height: 130px; font-size: 4rem; }
    .sparkle-deco, .heart-deco, .star-deco, .animal-deco { display: none; }
    .cheer-animal .animal-face { font-size: 1.8rem; }
    .cheer-animal .cheer-sign { font-size: 0.6rem; padding: 1px 5px; }
}

/* ========== ✨ ADDED FOR IMAGES ✨ ========== */
.herb-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This makes the image cover the area without distortion */
    border-radius: 50%; /* This makes the image itself circular */
}