:root {
    --chalkboard-green: #2a5b45;
    --wood-brown: #8B4513;
    --wood-light: #D2B48C;
    --accent-yellow: #FFD700;
}

/* 共通インナーコンテナ */
.section-inner {
    width: 100%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
}

@media (min-width: 1200px) {
    .section-inner {
        max-width: 1100px;
    }
}

/* body設定 - 英語版フォント変更のみ */
body {
    font-family: 'Helvetica Neue', Helvetica, Arial, 'Segoe UI', sans-serif;
    background: #f8f4e6;
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ヘッダーバナー */
.header-banner {
    width: 100%;
    padding: 0;
    background: #4a9e81;
    overflow: hidden;
}

.header-content {
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-content img {
    width: 100%;
    height: auto;
    display: block;
}

/* スティッキーナビ */
.sticky-menu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    background: var(--wood-brown);
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 0.5rem 1rem;
}

.nav-link {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #fff;
    white-space: nowrap;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--accent-yellow);
}

.btn-yellow {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--accent-yellow);
    color: #333;
    padding: 0.85rem 2rem;
    border-radius: 9999px;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s;
    font-size: 1.1rem;
}

.btn-yellow:hover {
    transform: translateY(-2px);
}

/* 木枠フレーム（見出し） */
.wood-frame {
    width: 100%;
    background: var(--wood-brown);
    border: 4px solid var(--wood-light);
    border-radius: 8px;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 1.1rem 1.3rem;
    margin-bottom: 1rem;
    box-sizing: border-box;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 1.25rem;
}

.wood-frame img {
    height: 3.3rem;
}

.lesson-header {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--wood-brown);
    padding: 8px 16px;
    border-radius: 8px 8px 0 0;
    font-weight: bold;
    color: #fff;
    display: inline-flex;
    align-items: center;
    margin-bottom: -1px;
}

/* チョークボード風カード（本文ボックス） */
.chalkboard {
    width: 100%;
    background: var(--chalkboard-green);
    border: 12px solid var(--wood-brown);
    border-radius: 8px;
    position: relative;
    color: #f5f5f5;
    box-shadow: 0 10px 15px rgba(0,0,0,0.3);
    overflow: hidden;
    margin-bottom: 2rem;
    padding: 2.8rem 2.2rem;
    box-sizing: border-box;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    isolation: isolate;
}

.chalkboard::before {
    content:'';
    position:absolute; top:0; left:0; right:0; bottom:0;
    background-image:
        linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size:20px 20px;
    pointer-events:none;
}

.chalk-title {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.4);
}

.chalk-text {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* 吹き出し */
.character-bubble,
.character-bubble-right {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    color: #333;
    position: relative;
    margin-bottom: 1rem;
    max-width: 330px;
    font-size: 1rem;
}

.character-bubble::after,
.character-bubble-right::after {
    display: none;
}

/* キャラクター会話 */
.character-dialog {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.character-dialog img {
    width: 64px;
}

/* エコシステム・機能ボックス */
.feature-box {
    background: rgba(42,91,69,0.8);
    border-radius: 8px;
    padding: 16px;
    transition: transform 0.2s;
}

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

.feature-box h4 {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* フッター */
footer, footer p, footer a {
    color: #333 !important;
}

footer {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    padding-top: 1rem;
    padding-bottom: 1rem;
    background: var(--wood-brown);
}

footer h3, footer h4 {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.bg-wood-brown {
    background: var(--wood-brown);
}

.border-wood-light {
    border-color: var(--wood-light);
}

/* ========== LIFE Walletページ用 追加スタイル ========== */
.wallet-features-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fit,minmax(280px,1fr));
    gap: 1.5rem;
}

.wallet-feature-card {
    background: rgba(255,255,255,0.1); 
    border-radius: 8px;
    padding: 1.5rem; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform .3s,box-shadow .3s;
}

.wallet-feature-card:hover {
    transform: translateY(-10px); 
    box-shadow: 0 12px 16px rgba(0,0,0,0.3);
}

.feature-icon { 
    font-size: 2.5rem; 
    color: var(--accent-yellow); 
    margin-bottom: 1rem; 
}

.download-btn {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--accent-yellow); 
    color: #333; 
    font-weight: bold;
    padding: 1rem 2rem; 
    border-radius: 50px; 
    display: inline-block;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3); 
    transition: transform .3s,box-shadow .3s;
}

.download-btn:hover {
    transform: translateY(-5px); 
    box-shadow: 0 8px 15px rgba(0,0,0,0.4);
}

.screenshot-container {
    border: 8px solid var(--wood-light); 
    border-radius: 16px;
    overflow: hidden; 
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.screenshot-container img { 
    width: 100%; 
    height: auto; 
    display: block; 
}

.qr-badge {
    background: #fff; 
    border-radius: 16px; 
    padding: 1rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* メインコンテナ */
.main-max {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* 3ステップの配置を統一 */
.step-container {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.step-number {
    flex-shrink: 0;
    width: 4rem;
    height: 4rem;
    background-color: #fbbf24;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 1.5rem;
    font-weight: bold;
    color: #065f46;
    margin-top: 0.25rem;
}

.step-content {
    flex: 1;
    padding-top: 0;
}

.step-content h4 {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.step-content p {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* 英語版専用言語切り替え */
.language-switcher {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 200;
    display: flex;
    gap: 0.5rem;
    background: rgba(139, 69, 19, 0.9);
    padding: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.lang-link, .lang-current {
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
}

.lang-link {
    color: #fff;
    background: transparent;
}

.lang-link:hover {
    background: rgba(255, 215, 0, 0.2);
    color: #FFD700;
}

.lang-current {
    background: #FFD700;
    color: #333;
    font-weight: bold;
}

/* ========== 星屑エフェクト用スタイル（改良版） ========== */
.starfield-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.8;
    will-change: auto;
    transform: translateZ(0);
}

/* タッチ時の視覚フィードバック - より洗練されたデザイン */
.touch-ripple {
    position: fixed;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(255, 215, 0, 0.8) 0%,
        rgba(255, 215, 0, 0.4) 30%,
        rgba(255, 215, 0, 0) 70%
    );
    pointer-events: none;
    z-index: 2;
    animation: ripple-expand 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    box-shadow:
        0 0 20px rgba(255, 215, 0, 0.5),
        0 0 40px rgba(255, 215, 0, 0.3);
}

@keyframes ripple-expand {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        transform: scale(2);
        opacity: 0.8;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* より美しい星屑パーティクル */
.star-particle {
    position: fixed;
    pointer-events: none;
    z-index: 1;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        var(--accent-yellow) 0%,
        rgba(255, 215, 0, 0.6) 50%,
        transparent 70%
    );
    box-shadow:
        0 0 6px var(--accent-yellow),
        0 0 12px rgba(255, 215, 0, 0.5);
    animation: twinkle 2s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* 流れ星エフェクトの改良 */
.shooting-star {
    position: fixed;
    pointer-events: none;
    z-index: 1;
    width: 3px;
    height: 3px;
    background: var(--accent-yellow);
    border-radius: 50%;
    box-shadow:
        0 0 8px var(--accent-yellow),
        0 0 16px var(--accent-yellow),
        0 0 24px rgba(255, 215, 0, 0.8);
}

.shooting-star::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 100%;
    width: 200px;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 215, 0, 0.8) 20%,
        var(--accent-yellow) 100%
    );
    transform: translateY(-50%);
    border-radius: 1px;
}

/* 星屑専用のオーバーレイエリア */
.starfield-overlay {
    position: absolute;
    top: -30px;
    left: -30px;
    right: -30px;
    bottom: -30px;
    pointer-events: none;
    z-index: 10;
    border-radius: inherit;
    overflow: visible;
}

/* タッチエリアの最適化 */
.interactive-element {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* パフォーマンス最適化のための追加スタイル */
.performance-optimized {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* PCでの表示最適化 */
@media (min-width: 768px) {
    .step-container {
        align-items: flex-start;
        gap: 2rem;
    }

    .step-number {
        width: 5rem;
        height: 5rem;
        font-size: 2rem;
        margin-top: 0.125rem;
    }
}

/* レスポンシブ調整 */
@media (max-width: 1024px) {
    .main-max, .chalkboard {
        max-width: 98vw;
        padding: 1.2rem 0.4rem;
    }
}

@media (max-width: 700px) {
    .section-inner {
        max-width: 100vw;
        padding-left: 0.4rem;
        padding-right: 0.4rem;
    }

    .wood-frame, .chalkboard {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .language-switcher {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.3rem;
    }

    .lang-link, .lang-current {
        padding: 0.2rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* 低電力モード対応 */
@media (prefers-reduced-motion: reduce) {
    .starfield-canvas,
    .touch-ripple,
    .star-particle,
    .shooting-star {
        animation: none !important;
        transition: none !important;
    }

    .starfield-canvas {
        opacity: 0.3;
    }
}

/* 高解像度ディスプレイ対応 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    .touch-ripple {
        background: radial-gradient(
            circle,
            rgba(255, 215, 0, 0.9) 0%,
            rgba(255, 215, 0, 0.5) 30%,
            rgba(255, 215, 0, 0) 70%
        );
    }
}

/* ダークモード対応（将来拡張用） */
@media (prefers-color-scheme: dark) {
    .starfield-canvas {
        opacity: 0.9;
    }

    .touch-ripple {
        background: radial-gradient(
            circle,
            rgba(255, 255, 255, 0.6) 0%,
            rgba(255, 255, 255, 0.3) 30%,
            rgba(255, 255, 255, 0) 70%
        );
    }
}

/* 英語版専用のフォント最適化 */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* アクセシビリティ用のスキップリンク */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    transition: top 0.3s;
}

.skip-to-main:focus {
    top: 6px;
}

.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;
}