/* Global styles and hero animation styles for Astro project */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* CSS Variables */
:root {
    --main-font: 'Orbitron', sans-serif;
    --japanese-font: 'Noto Sans JP', sans-serif;
    --primary-color: rgb(255, 127, 62); /* custom-orange */
    --glow-color: rgba(255, 127, 62, 0.7); /* custom-orange with alpha */
    --background-dark: #1a1a2e; /* Kept for space theme */
    --object-yellow: rgb(255, 127, 62); /* custom-orange */
    --object-green: #34a853; /* Kept for variety */
}

/* Hero Section Styles */
.hero-container {
    position: relative;
    width: 100%;
    background-image: url('https://storage.googleapis.com/gemini-prod/images/5086d795-802c-450f-a0e4-d6a9d59247ad.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    background-color: var(--background-dark); 
    overflow: hidden; 
}

.hero-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle, rgba(26, 26, 46, 0.1) 0%, rgba(26, 26, 46, 0.8) 80%);
    z-index: 1;
}

/* Cloud animations */
.cloud {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.7;
    animation: drift linear infinite;
    z-index: 2;
}
.cloud1 { 
    width: 200px; height: 100px; 
    background-image: url('https://storage.googleapis.com/gemini-prod/images/e2a1dd7e-37ee-45e3-a607-42c237c1626f.png'); 
    top: 10%; animation-duration: 70s; 
}
.cloud2 { 
    width: 150px; height: 75px; 
    background-image: url('https://storage.googleapis.com/gemini-prod/images/07d8339b-e85b-410a-b333-649033327d6d.png'); 
    top: 25%; animation-duration: 50s; animation-delay: -10s; 
}
.cloud3 { 
    width: 250px; height: 125px; 
    background-image: url('https://storage.googleapis.com/gemini-prod/images/e2a1dd7e-37ee-45e3-a607-42c237c1626f.png'); 
    top: 15%; transform: scaleX(-1); animation-duration: 90s; animation-delay: -25s; 
}

@keyframes drift {
    0% { transform: translateX(-250px) translateY(var(--cloud-offset-y, 0px)); } 
    100% { transform: translateX(calc(100vw + 250px)) translateY(var(--cloud-offset-y, 0px)); }
}

/* Shooting stars - 3つの流れ星 */
.shooting-star {
    position: absolute; 
    width: 4px; height: 4px; 
    background: #fff; 
    border-radius: 50%;
    box-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 40px #4ade80;
    z-index: 2;
}

.shooting-star::before { 
    content: ''; 
    position: absolute; 
    top: 50%; 
    transform: translateY(-50%); 
    width: 300px; 
    height: 2px; 
    background: linear-gradient(90deg, #fff, transparent); 
    right: 0;
}

/* 1つ目の流れ星 - 中央やや上 */
.shooting-star:nth-child(4) {
    top: 30%; 
    left: 80%;
    animation: shoot1 7s linear infinite;
}

/* 2つ目の流れ星 - 中央 */
.shooting-star:nth-child(5) {
    top: 55%; 
    left: 85%;
    animation: shoot2 5s linear infinite;
    animation-delay: -2.5s;
}

/* 3つ目の流れ星 - 中央やや下 */
.shooting-star:nth-child(6) {
    top: 70%; 
    left: 75%;
    animation: shoot3 9s linear infinite;
    animation-delay: -4s;
}

@keyframes shoot1 {
    0% { transform: rotate(315deg) translateX(0) translateY(0); opacity: 1; }
    70% { opacity: 1; }
    100% { transform: rotate(315deg) translateX(-120vmin) translateY(-120vmin); opacity: 0; } 
}

@keyframes shoot2 {
    0% { transform: rotate(300deg) translateX(0) translateY(0); opacity: 1; }
    75% { opacity: 1; }
    100% { transform: rotate(300deg) translateX(-110vmin) translateY(-110vmin); opacity: 0; } 
}

@keyframes shoot3 {
    0% { transform: rotate(330deg) translateX(0) translateY(0); opacity: 1; }
    65% { opacity: 1; }
    100% { transform: rotate(330deg) translateX(-130vmin) translateY(-130vmin); opacity: 0; } 
}

/* Game objects */
.game-object {
    position: absolute;
    z-index: 2; 
    filter: drop-shadow(0 0 8px rgba(0,0,0,0.5));
    transition: transform 0.3s ease;
}

.question-block {
    width: 50px;
    height: 50px;
    background: linear-gradient(145deg, #fca311, var(--object-yellow));
    border-radius: 8px;
    top: 45%;
    left: 20%;
    box-shadow: 0 0 10px var(--object-yellow), inset 0 0 5px rgba(255,255,255,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--main-font);
    font-size: 35px;
    font-weight: 900;
    color: white;
    text-shadow: 2px 2px 3px rgba(0,0,0,0.4);
    animation: bobbing 2.5s ease-in-out infinite;
}
.question-block:hover {
    animation-play-state: paused;
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--object-yellow), 0 0 30px var(--object-yellow);
}

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

.coin {
    width: 40px;
    height: 40px;
    background-color: var(--object-yellow);
    border-radius: 50%;
    top: 60%;
    right: 22%;
    box-shadow: 0 0 15px var(--object-yellow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    font-family: sans-serif;
    animation: spin 2s linear infinite;
}
.coin::before {
    content: '★';
    text-shadow: 0 0 5px white;
}

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

.pipe {
    width: 70px;
    height: 60px;
    bottom: 12%;
    left: 35%;
}
.pipe-top {
    width: 100%;
    height: 25px;
    background: linear-gradient(180deg, #4cd964, var(--object-green));
    border-radius: 8px;
    box-shadow: 0 0 10px var(--object-green);
}
.pipe-body {
    width: 80%;
    height: 45px;
    background-color: var(--object-green);
    margin: -10px auto 0;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
}

/* Hero content */
.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 2rem;
    transform-style: preserve-3d;
    transition: transform 0.1s linear; 
}
.main-title {
    font-family: var(--main-font);
    font-size: clamp(2.5rem, 8vw, 5rem); 
    font-weight: 700; margin: 0; letter-spacing: 2px;
    text-shadow: 0 0 10px var(--glow-color), 0 0 20px var(--glow-color), 0 0 40px black;
    animation: fadeInGlow 3s ease-in-out;
}
.sub-title {
    font-family: var(--japanese-font); 
    font-size: clamp(1rem, 2.5vw, 1.3rem); 
    margin: 1rem 0 2.5rem 0; font-weight: 700;
    line-height: 1.6;
    text-shadow: 0 2px 10px black;
    animation: fadeIn 3s ease-in-out;
}
.cta-button {
    display: inline-block; 
    font-family: var(--main-font); 
    font-size: 1rem; 
    font-weight: 700;
    text-decoration: none; 
    color: white; 
    background-color: transparent;
    border: 2px solid var(--primary-color); 
    padding: 0.8rem 2rem; 
    border-radius: 50px; 
    cursor: pointer; 
    box-shadow: 0 0 10px var(--glow-color), inset 0 0 8px rgba(255, 127, 62, 0.3);
    animation: fadeIn 3s ease-in-out;
    margin: 0.5rem;
}

.cta-button:hover {
    background-color: var(--primary-color); 
    color: var(--background-dark);
    box-shadow: 0 0 20px var(--glow-color), 0 0 30px var(--primary-color);
}

@keyframes fadeInGlow {
    from { opacity: 0; text-shadow: 0 0 5px rgba(0,0,0,0.5); transform: translateY(20px); }
    to { opacity: 1; text-shadow: 0 0 10px var(--glow-color), 0 0 20px var(--glow-color), 0 0 40px black; transform: translateY(0); }
}
@keyframes fadeIn {
     from { opacity: 0; transform: translateY(20px); }
     to { opacity: 1; transform: translateY(0); }
}

/* Global font styles */
body {
  font-family: 'Noto Sans JP', sans-serif;
}




/* カード全体のコンテナ */
.card {
    width: 360px; /* カードの幅 */
    max-width: 100%; /* レスポンシブ対応 */
    border-radius: 15px; /* 角の丸み */
    overflow: hidden; /* はみ出した要素を隠す（角丸を維持するため） */
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12); /* より美しい影 */
    text-align: center; /* テキストを中央揃え */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* スムーズなアニメーション */
    margin: 0 auto; /* 中央揃え */
    background: linear-gradient(180deg, #FEF5E7 0%, #F8F0E0 100%);
}

.card:hover {
    transform: translateY(-8px) scale(1.02); /* ホバー時により動的に */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2); /* 影を強くする */
}

/* 上部のカラフルなヘッダー */
.card-header {
    background: linear-gradient(135deg, #F7A629 0%, #FF8A00 100%); /* グラデーション */
    color: white;
    padding: 1.5em 1.5em; /* より余裕のある余白 */
    position: relative; /* 疑似要素を配置するための基準 */
}

/* 美しい波線デザイン */
.card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 25px;
    background: inherit;
    clip-path: polygon(
        0% 0%, 
        10% 50%, 
        20% 80%, 
        30% 60%, 
        40% 90%, 
        50% 70%, 
        60% 95%, 
        70% 60%, 
        80% 85%, 
        90% 50%, 
        100% 0%, 
        100% 100%, 
        0% 100%
    );
}

.card-header h2 {
    font-size: 2.2em;
    font-weight: 800; /* 太字 */
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); /* テキストに立体感 */
    font-family: 'Orbitron', sans-serif; /* よりスタイリッシュなフォント */
}

.card-header .subtitle {
    margin: 0;
    font-size: 1.1em;
    font-weight: 400;
    opacity: 0.95;
    font-family: 'Noto Sans JP', sans-serif;
}

/* 下部のエレガントなボディ */
.card-body {
    background: linear-gradient(180deg, #FEF5E7 0%, #F8F0E0 100%); /* グラデーション背景 */
    color: #2C3E50;
    padding: 3em 2.5em 2.5em; /* 波線の分だけ上部の余白を増やす */
    position: relative;
}

/* ボディに微細なパターンを追加 */
.card-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(247, 166, 41, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(247, 166, 41, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 40% 80%, rgba(247, 166, 41, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.card-body p {
    margin: 0;
    font-size: 1.05em;
    line-height: 1.8; /* より読みやすい行間 */
    font-weight: 500;
    text-align: center;
}

/* カードレベル別のカラーバリエーション */
.card:nth-child(1) .card-header {
    background: linear-gradient(135deg, #F7A629 0%, #FF8A00 100%); /* オレンジ */
}

.card:nth-child(2) .card-header {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%); /* ブルー */
}

.card:nth-child(3) .card-header {
    background: linear-gradient(135deg, #7B68EE 0%, #6A5ACD 100%); /* パープル */
}

/* より洗練されたホバーエフェクト */
.card:hover .card-header {
    background-size: 110% 110%;
}

.card:hover .card-body {
    background: linear-gradient(180deg, #FEFCF8 0%, #F9F2E8 100%);
}

/* モバイル対応の改良 */
@media (max-width: 768px) {
    .card {
        width: 100%;
        max-width: 340px;
        margin: 0 auto 1.5rem auto;
    }
    
    .card-header {
        padding: 2em 1.2em 2.5em;
    }
    
    .card-header h2 {
        font-size: 1.8em;
        letter-spacing: 1px;
    }
    
    .card-header .subtitle {
        font-size: 1em;
    }
    
    .card-body {
        padding: 2.5em 1.8em 2em;
    }
    
    .card-body p {
        font-size: 0.95em;
        line-height: 1.7;
    }
}

/* 追加のアニメーション効果 */
@keyframes cardFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
}

.card {
    animation: cardFloat 6s ease-in-out infinite;
}

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

.card:nth-child(3) {
    animation-delay: -4s;
}

/* Main Section Overview専用スタイル */
.main-section-card .card-body {
    padding: 2.5em 2em 2em; /* パディングを調整 */
}

.main-section-content {
    text-align: left; /* 左揃えに設定 */
}

.main-section-content .description-text {
    margin: 0 0 1.5rem 0;
    font-size: 0.95em;
    line-height: 1.6;
    font-weight: 500;
    text-align: left; /* 説明文も左揃え */
    color: #4A5568; /* 少し濃いグレーで読みやすく */
}

.link-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.link-item {
    display: block;
    font-size: 0.875rem; /* 14px */
    text-decoration: none;
    padding: 0.25rem 0;
    transition: all 0.2s ease;
    border-radius: 0.25rem;
    padding-left: 0.5rem;
}

/* リンクアイテムの色設定 */
.main-section-card:nth-child(1) .link-item {
    color: #9333EA;
}

.main-section-card:nth-child(1) .link-item:hover {
    color: #7C3AED;
    background-color: rgba(147, 51, 234, 0.1);
}

.main-section-card:nth-child(2) .link-item {
    color: #3B82F6;
}

.main-section-card:nth-child(2) .link-item:hover {
    color: #2563EB;
    background-color: rgba(59, 130, 246, 0.1);
}

.main-section-card:nth-child(3) .link-item {
    color: #10B981;
}

.main-section-card:nth-child(3) .link-item:hover {
    color: #059669;
    background-color: rgba(16, 185, 129, 0.1);
}

.main-section-card:nth-child(4) .link-item {
    color: #F97316;
}

.main-section-card:nth-child(4) .link-item:hover {
    color: #EA580C;
    background-color: rgba(249, 115, 22, 0.1);
}

/* モバイル対応 */
@media (max-width: 768px) {
    .main-section-card .card-body {
        padding: 2em 1.5em 1.5em;
    }
    
    .main-section-content .description-text {
        font-size: 0.9em;
        margin-bottom: 1.25rem;
    }
    
    .link-item {
        font-size: 0.8rem;
    }
}