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

:root {
    --bg-color: #EDE7F6; /* Dreamy purple */
    --primary: #FCE4EC; /* Pastel Pink */
    --primary-dark: #F8BBD0;
    --secondary: #FFF176; /* Golden Star */
    --secondary-dark: #FFEE58;
    --accent: #F48FB1; /* Pink accent */
    --accent-dark: #EC407A;
    --text: #4A148C; /* Dark purple text */
    --white: #ffffff;
}

body {
    font-family: 'Baloo Bhaijaan 2', cursive;
    background: linear-gradient(to bottom, var(--bg-color) 0%, var(--primary) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    color: var(--text);
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    padding: 2rem 1rem;
}

/* خلفية الحديقة السحرية */
.garden-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
    pointer-events: none;
}

.star-dust {
    position: absolute;
    bottom: -50px;
    background: rgba(255, 241, 118, 0.6); 
    border-radius: 50%;
    animation: floatUp infinite linear;
    box-shadow: 0 0 10px rgba(255, 241, 118, 0.8);
}
@keyframes floatUp {
    0% { transform: translateY(0) scale(1); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-110vh) scale(0.5); opacity: 0; }
}

.cloud-shadow {
    position: absolute;
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.4);
    animation: drift infinite linear;
    z-index: 1;
    filter: blur(2px);
}
@keyframes drift {
    0% { transform: translateX(110vw); }
    100% { transform: translateX(-30vw); }
}

.captain-avatar {
    position: absolute;
    top: 30px;
    right: 30px;
    font-size: 5rem;
    z-index: 10;
    animation: float 4s ease-in-out infinite;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.2));
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.container {
    background: rgba(255, 255, 255, 0.6);
    border: 6px solid var(--primary-dark);
    backdrop-filter: blur(10px);
    border-radius: 40px;
    padding: 3rem;
    box-shadow: 0 20px 50px rgba(74, 20, 140, 0.15), inset 0 0 25px rgba(255, 255, 255, 0.8);
    width: 90%;
    max-width: 700px;
    text-align: center;
    transition: all 0.4s ease;
    z-index: 10;
    position: relative;
    margin: auto;
}

/* Audio & Text wrappers */
.text-with-audio {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 0.5rem;
}
.subtitle-audio {
    margin-bottom: 2.5rem;
}

.title {
    font-size: 4rem;
    color: var(--accent-dark);
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8);
    margin: 0;
}

.subtitle {
    font-size: 1.8rem;
    color: var(--text);
    line-height: 1.6;
    font-weight: 700;
    margin: 0;
}

/* أزرار السماعة */
.speak-btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 0;
}
.speak-btn:hover {
    transform: scale(1.1);
    background: var(--secondary);
    color: var(--text);
}
.speak-btn:active {
    transform: scale(0.95);
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin-bottom: 1.5rem;
}

.input-audio-wrapper {
    position: relative;
    width: 85%;
}

input {
    width: 100%;
    padding: 20px 60px 20px 25px;
    font-size: 1.8rem;
    border: 6px solid var(--primary-dark);
    border-radius: 25px;
    outline: none;
    background: var(--white);
    color: var(--text);
    transition: all 0.3s;
    font-family: 'Baloo Bhaijaan 2', cursive;
    text-align: center;
    font-weight: 800;
}
input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(244, 143, 177, 0.6);
}

.input-speak {
    position: absolute;
    left: 15px; 
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
}
.input-speak:hover {
    transform: translateY(-50%) scale(1.1);
}

.flower-btn {
    background: var(--secondary);
    color: var(--text);
    border: none;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    font-size: 2.2rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: 'Baloo Bhaijaan 2', cursive;
    border: 8px dashed var(--accent);
    box-shadow: 0 10px 25px rgba(236, 64, 122, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
}
.flower-btn-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.flower-btn:hover {
    transform: scale(1.1) rotate(15deg) translateY(-5px);
    box-shadow: 0 15px 35px rgba(236, 64, 122, 0.5);
    background: #FFD54F;
}
.flower-btn:active {
    transform: scale(0.95);
}

.error-message {
    color: #E53935;
    font-weight: 800;
    font-size: 1.5rem;
    min-height: 40px;
    opacity: 0;
    transition: opacity 0.3s;
    background: rgba(255,255,255,0.8);
    padding: 10px 20px;
    border-radius: 15px;
    border: 2px solid #E53935;
    margin-top: 15px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.error-message.show {
    opacity: 1;
}

.hidden {
    display: none !important;
}

.cards-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.flower-card {
    position: relative;
    width: 180px;
    height: 180px;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    margin: 10px;
}

.flower-card .petals {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, #FF80AB, #F48FB1);
    border-radius: 40px;
    transition: all 0.4s;
    z-index: 0;
    box-shadow: 0 10px 20px rgba(236, 64, 122, 0.3);
}

.flower-card .petals::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: inherit;
    border-radius: 40px;
    transform: rotate(45deg);
    z-index: -1;
    box-shadow: 0 10px 20px rgba(236, 64, 122, 0.3);
}

.flower-card .glass {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.3);
    width: 130px;
    height: 130px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--white);
    border: 4px solid var(--secondary);
    transition: all 0.4s ease;
}

.flower-card:hover .petals {
    transform: translateY(-20px) scale(1.05);
}
.flower-card:hover .petals::before {
    transform: rotate(45deg) scale(1.05);
}
.flower-card:hover .glass {
    transform: translateY(-20px) scale(1.05);
    background: rgba(255,255,255,0.5);
    color: var(--text);
    border-color: #FFCA28;
}

.icon {
    font-size: 3.5rem;
    text-shadow: 0 5px 10px rgba(0,0,0,0.2);
    transition: transform 0.3s;
}
.flower-card:hover .icon {
    transform: scale(1.1);
}

.flower-card h3 {
    font-size: 1.5rem;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin: 0;
}
.flower-card:hover h3 {
    text-shadow: none;
}

.card-speak {
    width: 35px;
    height: 35px;
    font-size: 1rem;
    background: rgba(255,255,255,0.3);
}
.card-speak:hover {
    background: var(--secondary);
}
