/* ============================================
   SNAKE.CSS — Ooi Solutions (v4)
   "Don't Click" button at TOP RIGHT of heading
   Snake overlay transparent
   ============================================ */

/* ── HEADING ROW (Heading + Danger Button side by side) ── */
.flow-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
}
.flow-heading-row .flow-heading {
    flex-shrink: 1;
    min-width: 0;
}

/* ── CTA ROW LAYOUT ── */
.flow-cta-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 24px;
    flex-wrap: wrap;
    width: 100%;
}
.flow-cta-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.flow-cta-meta {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.6;
}

/* ── DANGER BUTTON (Don't Click) — positioned top-right of heading ── */
.flow-cta-btn--danger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 2px solid rgba(204, 78, 60, 0.7);
    border-radius: var(--radius-full);
    padding: 14px 28px;
    background: rgba(204, 78, 60, 0.12);
    color: #fff;
    font-family: var(--font-primary);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: dangerPulse 2.5s ease-in-out infinite;
    box-shadow:
        0 0 20px rgba(204, 78, 60, 0.15),
        inset 0 0 20px rgba(204, 78, 60, 0.05);
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 8px;
}
.flow-cta-btn--danger .danger-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(204, 78, 60, 0.2);
    flex-shrink: 0;
    animation: dangerIconShake 3s ease-in-out infinite;
}
.flow-cta-btn--danger .danger-icon svg {
    width: 16px;
    height: 16px;
    color: #CC4E3C;
}
.flow-cta-btn--danger .danger-text {
    position: relative;
    z-index: 1;
}

/* Pulsing glow animation */
@keyframes dangerPulse {
    0%, 100% {
        box-shadow:
            0 0 20px rgba(204, 78, 60, 0.15),
            inset 0 0 20px rgba(204, 78, 60, 0.05);
        border-color: rgba(204, 78, 60, 0.7);
    }
    50% {
        box-shadow:
            0 0 30px rgba(204, 78, 60, 0.3),
            0 0 60px rgba(204, 78, 60, 0.1),
            inset 0 0 30px rgba(204, 78, 60, 0.08);
        border-color: rgba(204, 78, 60, 0.9);
    }
}

/* Warning icon subtle shake */
@keyframes dangerIconShake {
    0%, 85%, 100% { transform: rotate(0deg); }
    88% { transform: rotate(-8deg); }
    91% { transform: rotate(8deg); }
    94% { transform: rotate(-5deg); }
    97% { transform: rotate(5deg); }
}

/* Hover: full danger mode */
.flow-cta-btn--danger:hover {
    background: rgba(204, 78, 60, 0.25);
    border-color: #CC4E3C;
    transform: translateY(-2px) scale(1.03);
    box-shadow:
        0 0 40px rgba(204, 78, 60, 0.4),
        0 8px 30px rgba(204, 78, 60, 0.3);
    animation: none;
}
.flow-cta-btn--danger:hover .danger-icon {
    background: rgba(204, 78, 60, 0.4);
    animation: none;
    transform: rotate(0deg);
}
.flow-cta-btn--danger:active {
    transform: scale(0.97);
}

/* ── SNAKE OVERLAY — TRANSPARENT ── */
.snake-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    background: transparent;
}
.snake-overlay.active {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

.snake-overlay canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
}

/* ── FOOD DOT (HTML overlay) ── */
.snake-food-dot {
    position: fixed;
    z-index: 10002;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #4ADE80;
    box-shadow:
        0 0 12px 4px rgba(74, 222, 128, 0.6),
        0 0 30px 8px rgba(74, 222, 128, 0.25);
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.snake-food-dot.visible {
    transform: translate(-50%, -50%) scale(1);
}
.snake-food-dot::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(74, 222, 128, 0.4);
    animation: snakeFoodPulse 1.2s ease-in-out infinite;
}
.snake-food-dot::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
}

@keyframes snakeFoodPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.8); opacity: 0; }
}

/* ── EAT FLASH ── */
.snake-eat-flash {
    position: fixed;
    inset: 0;
    z-index: 10001;
    pointer-events: none;
    background: radial-gradient(circle, rgba(74, 222, 128, 0.3) 0%, transparent 60%);
    opacity: 0;
    animation: snakeEatFlash 0.6s ease-out forwards;
}
@keyframes snakeEatFlash {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* ── HINT TEXT ── */
.snake-hint {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 10003;
    color: rgba(255, 255, 255, 0.6);
    font-family: var(--font-primary);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
    text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}
.snake-hint.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── CLOSE BUTTON ── */
.snake-close-btn {
    position: fixed;
    top: 24px;
    right: 28px;
    z-index: 10003;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(13, 31, 28, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(29, 124, 110, 0.3);
    border-radius: 50px;
    padding: 10px 20px;
    cursor: pointer;
    color: #fff;
    font-family: var(--font-primary);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}
.snake-overlay.active .snake-close-btn {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    transition-delay: 0.3s;
}
.snake-close-btn:hover {
    background: rgba(29, 124, 110, 0.9);
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(29, 124, 110, 0.5);
}
.snake-close-btn svg {
    width: 16px;
    height: 16px;
}

/* ── RESPONSIVE ── */
@media (max-width: 767px) {
    .flow-heading-row {
        flex-direction: row;        /* Keep side-by-side on mobile too */
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 12px;
    }
    .flow-cta-btn--danger {
        align-self: flex-start;     /* Top right position */
        padding: 10px 18px;
        font-size: 0.72rem;
        margin-top: 4px;
    }
    .flow-cta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .snake-close-btn {
        top: 12px;
        right: 12px;
        padding: 8px 16px;
        font-size: 0.65rem;
    }
    .snake-hint {
        bottom: 20px;
        font-size: 0.65rem;
    }
    .snake-food-dot {
        width: 20px;
        height: 20px;
    }
}
