/* リセットとベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #006994 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 15px;
    position: relative;
}

/* ヘッダー */
.header {
    text-align: center;
    padding: 40px 0;
    position: relative;
    overflow: hidden;
}

.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="1" fill="white" opacity="0.8"/><circle cx="80" cy="30" r="1" fill="white" opacity="0.6"/><circle cx="40" cy="60" r="1" fill="white" opacity="0.7"/><circle cx="90" cy="80" r="1" fill="white" opacity="0.5"/><circle cx="10" cy="90" r="1" fill="white" opacity="0.9"/></svg>') repeat;
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.title {
    position: relative;
    z-index: 2;
}

.title-main {
    display: block;
    font-size: 3.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 10px;
    animation: slideInDown 1s ease-out;
}

.title-sub {
    display: block;
    font-size: 1.2rem;
    font-weight: 300;
    color: rgba(255,255,255,0.9);
    animation: slideInUp 1s ease-out 0.6s both;
}

.title-version {
    display: inline-block;
    font-size: 1.3rem;
    font-weight: 600;
    background: linear-gradient(45deg, #87CEEB, #98FB98, #F0E68C, #FFB6C1);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.3);
    margin-top: 8px;
    margin-bottom: 8px;
    padding: 6px 12px;
    border-radius: 15px;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    animation: slideInUp 1s ease-out 0.3s both, softGlow 4s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(135, 206, 235, 0.2);
}

@keyframes slideInDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes softGlow {
    0% {
        background-position: 0% 50%;
        box-shadow: 0 2px 8px rgba(135, 206, 235, 0.3);
    }
    25% {
        background-position: 100% 50%;
        box-shadow: 0 2px 8px rgba(152, 251, 152, 0.3);
    }
    50% {
        background-position: 100% 50%;
        box-shadow: 0 2px 8px rgba(240, 230, 140, 0.3);
    }
    75% {
        background-position: 0% 50%;
        box-shadow: 0 2px 8px rgba(255, 182, 193, 0.3);
    }
    100% {
        background-position: 0% 50%;
        box-shadow: 0 2px 8px rgba(135, 206, 235, 0.3);
    }
}

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

/* 浮遊する動物 */
.floating-animals {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.animal {
    position: absolute;
    font-size: 2rem;
    animation: float 6s ease-in-out infinite;
}

.animal-1 { top: 15%; left: 8%; animation-delay: 0s; }
.animal-2 { top: 25%; right: 12%; animation-delay: 0.5s; }
.animal-3 { top: 35%; left: 15%; animation-delay: 1s; }
.animal-4 { top: 45%; right: 8%; animation-delay: 1.5s; }
.animal-5 { top: 55%; left: 5%; animation-delay: 2s; }
.animal-6 { top: 65%; right: 20%; animation-delay: 2.5s; }
.animal-7 { top: 75%; left: 12%; animation-delay: 3s; }
.animal-8 { top: 85%; right: 5%; animation-delay: 3.5s; }
.animal-9 { top: 20%; right: 35%; animation-delay: 4s; }
.animal-10 { top: 50%; left: 25%; animation-delay: 4.5s; }
.animal-11 { top: 80%; left: 30%; animation-delay: 5s; }

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

/* メインコンテンツ */
.main {
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    animation: fadeInUp 1s ease-out 0.5s both;
}

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

.intro-section {
    text-align: center;
    margin-bottom: 40px;
}

.intro-text {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.8;
    animation: fadeIn 1s ease-out 0.8s both;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* フォーム */
.form-section {
    margin-bottom: 40px;
}

.form-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.form-header {
    margin-bottom: 40px;
}

.form-title {
    font-size: 1.6rem;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.form-subtitle {
    font-size: 1.1rem;
    color: #666;
    font-weight: 300;
}

.birthday-form {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 25px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.form-inputs {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    margin-bottom: 40px;
}

.input-group {
    width: 100%;
    max-width: 300px;
}

.input-wrapper {
    position: relative;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #555;
    font-size: 1.1rem;
    margin-bottom: 12px;
    justify-content: center;
}

.label-icon {
    font-size: 1.3rem;
}

.label-text {
    font-size: 1.1rem;
}

.styled-select {
    width: 100%;
    padding: 18px 25px;
    border: 2px solid #e8e8e8;
    border-radius: 15px;
    font-size: 1.1rem;
    background: white;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23666" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6,9 12,15 18,9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
    padding-right: 50px;
}

.styled-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-3px);
    background-color: #f8f9ff;
}

.styled-select:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.submit-btn {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 20px 50px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    min-width: 280px;
}

.submit-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.4);
}

.submit-btn:active {
    transform: translateY(-2px);
}

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

.btn-icon {
    font-size: 1.4rem;
    animation: sparkle 2s ease-in-out infinite;
}

.btn-text {
    font-size: 1.2rem;
}

.btn-arrow {
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.submit-btn:hover .btn-arrow {
    transform: translateX(5px);
}

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

.submit-btn:hover .btn-glow {
    left: 100%;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(10deg); }
}

/* ローディング */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.loading-content {
    animation: fadeIn 0.5s ease-out;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-text {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 20px;
}

.loading-animals {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 1.5rem;
}

.loading-animals span {
    animation: bounce 1s infinite;
}

.loading-animals span:nth-child(1) { animation-delay: 0s; }
.loading-animals span:nth-child(2) { animation-delay: 0.1s; }
.loading-animals span:nth-child(3) { animation-delay: 0.2s; }
.loading-animals span:nth-child(4) { animation-delay: 0.3s; }
.loading-animals span:nth-child(5) { animation-delay: 0.4s; }
.loading-animals span:nth-child(6) { animation-delay: 0.5s; }

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

/* 結果表示 */
.result {
    text-align: center;
    animation: slideInUp 0.8s ease-out;
}

.result-content {
    max-width: 900px;
    margin: 0 auto;
}

.result-header {
    margin-bottom: 40px;
}

.result-animal {
    font-size: 8rem;
    margin-bottom: 20px;
    animation: bounceIn 1s ease-out;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.result-title {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 10px;
    font-weight: 700;
}

.result-subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 30px;
}

.result-details {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    padding: 10px;
    margin-bottom: 30px;
    text-align: left;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.2);
}

.detail-section {
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255,255,255,0.7);
    border-radius: 15px;
    border-left: 4px solid #667eea;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.detail-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-title {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
}

.detail-content {
    color: #444;
    line-height: 1.6;
    font-size: 0.95rem;
    font-weight: 400;
    white-space: pre-line;
}

.detail-content ul {
    margin: 10px 0;
    padding-left: 0;
    list-style: none;
    list-style-type: none;
}

.detail-content li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 0;
    list-style: none;
    list-style-type: none;
}

.detail-content li::marker {
    display: none;
}

.detail-content ul li::before,
.detail-content ul li::after {
    content: none;
}

.detail-content ul li {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}


.result-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.retry-btn, .share-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn {
    background: #6c757d;
    color: white;
}

.share-btn {
    background: #28a745;
    color: white;
}

.retry-btn:hover, .share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* フッター */
.footer {
    text-align: center;
    padding: 20px 0;
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    background: rgba(0,0,0,0.05);
    margin-top: 20px;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-links {
    margin: 15px 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.75rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
    text-decoration: underline;
}

.footer-note {
    margin-top: 15px;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    line-height: 1.4;
}

/* ユーティリティクラス */
.hidden {
    display: none !important;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: 8px;
    }
    
    .title-main {
        font-size: 2.5rem;
    }
    
    .title-sub {
        font-size: 1rem;
    }
    
    .form-title {
        font-size: 1.3rem;
    }
    
    .main {
        padding: 15px;
    }
    
    .form-inputs {
        flex-direction: column;
        gap: 20px;
    }
    
    .input-group {
        min-width: auto;
    }
    
    .result-animal {
        font-size: 6rem;
    }
    
    .result-title {
        font-size: 2rem;
    }
    
    .result-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .retry-btn, .share-btn {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .title-main {
        font-size: 2rem;
    }
    
    .form-inputs {
        flex-direction: column;
        gap: 15px;
    }
    
    .birthday-form {
        padding: 15px;
    }
    
    .result-animal {
        font-size: 5rem;
    }
    
    .result-title {
        font-size: 1.8rem;
    }
}

/* 動物イラスト用のCSS */
.animal-illustration {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    position: relative;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: float 3s ease-in-out infinite;
}

.animal-illustration::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 400% 400%;
    animation: gradientShift 3s ease infinite;
    z-index: -1;
}

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

.animal-illustration .emoji {
    font-size: 4rem;
    z-index: 1;
}

/* デザイナー/コーダー風の装飾 */
.designer-hat {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 40px;
    background: #333;
    border-radius: 10px 10px 0 0;
}

.designer-hat::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 20px;
    background: #333;
    border-radius: 10px;
}

.coder-glasses {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 30px;
    border: 3px solid #333;
    border-radius: 15px;
}

.coder-glasses::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 20px;
    background: #333;
}
