/* 基本的なリセットとフォント設定 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Hiragino Maru Gothic ProN W4', 'ヒラギノ丸ゴ ProN W4', 'Helvetica Neue', 'Yu Gothic UI', Arial, sans-serif;
    line-height: 1.6;
    color: #333333;
    background-color: #ffffff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: #f18e1d;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ヘッダー */
header {
    background-color: #ffffff;
    color: #ffffff;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgb(0 0 0 / 0.2);
    transition: transform 0.3s ease-in-out; /* アニメーションを追加 */
    transform: translateY(0); /* 初期状態（隠れていない状態） */
/*    border-bottom-color: #f18e1d; */
/*    border-bottom-width: 20px; */
}

/* ヘッダーを隠すためのクラス */
header.hide {
    transform: translateY(-100%); /* 自身の高さ分だけ上に移動させて画面外へ */
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    font-size: 2.5em; /* 大きなロゴ */
    margin: 0;
    letter-spacing: 2px;
    width: 30%;
}

.site-logo a {
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
}

.site-logo a:hover {
    color: #f0f0f0;
}

.main-nav {
    list-style: none;
    display: flex;
    gap: 30px; /* メニュー間のスペース */
}

.main-nav a {
    color: #555555;
    font-weight: bold;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s ease;
}

.main-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: #f18e1d;
    bottom: -5px;
    left: 0;
    transition: width 0.3s ease;
}

.main-nav a:hover {
    color: #f18e1d;
}

.main-nav a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none; /* PCでは非表示 */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: #555555;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

/* --- 言語切り替えボタン --- */
.language-switcher {
    display: flex;
    align-items: center;
    gap: 5px; /* ボタン間のスペース */
    margin-left: auto; /* PC表示時、ナビゲーションの右端に寄せる */
    padding-left: 10px; /* ナビゲーションとの間に少しスペース */
}

.language-switcher .lang-button {
    color: #f18e1d;
    padding: 5px 10px;
    border: 1px solid #f18e1d;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: bold;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    text-decoration: none;
}

.language-switcher .lang-button:hover {
    background-color: #f18e1d;
    border-color: #f18e1d;
    color: #fff;
}

.language-switcher .lang-button.active {
    background-color: #f18e1d; /* アクティブな言語のボタンの背景色 */
    border-color: #f18e1d;
    color: #fff; /* アクティブな言語は白文字 */
    cursor: default; /* アクティブなボタンはクリックできないように */
}

.language-switcher .lang-button.active:hover {
    background-color: #f18e1d; /* ホバーしても色が変わらないように */
    border-color: #f18e1d;
    color: #fff; /* アクティブな言語は白文字 */
}

/* ヒーローセクション */
#hero {
    background: url('../images/chidori_hero_02.png') no-repeat center center/cover;
    color: #ffffff;
    text-align: center;
    padding: 30px 20px;
    position: relative;
}

#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgb(255 255 235 / 0.7); /* オーバーレイ */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

#hero h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #555555;
/*    text-shadow: 2px 2px 4px rgb(102 102 102 / 0.9); */
}

#hero p {
    font-size: 1.3em;
    max-width: 700px;
    margin: 0 auto;
    color: #555555;
/*    text-shadow: 1px 1px 2px rgb(102 102 102); */
}

/* 各セクション共通 */
.section-padding {
    padding: 80px 0;
}

.section-padding h2 {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 50px;
    color: #555555;
    position: relative;
    padding-bottom: 15px;
}

.section-padding h2::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 60px;
    height: 4px;
    background-color: #f18e1d;
    border-radius: 2px;
}

.bg-light {
    background-color: #f9f9f9;
}

/* ゲーム一覧 */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    justify-content: center; /* 中央寄せ */
}

.game-tile {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgb(0 0 0 / 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
    padding-bottom: 20px;
}

.game-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgb(0 0 0 / 0.15);
}

.game-tile img {
/*    width: 100%;
    height: 200px; */ /* 固定高さ */
    max-width: 100%;
    height: auto;
    object-fit: cover; /* 画像を中央で切り抜き */
    border-bottom: 1px solid #eeeeee;
}

.game-tile h3 {
    margin: 20px 15px 0;
    font-size: 2.0em;
    color: #555555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ニュース・Note記事 */
.news-list, .note-list {
    display: grid;
    gap: 30px;
}

.news-item, .note-item {
    background-color: #ffffff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-item:hover, .note-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 12px rgb(0 0 0 / 0.12);
}

.news-item h3, .note-item h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.news-item h3 a, .note-item h3 a {
    color: #555555;
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-item h3 a:hover, .note-item h3 a:hover {
    color: #f18e1d;
    text-decoration: underline;
}

.news-item time, .note-item time {
    display: block;
    font-size: 0.9em;
    color: #777777;
    margin-bottom: 15px;
}

.news-item p, .note-item p {
    font-size: 1.05em;
    color: #555555;
}

/* --- その他のNote記事へのリンク --- */
.note-more-link {
    text-align: center; /* リンクを中央揃えにする */
    margin-top: 40px; /* Note記事リストとの間に余白を確保 */
}

.note-more-link a {
    display: inline-block;
    padding: 10px 20px;
    border: 2px solid #333; /* 枠線でボタンのような見た目に */
    color: #333;
    font-weight: bold;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.note-more-link a:hover {
    background-color: #333;
    color: #fff; /* ホバーで背景が濃くなり、文字が白に */
    text-decoration: none;
}

.note-more-link a span {
    margin-right: 5px; /* テキストと矢印の間の余白 */
}

/* フッター */
footer {
    background-color: #f18e1d;
    color: #ffffff;
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
    font-size: 0.9em;
}

.footer-social {
    display: flex; /* 子要素（リンク画像）を横並びにする */
    gap: 15px; /* ソーシャルアイコン間の隙間。必要に応じて調整 */
    flex-wrap: wrap; /* アイコンが増えて幅が足りなくなった場合に改行 */
    justify-content: center; /* アイコンを中央寄せにする */
}

footer .container {
    display: flex; /* Flexboxを有効化 */
    flex-direction: column; /* 縦方向に並べる */
    align-items: center; /* 水平方向の中央揃え */
    gap: 15px; /* 要素間の隙間 */
}

.footer-social a {
    display: block; /* imgを囲むaタグ */
    line-height: 0; /* 余計な空白をなくす */
}

.footer-social img {
    width: 30px; /* アイコンのサイズ */
    height: 30px;
    transition: transform 0.3s ease;
    border-radius: 4px;
}

.footer-social img:hover {
    transform: translateY(-3px); /* ホバーで少し浮き上がる */
}

/* --- ページトップへ戻るボタン --- */
.back-to-top {
    position: fixed; /* 画面に固定 */
    bottom: 30px; /* 下からの位置 */
    right: 30px; /* 右からの位置 */
    display: none; /* 初期状態では非表示 */
    z-index: 999; /* 他の要素より手前に表示 */
    opacity: 0.8; /* 透過度 */
    transition: opacity 0.3s ease, transform 0.3s ease; /* ホバー時のアニメーション */
    border-radius: 50%; /* 正円にする（画像が正方形の場合に適用） */
    overflow: hidden; /* 角丸からはみ出る部分を隠す */
    box-shadow: 0 4px 8px rgba(0,0,0,0.2); /* 影で立体感を出す */
}

.back-to-top:hover {
    opacity: 1; /* ホバーで透過度を上げる */
    transform: translateY(-3px); /* 少し上に動かす */
}

.back-to-top img {
    display: block; /* 画像をブロック要素にして余白をなくす */
    width: 60px; /* ボタンの幅を調整 */
    height: 60px; /* ボタンの高さを調整 */
    object-fit: contain; /* 画像がはみ出さないように調整 */
    /* 背景が透過画像なら、背景色を付けることも可能 (例: background-color: rgba(0,0,0,0.5); ) */
}

/* セクション別の背景色指定 */
section.cobaan {
    background-color: #000033;
}

section.wabisaby {
    background-color: #999933;
}

/* ゲーム詳細ページの追加スタイル */
#game-detail .game-title {
    text-align: center;
    font-size: 5em;
    margin-bottom: 40px;
    color: #ffffff;
}

#game-detail .game-subtitle {
    text-align: center;
    font-style: italic;
    font-size: 1.5em;
    margin-bottom: 40px;
    color: #ffffff;
}

.game-header-image {
    margin-bottom: 40px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    width: 100%; /* 親の.containerの幅に合わせる */
    display: flex; /* 画像を中央寄せにするためにFlexboxを有効にする */
    justify-content: center; /* Flexboxで子要素（画像）を水平方向中央に配置 */
    align-items: center; /* 必要であれば、垂直方向中央にも配置（画像が親より小さい場合） */
    background-color: #ffffff;
}

.game-header-image img {
    max-width: 100%; /* 親要素の幅を超えないようにする */
    height: auto;
    display: block; /* imgがインライン要素なので、blockにして余計な余白をなくす */
    /* width: 1160px; などの固定幅指定は、HTMLのimgタグから削除するか、
       このCSSルールより詳細度の低い場所に移すことを推奨します。
       もし固定幅を指定したい場合は、max-widthと併用してください。 */
}

.game-info, .game-rules, .game-resources {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.game-info h3, .game-rules h3, .game-resources h3 {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: #333333;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.game-info p, .game-rules p, .game-resources ul {
    line-height: 1.8;
}

.game-info ul {
    padding-inline-start: 50px;
}

.game-info p, .game-rules div.game-ruleblock {
    font-size: 1.1em;
}

.game-ruleblock, .game-infoblock {
    padding: 15px 5px;
}

.game-ruleblock b {
    color: #ff0000;
}

.game-ruleblock p {
    padding-bottom: 0.8em;
}

.game-images {
    list-style: none;
}

.game-resources ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.game-resources .button {
    display: inline-block;
    background-color: #007bff;
    color: #ffffff;
    padding: 12px 25px;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-weight: bold;
    text-align: center;
}

.game-resources .button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    text-decoration: none;
}

/* --- スクロールアンカーの調整 --- */
/* 特定のセクションタイトルにのみ適用したい場合（より詳細なコントロール） */
#games,
#news,
#note,
#about {
    scroll-margin-top: 30px; /* ヘッダーの高さ+余裕を持たせたピクセル数 */
}