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

body {
    font-family: 'Trebuchet MS', 'Lucida Grande', 'Lucida Sans Unicode', Arial, sans-serif;
    background: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 20px;
    /* Improve mobile touch scrolling */
    -webkit-overflow-scrolling: touch;
    /* Prevent horizontal scroll on mobile */
    overflow-x: hidden;
}

.container {
    text-align: center;
    max-width: 600px;
    width: 100%;
}


h1 {
    font-size: 96px;
    font-weight: 700;
    background: linear-gradient(135deg, #ff6b6b 0%, #ffd93d 25%, #6bcf7f 50%, #4d9de0 75%, #bb6bd9 100%);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 40px;
    letter-spacing: -3px;
    text-align: center;
    position: relative;
    animation: titleGradient 15s ease-in-out infinite;
    text-transform: uppercase;
    font-family: 'Trebuchet MS', 'Lucida Grande', 'Lucida Sans Unicode', Arial, sans-serif;
    
    /* Subtle bubble styling - less dominant */
    padding: 15px 30px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 107, 107, 0.15);
    display: inline-block;
}

h1::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ffd93d 25%, #6bcf7f 50%, #4d9de0 75%, #bb6bd9 100%);
    background-size: 300% 300%;
    border-radius: 22px;
    z-index: -1;
    animation: titleGradient 15s ease-in-out infinite;
    opacity: 0.15;
}

@keyframes titleGradient {
    0%, 100% {
        background-position: 0% 50%;
    }
    25% {
        background-position: 100% 25%;
    }
    50% {
        background-position: 200% 50%;
    }
    75% {
        background-position: 300% 75%;
    }
}

.search-box {
    margin-bottom: 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-container {
    position: relative;
    display: inline-block;
    margin: 8px 20px;
}





.input-container input {
    margin: 0;
}

.shake-container {
    animation: containerShake 0.6s ease-in-out;
}

@keyframes containerShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

input[type="text"] {
    width: 350px;
    height: 56px;
    padding: 0 20px;
    margin: 8px 20px;
    border: 2px solid rgba(255, 107, 107, 0.3);
    border-radius: 28px;
    font-size: 18px;
    outline: none;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.1);
    font-weight: 500;
}

input[type="text"]:hover {
    border-color: rgba(255, 107, 107, 0.5);
    box-shadow: 0 12px 30px rgba(255, 107, 107, 0.2);
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 1);
}

input[type="text"]:focus {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.2), 0 15px 35px rgba(255, 107, 107, 0.3);
    transform: translateY(-4px);
    outline: none;
    background: rgba(255, 255, 255, 1);
}

input[type="text"].valid {
    border-color: #34a853;
    box-shadow: 0 0 0 3px rgba(52, 168, 83, 0.1), 0 4px 12px rgba(52, 168, 83, 0.2);
}

input[type="text"].invalid {
    border-color: #ea4335;
    box-shadow: 0 0 0 3px rgba(234, 67, 53, 0.1), 0 4px 12px rgba(234, 67, 53, 0.2);
    animation: inputShake 0.5s ease-in-out;
}

@keyframes inputShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

input[type="text"]::placeholder {
    color: #9aa0a6;
}

.button-container {
    margin-top: 30px;
}

.flames-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    border: none;
    border-radius: 30px;
    color: #ffffff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 46px;
    min-width: 160px;
    padding: 12px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 11px 4px;
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
    position: relative;
    overflow: hidden;
}

.flames-btn:hover {
    background: linear-gradient(135deg, #ff5252 0%, #e53935 100%);
    box-shadow: 0 12px 30px rgba(255, 107, 107, 0.4);
    transform: translateY(-3px);
}

.flames-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.3), 0 8px 20px rgba(255, 107, 107, 0.3);
}

/* Mobile touch improvements */
.flames-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(255, 107, 107, 0.3);
}

.flames-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.flames-btn:hover::before {
    left: 100%;
}

/* Turbo Mode Premium Styling */
.fast-mode-container {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.fast-mode-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px 20px;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 107, 107, 0.2);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.1);
    transition: all 0.3s ease;
    user-select: none;
    font-size: 15px;
    font-weight: 600;
    color: #555;
    min-width: 140px;
    justify-content: center;
}

.fast-mode-label:hover {
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.4);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.15);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 1);
}

.fast-mode-checkbox {
    appearance: none;
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 107, 107, 0.4);
    border-radius: 6px;
    margin-right: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.1);
}

.fast-mode-checkbox:hover {
    border-color: #ff6b6b;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
    transform: scale(1.05);
}

.fast-mode-checkbox:checked {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    border-color: #ff6b6b;
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.3);
    transform: scale(1.05);
}

.fast-mode-checkbox:checked::before {
    content: '🚀';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
}

/* Active state for when checkbox is checked */
.fast-mode-label.active {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, rgba(238, 90, 82, 0.1) 100%);
    border-color: rgba(255, 107, 107, 0.5);
    color: #ff6b6b;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.2);
}

.fast-mode-text {
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 13px;
}

/* Audio Controls Styling */
.audio-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

.audio-controls:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.audio-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 12px;
    transition: all 0.3s ease;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.audio-btn:hover {
    background: rgba(255, 107, 107, 0.1);
    transform: scale(1.1);
}

.audio-btn:active {
    transform: scale(0.95);
}

/* Mobile responsiveness for audio controls */
@media (max-width: 768px) {
    .audio-controls {
        top: 15px;
        right: 15px;
        padding: 6px;
    }
    
    .audio-btn {
        font-size: 18px;
        width: 36px;
        height: 36px;
        padding: 6px;
    }
}

/* Reset Button Special Styling */
.reset-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 30px;
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.reset-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1abc95 100%);
    box-shadow: 0 12px 30px rgba(40, 167, 69, 0.4);
    transform: translateY(-3px);
}

.reset-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(40, 167, 69, 0.3);
}

.reset-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.reset-btn:hover::before {
    left: 100%;
}

/* Improve touch targets for mobile */
@media (pointer: coarse) {
    .flames-btn {
        min-height: 44px;
        padding: 0 24px;
    }
    
    input[type="text"] {
        min-height: 44px;
    }
}

.result {
    margin-top: 40px;
    padding: 30px;
    border-radius: 20px;
    transition: all 0.5s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.result::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #f9ca24, #f0932b, #eb4d4b, #6c5ce7);
    background-size: 400% 400%;
    border-radius: 22px;
    z-index: -2;
    animation: gradientShift 3s ease infinite;
}

.result::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    border-radius: 20px;
    z-index: -1;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.result.friend { 
    background: linear-gradient(135deg, #e8f5e8 0%, #d4f1d4 100%); 
    color: #0f5a2c; 
    border: 2px solid #a8d8a8;
}

.result.love { 
    background: linear-gradient(135deg, #fce8e6 0%, #fdd6d1 100%); 
    color: #b91c00; 
    border: 2px solid #f19a88;
}

.result.affection { 
    background: linear-gradient(135deg, #f3e8fd 0%, #e8d6fc 100%); 
    color: #6a1b8c; 
    border: 2px solid #c292f7;
}

.result.marriage { 
    background: linear-gradient(135deg, #fff3cd 0%, #fff0b8 100%); 
    color: #6b5003; 
    border: 2px solid #ffd93d;
}

.result.enemy { 
    background: linear-gradient(135deg, #f8d7da 0%, #f5c2c7 100%); 
    color: #5a161c; 
    border: 2px solid #ed969e;
}

.result.sibling { 
    background: linear-gradient(135deg, #e7f3ff 0%, #d1e7ff 100%); 
    color: #0a3d91; 
    border: 2px solid #90caf9;
}

.result h2 {
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.result h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: currentColor;
    margin: 10px auto;
    border-radius: 2px;
    opacity: 0.6;
}

.result p {
    font-size: 18px;
    font-weight: 400;
    text-align: center;
    line-height: 1.6;
    margin-bottom: 20px;
}

.result-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.result-names {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 15px 0 20px;
    flex-wrap: wrap;
    gap: 8px;
}

.result-name {
    background: rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-transform: capitalize;
}

.result-connector {
    font-size: 20px;
    font-weight: bold;
    opacity: 0.7;
    margin: 0 4px;
}

.share-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    padding: 0 20px;
    flex-wrap: wrap;
}

.share-btn {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 25px;
    color: #444;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 90px;
    justify-content: center;
}

.share-btn:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    border-color: rgba(0, 0, 0, 0.15);
}

.share-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.copy-btn:hover {
    border-color: rgba(76, 175, 80, 0.5);
    color: #4caf50;
}

.web-share-btn:hover {
    border-color: rgba(33, 150, 243, 0.5);
    color: #2196f3;
}

.image-btn:hover {
    border-color: rgba(156, 39, 176, 0.5);
    color: #9c27b0;
}





.steps {
    display: none; /* Hide steps for clean look initially */
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: left;
    max-height: 300px;
    overflow-y: auto;
}

.step {
    margin-bottom: 15px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #4285f4;
}

.step h4 {
    color: #202124;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}

.step p {
    color: #5f6368;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.4;
}

.struck {
    text-decoration: line-through;
    color: #9aa0a6;
}

/* Animation Styles */
.animation-area {
    margin-top: 40px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.animation-area.show {
    opacity: 1;
    transform: translateY(0);
}

.names-display {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.names-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.name-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    font-size: 18px;
}

.name-row:last-child {
    margin-bottom: 0;
}

.animated-name {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 20px;
    letter-spacing: 2px;
    text-align: center;
}

.letter {
    display: inline-block;
    padding: 8px 12px;
    margin: 4px;
    border-radius: 12px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #90caf9;
    color: #0d47a1;
    transition: all 0.5s ease;
    position: relative;
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
    transform: translateY(0);
}

.space-char {
    display: inline-block;
    width: 8px;
    margin: 4px 2px;
    padding: 0;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 16px;
    transition: none !important;
    color: inherit;
    text-decoration: none !important;
    animation: none !important;
    transform: none !important;
}

.letter:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(33, 150, 243, 0.3);
}

.letter.striking,
.flames-letter.striking {
    animation: strikeAnimation 0.8s ease-in-out;
    background: #ffebee;
    border-color: #ffcdd2;
    color: #c62828;
}

.letter.struck,
.flames-letter.struck {
    background: #f5f5f5;
    border-color: #e0e0e0;
    color: #9e9e9e;
    text-decoration: line-through;
    transform: scale(0.9);
    opacity: 0.6;
}

.letter.counting,
.flames-letter.counting {
    background: #fff3e0;
    border-color: #ffcc02;
    color: #f57c00;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(245, 124, 0, 0.3);
    transition: all 0.2s ease;
}

@keyframes strikeAnimation {
    0% {
        transform: scale(1);
        background: #e3f2fd;
    }
    25% {
        transform: scale(1.2);
        background: #fff3e0;
        box-shadow: 0 4px 8px rgba(255, 152, 0, 0.3);
    }
    50% {
        transform: scale(1.1);
        background: #ffebee;
    }
    75% {
        transform: scale(1.05);
        background: #f5f5f5;
    }
    100% {
        transform: scale(0.9);
        background: #f5f5f5;
    }
}

/* Performance optimizations for mobile */
.letter, .flames-letter {
    /* Hardware acceleration for smoother animations */
    transform: translateZ(0);
    will-change: transform, background-color, box-shadow;
}

/* Floating Hearts Background */
.floating-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.heart {
    position: absolute;
    color: rgba(198, 128, 157, 0.6);
    font-size: 14px;
    animation: floatUp 15s linear forwards;
    pointer-events: none;
}

.heart:nth-child(2n) {
    animation-duration: 15s;
    color: rgba(186, 104, 136, 0.5);
    font-size: 12px;
}

.heart:nth-child(3n) {
    animation-duration: 15s;
    color: rgba(167, 88, 118, 0.4);
    font-size: 16px;
}

@keyframes floatUp {
    0% {
        bottom: -100px;
        transform: translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.1;
    }
    20% {
        opacity: 0.3;
    }
    30% {
        opacity: 0.6;
    }
    40% {
        opacity: 1;
    }
    60% {
        opacity: 1;
    }
    70% {
        opacity: 0.8;
    }
    80% {
        opacity: 0.6;
    }
    85% {
        opacity: 0.4;
    }
    90% {
        opacity: 0.2;
    }
    95% {
        opacity: 0.1;
    }
    100% {
        bottom: 120vh;
        transform: translateX(-20px) rotate(10deg);
        opacity: 0;
    }
}

/* Result Celebration Animations */
.celebration-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

/* Love - Heart Confetti */
.heart-confetti {
    position: absolute;
    color: #e91e63;
    font-size: 18px;
    animation: heartConfetti 6s ease-out forwards;
    pointer-events: none;
}

@keyframes heartConfetti {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    90% {
        transform: translateY(100vh) rotate(360deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(360deg) scale(1);
        opacity: 0;
    }
}

/* Marriage - Wedding Bells */
.wedding-bell {
    position: absolute;
    color: #ffd700;
    font-size: 24px;
    animation: weddingBell 7s ease-in-out forwards;
    pointer-events: none;
}

@keyframes weddingBell {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    90% {
        transform: translateY(100vh) rotate(180deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(180deg) scale(1);
        opacity: 0;
    }
}

/* Friend - Cheerful Stars */
.friend-star {
    position: absolute;
    color: #4caf50;
    font-size: 16px;
    animation: friendStar 5s ease-out forwards;
    pointer-events: none;
}

@keyframes friendStar {
    0% {
        transform: translateY(0) scale(1) rotate(0deg);
        opacity: 1;
    }
    90% {
        transform: translateY(100vh) scale(1) rotate(360deg);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) scale(1) rotate(360deg);
        opacity: 0;
    }
}

/* Affection - Gentle Sparkles */
.affection-sparkle {
    position: absolute;
    color: #9c27b0;
    font-size: 12px;
    animation: affectionSparkle 6s ease-in-out forwards;
    pointer-events: none;
}

@keyframes affectionSparkle {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    90% {
        transform: translateY(100vh) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) scale(1);
        opacity: 0;
    }
}

/* Enemy - Playful Storm Clouds */
.storm-cloud {
    position: absolute;
    color: #607d8b;
    font-size: 20px;
    animation: stormCloud 5.5s ease-in-out forwards;
    pointer-events: none;
}

@keyframes stormCloud {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 1;
    }
    90% {
        transform: translateY(100vh) translateX(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) translateX(0) scale(1);
        opacity: 0;
    }
}

/* Sibling - Family Hearts */
.family-heart {
    position: absolute;
    color: #ff9800;
    font-size: 14px;
    animation: familyHeart 6.5s ease-out forwards;
    pointer-events: none;
}

@keyframes familyHeart {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    90% {
        transform: translateY(100vh) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) scale(1);
        opacity: 0;
    }
}

/* Reduce animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .letter, .flames-letter {
        transition: none !important;
        animation: none !important;
    }
    
    .search-container-hidden {
        transition: none !important;
    }
    
    .animation-area {
        transition: none !important;
    }
    
    .floating-hearts,
    .heart,
    .celebration-container,
    .heart-confetti,
    .wedding-bell,
    .friend-star,
    .affection-sparkle,
    .storm-cloud,
    .family-heart,
    .result-icon,
    .names-display::before,
    .reset-btn::before,
    .flames-btn::before,
    h1,
    h1::after,
    input[type="text"],
    .shake-container {
        animation: none !important;
    }
    
    .floating-hearts,
    .heart,
    .celebration-container,
    .heart-confetti,
    .wedding-bell,
    .friend-star,
    .affection-sparkle,
    .storm-cloud,
    .family-heart {
        display: none !important;
    }
    
    .result::before {
        animation: none !important;
    }
    
    @keyframes strikeAnimation {
        0%, 100% {
            transform: scale(0.9);
            background: #f5f5f5;
        }
    }
}



.search-container-hidden {
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.5s ease;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 20px 15px;
        align-items: center;
    }

    .container {
        max-width: 100%;
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    h1 {
        font-size: 64px;
        margin-bottom: 30px;
        letter-spacing: -2px;
        padding: 12px 20px;
        border-radius: 18px;
    }
    
    h1::before {
        border-radius: 20px;
    }
    
    .input-container {
        margin: 8px 0;
        width: 100%;
        max-width: 300px;
    }
    
    input[type="text"] {
        width: 100%;
        height: 52px;
        font-size: 16px;
        margin: 0;
        padding: 15px 20px;
        border-radius: 25px;
    }
    
    .flames-btn {
        min-width: 140px;
        height: 44px;
        font-size: 15px;
    }
    
    .fast-mode-label {
        padding: 10px 16px;
        font-size: 14px;
        min-width: 120px;
    }
    
    .fast-mode-checkbox {
        width: 20px;
        height: 20px;
        margin-right: 10px;
    }
    
    .fast-mode-text {
        font-size: 12px;
    }

    .names-display {
        padding: 20px;
    }

    .name-row {
        font-size: 16px;
        justify-content: center;
        margin-bottom: 20px;
    }

    .animated-name {
        width: 100%;
        text-align: center;
    }

    .letter {
        font-size: 18px;
        padding: 6px 8px;
        margin: 3px;
    }
    
    .space-char {
        width: 6px;
        font-size: 18px;
        margin: 3px 2px;
    }

    .result h2 {
        font-size: 22px;
    }

    .result p {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 15px 10px;
        align-items: center;
    }

    .container {
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    h1 {
        font-size: 48px;
        margin-bottom: 25px;
        letter-spacing: -1px;
    }
    
    h1::after {
        width: 80px;
        height: 3px;
    }
    
    .input-container {
        margin: 6px 0;
        width: 100%;
        max-width: 280px;
    }
    
    input[type="text"] {
        width: 100%;
        height: 48px;
        font-size: 16px;
        border-radius: 24px;
        margin: 0;
    }
    
    .fast-mode-label {
        padding: 8px 14px;
        font-size: 13px;
        min-width: 100px;
        border-radius: 20px;
    }
    
    .fast-mode-checkbox {
        width: 18px;
        height: 18px;
        margin-right: 8px;
    }
    
    .fast-mode-text {
        font-size: 11px;
    }
    
    .flames-btn {
        min-width: 120px;
        height: 42px;
        font-size: 14px;
        padding: 0 20px;
        margin: 8px 2px;
    }

    .names-display {
        padding: 15px;
    }

    .name-row {
        font-size: 14px;
        margin-bottom: 15px;
        justify-content: center;
    }

    .animated-name {
        font-size: 16px;
    }

    .letter {
        font-size: 16px;
        padding: 4px 6px;
        margin: 2px;
        letter-spacing: 1px;
    }
    
    .space-char {
        width: 6px;
        font-size: 16px;
        margin: 2px 1px;
    }

    .flames-letter {
        font-size: 20px;
        padding: 6px 8px;
        margin: 3px;
    }

    .count-display {
        font-size: 16px !important;
        margin-bottom: 10px !important;
    }

    .result {
        margin-top: 30px;
        padding: 15px;
    }

    .result h2 {
        font-size: 20px;
    }

    .result p {
        font-size: 14px;
    }
    
    .share-actions {
        gap: 8px;
        margin-top: 20px;
    }
    
    .share-btn {
        font-size: 13px;
        padding: 8px 12px;
        min-width: 80px;
    }
    


    .step {
        padding: 10px;
        margin-bottom: 12px;
    }

    .step h4 {
        font-size: 13px;
    }

    .step p {
        font-size: 12px;
    }
}

@media (max-width: 320px) {
    h1 {
        font-size: 40px;
        letter-spacing: -1px;
    }
    
    h1::after {
        width: 70px;
        height: 2px;
    }

    input[type="text"] {
        height: 44px;
        font-size: 15px;
        margin: 0;
    }
    
    .fast-mode-label {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 90px;
        border-radius: 18px;
    }
    
    .fast-mode-checkbox {
        width: 16px;
        height: 16px;
        margin-right: 6px;
    }
    
    .fast-mode-text {
        font-size: 10px;
    }

    .flames-btn {
        min-width: 100px;
        height: 40px;
        font-size: 13px;
        padding: 0 16px;
    }

    .letter {
        font-size: 14px;
        padding: 3px 5px;
        margin: 1px;
    }
    
    .space-char {
        width: 5px;
        font-size: 14px;
        margin: 1px;
    }

    .flames-letter {
        font-size: 18px;
        padding: 5px 6px;
        margin: 2px;
    }

    .names-display {
        padding: 12px;
    }

    .result {
        padding: 12px;
    }

    .result h2 {
        font-size: 18px;
    }

    .result p {
        font-size: 13px;
    }
}

/* Export-safe card (used only for html2canvas capture) */
.export-wrap {
    width: 640px;
    padding: 4px;
    border-radius: 22px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #f9ca24, #f0932b, #eb4d4b, #6c5ce7);
}

.export-card {
    border-radius: 20px;
    padding: 40px 32px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.export-wrap.export-friend .export-card { 
    background: linear-gradient(135deg, #e8f5e8 0%, #d4f1d4 100%);
    color: #0f5a2c;
    border: 2px solid #a8d8a8;
}
.export-wrap.export-love .export-card { 
    background: linear-gradient(135deg, #fce8e6 0%, #fdd6d1 100%);
    color: #b91c00;
    border: 2px solid #f19a88;
}
.export-wrap.export-affection .export-card { 
    background: linear-gradient(135deg, #f3e8fd 0%, #e8d6fc 100%);
    color: #6a1b8c;
    border: 2px solid #c292f7;
}
.export-wrap.export-marriage .export-card { 
    background: linear-gradient(135deg, #fff3cd 0%, #fff0b8 100%);
    color: #6b5003;
    border: 2px solid #ffd93d;
}
.export-wrap.export-enemy .export-card { 
    background: linear-gradient(135deg, #f8d7da 0%, #f5c2c7 100%);
    color: #5a161c;
    border: 2px solid #ed969e;
}
.export-wrap.export-sibling .export-card { 
    background: linear-gradient(135deg, #e7f3ff 0%, #d1e7ff 100%);
    color: #0a3d91;
    border: 2px solid #90caf9;
}

.export-icon {
    font-size: 64px;
    text-align: center;
    margin-bottom: 16px;
}

.export-title {
    font-size: 42px;
    font-weight: 700;
    text-align: center;
    margin: 0 0 8px 0;
}

.export-underline {
    width: 120px;
    height: 6px;
    border-radius: 3px;
    margin: 8px auto 24px auto;
    opacity: 0.7;
}

.export-wrap.export-friend .export-underline { background: #0f5a2c; }
.export-wrap.export-love .export-underline { background: #b91c00; }
.export-wrap.export-affection .export-underline { background: #6a1b8c; }
.export-wrap.export-marriage .export-underline { background: #6b5003; }
.export-wrap.export-enemy .export-underline { background: #5a161c; }
.export-wrap.export-sibling .export-underline { background: #0a3d91; }

.export-names {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 12px 0 24px 0;
}

.export-name-tag {
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 28px;
    padding: 10px 18px;
    font-weight: 700;
    font-size: 22px;
    color: #333;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.export-amp {
    font-size: 28px;
    font-weight: 800;
    opacity: 0.7;
}

.export-message {
    text-align: center;
    font-size: 20px;
    color: rgba(0,0,0,0.7);
}

/* Enhanced Mobile Compatibility Improvements */

/* Better touch scrolling and momentum */
html {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Prevent zoom on input focus for iOS */
@media screen and (max-width: 768px) {
    input[type="text"]:focus {
        font-size: 16px !important;
    }
}

/* Improve touch targets for accessibility */
.flames-btn, .reset-btn, .share-btn, .audio-btn, .fast-mode-label {
    min-height: 44px;
    min-width: 44px;
}

/* Better mobile tap highlighting */
* {
    -webkit-tap-highlight-color: rgba(255, 107, 107, 0.2);
    -webkit-touch-callout: none;
}

/* Prevent text selection on interactive elements */
.flames-btn, .reset-btn, .share-btn, .audio-btn, .fast-mode-label, .letter, .flames-letter {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection on inputs and results */
input[type="text"], .result p, .result h2 {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Improve mobile performance with hardware acceleration */
.container, .search-box, .animation-area, .result, .floating-hearts {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Better mobile navigation bar handling */
@supports (padding: max(0px)) {
    body {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
    
    .audio-controls {
        top: max(20px, env(safe-area-inset-top));
        right: max(20px, env(safe-area-inset-right));
    }
}

/* Mobile-specific animations optimizations */
@media (max-width: 768px) {
    /* Reduce animation complexity on mobile */
    .floating-hearts .heart {
        animation-duration: 12s !important;
    }
    
    /* Optimize celebration animations for mobile */
    .heart-confetti, .wedding-bell, .friend-star, .affection-sparkle, .storm-cloud, .family-heart {
        animation-duration: 4s !important;
    }
    
    /* Optimize gradient animations for mobile performance */
    h1, h1::before, .result::before {
        animation-duration: 20s !important;
    }
}

/* Mobile landscape orientation improvements */
@media screen and (orientation: landscape) and (max-height: 600px) {
    body {
        padding: 10px 20px;
    }
    
    h1 {
        font-size: 48px;
        margin-bottom: 20px;
    }
    
    .names-display {
        padding: 15px;
    }
    
    .result {
        padding: 20px;
        margin-top: 20px;
    }
}

/* High DPI displays optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .result-icon, .export-icon {
        image-rendering: crisp-edges;
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Dark mode support for mobile devices */
@media (prefers-color-scheme: dark) {
    body {
        background: #121212;
    }
    
    .names-display {
        background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .letter {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
        border-color: #718096;
        color: #e2e8f0;
    }
}

/* Reduce motion for mobile users who prefer it */
@media (prefers-reduced-motion: reduce) and (max-width: 768px) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}