/* リセット & 基本設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* カスタムフォントの読み込み */
@font-face {
    font-family: 'Unispace';
    src: url('/static/font/unispace bd.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

html {
    width: 100%;
    max-width: 100vw;
}

:root {
    --primary-color: #ff5100;
    --secondary-color: #ff6b35;
    --dark-color: #1a1a2e;
    --light-color: #f5f5f5;
    --accent-color: #4ecdc4;
    --text-color: #333;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
    width: 100%;
    position: relative;
    max-width: 100vw;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* すべてのセクションがはみ出さないようにする */
section {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* ヘッダー */
.site-header {
    background: linear-gradient(135deg, var(--dark-color) 0%, #16213e 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    transition: transform 0.3s ease-in-out, padding 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

/* メインコンテンツにヘッダー分の上部余白を追加 */
.main-content {
    padding-top: 70px;
}

/* PC版：スクロール時にヘッダーをコンパクトに */
@media (min-width: 769px) {
    .site-header.scrolled {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }
    
    .site-header.scrolled .header-content {
        padding: 0.5rem 0;
    }
    
    .site-header.scrolled .logo h1 {
        font-size: 1.5rem;
    }
}

/* スマホ表示時のヘッダー非表示アニメーション */
@media (max-width: 768px) {
    .site-header.header-hidden {
        transform: translateY(-100%);
    }
    
    .site-header.header-visible {
        transform: translateY(0);
    }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    transition: padding 0.3s ease-in-out;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: bold;
    font-family: 'Unispace', 'Segoe UI', sans-serif;
    transition: font-size 0.3s ease-in-out;
}

.logo a {
    color: rgba(255, 230, 0, 0.9);
    text-decoration: none;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* ハンバーガーメニューボタン */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ハンバーガーメニューが開いている時のアニメーション */
.hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.main-nav a:hover {
    color: var(--primary-color);
}

/* Discordアイコン（ヘッダー） */
.discord-link {
    display: flex;
    align-items: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.discord-link:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.discord-icon {
    height: 24px;
    width: auto;
    display: block;
}

/* ヒーローセクション */
.hero-section {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.25) 0%, rgba(139, 56, 56, 0.25) 100%), url('/static/img/background.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    padding: 5rem 0;
    text-align: center;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--dark-color);
}

.btn-primary:hover {
    background-color: #ff864e;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background-color: white;
    color: var(--dark-color);
}

/* セクション */
section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--dark-color);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    margin: 1rem auto;
    border-radius: 2px;
}

/* 特徴セクション */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: var(--dark-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.feature-card p {
    color: #666;
    line-height: 1.8;
}

/* ギャラリーセクション */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover img,
.gallery-item:hover video {
    transform: scale(1.05);
}

/* ダウンロードセクション */
.download-section {
    background: linear-gradient(135deg, var(--accent-color) 0%, #45b7af 100%);
    color: white;
}

.download-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.download-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.download-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.platform-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.platform-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: white;
    color: var(--dark-color);
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.platform-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.platform-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.platform-btn.disabled:hover {
    transform: none;
}

/* フッター */
.site-footer {
    background-color: var(--dark-color);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: #866eff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--primary-color);
}

/* Discordリンク（フッター） */
.discord-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.discord-footer-link:hover {
    transform: translateX(5px);
}

.discord-footer-icon {
    height: 20px;
    width: auto;
    vertical-align: middle;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #8b9deb;
}

/* よくある質問セクション */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: white;
    margin-bottom: 1rem;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    cursor: pointer;
    user-select: none;
    background-color: white;
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background-color: #f9f9f9;
}

.faq-question h3 {
    color: var(--dark-color);
    font-size: 1.1rem;
    margin: 0;
    flex: 1;
}

.faq-icon {
    font-size: 1.5rem;
    color: var(--accent-color);
    font-weight: bold;
    transition: transform 0.3s ease;
    min-width: 30px;
    text-align: center;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background-color: #f9f9f9;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 1.5rem;
}

.faq-answer p {
    margin: 0;
    color: #666;
    line-height: 1.8;
}

.faq-answer a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

.faq-answer a:hover {
    text-decoration: underline;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0;
    }

    /* ハンバーガーメニューボタンを表示 */
    .hamburger-menu {
        display: flex;
    }

    /* モバイル時はナビゲーションを非表示 */
    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background: linear-gradient(135deg, var(--dark-color) 0%, #16213e 100%);
        padding: 5rem 2rem 2rem;
        transition: transform 0.3s ease-in-out, visibility 0.3s;
        transform: translateX(100%);
        z-index: 1000;
        overflow-x: hidden;
        overflow-y: auto;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
        visibility: hidden;
    }

    /* メニューが開いている時 */
    .main-nav.active {
        transform: translateX(0);
        visibility: visible;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
    }

    .main-nav li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .main-nav li:last-child {
        border-bottom: none;
    }

    .main-nav a {
        display: block;
        padding: 1rem 0;
        font-size: 1.1rem;
    }

    .discord-link {
        justify-content: flex-start;
        gap: 0.5rem;
    }

    .discord-icon {
        height: 20px;
    }

    /* オーバーレイ（メニューの背景） */
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 999;
    }

    body.menu-open::before {
        opacity: 1;
        visibility: visible;
    }

    body.menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }

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

    .features-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* 広告の表示切り替え */
/* PC版（769px以上）：PC広告のみ表示 */
@media (min-width: 769px) {
    .ad-pc {
        display: flex !important;
    }
    .ad-mobile {
        display: none !important;
    }
}

/* スマホ版（768px以下）：スマホ広告のみ表示 */
@media (max-width: 768px) {
    .ad-pc {
        display: none !important;
    }
    .ad-mobile {
        display: flex !important;
        width: 100vw !important;
        max-width: 100vw !important;
        overflow: hidden !important;
        position: relative !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 0 !important;
        left: 50% !important;
        right: 50% !important;
        margin-left: -50vw !important;
        margin-right: -50vw !important;
    }
    
    /* 広告内のすべての要素がはみ出さないようにする */
    .ad-mobile * {
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
    
    /* 広告内のiframeも制限 */
    .ad-mobile iframe {
        max-width: 100vw !important;
        width: 100vw !important;
        transform: scale(0.95) !important;
        transform-origin: center !important;
    }
    
    /* 広告内のdivも制限 */
    .ad-mobile div,
    .ad-mobile > * {
        max-width: 100vw !important;
        overflow: hidden !important;
    }
}
