@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;900&family=Tajawal:wght@400;500;700&display=swap');

:root {
    --bg-primary: #120a21;
    --bg-secondary: #1a0f30;
    --bg-tertiary: #2a1b4e;
    --text-primary: #ffffff;
    --text-secondary: #e2d9f3;
    --accent-gold: #ffd700;
    --accent-gold-hover: #ffaa00;
    --accent-pink: #ff4081;
    --accent-green: #4caf50;
    --accent-red: #f44336;
    --glass-bg: rgba(42, 27, 78, 0.45);
    --glass-border: rgba(255, 215, 0, 0.2);
    --font-heading: 'Cairo', sans-serif;
    --font-body: 'Tajawal', sans-serif;
    --border-radius: 20px;
    --transition-speed: 0.3s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    background-image:
        radial-gradient(circle at 20% 30%, rgba(138, 43, 226, 0.2) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(218, 165, 32, 0.15) 0%, transparent 40%),
        linear-gradient(to bottom, #120a21, #0a0514);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Twinkling Stars Background */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    background-color: #fff;
    border-radius: 50%;
    animation: twinkle 3s infinite ease-in-out;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.2;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* App Header & Layout */
header {
    z-index: 10;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.music-btn,
.parent-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 10px 15px;
    border-radius: 12px;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-speed);
    backdrop-filter: blur(5px);
}

.music-btn:hover,
.parent-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.2);
}

main {
    flex: 1;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.container {
    width: 100%;
}

/* Base Card / Screen Styles */
.screen {
    display: none;
    animation: fadeIn 0.5s ease-out forwards;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(255, 215, 0, 0.05);
    backdrop-filter: blur(15px);
    text-align: center;
    position: relative;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typography styles */
h1 {
    font-family: var(--font-heading);
    font-weight: 900;
    color: var(--accent-gold);
    font-size: 2.3rem;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.5);
}

h2 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--accent-gold);
    font-size: 1.8rem;
    margin-bottom: 20px;
}

p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Welcome Screen */
.eid-greeting-svg {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px auto;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6));
    animation: pulse 3s infinite alternate ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.05);
    }
}

.kids-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.kid-card {
    background: rgba(26, 15, 48, 0.6);
    border: 2px solid rgba(255, 215, 0, 0.15);
    border-radius: var(--border-radius);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.kid-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--accent-gold);
    transform: scaleX(0);
    transition: transform var(--transition-speed);
}

.kid-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-gold);
    box-shadow: 0 10px 25px rgba(255, 215, 0, 0.2);
    background: rgba(42, 27, 78, 0.8);
}

.kid-card:hover::before {
    transform: scaleX(1);
}

.kid-avatar {
    width: 85px;
    height: 85px;
    margin-bottom: 15px;
    border-radius: 50%;
    border: 3px solid var(--accent-gold);
    object-fit: cover;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.25);
    background: var(--bg-primary);
}

.kid-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--text-primary);
}

.kid-progress-badge {
    margin-top: 10px;
    background: var(--bg-tertiary);
    color: var(--accent-gold);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.1);
}

/* Game Screen */
.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

.player-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--accent-gold);
    object-fit: cover;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.player-tag {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    background: rgba(255, 215, 0, 0.15);
    color: var(--accent-gold);
    padding: 5px 15px;
    border-radius: 30px;
    border: 1px solid var(--accent-gold);
}

.progress-counter {
    font-weight: 700;
    color: var(--text-secondary);
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background: var(--bg-secondary);
    border-radius: 5px;
    margin-bottom: 30px;
    overflow: hidden;
    border: 1px solid rgba(255, 215, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-gold-hover));
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px var(--accent-gold);
}

.clue-box {
    background: rgba(18, 10, 33, 0.5);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    font-size: 1.25rem;
    line-height: 1.8;
    color: #fff;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.clue-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: inline-block;
}

.input-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
}

.code-input {
    background: rgba(26, 15, 48, 0.8);
    border: 2px solid rgba(255, 215, 0, 0.3);
    color: #fff;
    padding: 15px;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 1.2rem;
    text-align: center;
    font-weight: 700;
    transition: all var(--transition-speed);
}

.code-input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    background: var(--bg-tertiary);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold), #ff9900);
    border: none;
    color: #120a21;
    padding: 15px 30px;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.15rem;
    cursor: pointer;
    transition: all var(--transition-speed);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.5);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-secondary {
    background: transparent;
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: var(--accent-gold);
    padding: 10px 20px;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-speed);
    margin-top: 15px;
}

.btn-secondary:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--accent-gold);
}

/* Shake animation for wrong inputs */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-8px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(8px);
    }
}

/* Correct feedback effect */
.pulse-green {
    animation: pulseGreen 0.6s ease-out;
}

@keyframes pulseGreen {
    0% {
        border-color: rgba(255, 215, 0, 0.3);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(76, 175, 80, 0);
    }

    100% {
        border-color: var(--accent-green);
    }
}

/* Mascot (Sheep) Styling */
.sheep-container {
    width: 100px;
    height: 100px;
    margin: 20px auto 0 auto;
    position: relative;
    cursor: pointer;
}

.sheep-svg {
    width: 100%;
    height: 100%;
    animation: float 4s infinite alternate ease-in-out;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    100% {
        transform: translateY(-10px) rotate(3deg);
    }
}

.sheep-jump {
    animation: jump 0.8s ease-in-out;
}

@keyframes jump {

    0%,
    100% {
        transform: translateY(0) scale(1, 1);
    }

    30% {
        transform: translateY(-35px) scale(0.9, 1.1);
    }

    50% {
        transform: translateY(-40px) rotate(15deg);
    }

    80% {
        transform: translateY(-5px) scale(1.1, 0.9);
    }
}

/* Victory Screen */
.victory-card {
    padding: 40px;
    border-color: var(--accent-gold);
    box-shadow: 0 0 35px rgba(255, 215, 0, 0.3);
}

.victory-avatar-container {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 25px auto;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.5));
    animation: wobble 4s infinite ease-in-out alternate;
}

.victory-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid var(--accent-gold);
    object-fit: cover;
}

.victory-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: linear-gradient(135deg, var(--accent-gold), #ff9900);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    border: 2px solid var(--bg-secondary);
}

@keyframes wobble {
    0% {
        transform: translateY(0) rotate(-3deg);
    }

    100% {
        transform: translateY(-8px) rotate(3deg);
    }

    50% {
        transform: rotate(5deg);
    }
}

.victory-message-box {
    background: rgba(255, 215, 0, 0.1);
    border: 2px dashed var(--accent-gold);
    border-radius: 15px;
    padding: 25px;
    margin: 25px 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.8;
}

/* Parent Password Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 5, 20, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border: 2px solid var(--accent-gold);
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.modal-content h3 {
    font-family: var(--font-heading);
    color: var(--accent-gold);
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.modal-content .math-question {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 20px 0;
    color: var(--text-primary);
}

/* Parent Dashboard Screen */
.dashboard-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}

.tab-btn {
    background: rgba(255, 215, 0, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 700;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn.active {
    background: var(--accent-gold);
    color: var(--bg-primary);
    border-color: var(--accent-gold);
}

.tab-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--accent-gold);
    object-fit: cover;
}

.clue-edit-row {
    background: rgba(18, 10, 33, 0.4);
    border: 1px solid rgba(255, 215, 0, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: right;
}

.clue-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
    background: rgba(26, 15, 48, 0.9);
    border: 1px solid rgba(255, 215, 0, 0.2);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.95rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 50px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-gold);
}

.dashboard-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

/* Print options card styling */
.print-options-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
    text-align: right;
    backdrop-filter: blur(5px);
}

.print-options-card h3 {
    font-size: 1rem;
    color: var(--accent-gold);
    margin-bottom: 12px;
    font-family: var(--font-heading);
}

.print-options-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.print-option-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    user-select: none;
    transition: color var(--transition-speed);
}

.print-option-label:hover {
    color: var(--text-primary);
}

.print-option-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-gold);
    cursor: pointer;
}

/* Printable checklist & card generators styles */
.print-section {
    display: none;
}

#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 99;
}

/* Print Styling */
@media print {
    @page {
        size: A4;
        margin: 1.5cm;
    }

    /* Hide everything on the page except the print container */
    body>*:not(.print-section) {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        display: block !important;
        min-height: 0 !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        position: static !important;
    }

    .print-section {
        display: block !important;
        position: static !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        direction: rtl !important;
        box-sizing: border-box !important;
        font-family: 'Tajawal', sans-serif;
    }

    .print-title {
        text-align: center;
        font-size: 20px;
        margin-bottom: 15px;
        border-bottom: 2px double #000;
        padding-bottom: 8px;
        font-weight: bold;
        color: #000 !important;
    }

    .print-section p {
        color: #333 !important;
        font-size: 12px;
        margin-bottom: 15px;
        text-align: center;
    }

    .setup-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 30px;
    }

    .setup-table th,
    .setup-table td {
        border: 1px solid #000;
        padding: 8px;
        text-align: right;
        font-size: 13px;
        color: #000 !important;
    }

    .setup-table th {
        background-color: #f2f2f2 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .print-cards-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        width: 100%;
    }

    .print-card {
        border: 2px dashed #000 !important;
        padding: 15px;
        border-radius: 8px;
        position: relative;
        height: 220px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        box-sizing: border-box;
        page-break-inside: avoid;
        break-inside: avoid;
        background: #fff !important;
        color: #000 !important;
    }

    .print-card-header {
        display: flex;
        justify-content: space-between;
        border-bottom: 1px solid #000;
        padding-bottom: 5px;
        font-weight: bold;
        font-size: 14px;
        color: #000 !important;
    }

    .print-card-body {
        margin: 10px 0;
        font-size: 13px;
        text-align: center;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        color: #000 !important;
    }

    .print-card-body p {
        color: #000 !important;
        font-size: 12px;
        margin-bottom: 5px;
        text-align: center;
    }

    .print-card-code {
        border: 2px solid #000 !important;
        padding: 5px 15px;
        font-weight: bold;
        background: #f0f0f0 !important;
        font-size: 16px;
        margin-top: 5px;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .print-card-footer {
        text-align: center;
        font-size: 10px;
        color: #333 !important;
        border-top: 1px solid #ccc;
        padding-top: 5px;
    }
}

/* Footer styling */
footer {
    text-align: center;
    padding: 20px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    z-index: 10;
}

footer a {
    color: var(--accent-gold);
    text-decoration: none;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    h1 {
        font-size: 1.8rem;
    }

    .screen {
        padding: 20px;
    }

    .clue-box {
        font-size: 1.1rem;
        padding: 15px;
    }

    .btn-primary {
        padding: 12px 24px;
        font-size: 1rem;
    }

    .kids-selector {
        grid-template-columns: 1fr;
    }

    .kid-card {
        flex-direction: row;
        gap: 15px;
        align-items: center;
        padding: 15px;
    }

    .kid-avatar {
        width: 60px;
        height: 60px;
        margin-bottom: 0;
    }

    .kid-card::before {
        width: 6px;
        height: 100%;
        transform: scaleY(0);
        transform-origin: top;
    }

    .kid-card:hover::before {
        transform: scaleY(1);
    }
}

/* Victory Song Scroll Styles */
.victory-song-scroll {
    background: linear-gradient(135deg, rgba(255, 248, 220, 0.95), rgba(255, 235, 180, 0.98));
    border: 2px solid var(--accent-gold);
    border-radius: 16px;
    padding: 25px;
    margin: 25px auto;
    max-width: 480px;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.25), inset 0 0 20px rgba(255, 215, 0, 0.1);
    position: relative;
    overflow: hidden;
    animation: scrollSlideIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes scrollSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.song-scroll-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    color: #7a5800;
    margin-bottom: 15px;
    font-weight: 900;
    text-align: center;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.song-content {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
}

.song-line {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.15rem;
    color: #3e2800;
    margin: 2px 0;
    line-height: 1.6;
    direction: rtl;
    animation: fadeInLine 0.5s ease-out both;
}

/* Staggered fadeIn for song lines */
.song-line:nth-child(1) { animation-delay: 0.1s; }
.song-line:nth-child(2) { animation-delay: 0.25s; }
.song-line:nth-child(3) { animation-delay: 0.4s; }
.song-line:nth-child(4) { animation-delay: 0.55s; }
.song-line:nth-child(5) { animation-delay: 0.7s; }
.song-line:nth-child(6) { animation-delay: 0.85s; }
.song-line:nth-child(7) { animation-delay: 1.0s; }
.song-line:nth-child(8) { animation-delay: 1.15s; }

@keyframes fadeInLine {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scroll-decoration {
    font-size: 1.1rem;
    color: #8c6600;
    opacity: 0.8;
    text-align: center;
    letter-spacing: 6px;
    margin: 5px 0;
    user-select: none;
}

.speech-btn {
    margin-top: 10px;
    background: linear-gradient(135deg, #8c6600, #ffaa00);
    color: #fff !important;
    border: none;
    border-radius: 30px;
    padding: 10px 22px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-speed);
    box-shadow: 0 4px 10px rgba(140, 102, 0, 0.3);
    font-family: var(--font-body);
}

.speech-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(140, 102, 0, 0.55);
}

.speech-btn.speaking-active {
    background: linear-gradient(135deg, var(--accent-pink), #e91e63);
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.4);
    animation: pulseSpeaking 1.5s infinite ease-in-out;
}

@keyframes pulseSpeaking {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03);
    }
}

/* Interactive Sheep Pasture System */
#sheepPasture {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 110px;
    z-index: 50;
    pointer-events: none;
    overflow: visible;
}

#sheepPasture::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 18px;
    background: linear-gradient(to top, rgba(76, 175, 80, 0.25), transparent);
    border-radius: 0;
    pointer-events: none;
}

.grass-tuft {
    position: absolute;
    bottom: 0;
    pointer-events: none;
    opacity: 0.7;
    animation: grassSway 2.5s ease-in-out infinite alternate;
}

@keyframes grassSway {
    0% { transform: rotate(-3deg); }
    100% { transform: rotate(3deg); }
}

.pasture-sheep {
    position: absolute;
    bottom: 5px;
    width: 80px;
    height: 80px;
    cursor: pointer;
    pointer-events: all;
    transition: transform 0.15s ease;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
}

.pasture-sheep:hover {
    filter: drop-shadow(0 5px 12px rgba(255, 215, 0, 0.5)) brightness(1.1);
}

.pasture-sheep:active {
    transform: scale(1.15) !important;
}

.sheep-clicked-jump {
    animation: sheepClickJump 0.7s ease-out;
}

@keyframes sheepClickJump {
    0% { transform: translateY(0) rotate(0deg); }
    30% { transform: translateY(-40px) rotate(-15deg); }
    50% { transform: translateY(-50px) rotate(15deg) scale(1.1); }
    80% { transform: translateY(-10px) rotate(-5deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

.sheep-bubble {
    position: absolute;
    top: -35px;
    left: 50%;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.5);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    animation: bubbleFloat 2.5s ease-out forwards;
    pointer-events: none;
    z-index: 999;
}

@keyframes bubbleFloat {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    70% {
        opacity: 1;
        transform: translateX(-50%) translateY(-20px);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-35px);
    }
}

/* Crescent Moon Spin Twinkle Animation */
.eid-greeting-svg {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.eid-greeting-svg:hover {
    transform: scale(1.08);
}

.moon-spin {
    animation: moonSpin 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes moonSpin {
    0% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.25) rotate(180deg);
        filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.95));
    }
    100% {
        transform: scale(1) rotate(360deg);
    }
}
