/* =================================
   CrossTalks メインスタイルシート
   SEO最適化・HTML優先設計・ヘッダーアイコン対応
   ================================= */

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

:root {
    /* カラーパレット（変更可能） */
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #ff6b6b;
    --success-color: #51cf66;
    --warning-color: #ffd93d;
    --text-color: #333;
    --text-light: #666;
    --text-lighter: #888;
    --background-light: rgba(255, 255, 255, 0.95);
    --background-glass: rgba(255, 255, 255, 0.9);
    
    /* サイズ設定（変更可能） */
    --header-height: 120px;
    --footer-height: 40px;
    --container-max-width: 1200px;
    --border-radius: 20px;
    --border-radius-small: 15px;
    --box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    --box-shadow-hover: 0 30px 60px rgba(0, 0, 0, 0.2);
    
    /* フォント設定 */
    --font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-base: 16px;
    --line-height-base: 1.6;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    color: var(--text-color);
    overflow-x: hidden;
    line-height: var(--line-height-base);
    font-size: var(--font-size-base);
}

/* ========== 星空背景アニメーション ========== */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

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

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

/* ========== ヘッダー（修正版） ========== */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--box-shadow);
    z-index: 1000;
    padding: 1rem 2rem;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--container-max-width);
    width: 100%;
    margin: 0 auto;
    gap: 1rem;
}

/* ========== 左側：メインアイコン ========== */
.header-left {
    flex: 0 0 auto;
}

.main-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-emoji {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.logo-emoji:hover {
    transform: scale(1.1) rotate(5deg);
    background: rgba(255, 255, 255, 0.3);
}

.main-logo {
    width: 60px;
    height: 60px;
    border-radius: 15%;
    object-fit: contain;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.3s ease;
}

.main-logo:hover {
    transform: scale(1.1);
}

/* ========== 中央：テキスト ========== */
.header-text {
    flex: 1;
    text-align: center;
    color: white;
    padding: 0 1rem;
}

.header-text h1 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header-text p {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
    opacity: 0.9;
}

.header-subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
    display: block;
}

/* ========== 右側：キャラクター画像 ========== */
.header-right {
    flex: 0 0 auto;
}

.character-icons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.character-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.character-emoji {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.character-emoji:hover {
    transform: scale(1.1) rotate(-5deg);
    background: rgba(255, 255, 255, 0.25);
}

.character-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: contain;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.character-img:hover {
    transform: scale(1.1);
}

/* ========== アニメーション効果 ========== */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.character-emoji:nth-child(1) {
    animation: float 3s ease-in-out infinite;
}

.character-emoji:nth-child(2) {
    animation: float 3s ease-in-out infinite 1.5s;
}

/* ========== 旧ヘッダースタイル（互換性維持） ========== */
.logo-link {
    display: inline-block;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo-link:hover {
    transform: scale(1.05);
}

.logo {
    border-radius: 50%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.logo-main {
    width: 52px;
    height: 52px;
}

.logo-left,
.logo-right {
    width: 86px;
    height: 86px;
}

/* ========== メインコンテンツ ========== */
#main-content {
    margin-top: var(--header-height);
    padding: 2rem;
    position: relative;
    z-index: 10;
    min-height: calc(100vh - var(--header-height));
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
}

/* ========== 広告コンテナ ========== */
.ad-container {
    margin: 2rem 0;
    text-align: center;
    background: var(--background-glass);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.ad-label {
    font-size: 0.8rem;
    color: var(--text-lighter);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* レスポンシブ広告 */
.ad-responsive {
    display: block;
    width: 100%;
    height: 280px;
}

.ad-sidebar {
    width: 300px;
    height: 600px;
}

.ad-banner {
    width: 728px;
    height: 90px;
    margin: 0 auto;
}

/* サイドバー広告（デスクトップ用） */
.sidebar-ads {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: none;
}

/* ========== セクション共通スタイル ========== */
.section-title {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 2rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.lazy-load {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.lazy-load.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* ========== ウェルカムセクション ========== */
.welcome-section {
    text-align: center;
    margin-bottom: 3rem;
    background: var(--background-light);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    box-shadow: var(--box-shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.welcome-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* ========== ニュースセクション ========== */
.news-section {
    background: var(--background-light);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 2rem;
}

.news-section .section-title {
    color: var(--text-color);
    text-shadow: none;
}

.news-item {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.news-item:last-child {
    border-bottom: none;
}

.news-date {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.9rem;
}

.news-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin: 0.5rem 0;
    color: var(--text-color);
}

.news-item p {
    color: var(--text-light);
    line-height: 1.6;
}

/* ========== ゲームセクション ========== */
.games-section {
    margin-bottom: 3rem;
}

.games-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}

.game-card {
    background: var(--background-light);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    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.5s;
}

.game-card:hover::before {
    left: 100%;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--box-shadow-hover);
}

.game-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.game-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.game-info {
    flex: 1;
}

.game-info h3 {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.game-status {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    white-space: nowrap;
}

.game-status.popular {
    background: linear-gradient(45deg, var(--accent-color), #ee5a24);
}

.game-status.new {
    background: linear-gradient(45deg, var(--success-color), #38d9a9);
}

.game-status.coming-soon {
    background: linear-gradient(45deg, var(--warning-color), #ffa94d);
    color: var(--text-color);
}

.game-description {
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.game-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.feature-tag {
    padding: 0.4rem 0.8rem;
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    border-radius: var(--border-radius-small);
    font-size: 0.9rem;
    border: 1px solid rgba(102, 126, 234, 0.2);
    white-space: nowrap;
}

.play-button {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius-small);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    font-family: inherit;
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.play-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ========== SEO用コンテンツセクション ========== */
.content-section {
    background: var(--background-light);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 2rem;
}

.content-section h2 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
}

.content-section h3 {
    color: var(--text-color);
    margin: 1.5rem 0 0.5rem 0;
    font-size: 1.2rem;
    font-weight: bold;
}

.content-section p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: var(--text-light);
}

.content-section ul {
    margin: 1rem 0;
    padding-left: 2rem;
}

.content-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: var(--text-light);
}

.content-section strong {
    color: var(--text-color);
    font-weight: bold;
}

/* ========== フッター ========== */
#main-footer {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    padding: 3rem 2rem 2rem;
    margin-top: 3rem;
}

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

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: bold;
}

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

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-bottom p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* ========== Flutter統合用スタイル ========== */
#flutter-app-area {
    position: relative;
    z-index: 10;
    background: var(--background-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

#flutter_container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 400px;
    max-height: 80vh;
    overflow: hidden;
    position: relative;
}

/* Flutter非表示時のスタイル */
#static-content.hidden {
    display: none;
}

#flutter-app-area.active {
    display: block !important;
}

/* ========== レスポンシブデザイン ========== */
@media (min-width: 1400px) {
    .sidebar-ads {
        display: block;
    }
}

@media (min-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    }
    
    .ad-banner {
        display: block;
        margin: 0 auto;
    }
    
    .welcome-title {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 100px;
    }
    
    #main-header {
        padding: 0.5rem 1rem;
    }
    
    .header-container {
        gap: 0.5rem;
    }
    
    .header-text h1 {
        font-size: 1.4rem;
    }
    
    .header-text p {
        font-size: 0.9rem;
    }
    
    .header-subtitle {
        display: none;
    }
    
    .logo-emoji {
        width: 45px;
        height: 45px;
        font-size: 1.8rem;
    }
    
    .character-emoji {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .main-logo,
    .character-img {
        width: 45px;
        height: 45px;
    }
    
    .welcome-title {
        font-size: 2rem;
    }
    
    .welcome-subtitle {
        font-size: 1rem;
    }
    
    .game-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .game-info h3 {
        font-size: 1.3rem;
    }
    
    #main-content {
        padding: 1rem;
    }
    
    .ad-banner {
        display: none;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .content-section {
        padding: 1.5rem;
    }
    
    .content-section h2 {
        font-size: 1.3rem;
    }
    
    .content-section h3 {
        font-size: 1.1rem;
    }
    
    #flutter_container {
        max-height: 70vh;
        padding: 0 8px;
    }
}

@media (max-width: 480px) {
    .header-text h1 {
        font-size: 1.2rem;
    }
    
    .header-text p {
        font-size: 0.8rem;
    }
    
    .logo-emoji {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .character-emoji {
        width: 35px;
        height: 35px;
        font-size: 1.3rem;
    }
    
    .character-icons {
        gap: 0.3rem;
    }
    
    .game-card {
        padding: 1.5rem;
    }
    
    .game-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .feature-tag {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    
    .play-button {
        width: 100%;
        padding: 0.8rem 1.5rem;
    }
    
    #flutter_container {
        max-height: 60vh;
        padding: 0 4px;
    }
}

/* ========== アニメーション・トランジション ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .character-emoji {
        animation: none !important;
    }
}

/* ========== プリント用スタイル ========== */
@media print {
    .stars,
    .sidebar-ads,
    .ad-container,
    #main-header,
    #main-footer {
        display: none !important;
    }
    
    #main-content {
        margin-top: 0;
        box-shadow: none;
    }
    
    .game-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ========== ダークモード対応（オプション） ========== */
@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #f0f0f0;
        --text-light: #ccc;
        --text-lighter: #999;
        --background-light: rgba(30, 30, 30, 0.95);
        --background-glass: rgba(40, 40, 40, 0.9);
    }
    
    body {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
}

/* ========== アクセシビリティ ========== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* フォーカス表示の改善 */
a:focus,
button:focus,
.game-card:focus,
.logo-emoji:focus,
.character-emoji:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ハイコントラスト対応 */
@media (prefers-contrast: high) {
    :root {
        --box-shadow: 0 0 0 2px var(--text-color);
        --box-shadow-hover: 0 0 0 3px var(--text-color);
    }
    
    .game-card {
        border: 2px solid var(--text-color);
    }
    
    .logo-emoji,
    .character-emoji {
        border: 2px solid var(--text-color);
    }
}

/* ========== カスタムプロパティの拡張用 ========== */
.customizable-section {
    background: var(--custom-background, var(--background-light));
    color: var(--custom-text-color, var(--text-color));
    padding: var(--custom-padding, 2rem);
    margin: var(--custom-margin, 1rem 0);
    border-radius: var(--custom-border-radius, var(--border-radius));
}

/* 専門職向けデザイン要素 */
.target-users {
    text-align: center;
    margin: 2rem 0;
}

.user-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.user-tag {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
}

.game-status.available {
    background: linear-gradient(45deg, var(--success-color), #38d9a9);
}

.game-status.development {
    background: linear-gradient(45deg, var(--warning-color), #ffa94d);
    color: var(--text-color);
}

.game-status.premium {
    background: linear-gradient(45deg, #9c88ff, #8c7ae6);
}

.game-card.premium {
    border: 2px solid rgba(156, 136, 255, 0.3);
}

.news-item.featured {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
}

.guideline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.guideline-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.guideline-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.safety-features {
    list-style: none;
    padding-left: 0;
}

.safety-features li {
    background: rgba(81, 207, 102, 0.1);
    margin: 0.5rem 0;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--success-color);
}