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

:root {
    --ocean-deep: #0F2042;
    --ocean-light: #00A896;
    --amber-gold: #FAB800;
    --creamy-white: #F8F9FA;
    --wood-brown: #8B5A2B;
}

body {
    font-family: 'Baloo Bhaijaan 2', cursive;
    background: linear-gradient(180deg, #1A4E7A 0%, var(--ocean-deep) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    color: var(--creamy-white);
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    padding: 2rem 1rem;
}

/* حركة الأسماك والفقاعات */
.bubbles {
    position: absolute;
    bottom: -100px;
    width: 100%;
    display: flex;
    justify-content: space-around;
    z-index: 1;
}
.bubble {
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    animation: rise 10s infinite ease-in;
}
.bubble:nth-child(even) {
    width: 35px;
    height: 35px;
    animation-duration: 8s;
}
@keyframes rise {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-100vh) scale(1.5); opacity: 0; }
}

.fishes {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
}
.fish {
    position: absolute;
    font-size: 3rem;
    opacity: 0.15;
    animation: swim 20s infinite linear;
}
.fish1 { top: 15%; left: -10%; animation-duration: 25s; }
.fish2 { top: 75%; left: -10%; animation-duration: 18s; animation-delay: 5s; font-size: 2.5rem; }
.fish3 { top: 45%; right: -10%; animation-name: swim-reverse; animation-duration: 35s; font-size: 4rem; opacity: 0.1; }
@keyframes swim {
    0% { transform: translateX(-15vw); }
    100% { transform: translateX(115vw); }
}
@keyframes swim-reverse {
    0% { transform: translateX(15vw) scaleX(-1); }
    100% { transform: translateX(-115vw) scaleX(-1); }
}

.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.3));
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.container {
    background: rgba(15, 32, 66, 0.7);
    border: 6px solid var(--ocean-light);
    backdrop-filter: blur(10px);
    border-radius: 40px;
    padding: 3rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), inset 0 0 25px rgba(0, 168, 150, 0.4);
    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(--amber-gold);
    font-weight: 800;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.6);
    margin: 0;
}

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

/* أزرار السماعة */
.speak-btn {
    background: var(--ocean-light);
    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.3);
    padding: 0;
}
.speak-btn:hover {
    transform: scale(1.1);
    background: var(--amber-gold);
}
.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(--ocean-light);
    border-radius: 25px;
    outline: none;
    background: var(--creamy-white);
    color: var(--ocean-deep);
    transition: all 0.3s;
    font-family: 'Baloo Bhaijaan 2', cursive;
    text-align: center;
    font-weight: 800;
}
input:focus {
    border-color: var(--amber-gold);
    box-shadow: 0 0 20px rgba(250, 184, 0, 0.6);
}

.input-speak {
    position: absolute;
    left: 15px; /* RTL meaning left is inside the input end */
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
}
.input-speak:hover {
    transform: translateY(-50%) scale(1.1);
}

.helm-btn {
    background: var(--amber-gold);
    color: var(--ocean-deep);
    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(--creamy-white);
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
}
.helm-btn-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.btn-speak {
    width: 35px;
    height: 35px;
    font-size: 1rem;
    background: rgba(255,255,255,0.4);
}
.btn-speak:hover {
    background: white;
}
.helm-btn:hover {
    transform: scale(1.1) rotate(15deg) translateY(-5px);
    box-shadow: 0 15px 35px rgba(250, 184, 0, 0.5);
    background: #FFCA28;
}
.helm-btn:active {
    transform: scale(0.95);
}

.error-message {
    color: #FF6B6B;
    font-weight: 800;
    font-size: 1.5rem;
    min-height: 40px;
    opacity: 0;
    transition: opacity 0.3s;
    background: rgba(0,0,0,0.3);
    padding: 10px 20px;
    border-radius: 15px;
    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;
}

.porthole-card {
    text-decoration: none;
    background: var(--wood-brown);
    border-radius: 50%;
    width: 180px;
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 12px 30px rgba(0,0,0,0.6), inset 0 0 15px rgba(0,0,0,0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 12px;
}

.porthole-card .glass {
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(0, 168, 150, 0.9) 100%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 5px solid #5C3A21;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--creamy-white);
    transition: all 0.4s ease;
}

.porthole-card:hover {
    transform: translateY(-20px) scale(1.05);
}
.porthole-card:hover .glass {
    background: linear-gradient(135deg, rgba(255,255,255,0.7) 0%, var(--amber-gold) 100%);
    color: var(--ocean-deep);
}

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

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

.card-speak {
    width: 35px;
    height: 35px;
    font-size: 1rem;
    background: rgba(0,0,0,0.2);
}
.card-speak:hover {
    background: var(--amber-gold);
}
