/* ✨ 魔法の物語 - Magical Story Generator CSS ✨ */
/* Enhanced with Anime/Japanese aesthetic elements */

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

:root {
    /* Magical Color Palette - Anime Inspired */
    --sakura-pink: #FFB7C5;
    --soft-lavender: #E6E6FA;
    --anime-blue: #87CEEB;
    --magical-purple: #DDA0DD;
    --golden-yellow: #FFD700;
    --mint-green: #98FB98;
    --cream-white: #FFFAF0;
    --deep-purple: #663399;
    --anime-red: #FF69B4;
    --starlight: #F0F8FF;

    /* Text Colors */
    --text-dark: #2D2D2D;
    --text-light: rgba(255, 255, 255, 0.95);
    --text-accent: #6B46C1;

    /* Effects */
    --shadow-soft: rgba(0, 0, 0, 0.1);
    --shadow-glow: rgba(255, 215, 0, 0.4);
    --shadow-pink: rgba(255, 183, 197, 0.4);
    --gradient-anime: linear-gradient(135deg, var(--sakura-pink), var(--anime-blue), var(--magical-purple));
    --gradient-sunset: linear-gradient(135deg, #FF6B9D, #C44569, #6C5CE7);
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, 
        var(--sakura-pink) 0%, 
        var(--anime-blue) 25%, 
        var(--magical-purple) 50%, 
        var(--deep-purple) 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    color: var(--text-dark);
}

/* Magical Particles Background (Anime Style) */
.magic-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    opacity: 0.7;
    animation-duration: 8s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
}

.particle.sakura {
    width: 12px;
    height: 12px;
    background: var(--sakura-pink);
    border-radius: 50% 0;
    transform: rotate(45deg);
    animation-name: sakura-fall;
}

.particle.sakura:nth-child(1) { top: -10px; left: 10%; animation-delay: 0s; }
.particle.sakura:nth-child(2) { top: -10px; left: 30%; animation-delay: 2s; }
.particle.sakura:nth-child(3) { top: -10px; left: 60%; animation-delay: 4s; }
.particle.sakura:nth-child(4) { top: -10px; left: 80%; animation-delay: 6s; }
.particle.sakura:nth-child(5) { top: -10px; left: 90%; animation-delay: 1s; }

.particle.star {
    width: 8px;
    height: 8px;
    background: var(--golden-yellow);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    animation-name: star-twinkle;
}

.particle.star:nth-child(6) { top: 20%; left: 15%; animation-delay: 0.5s; }
.particle.star:nth-child(7) { top: 40%; left: 85%; animation-delay: 2.5s; }
.particle.star:nth-child(8) { top: 70%; left: 25%; animation-delay: 4.5s; }

.particle.heart {
    width: 10px;
    height: 10px;
    background: var(--anime-red);
    position: relative;
    transform: rotate(-45deg);
    animation-name: heart-float;
}

.particle.heart:before,
.particle.heart:after {
    content: '';
    width: 10px;
    height: 10px;
    position: absolute;
    left: 5px;
    top: 0;
    background: var(--anime-red);
    border-radius: 50%;
    transform: rotate(-45deg);
    transform-origin: 0 100%;
}

.particle.heart:after {
    left: 0;
    transform: rotate(45deg);
    transform-origin: 100% 100%;
}

.particle.heart:nth-child(9) { top: 60%; left: 70%; animation-delay: 3s; }
.particle.heart:nth-child(10) { top: 80%; left: 40%; animation-delay: 5s; }

@keyframes sakura-fall {
    0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

@keyframes star-twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
}

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

/* Enhanced Stars Background */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 4s infinite alternate;
}

.star:nth-child(1) { width: 2px; height: 2px; top: 10%; left: 20%; animation-delay: 0s; }
.star:nth-child(2) { width: 3px; height: 3px; top: 20%; left: 80%; animation-delay: 0.5s; }
.star:nth-child(3) { width: 1px; height: 1px; top: 30%; left: 50%; animation-delay: 1s; }
.star:nth-child(4) { width: 2px; height: 2px; top: 40%; left: 10%; animation-delay: 1.5s; }
.star:nth-child(5) { width: 3px; height: 3px; top: 50%; left: 90%; animation-delay: 2s; }
.star:nth-child(6) { width: 1px; height: 1px; top: 60%; left: 30%; animation-delay: 0.3s; }
.star:nth-child(7) { width: 2px; height: 2px; top: 70%; left: 70%; animation-delay: 0.8s; }
.star:nth-child(8) { width: 3px; height: 3px; top: 80%; left: 15%; animation-delay: 1.3s; }
.star:nth-child(9) { width: 1px; height: 1px; top: 15%; left: 60%; animation-delay: 1.8s; }
.star:nth-child(10) { width: 2px; height: 2px; top: 25%; left: 40%; animation-delay: 2.3s; }

@keyframes twinkle {
    0% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0.3; transform: scale(1); }
}

/* Main Container */
.container {
    position: relative;
    z-index: 2;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Enhanced Header with Anime Elements */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    position: relative;
}

.title-container {
    margin-bottom: 30px;
}

.title {
    margin-bottom: 20px;
    animation: float 8s ease-in-out infinite;
}

.title-japanese {
    display: block;
    font-family: 'Kalam', cursive;
    font-size: 2rem;
    color: var(--text-light);
    text-shadow: 2px 2px 8px var(--shadow-pink);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.title-english {
    display: block;
    font-family: 'Pacifico', cursive;
    font-size: 2.5rem;
    color: var(--text-light);
    text-shadow: 2px 2px 10px var(--shadow-glow);
}

.subtitle-container {
    opacity: 0.9;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    font-weight: 300;
    margin-bottom: 8px;
}

.subtitle-japanese {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
    opacity: 0.8;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

/* Anime Mascot */
.mascot-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.mascot {
    position: relative;
    animation: mascot-bounce 4s ease-in-out infinite;
}

.mascot-body {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--sakura-pink), var(--anime-blue));
    border-radius: 50%;
    position: relative;
    box-shadow: 0 5px 20px var(--shadow-pink);
}

.mascot-face {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.mascot-eyes {
    display: flex;
    gap: 8px;
    margin-bottom: 5px;
}

.eye {
    width: 8px;
    height: 8px;
    background: var(--text-dark);
    border-radius: 50%;
    animation: blink 3s infinite;
}

.mascot-mouth {
    width: 12px;
    height: 6px;
    background: var(--anime-red);
    border-radius: 0 0 12px 12px;
    margin: 0 auto;
}

.mascot-cheeks {
    position: absolute;
    top: 15px;
    left: -15px;
    right: -15px;
}

.cheek {
    width: 10px;
    height: 8px;
    background: var(--anime-red);
    border-radius: 50%;
    opacity: 0.6;
    position: absolute;
}

.cheek.left { left: 0; }
.cheek.right { right: 0; }

.mascot-speech {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    color: var(--text-dark);
    box-shadow: 0 3px 10px var(--shadow-soft);
    white-space: nowrap;
    opacity: 0;
    animation: speech-bubble 6s ease-in-out infinite;
}

.mascot-speech::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

@keyframes mascot-bounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-8px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(-4px); }
}

@keyframes blink {
    0%, 90%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
}

@keyframes speech-bubble {
    0%, 70%, 100% { opacity: 0; transform: translateX(-50%) scale(0.8); }
    10%, 60% { opacity: 1; transform: translateX(-50%) scale(1); }
}

/* Enhanced Input Section */
.input-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 15px 50px var(--shadow-soft);
    position: relative;
    backdrop-filter: blur(10px);
    border: 2px solid transparent;
    background-clip: padding-box;
}

.input-section::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-anime);
    border-radius: 30px;
    z-index: -1;
    animation: border-rainbow 5s linear infinite;
}

@keyframes border-rainbow {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

.section-header {
    text-align: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-family: 'Kalam', cursive;
    font-size: 1.8rem;
    color: var(--text-accent);
    margin-bottom: 10px;
}

.section-subtitle {
    color: var(--text-dark);
    font-style: italic;
    opacity: 0.8;
}

/* Enhanced Input */
.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.input-container {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.story-input {
    width: 100%;
    padding: 18px 25px;
    border: 3px solid var(--soft-lavender);
    border-radius: 50px;
    font-size: 1.1rem;
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #fff, #f8f9ff);
    color: var(--text-dark);
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
}

.story-input:focus {
    outline: none;
    border-color: var(--golden-yellow);
    box-shadow: 0 0 25px var(--shadow-glow);
    transform: scale(1.02);
}

.story-input::placeholder {
    color: var(--magical-purple);
    font-style: italic;
}

.input-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.input-sparkle {
    position: absolute;
    top: -5px;
    right: 20px;
    width: 15px;
    height: 15px;
    background: var(--golden-yellow);
    border-radius: 50%;
    opacity: 0;
    animation: input-sparkle 3s ease-in-out infinite;
}

@keyframes input-sparkle {
    0%, 70%, 100% { opacity: 0; transform: scale(0); }
    35% { opacity: 1; transform: scale(1.2); }
}

/* Enhanced Magic Button */
.magic-button {
    position: relative;
    padding: 18px 35px;
    border: none;
    border-radius: 50px;
    background: var(--gradient-sunset);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 8px 25px var(--shadow-pink);
}

.magic-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px var(--shadow-pink);
}

.magic-button:active {
    transform: translateY(-2px) scale(1.02);
}

.button-content {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 2;
}

.button-icon {
    font-size: 1.3rem;
    animation: icon-pulse 2s ease-in-out infinite;
}

.button-japanese {
    font-size: 0.9rem;
    opacity: 0.9;
    font-style: italic;
}

.button-effects {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.button-sparkle {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s;
}

.magic-button:hover .button-sparkle {
    left: 100%;
}

.button-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.magic-button:hover .button-glow {
    width: 200%;
    height: 200%;
}

@keyframes icon-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* API Status */
.api-status {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    margin-top: 20px;
    backdrop-filter: blur(5px);
}

.status-indicator {
    font-size: 1.5rem;
    animation: pulse 2s ease-in-out infinite;
}

.status-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.status-text {
    font-weight: 500;
    color: var(--text-dark);
}

.status-subtext {
    font-size: 0.8rem;
    color: var(--text-accent);
    opacity: 0.8;
}

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

/* Enhanced Story Section */
.story-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    margin-bottom: 30px;
    box-shadow: 0 15px 50px var(--shadow-soft);
    overflow: hidden;
    min-height: 200px;
    position: relative;
    backdrop-filter: blur(10px);
}

.story-container {
    padding: 40px;
}

.story-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.story-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.story-title-text {
    font-family: 'Pacifico', cursive;
    color: var(--text-accent);
    font-size: 2rem;
}

.story-title-japanese {
    font-family: 'Kalam', cursive;
    color: var(--magical-purple);
    font-size: 1rem;
    opacity: 0.8;
}

.story-title-icon {
    font-size: 2.5rem;
    animation: book-open 4s ease-in-out infinite;
}

@keyframes book-open {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1) rotateY(10deg); }
    75% { transform: scale(1.1) rotateY(-10deg); }
}

.story-decorations {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
}

.decoration {
    font-size: 2rem;
    opacity: 0.7;
    animation: decoration-float 6s ease-in-out infinite;
}

.decoration.right {
    animation-delay: 3s;
}

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

.story-content {
    line-height: 1.8;
    font-size: 1.1rem;
    color: var(--text-dark);
    text-align: left;
    margin-bottom: 30px;
    animation: fadeInUp 0.8s ease-out;
}

.story-content p {
    margin-bottom: 1.5em;
    text-indent: 1.5em;
    text-align: justify;
}

.story-placeholder {
    text-align: center;
    font-style: italic;
    color: var(--magical-purple);
    opacity: 0.7;
    text-indent: 0;
}

.placeholder-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 15px;
}

.placeholder-japanese {
    display: block;
    font-size: 0.9rem;
    margin-top: 10px;
    opacity: 0.8;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Story Actions */
.story-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
    opacity: 0;
    animation: actions-fadeIn 0.8s ease-out 0.5s forwards;
}

.action-button {
    padding: 12px 20px;
    border: 2px solid var(--magical-purple);
    border-radius: 25px;
    background: transparent;
    color: var(--magical-purple);
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-button:hover {
    background: var(--magical-purple);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow-soft);
}

@keyframes actions-fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Enhanced Loading Animation */
.loading-container {
    display: none;
    text-align: center;
    padding: 60px 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.loading-container.show {
    display: block;
    animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.loading-animation {
    position: relative;
}

.magic-orb {
    width: 80px;
    height: 80px;
    position: relative;
    margin: 0 auto;
}

.orb-core {
    width: 60px;
    height: 60px;
    background: var(--gradient-sunset);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orb-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 30px var(--shadow-pink);
}

.orb-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ring {
    position: absolute;
    border: 2px solid var(--magical-purple);
    border-radius: 50%;
    opacity: 0.6;
}

.ring-1 {
    width: 70px;
    height: 70px;
    animation: ring-rotate 3s linear infinite;
}

.ring-2 {
    width: 85px;
    height: 85px;
    animation: ring-rotate 3s linear infinite reverse;
    animation-delay: 1s;
}

.ring-3 {
    width: 100px;
    height: 100px;
    animation: ring-rotate 3s linear infinite;
    animation-delay: 2s;
}

@keyframes orb-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

@keyframes ring-rotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.loading-particles {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.loading-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--golden-yellow);
    border-radius: 50%;
    animation: particle-orbit 4s linear infinite;
}

.loading-particle:nth-child(1) { animation-delay: 0s; }
.loading-particle:nth-child(2) { animation-delay: 0.8s; }
.loading-particle:nth-child(3) { animation-delay: 1.6s; }
.loading-particle:nth-child(4) { animation-delay: 2.4s; }
.loading-particle:nth-child(5) { animation-delay: 3.2s; }

@keyframes particle-orbit {
    0% { 
        transform: rotate(0deg) translateX(50px) rotate(0deg); 
        opacity: 1; 
        box-shadow: 0 0 10px var(--golden-yellow);
    }
    100% { 
        transform: rotate(360deg) translateX(50px) rotate(-360deg); 
        opacity: 1; 
        box-shadow: 0 0 10px var(--golden-yellow);
    }
}

.loading-text {
    text-align: center;
}

.loading-message {
    color: var(--text-accent);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    animation: loading-fade 3s ease-in-out infinite;
}

.loading-japanese {
    color: var(--magical-purple);
    font-size: 1rem;
    font-style: italic;
    opacity: 0.8;
    animation: loading-fade 3s ease-in-out infinite;
    animation-delay: 0.5s;
}

@keyframes loading-fade {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Enhanced Error Display */
.error-container {
    display: none;
    background: linear-gradient(135deg, #ffe6e6, #ffd6d6);
    border-radius: 25px;
    padding: 40px;
    text-align: center;
    border: 2px solid #ffb3b3;
    margin-bottom: 30px;
}

.error-container.show {
    display: block;
    animation: shake 0.6s ease-in-out;
}

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

.error-mascot {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: mascot-sad 2s ease-in-out infinite;
}

@keyframes mascot-sad {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.error-title {
    color: #cc3333;
    margin-bottom: 20px;
    font-family: 'Kalam', cursive;
}

.error-title span:first-child {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.error-japanese {
    font-size: 1rem;
    opacity: 0.8;
}

.error-message {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
    font-size: 1rem;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.retry-button {
    padding: 12px 25px;
    background: linear-gradient(135deg, #ff6b9d, #ff8fab);
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.retry-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 157, 0.4);
}

.retry-button.secondary {
    background: linear-gradient(135deg, #a8a4ce, #b8b4d8);
}

.retry-button.secondary:hover {
    box-shadow: 0 5px 15px rgba(168, 164, 206, 0.4);
}

/* Enhanced Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: auto;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.footer-text {
    color: var(--text-light);
    font-size: 1rem;
    opacity: 0.9;
}

.footer-text span:first-child {
    display: block;
    margin-bottom: 5px;
}

.footer-japanese {
    font-size: 0.8rem;
    font-style: italic;
}

.footer-hearts {
    display: flex;
    gap: 10px;
}

.heart {
    font-size: 1.2rem;
    animation: heart-beat 2s ease-in-out infinite;
}

.heart:nth-child(2) {
    animation-delay: 0.7s;
}

.heart:nth-child(3) {
    animation-delay: 1.4s;
}

@keyframes heart-beat {
    0%, 50%, 100% { transform: scale(1); }
    25% { transform: scale(1.2); }
}

/* Status color classes */
.api-status.checking .status-indicator {
    color: #ffa500;
    animation: spin 1s linear infinite;
}

.api-status.healthy .status-indicator {
    color: #28a745;
}

.api-status.warning .status-indicator {
    color: #ffc107;
}

.api-status.error .status-indicator {
    color: #dc3545;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .title-japanese {
        font-size: 1.5rem;
    }

    .title-english {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .input-section,
    .story-section,
    .loading-container,
    .error-container {
        padding: 25px;
        border-radius: 20px;
    }

    .input-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .magic-button {
        width: 100%;
    }

    .story-title-text {
        font-size: 1.5rem;
    }

    .story-content {
        font-size: 1rem;
    }

    .error-actions {
        flex-direction: column;
        align-items: center;
    }

    .retry-button {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .title-japanese {
        font-size: 1.2rem;
    }

    .title-english {
        font-size: 1.8rem;
    }

    .input-section,
    .story-section,
    .loading-container,
    .error-container {
        padding: 20px;
        border-radius: 18px;
    }

    .mascot-body {
        width: 50px;
        height: 50px;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .magic-orb {
        width: 60px;
        height: 60px;
    }

    .orb-core {
        width: 45px;
        height: 45px;
    }
}

/* Hidden class for JavaScript control */
.hidden {
    display: none !important;
}

/* Fade in animation class */
.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

/* Special anime-inspired text effects */
.anime-glow {
    text-shadow: 0 0 10px var(--golden-yellow), 0 0 20px var(--golden-yellow), 0 0 30px var(--golden-yellow);
}

.sakura-text {
    background: linear-gradient(135deg, var(--sakura-pink), var(--anime-red));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}