/**
 * Eduplayify Game Mode: Ocean Fish (السمكة السابحة)
 * تصميم وتنسيق متجاوب بالكامل لجميع الشاشات (كمبيوتر، لابتوب، جوال، أجهزة لوحية وملء الشاشة).
 * متوافق مع معايير الأداء العالي والمتصفحات القديمة (§10 و §12).
 */

.fish-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    padding: 2px 4px 6px 4px;
    box-sizing: border-box;
    position: relative;
    gap: 6px;
    overscroll-behavior: contain;
}

#gamePlayArea:fullscreen .fish-stage,
.gpa-fullscreen .fish-stage {
    max-width: 1240px;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    padding: 4px 6px;
    justify-content: space-between;
    gap: 4px;
}

/* شريط السؤال والحالة */
.fish-hud {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 5px;
    box-sizing: border-box;
}

.fish-q-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #ffffff;
    border: 1.5px solid #bae6fd;
    border-radius: 12px;
    padding: 8px 14px;
    box-shadow: 0 2px 8px rgba(8, 145, 178, 0.08);
    min-height: 44px;
    box-sizing: border-box;
}

.fish-q-badge {
    background: #ecfeff;
    color: #0e7490;
    font-weight: 800;
    font-size: 0.8rem;
    padding: 3px 9px;
    border-radius: 9999px;
    white-space: nowrap;
    border: 1px solid #a5f3fc;
    flex-shrink: 0;
}

.fish-q-thumb {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 8px;
    border: 1.5px solid #cbd5e1;
    cursor: zoom-in;
    flex-shrink: 0;
    transition: transform 0.15s ease, border-color 0.15s ease;
    display: none;
}

.fish-q-thumb:hover {
    transform: scale(1.08);
    border-color: #0891b2;
}

.fish-q-text {
    flex: 1;
    font-weight: 800;
    color: var(--ink, #0f172a);
    font-size: 1.05rem;
    line-height: 1.35;
    margin: 0;
    text-align: center;
    word-break: break-word;
}

.fish-tts-btn {
    background: #f0f9ff;
    border: 1px solid #7dd3fc;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s ease, background 0.1s ease;
    font-size: 0.95rem;
    flex-shrink: 0;
    color: #0369a1;
}

.fish-tts-btn:hover {
    background: #e0f2fe;
    transform: scale(1.06);
}

.fish-tts-btn:active {
    transform: scale(0.92);
}

.fish-meta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 2px;
}

.fish-meta-left,
.fish-meta-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.fish-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 800;
    background: #f8fafc;
    color: #334155;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

.fish-pill.is-streak {
    background: #fef3c7;
    color: #b45309;
    border-color: #f59e0b;
    box-shadow: 0 1px 4px rgba(245, 158, 11, 0.2);
}

.fish-pill.is-multi {
    background: #ecfeff;
    color: #0e7490;
    border-color: #22d3ee;
    box-shadow: 0 1px 4px rgba(6, 182, 212, 0.22);
}

.fish-speed-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 800;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #6ee7b7;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
}

.fish-speed-btn:hover {
    background: #d1fae5;
    transform: scale(1.03);
}

.fish-speed-btn:active {
    transform: scale(0.96);
}

.fish-hint-text {
    font-size: 0.76rem;
    color: var(--ink-soft, #475569);
    margin: 0;
}

/* حاوية الكانفس المائي */
.fish-canvas-wrap {
    position: relative;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(8, 145, 178, 0.24), 0 2px 6px rgba(0, 0, 0, 0.08);
    background: #0369a1;
    border: 2px solid #0284c7;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none !important;
    -webkit-touch-callout: none;
    overscroll-behavior: contain;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gamePlayArea:fullscreen .fish-canvas-wrap,
.gpa-fullscreen .fish-canvas-wrap {
    max-width: 1240px;
    border-radius: 10px;
    box-shadow: none;
}

.fish-canvas {
    display: block;
    cursor: default;
    max-width: 100%;
    vertical-align: middle;
    touch-action: none !important;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.fish-canvas.is-hover-fish {
    cursor: grab;
}

.fish-canvas.is-dragging-fish {
    cursor: grabbing;
}

/* شاشة البدء فوق الماء */
.fish-start-overlay {
    position: absolute;
    top: 2px;
    right: 2px;
    bottom: 2px;
    left: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    border-radius: 14px;
    background: rgba(12, 74, 110, 0.62);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 20;
    transition: opacity 0.25s ease;
}

.fish-start-overlay.is-gone {
    opacity: 0;
    pointer-events: none;
}

.fish-start-card {
    background: #ffffff;
    border: 2px solid #38bdf8;
    border-radius: 18px;
    padding: 18px 24px;
    max-width: 390px;
    width: 92%;
    text-align: center;
    box-shadow: 0 14px 32px rgba(2, 132, 199, 0.28);
}

.fish-start-icon {
    font-size: 2.6rem;
    line-height: 1.1;
    margin-bottom: 6px;
}

.fish-start-title {
    margin: 0 0 6px 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: #0c4a6e;
}

.fish-start-msg {
    margin: 0 0 14px 0;
    font-size: 0.88rem;
    color: #334155;
    line-height: 1.5;
}

.fish-start-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 26px;
    border-radius: 9999px;
    border: none;
    background: linear-gradient(135deg, #06b6d4 0%, #0284c7 100%);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.98rem;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.35);
    transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.fish-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.44);
}

.fish-start-btn:active {
    transform: scale(0.96);
}

/* شريط أزرار التحكم بالسمكة أسفل الكانفس */
.fish-controls-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 4px 0 2px 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

.fish-dpad {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #f0f9ff;
    border: 1.5px solid #bae6fd;
    border-radius: 16px;
    padding: 6px 12px;
    box-shadow: 0 3px 10px rgba(8, 145, 178, 0.1);
}

.fish-dbtn {
    width: 48px;
    height: 44px;
    border-radius: 12px;
    border: 1.5px solid #38bdf8;
    background: #ffffff;
    color: #0369a1;
    font-size: 1.1rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 0 #7dd3fc;
    transition: transform 0.08s ease, background 0.1s ease, box-shadow 0.08s ease;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.fish-dbtn:hover {
    background: #e0f2fe;
}

.fish-dbtn:active,
.fish-dbtn.is-active {
    background: #0284c7;
    color: #ffffff;
    border-color: #0369a1;
    transform: translateY(2px);
    box-shadow: 0 1px 0 #0369a1;
}

.fish-dpad-vertical {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.fish-dpad-vertical .fish-dbtn {
    width: 52px;
    height: 36px;
}

@media (max-width: 640px) {
    .fish-q-card {
        padding: 6px 10px;
        gap: 7px;
    }

    .fish-q-text {
        font-size: 0.94rem;
    }

    .fish-q-badge {
        font-size: 0.73rem;
        padding: 2px 7px;
    }

    .fish-hint-text {
        display: none;
    }

    .fish-dpad {
        gap: 8px;
        padding: 5px 10px;
    }

    .fish-dbtn {
        width: 46px;
        height: 42px;
    }

    .fish-dpad-vertical .fish-dbtn {
        width: 48px;
        height: 36px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fish-start-overlay,
    .fish-start-btn,
    .fish-dbtn,
    .fish-speed-btn,
    .fish-tts-btn {
        transition: none;
    }
}
