/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background: 
        radial-gradient(circle at 25% 25%, rgba(255, 182, 193, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 218, 185, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 239, 213, 0.2) 0%, transparent 70%),
        linear-gradient(135deg, #fdf6e3 0%, #f7f1e8 25%, #faf5f0 50%, #f9f3ee 75%, #fdf8f3 100%);
    min-height: 100vh;
    font-size: 16px;
    background-attachment: fixed;
    
    /* Mobile scrolling improvements */
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Site Header in Hero */
.site-header {
    text-align: center;
    margin-bottom: 24px;
}

.site-title {
    font-size: 3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin: 0;
}

.granny {
    font-size: 1.4em;
    animation: wave 3s ease-in-out infinite;
}

.banana {
    font-size: 1.4em;
    animation: bounce 2s ease-in-out infinite;
    filter: hue-rotate(-10deg) saturate(1.3) brightness(0.9);
}

.nanna-text {
    font-weight: bold;
    color: #2c3e50; /* Darker text for better contrast */
}

.banana-text {
    color: #E59B23; /* Updated dark yellow color */
    font-weight: normal;
}

.ai-text {
    font-style: italic;
    font-size: 0.85em;
    color: #2c3e50;
    opacity: 0.6;
    font-weight: normal;
}

.site-name {
    color: #2c3e50;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-weight: 500;
}

/* Hero Section */
.hero-section {
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 235, 59, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(255, 193, 7, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 40% 40%, rgba(255, 235, 59, 0.05) 0%, transparent 50%),
        #ffffff;
    padding: 40px 0 100px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '🍌';
    position: absolute;
    font-size: 120px;
    opacity: 0.03;
    top: 20%;
    left: 10%;
    animation: float 6s ease-in-out infinite;
    pointer-events: none;
}

.hero-section::after {
    content: '🍌';
    position: absolute;
    font-size: 80px;
    opacity: 0.04;
    bottom: 20%;
    right: 15%;
    animation: float 8s ease-in-out infinite reverse;
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero-header {
    text-align: center;
    margin-bottom: 60px;
}

.hero-header h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 500;
    line-height: 1.2;
}

.hero-header p {
    font-size: 1.1rem;
    color: #8b7355;
    font-style: italic;
    font-family: 'Georgia', serif;
}

/* Hero Floating Nanna Sayings */
.hero-nanna-sayings {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.hero-nanna-saying {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    color: #8b7355;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 0.75rem;
    font-style: italic;
    font-family: 'Georgia', serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.15);
    animation-timing-function: linear;
    animation-fill-mode: forwards;
    opacity: 0;
    white-space: normal;
    max-width: 280px;
    min-width: 160px;
    text-align: center;
    line-height: 1.3;
    word-wrap: break-word;
}

.hero-nanna-saying::before {
    content: '"';
    color: #d4af37;
    font-size: 1.1em;
    margin-right: 1px;
}

.hero-nanna-saying::after {
    content: '"';
    color: #d4af37;
    font-size: 1.1em;
    margin-left: 1px;
}

/* Gallery */
.gallery-section {
    background: #fefefe;
    padding: 0;
}

.prompt-container {
    background: #ffffff;
    border-radius: 16px;
    padding: 36px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    border: 1px solid #f5f5f5;
    position: relative;
}

.prompt-container::before {
    content: '✿';
    position: absolute;
    top: 24px;
    right: 24px;
    font-size: 1.2rem;
    color: #d4af37;
    opacity: 0.6;
}

.prompt-header {
    text-align: center;
    margin-bottom: 24px;
}

.prompt-header h2 {
    font-size: 1.6rem;
    color: #2c3e50;
    margin-bottom: 0;
    font-weight: 500;
    font-family: 'Georgia', serif;
}

.input-wrapper {
    position: relative;
    margin-bottom: 32px;
}

#promptInput {
    width: 100%;
    padding: 20px 24px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    background: #fafafa;
    transition: all 0.2s ease;
    line-height: 1.5;
}

#promptInput:focus {
    outline: none;
    border-color: #d4af37;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

#promptInput::placeholder {
    color: #999;
    font-style: italic;
}

.input-info {
    position: absolute;
    bottom: -24px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.public-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: #999;
    transition: color 0.2s ease;
    margin-left: 15px;
    position: relative;
}

.public-indicator:hover {
    color: #666;
}

.public-indicator[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.public-indicator[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    margin-bottom: -2px;
}

.globe-icon {
    font-size: 0.8em;
    filter: grayscale(1);
    opacity: 0.8;
}

.public-text {
    font-size: 0.85rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.char-counter {
    font-size: 0.85rem;
    color: #999;
    font-family: 'Monaco', monospace;
}

.generate-btn {
    width: 100%;
    background: #2c3e50;
    color: white;
    border: none;
    padding: 20px 32px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

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

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

.generate-btn:hover {
    background: #1e2a3a;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.generate-btn:active {
    transform: translateY(0);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-emoji {
    font-size: 1.2rem;
    opacity: 0.8;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 2px solid #f0f0f0;
    border-top: 2px solid #d4af37;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 0.8s linear infinite;
}

/* Gallery Separator */
.gallery-separator {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.3), transparent);
    margin: 0;
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0;
    width: 100%;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
    z-index: 1;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-item-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gallery-item:hover .gallery-item-actions {
    opacity: 1;
}

.gallery-action-btn {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gallery-action-btn:hover {
    background: rgba(255, 255, 255, 1);
    color: #2c3e50;
    transform: scale(1.1);
}

.gallery-action-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.gallery-item.new-image {
    animation: newImageGlow 3s ease-out;
    z-index: 2;
}

@keyframes newImageGlow {
    0% {
        box-shadow: 0 0 0 rgba(212, 175, 55, 0);
        transform: scale(1);
    }
    25% {
        box-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
        transform: scale(1.02);
    }
    50% {
        box-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
        transform: scale(1.01);
    }
    100% {
        box-shadow: 0 0 0 rgba(212, 175, 55, 0);
        transform: scale(1);
    }
}

.no-images {
    text-align: center;
    padding: 120px 20px;
    color: #999;
}

.no-images-emoji {
    font-size: 3rem;
    display: block;
    margin-bottom: 24px;
    opacity: 0.6;
}

.no-images h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: #666;
    font-weight: 400;
}

.no-images p {
    color: #999;
    font-style: italic;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

#modalImage {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

.modal-info {
    padding: 32px;
    text-align: center;
    border-top: 1px solid #f0f0f0;
}

.modal-prompt {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 16px;
    font-size: 1.1rem;
    line-height: 1.4;
}

.modal-timestamp {
    color: #999;
    font-size: 0.9rem;
    font-family: 'Monaco', monospace;
}

/* Credits Modal */
.credits-modal {
    max-width: 500px;
    text-align: center;
    padding: 0;
}

.credits-modal-content {
    padding: 40px 32px;
}

.nanna-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.credits-modal h3 {
    color: #8B4513;
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.nanna-message {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #555;
    margin: 0;
}

.nanna-message a {
    color: #D2691E;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: border-bottom-color 0.2s ease;
}

.nanna-message a:hover {
    border-bottom-color: #D2691E;
}

/* Footer */
.footer {
    text-align: center;
    padding: 60px 0;
    color: #999;
    border-top: 1px solid #f0f0f0;
    margin-top: 120px;
    background: #faf9f7;
}

.footer-content p {
    margin-bottom: 8px;
}

.disclaimer {
    font-size: 0.85rem;
    opacity: 0.8;
    font-style: italic;
}

.legal-links {
    font-size: 8pt;
    margin-top: 12px;
    text-align: center;
}

.legal-link {
    color: #8b7355;
    text-decoration: none;
    transition: color 0.2s ease;
}

.legal-link:hover {
    color: #2c3e50;
    text-decoration: underline;
}

/* Legal Pages Styles */
.legal-page {
    min-height: 100vh;
    background: #ffffff;
    padding: 40px 0;
}

.legal-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.legal-header .site-title {
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.back-link {
    color: #8b7355;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #2c3e50;
}

.legal-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

.legal-content h2 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-align: center;
}

.legal-content h3 {
    color: #2c3e50;
    font-size: 1.4rem;
    margin: 30px 0 15px 0;
    border-bottom: 2px solid #E59B23;
    padding-bottom: 5px;
}

.legal-content h4 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin: 20px 0 10px 0;
    font-weight: 600;
}

.legal-content p {
    margin-bottom: 15px;
    color: #2c3e50;
}

.legal-content ul {
    margin: 15px 0 15px 20px;
}

.legal-content li {
    margin-bottom: 8px;
    color: #2c3e50;
}

.legal-content a {
    color: #E59B23;
    text-decoration: none;
}

.legal-content a:hover {
    text-decoration: underline;
}

.last-updated {
    text-align: center;
    font-style: italic;
    color: #8b7355;
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.legal-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.legal-footer p {
    font-weight: 500;
    color: #8b7355;
    font-style: italic;
}



/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { 
        transform: translateY(0); 
    }
    40% { 
        transform: translateY(-6px); 
    }
    60% { 
        transform: translateY(-3px); 
    }
}

@keyframes wave {
    0%, 100% { 
        transform: rotate(0deg); 
    }
    25% { 
        transform: rotate(-10deg); 
    }
    75% { 
        transform: rotate(10deg); 
    }
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
    }
    50% { 
        transform: translateY(-20px) rotate(5deg); 
    }
}

@keyframes heroFloatUp {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0) scale(0.9);
    }
    15% {
        opacity: 0.8;
        transform: translateY(calc(var(--distance) * -0.15px)) translateX(calc(var(--x-direction) * var(--distance) * 0.15px)) scale(1);
    }
    60% {
        opacity: 0.8;
        transform: translateY(calc(var(--distance) * -0.6px)) translateX(calc(var(--x-direction) * var(--distance) * 0.6px)) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(calc(var(--distance) * -1px)) translateX(calc(var(--x-direction) * var(--distance) * 1px)) scale(0.9);
    }
}

/* ===== CREDIT SYSTEM STYLES ===== */

/* Credit Counter */
.credit-counter {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #E59B23, #d4af37);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

/* Credit Request Form */
.credit-request {
    margin-top: 32px;
    padding: 24px;
    background: linear-gradient(135deg, #fef7e7, #fdf4e3);
    border-radius: 16px;
    border: 2px solid #f0d47a;
}

.nanna-message {
    margin-bottom: 20px;
}

.nanna-message p {
    color: #8b4513;
    font-style: italic;
    line-height: 1.6;
    text-align: left;
    font-family: 'Georgia', serif;
    margin-bottom: 12px;
}

.nanna-message p:first-child {
    font-weight: 600;
    margin-bottom: 16px;
}

.nanna-message p:last-child {
    font-weight: 600;
    margin-top: 16px;
    margin-bottom: 0;
    text-align: right;
}

.credit-form {
    margin-bottom: 16px;
}

.email-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

#creditEmail {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e8d5b7;
    border-radius: 10px;
    font-size: 1rem;
    background: #ffffff;
    transition: border-color 0.2s ease;
}

#creditEmail:focus {
    outline: none;
    border-color: #E59B23;
}

.credit-btn {
    background: #E59B23;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.credit-btn:hover {
    background: #d4af37;
    transform: translateY(-1px);
}

.credit-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px;
    color: #8b4513;
}

.credit-loading .loading-spinner {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

/* Responsive Design - Mobile Tablet */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    body {
        font-size: 15px;
    }
    
    .hero-section {
        padding: 20px 0 60px;
    }
    
    .site-header {
        margin-bottom: 16px;
    }
    
    .site-title {
        font-size: 2.5rem;
        gap: 10px;
        /* Keep emoji and text on same line */
        flex-direction: row;
        align-items: center;
    }
    
    .granny, .banana {
        font-size: 0.9em; /* Slightly smaller to fit better */
    }
    
    .hero-header {
        margin-bottom: 40px;
    }
    
    .hero-header h1 {
        font-size: clamp(1.2rem, 4vw, 1.8rem);
        line-height: 1.2;
        margin-bottom: 12px;
    }
    
    .hero-header p {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 16px;
    }
    
    /* Improved gallery grid for tablet - no spacing, no rounded corners */
    .gallery-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0;
    }
    
    .gallery-section {
        padding: 20px 0 0;
    }
    
    .gallery-header h2 {
        font-size: 1.5rem;
        margin-bottom: 16px;
    }
    
    /* Better prompt form on mobile */
    .prompt-container {
        padding: 28px 20px;
        margin: 20px 16px;
        border-radius: 16px;
    }
    
    .prompt-header h2 {
        font-size: 1.4rem;
        margin-bottom: 20px;
    }
    
    #promptInput {
        padding: 16px 18px;
        font-size: 16px; /* Prevent zoom on iOS */
        min-height: 100px;
        border-radius: 12px;
    }
    
    .generate-btn {
        font-size: 1rem;
        padding: 16px 24px;
        border-radius: 12px;
        width: 100%;
    }
    
    /* Better modal on mobile */
    .modal-content {
        max-width: 95vw;
        max-height: 90vh;
        margin: 5vh auto;
        border-radius: 16px;
    }
    
    /* Credits modal on mobile */
    .credits-modal {
        max-width: 95vw;
    }
    
    .credits-modal-content {
        padding: 24px 20px;
    }
    
    .nanna-icon {
        font-size: 2.5rem;
        margin-bottom: 16px;
    }
    
    .credits-modal h3 {
        font-size: 1.3rem;
        margin-bottom: 16px;
    }
    
    .nanna-message {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    .modal-info {
        padding: 20px;
    }
    
    .modal-prompt {
        font-size: 1rem;
        margin-bottom: 12px;
    }
    
    /* Improve gallery items on mobile - no rounded corners */
    .gallery-item {
        border-radius: 0;
        overflow: hidden;
    }
    
    .gallery-item img {
        border-radius: 0;
    }
    
    /* Better floating quotes on mobile */
    .hero-nanna-saying {
        font-size: 0.7rem;
        padding: 8px 12px;
        max-width: 200px;
        min-width: 120px;
        border-radius: 16px;
    }
    
    /* Footer adjustments */
    .footer {
        padding: 40px 0;
        margin-top: 80px;
    }
    
    /* Credit system mobile styles */
    .credit-counter {
        top: 16px;
        right: 16px;
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .email-input-wrapper {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .credit-btn {
        width: 100%;
        padding: 14px 20px;
    }
}

/* Medium Mobile Phones */
@media (max-width: 600px) {
    .container {
        padding: 0 14px;
    }
    
    .site-title {
        font-size: 2.2rem;
        gap: 8px;
        /* Keep emoji and text on same line */
        flex-direction: row;
        align-items: center;
    }
    
    .granny, .banana {
        font-size: 0.85em; /* Smaller to fit better on medium phones */
    }
    
    .hero-header h1 {
        font-size: clamp(1.1rem, 4.5vw, 1.6rem);
    }
    
    .hero-header p {
        font-size: 0.95rem;
    }
    
    /* Single column gallery on medium phones - no spacing */
    .gallery-container {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .prompt-container {
        padding: 24px 18px;
        margin: 18px 12px;
    }
    
    .prompt-header h2 {
        font-size: 1.3rem;
        margin-bottom: 18px;
    }
    
    #promptInput {
        min-height: 90px;
    }
    
    .generate-btn {
        padding: 15px 22px;
        font-size: 0.98rem;
    }
    
    .hero-nanna-saying {
        font-size: 0.65rem;
        max-width: 190px;
        min-width: 110px;
    }
}

/* Small Mobile Phones */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    body {
        font-size: 14px;
    }
    
    .site-header {
        margin-bottom: 16px;
    }
    
    .site-title {
        font-size: 1.8rem;
        gap: 6px;
        /* Keep emoji and text on same line even on small phones */
        flex-direction: row;
        align-items: center;
        margin-bottom: 8px;
    }
    
    .granny, .banana {
        font-size: 0.8em; /* Smaller emojis to fit on small screens */
    }
    
    .hero-section {
        padding: 16px 0 50px;
    }
    
    .hero-header {
        margin-bottom: 32px;
    }
    
    .hero-header h1 {
        font-size: clamp(1rem, 5vw, 1.4rem);
        line-height: 1.3;
        margin-bottom: 10px;
    }
    
    .hero-header p {
        font-size: 0.9rem;
        line-height: 1.4;
        margin-bottom: 12px;
    }
    
    /* Single column gallery on phones - no spacing */
    .gallery-container {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .gallery-section {
        padding: 10px 0 0;
    }
    
    .gallery-header h2 {
        font-size: 1.3rem;
        margin-bottom: 12px;
    }
    
    /* Optimized form for phones */
    .prompt-container {
        padding: 20px 16px;
        margin: 16px 8px;
        border-radius: 16px;
    }
    
    .prompt-header h2 {
        font-size: 1.2rem;
        margin-bottom: 16px;
    }
    
    #promptInput {
        padding: 14px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
        min-height: 80px;
        border-radius: 10px;
    }
    
    .input-wrapper {
        margin-bottom: 24px;
    }
    
    .input-info {
        bottom: -20px;
    }
    
    .char-counter,
    .public-indicator {
        font-size: 0.75rem;
    }
    
    .generate-btn {
        font-size: 0.95rem;
        padding: 14px 20px;
        border-radius: 10px;
        width: 100%;
    }
    
    /* Mobile-optimized modal */
    .modal-content {
        max-width: 98vw;
        max-height: 95vh;
        margin: 2.5vh auto;
        border-radius: 12px;
    }
    
    /* Credits modal on small phones */
    .credits-modal {
        max-width: 98vw;
    }
    
    .credits-modal-content {
        padding: 20px 16px;
    }
    
    .nanna-icon {
        font-size: 2rem;
        margin-bottom: 12px;
    }
    
    .credits-modal h3 {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }
    
    .nanna-message {
        font-size: 0.95rem;
        line-height: 1.4;
    }
    
    .modal-info {
        padding: 16px;
    }
    
    .modal-prompt {
        font-size: 0.95rem;
        margin-bottom: 10px;
        line-height: 1.4;
    }
    
    .modal-timestamp {
        font-size: 0.8rem;
    }
    
    /* Gallery items on phones - no rounded corners, no spacing */
    .gallery-item {
        border-radius: 0;
        margin-bottom: 0;
    }
    
    .gallery-item img {
        border-radius: 0;
    }
    
    /* Smaller floating quotes on phones */
    .hero-nanna-saying {
        font-size: 0.6rem;
        padding: 6px 10px;
        max-width: 180px;
        min-width: 100px;
        border-radius: 12px;
    }
    
    /* Compact footer */
    .footer {
        padding: 32px 0;
        margin-top: 60px;
    }
    
    .footer-content p {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }
    
    .disclaimer {
        font-size: 0.8rem;
    }
    
    /* Touch-friendly gallery actions */
    .gallery-action-btn {
        width: 36px;
        height: 36px;
        padding: 8px;
    }
    
    .gallery-action-btn svg {
        width: 18px;
        height: 18px;
    }
    
    /* Larger close button for mobile */
    .modal-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 20px;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(8px);
    }
    
    /* Better mobile modal padding */
    .modal {
        padding: 10px;
    }
    
    /* Prevent background scroll on mobile when modal is open */
    body.modal-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
}