:root {
    --primary-color: #4f46e5;
    --secondary-color: #06b6d4;
    --accent-color: #f59e0b;
    --dark-bg: #0f172a;
    --light-bg: #f8fafc;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    /*padding-top: 0;*/
    padding-top: var(--navbar-height, 64px);
}

/* ヒーローセクション統合版 */
.hero-gradient {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #e262c6 0%, #764ba2 100%);
    min-height: 100vh;
    /* ↓↓↓ここ追加↓↓↓ */
    box-shadow: 0 10px 40px -8px rgba(30,32,80,0.30);
}

/* セクション下端にフェード・フォロー効果 */
.hero-gradient::after {
    content: "";
    display: block;
    position: absolute;
    left: 0; right: 0; bottom: -1px; height: 64px;
    pointer-events: none;
    z-index: 0;
    /* ここがグラデーションによるフェード */
    background: linear-gradient(
      to bottom,
      rgba(15, 23, 42, 0.19) 0%,
      rgba(15, 23, 42, 0.08) 40%,
      rgba(255,255,255,0.0) 100%
    );
}

/* 背景画像を全幅に - レスポンシブでも常に100% */
.hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important; /* !importantで強制的に全幅 */
    height: 100%;
    background-image: url('/assets/img/top_back.webp');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    opacity: 0.8;   
    z-index: 1;
}

/* HTMLのimg要素は非表示にして、背景画像のみ使用 */
.character-img {
    display: none;
}

.character-container {
    display: none;
}

/* コンテナ */
.container {
    position: relative;
    z-index: 10;
}

/* CSS発火タイミング調整 */
.main-logo.no-anim, .subtitle.no-anim {
    opacity: 0 !important;
    transform: translateY(100px) !important;
    animation: none !important;
}

/* メインロゴアニメーション */
.main-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateY(100px);
    opacity: 0;
    /*animation: slideUpLogo 1.2s ease-out forwards;*/
    /*animation-delay: 0.3s;*/
    position: relative;
    z-index: 10;
}

.main-logo-img {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 250px;
    height: auto;
    filter: brightness(0) invert(0) drop-shadow(0 0 20px rgba(255, 255, 255, 0.5));
    margin-bottom: 40px;
}

.main-logo-img-bar {
    margin-right: 12px;
    filter: brightness(0) invert(1) drop-shadow(0 0 20px rgba(255, 255, 255, 0.5));
}

/* サブタイトル */
.subtitle {
    opacity: 0;
    /*animation: fadeInUp 1s ease-out forwards;*/
    /*animation-delay: 1s;*/
    position: relative;
    z-index: 10;
}

/*追加*/
.main-logo.anim-start {
    animation: slideUpLogo 1.2s ease-out forwards;
}

/*追加*/
.subtitle.anim-start {
    animation: fadeInUp 1s ease-out forwards;
}

.subtitle h1 {
    margin-top: 20px;
    color: white !important;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8);
}

.subtitle p {
    color: rgba(255, 255, 255, 0.95) !important;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

.top-ai-text{
    color: red !important;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
    font-weight: bold;
}

/* ロゴアニメーションコンテナ */

.subtitle.fade-in-delayed {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    /* 影は絶対入れない */
    box-shadow: none !important;
    /* paddingも多すぎたらここで抑える */
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    background: none !important; /* 念のため背景も無効化 */
}


.logo-animation-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    position: relative;
    z-index: 10;
    /* ↓↓↓ 幅を最大限指定して中央寄せ崩れ防止！ ↓↓↓ */
    max-width: 620px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    /* ↑↑↑ ここが重要 ↑↑↑ */
    animation: slideUpLogo 1.2s ease-out forwards;
    animation-delay: 0.3s;
    margin-top: 0;
    margin-bottom: 10px;
    padding: 60px 40px 12px 40px;
    background: rgba(16, 18, 28, 0.16);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px 0 rgba(40,40,60,0.09);
}


.typewriter-stack .display-4,
.typewriter-stack h1,
.display-4 {
    text-shadow: 0 2px 6px rgba(0,0,0,0.13), 0 1px 2px #fff2 !important;
}
@keyframes slideUpLogo {
    from { opacity: 0; transform: translateY(100px);}
    to   { opacity: 1; transform: translateY(0);}
}

/* タイプライター風スタック */
.typewriter-stack {
  line-height: 1.05;
  text-align: left; /* 中央にしたい場合は center */
  /* white-space: pre; はつけない！ */
}
.blinking-caret {
    display: inline-block;
    width: 1.05em;
    height: 1em;
    color: #1bd3e6;
    font-size: 1em;
    font-weight: bold;
    vertical-align: -0.05em;
    animation: caret-blink 0.7s steps(1) infinite;
    margin-left: 2px;
}
@keyframes caret-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.22; }
}
.top-ai-text {
    color: #ff2e2e;
    font-weight: bold;
}

/* ボタン */
.btn-modern,
.btn-outline-light {
    position: relative;
    z-index: 10;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* アニメーション */
@keyframes slideUpLogo {
    0% {
        transform: translateY(100px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

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

/* タイピングエフェクト */
.typing-effect {
    overflow: hidden;
    border-right: 2px solid #f59e0b;
    white-space: nowrap;
    animation: typing 2s steps(12, end) 1.5s forwards,
               blink-caret 0.75s step-end infinite 1.5s;
    width: 0;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #f59e0b; }
}

/* 装飾要素 */
.hero-decorations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.deco-circle {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: rotate 20s linear infinite;
}

.deco-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    right: 10%;
}

.deco-2 {
    width: 150px;
    height: 150px;
    bottom: 20%;
    left: 10%;
    animation-direction: reverse;
}

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

/* Modern Navbar */
.navbar-custom {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: none !important;
    transition: all 0.3s ease;
    /* ここに追加！ */
    box-shadow: 0 4px 18px -4px rgba(20,24,40,0.21), 0 1.5px 0px 0px rgba(0,0,0,0.04);
}


.navbar-custom.scrolled {
    background: rgba(15, 23, 42, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--accent-color), #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-brand img {
    opacity: 1;
    height: 40px;
    width: auto;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-color) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* Modern Cards */
.card-custom {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.card-custom:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

/* Modern Buttons */
.btn-modern {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 50px;
    padding: 12px 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-modern::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;
}

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

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.4);
}

/* Floating Elements */
.floating {
    animation: floating 3s ease-in-out infinite;
}

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

/* Section Styling */
.section-padding {
    padding: 80px 0;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--primary-color);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* レスポンシブ対応 - 画像は常に全幅 */
@media (max-width: 992px) {
    .hero-bg-image {
        width: 100% !important; /* タブレットでも全幅 */
        opacity: 0.7;
    }
    
    .main-logo-img {
        margin-bottom: 30px;
        max-width: 220px;
    }
    
    .logo-animation-container {
        padding: 40px 30px;
        margin: 30px 15px;
    }
}

@media (max-width: 768px) {
    .hero-bg-image {
        width: 100% !important; /* モバイルでも全幅 */
        opacity: 0.6;
    }
    
    .main-logo-img {
        margin-bottom: 25px;
        max-width: 180px;
    }
    
    .logo-animation-container {
        align-items: center;
        text-align: center;
        margin: 20px 10px;
        padding: 30px 20px;
    }
    
    .subtitle h1 {
        font-size: 2rem;
    }
}


/*ローディング画面専用*/
#loading-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: url('/assets/img/loading/loading-back.webp') center/cover no-repeat, rgba(18, 21, 32, 0.77);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: opacity .4s;
}

#loading-overlay.hide {
  opacity: 0;
  pointer-events: none;
}

.loading-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.loading-gif {
  width: 120px;
  margin-bottom: 24px;
  border-radius: 16px;
  box-shadow: 0 4px 28px 0 #66c3ef22;
}

.progress-container {
  width: 280px;
  margin-top: 0;
}

.progress-bar-bg {
  width: 320px;
  height: 12px;
  background: #2226;
  border-radius: 8px;
  margin: 0 auto 18px auto;
  overflow: hidden;
  position: relative;
  /* 黒シャドウ */
  box-shadow: 0 4px 18px 0 rgba(0,0,0,0.30), 0 1px 4px 0 #0008;
}

.progress-bar-fg {
  height: 100%;
  background: linear-gradient(90deg, #aeefff 0%, #ffedae 100%);
  box-shadow: 0 1px 6px #222a, 0 0.5px 0px 0px #fff8;
  border-radius: 8px 8px 8px 8px;
  transition: width 0.15s;
}

.sparkle {
  position: absolute;
  top: -8px;
  left: 0;
  width: 24px; height: 30px;
  pointer-events: none;
  /* キラキラっぽいSVGアイコン */
  background: url("data:image/svg+xml,%3Csvg width='28' height='30' viewBox='0 0 28 30' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14 0 L17 11 L28 14 L17 17 L14 28 L11 17 L0 14 L11 11 Z' fill='%23fffbe7' stroke='%23ffdf75' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat center;
  opacity: 0.9;
  transition: left 0.15s;
  filter: drop-shadow(0 0 7px #ffecb2) drop-shadow(0 0 4px #f6c6fd77);
}

.loading-message {
  font-size: 1.2rem;
  color: #fffdf7;
  letter-spacing: 0.02em;
  font-family: 'Kosugi Maru', 'Inter', sans-serif;
  text-align: center;
  font-weight: bold;
  user-select: none;
}

@media (max-width: 400px) {
  .progress-container { width: 94vw; }
}

/* アカツキちゃんローディング画面（style.cssの#loading-overlay部分を更新） */
#loading-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: url('/assets/img/aktk-chan-bg/dawn-sky.webp') center/cover no-repeat;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: opacity .8s ease;
    overflow: hidden;
}

#loading-overlay.hide {
    opacity: 0;
    pointer-events: none;
}

/* アカツキちゃんメイン */
.akatsuki-loading {
    width: 300px;
    height: 350px;
    position: relative;
    margin-bottom: 2rem;
    animation: akatsukiFloat 2s ease-in-out infinite;
    z-index: 10;
}

.akatsuki-loading img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
}

/* 星の噴出コンテナ */
.stars-eruption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 5;
}

/* 星のパーティクル */
.star-particle {
    position: absolute;
    width: 24px;
    height: 24px;
    opacity: 0;
}

.star-particle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ローディングテキスト */
.loading-text {
    font-size: 1.8rem;
    color: white;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
    opacity: 0;
    animation: textFadeIn 0.8s ease-out 1s forwards;
    z-index: 10;
}

/* プログレス部分 */
.loading-progress {
    width: 350px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    opacity: 0;
    animation: textFadeIn 0.8s ease-out 1.5s forwards;
    z-index: 10;
}

.progress-bar-inner {
    height: 12px;
    background: linear-gradient(90deg, #667eea, #f093fb);
    border-radius: 8px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* アニメーション */
@keyframes akatsukiFloat {
    0%, 100% {
        transform: translateY(0px) rotate(-1deg);
    }
    25% {
        transform: translateY(-15px) rotate(1deg);
    }
    50% {
        transform: translateY(-8px) rotate(-0.5deg);
    }
    75% {
        transform: translateY(-18px) rotate(0.8deg);
    }
}

@keyframes starErupt {
    0% {
        transform: translateY(100vh) scale(0) rotate(0deg);
        opacity: 0;
    }
    15% {
        opacity: 1;
        transform: translateY(70vh) scale(1) rotate(90deg);
    }
    85% {
        opacity: 1;
        transform: translateY(-20vh) scale(1.2) rotate(270deg);
    }
    100% {
        transform: translateY(-40vh) scale(0.6) rotate(360deg);
        opacity: 0;
    }
}

@keyframes sparkleErupt {
    0% {
        transform: translateY(100vh) scale(0) rotate(0deg);
        opacity: 0;
    }
    20% {
        opacity: 0.8;
        transform: translateY(60vh) scale(1) rotate(120deg);
    }
    80% {
        opacity: 0.8;
        transform: translateY(-15vh) scale(1.1) rotate(300deg);
    }
    100% {
        transform: translateY(-35vh) scale(0.4) rotate(480deg);
        opacity: 0;
    }
}

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

/* レスポンシブ */
@media (max-width: 768px) {
    .akatsuki-loading {
        width: 250px;
        height: 280px;
    }

    .loading-text {
        font-size: 1.4rem;
    }

    .loading-progress {
        width: 280px;
    }
}

@media (max-width: 480px) {
    .akatsuki-loading {
        width: 200px;
        height: 230px;
    }

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

    .loading-progress {
        width: 250px;
    }
}

/* アカツキちゃんの画像をゆらゆら */
.floating-akatsuki {
    animation: akatsukiFloat 4s ease-in-out infinite;
}

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

/* アカツキちゃんのボタン */
#akatsuki-chanBtn {
    background: linear-gradient(135deg, #dc8aec, #73baf5);
    color: white;
    border: white;
}

#akatsuki-chanBtn2 {
    border: 1px solid white;
    background: linear-gradient(135deg, #dc8aec, #73baf5);
    color: white;
}

/* アカツキちゃんのボタンホバー */
#akatsuki-chanBtn:hover {
    background: linear-gradient(135deg, #ff6ec4, #7873f5);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
}
#akatsuki-chanBtn2:hover {
    background: linear-gradient(135deg, #fbc2eb, #a6c1ee);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
}

/* アカツキちゃん設定資料ページ用*/
.page-fadein {
  opacity: 0;
  transform: translateY(20px);
  animation: pageFadeIn 1s ease-out forwards;
}

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