/* --- Color Palette --- */
:root {
    --cream: #fffef2;
    --green-soft: #f1f8e9;
    --green-main: #81c784;
    --green-dark: #388e3c;
    --pink-accent: #ffb7c5;
    --pink-soft: #fff0f3;
    --text: #2c3e2c;
    --white: #ffffff;
    --yt-red: #ff0000;
}

/* --- Base --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { 
    font-family: 'Noto Sans JP', sans-serif; 
    background: var(--cream); 
    color: var(--text);
    line-height: 1.8;
    overflow-x: hidden;
}
.content-limit { max-width: 1100px; margin: 0 auto; padding: 0 5%; }
.section { padding: 100px 0; }

.green-soft-bg { background: var(--green-soft); }
.green-bg { background: var(--green-dark); color: white; }
.white-bg { background: white; }
.cream-bg { background: var(--cream); }

/* --- Header --- */
header { 
    background: rgba(255, 255, 255, 0.95); 
    backdrop-filter: blur(10px);
    position: sticky; top: 0; z-index: 1000; padding: 15px 0;
    border-bottom: 3px solid var(--green-soft);
}
.navbar { display: flex; justify-content: space-between; align-items: center; }
.logo { font-family: 'Montserrat', sans-serif; font-size: 1.6rem; font-weight: 900; color: var(--green-dark); }
.logo span { color: var(--pink-accent); }
.nav-links { display: flex; gap: 20px; list-style: none; }
.nav-links a { text-decoration: none; color: var(--text); font-weight: 700; font-size: 0.9rem; transition: 0.3s; }
.nav-links a:hover { color: var(--green-main); }
.discord-btn { 
    background: var(--green-main); color: white; text-decoration: none;
    padding: 10px 22px; border-radius: 50px; font-weight: 900;
    box-shadow: 0 5px 15px rgba(129, 199, 132, 0.4); transition: 0.3s;
}
.discord-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(129, 199, 132, 0.6); }

/* --- Hero --- */
.hero { min-height: 90vh; display: flex; align-items: center; text-align: center; position: relative; }
.hero-bg-shapes .shape { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.4; z-index: 0; }
.s1 { width: 400px; height: 400px; background: var(--green-soft); top: -10%; right: -5%; }
.s2 { width: 300px; height: 300px; background: var(--pink-soft); bottom: -5%; left: -5%; }

.hero-inner { position: relative; z-index: 1; width: 100%; }
.status-badge { display: inline-block; padding: 5px 15px; background: white; border-radius: 50px; font-weight: 900; font-size: 0.8rem; border: 2px solid var(--green-main); margin-bottom: 20px; }
.pulse { display: inline-block; width: 8px; height: 8px; background: #2ecc71; border-radius: 50%; margin-right: 8px; animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.3; } 100% { opacity: 1; } }

.main-title { font-family: 'Montserrat', sans-serif; font-size: clamp(3.5rem, 12vw, 6.5rem); line-height: 1; margin-bottom: 20px; }
.main-title span { color: var(--pink-accent); }
.hero-tag { font-weight: 900; color: var(--green-dark); letter-spacing: 2px; }

/* --- IP Sections --- */
.ip-section { margin-top: 50px; }
.copy-card { 
    background: white; padding: 40px; border-radius: 30px; cursor: pointer;
    box-shadow: 0 20px 40px rgba(0,0,0,0.05); transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 3px solid transparent;
}
.copy-card:hover { transform: scale(1.02); border-color: var(--green-main); }
.edition-tag { background: var(--green-soft); color: var(--green-dark); padding: 5px 15px; border-radius: 8px; font-weight: 900; font-size: 0.8rem; }
.ip-display { font-size: clamp(1.2rem, 5vw, 2.5rem); font-weight: 900; margin: 20px 0; color: var(--green-dark); }
.btn-copy { color: var(--green-main); font-weight: 900; text-decoration: underline; }

.be-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.be-card { 
    background: white; padding: 25px; border-radius: 20px; cursor: pointer; border: 2px solid #eee; transition: 0.3s;
}
.be-card:hover { border-color: var(--green-main); background: var(--green-soft); }
.be-card strong { display: block; font-size: 1.3rem; margin-top: 5px; color: var(--green-dark); }
.copy-hint { font-size: 0.7rem; color: #bbb; font-weight: 900; }

/* --- YouTube Buttons --- */
.yt-container { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 50px; }
.yt-btn-giant { 
    display: flex; align-items: center; background: white; padding: 30px; 
    border-radius: 30px; text-decoration: none; border: 3px solid #eee;
    transition: 0.4s; position: relative; overflow: hidden;
}
.yt-icon-box { 
    width: 80px; height: 80px; background: #f5f5f5; border-radius: 20px;
    display: flex; align-items: center; justify-content: center; font-size: 3rem; color: var(--yt-red); transition: 0.4s;
}
.yt-info { margin-left: 20px; text-align: left; }
.yt-badge { display: inline-block; font-size: 0.7rem; font-weight: 900; color: white; background: var(--yt-red); padding: 2px 10px; border-radius: 4px; margin-bottom: 5px; }
.yt-name { display: block; font-size: 1.4rem; color: var(--text); font-weight: 900; }

.yt-btn-giant:hover { transform: translateY(-10px); border-color: var(--yt-red); box-shadow: 0 15px 35px rgba(255,0,0,0.1); }
.yt-btn-giant:hover .yt-icon-box { background: var(--yt-red); color: white; transform: rotate(-10deg) scale(1.1); }

/* --- ★ NEW: お知らせセクション (News) ★ --- */
.news-grid {
    display: grid;
    grid-template-columns: 1fr; 
    gap: 20px;
    margin-top: 40px;
}
.news-item {
    background: white;
    padding: 30px 40px;
    border-radius: 25px;
    border-left: 8px solid var(--green-main);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}
.news-item:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    border-left-color: var(--pink-accent);
}
.news-date {
    font-size: 0.95rem; /* 日付の大きさ調整 */
    font-weight: 900;
    color: #888;
    margin-bottom: 8px;
}
.news-text {
    font-size: 1.2rem; /* 内容の大きさ調整 */
    font-weight: 700;
    color: var(--text);
}

/* --- ★ REVISED: 近日公開セクション (Upcoming) ★ --- */
.grid-2-center {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    max-width: 850px; /* 2枚が綺麗に見える幅に制限 */
    margin: 0 auto;
}

/* --- Server List & Cards --- */
.sec-title { text-align: center; font-size: 2.5rem; font-weight: 900; margin-bottom: 60px; }
.en-sub { display: block; font-family: 'Montserrat', sans-serif; font-size: 0.9rem; color: var(--pink-accent); letter-spacing: 3px; margin-top: 5px; }
.white .en-sub { color: var(--green-soft); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.card-item { 
    background: white; padding: 50px 30px; border-radius: 40px; text-align: center; 
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1); 
    position: relative; overflow: hidden; color: var(--text); border: 2px solid transparent;
}
#servers .card-item:hover {
    transform: translateY(-15px) scale(1.03);
    border-color: var(--pink-accent);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
    background: linear-gradient(180deg, #ffffff 0%, var(--pink-soft) 100%);
}
.hover-up:hover { transform: translateY(-20px); box-shadow: 0 25px 50px rgba(0,0,0,0.1); }

.card-icon { width: 80px; height: 80px; margin: 0 auto 25px; border-radius: 25px; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; transition: 0.3s; }
.card-icon.green { background: var(--green-soft); color: var(--green-dark); }
.card-icon.pink { background: var(--pink-soft); color: var(--pink-accent); }
.card-label, .card-category { font-weight: 900; font-size: 0.7rem; letter-spacing: 2px; padding: 4px 15px; border-radius: 5px; margin-bottom: 10px; display: inline-block; }
.card-label { background: #eee; color: #999; }
.card-category { background: var(--pink-soft); color: var(--pink-accent); }

.card-list { list-style: none; text-align: left; margin-top: 20px; }
.card-list li { font-size: 0.9rem; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; }
.card-list li::before { content: '✓'; color: var(--green-main); font-weight: 900; margin-right: 10px; }

/* --- Staff Section --- */
.role-badge { display: inline-block; padding: 6px 18px; border-radius: 8px; font-weight: 900; font-size: 0.8rem; color: white; margin-bottom: 20px; }
.r-owner { background: var(--pink-accent); }
.r-admin { background: #f39c12; }
.r-mod { background: var(--green-main); }
.r-prog { background: #27ae60; }
.r-dev { background: #2980b9; }
.r-build { background: #8e44ad; }

.staff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 40px; }
.staff-flex { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 15px; margin-bottom: 40px; }
.staff-card { background: var(--green-soft); padding: 25px; border-radius: 20px; border-left: 6px solid var(--green-main); transition: 0.3s; }
.staff-card:hover { transform: translateX(10px); background: white; box-shadow: 0 10px 20px rgba(0,0,0,0.05); }
.prem { border-left-color: var(--pink-accent); background: #fffcf5; }

/* --- Policies --- */
.legal-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.legal-box { background: white; padding: 40px; border-radius: 30px; }
.scroll-area { height: 350px; overflow-y: auto; padding-right: 15px; font-size: 0.85rem; color: #555; }
.scroll-area h4 { margin: 25px 0 10px; color: var(--green-dark); border-bottom: 2px solid var(--green-soft); }

/* --- Toast Animation --- */
#toast-container { position: fixed; top: 30px; right: 30px; z-index: 9999; }
.toast { 
    background: #333; color: white; padding: 18px 30px; border-radius: 20px;
    font-weight: 900; margin-bottom: 10px; box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    transform: translateX(150%) rotate(15deg); 
    opacity: 0; 
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
    display: flex; align-items: center; gap: 12px;
}
.toast.show { transform: translateX(0) rotate(0deg); opacity: 1; }
.toast.exit { 
    transform: translateY(-50px) scale(0.9); 
    opacity: 0; 
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.toast i { color: var(--green-main); font-size: 1.2rem; }

.footer { padding: 60px 0; text-align: center; color: #999; font-weight: 700; }

/* --- Responsive --- */
@media (max-width: 900px) {
    .grid-3, .yt-container, .legal-wrap, .be-grid, .staff-grid, .grid-2-center { grid-template-columns: 1fr; }
    .nav-links { display: none; }
}

/* --- Server Status Styles --- */
.status-badge.offline {
    border-color: #e74c3c !important;
    color: #e74c3c !important;
}
.status-badge.offline .pulse {
    background: #e74c3c !important;
    animation: none !important;
    opacity: 0.6;
}
.status-badge.online {
    border-color: var(--green-main) !important;
    color: var(--green-dark) !important;
}
#player-count {
    font-size: 0.85rem;
    font-weight: 900;
}

/* --- Wikiを中央に寄せるための設定 --- */
.grid-1-center {
    display: flex;
    justify-content: center;
    margin: 0 auto;
}

/* モバイル表示（画面が狭い時）の調整 */
@media (max-width: 900px) {
    .grid-1-center {
        display: block; /* スマホでは横幅いっぱいに */
    }
}

/* --- サーバーの魅力セクションの調整 --- */
#features {
    background-color: var(--green-soft); /* 背景を少し色付きに */
}

#features .card-item {
    background: white;
    border: 2px solid rgba(129, 199, 132, 0.2); /* 薄い緑の枠線 */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); /* 影を少し濃く */
    transition: all 0.3s ease;
}

#features .card-item:hover {
    border-color: var(--pink-accent); /* ホバー時に枠の色を変える */
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* --- ヘッダーを1列に収めるための調整 --- */

/* 1. 全体の横幅制限を広げる */
header .content-limit {
    max-width: 1300px; /* 1100pxから拡張 */
}

/* 2. ロゴとメニューの間隔を最大まで広げる */
.navbar {
    justify-content: space-between;
}

/* 3. メニュー同士の隙間を少し詰める */
.nav-links {
    gap: 12px; /* 20pxから12pxに凝縮 */
}

/* 4. メニューの文字サイズを少しだけ小さくする(1列に収めるため) */
.nav-links a {
    font-size: 0.85rem;
}

/* 5. ロゴをより左端へ */
.logo {
    margin-right: auto;
    padding-right: 20px;
}

/* --- ヘッダーのレイアウト再調整 --- */

/* 1. ヘッダーだけ横幅の制限を解除して広々させる */
header .content-limit {
    max-width: 95%; /* 画面の端から端まで広く使う */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 2. メニュー同士の間隔をゆったり戻す */
.nav-links {
    gap: 18px; /* 12pxから18pxに広げて読みやすく */
    margin-left: 20px;
    margin-right: 20px;
    flex-wrap: nowrap; /* 絶対に折り返さない */
}

/* 3. 文字サイズを標準に戻す */
.nav-links a {
    font-size: 0.9rem;
    white-space: nowrap; /* 文字が途中で改行されるのを防ぐ */
}

/* 4. Discordボタンが大きすぎて圧迫している場合は少し調整 */
.discord-btn {
    padding: 8px 18px;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* ==========================================
   Wikiセクション用の追加デザイン
   ========================================== */

/* 1. ヘッダーのWikiボタン */
.nav-btn {
    padding: 8px 18px;
    text-decoration: none;
    color: #333;
    font-weight: bold;
    border: 1.5px solid #333;
    border-radius: 6px;
    margin-left: 15px;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: #333;
    color: #fff;
}

/* 2. メインページのWiki紹介セクション */
#wiki-section {
    background-color: #ffffff; /* 白背景 */
    padding: 80px 20px;
    text-align: center;
}

#wiki-section h2 {
    font-size: 2rem;
    color: #1a1a1a;
    margin-bottom: 40px;
}

/* 3. プレビューカード（省略されたWiki） */
.wiki-card {
    max-width: 600px;
    margin: 0 auto 30px;
    padding: 25px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.wiki-card h3 {
    margin-top: 0;
    font-size: 1.3rem;
}

.wiki-card p {
    color: #666;
    line-height: 1.6;
}

/* 4. 「詳しく見る」リンク */
.detail-link {
    display: inline-block;
    margin-top: 10px;
    color: #000;
    text-decoration: none;
    font-weight: bold;
    border-bottom: 2px solid #000;
}

/* 5. セクション一番下の「Wikiを見る」ボタン */
.big-wiki-button {
    display: inline-block;
    margin-top: 20px;
    padding: 16px 50px;
    background-color: #000; /* 黒系 */
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    transition: transform 0.2s;
}

.big-wiki-button:hover {
    transform: scale(1.05);
    background-color: #333;
}

/* --- [1] テーマの変数定義 --- */
:root {
    --header-bg: rgba(255, 255, 255, 0.8); /* 半透明の白 */
    --header-text: #333333;
    --blur-amount: 10px; /* 磨りガラス効果の強さ */
}

[data-theme="dark"] {
    --header-bg: rgba(26, 26, 26, 0.8); /* 半透明の黒 */
    --header-text: #ffffff;
}

/* --- [2] ヘッダーのデザイン修正 --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--header-bg);
    backdrop-filter: blur(var(--blur-amount)); /* 背景をぼかす（おしゃれ！） */
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s, color 0.3s;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

/* リンクの文字色 */
.nav-links a {
    color: var(--header-text);
    text-decoration: none;
    transition: 0.3s;
}

/* モード切り替えアイコンの色 */
.header-theme-btn i {
    color: var(--header-text);
}

/* ナビバーの中身を調整 */
.navbar.content-limit {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 20px; /* 上下を 15px → 8px に減らして短くします */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ロゴのサイズが大きすぎてヘッダーを押し広げている場合は、ここも調整 */
.logo {
    font-size: 1.2rem; /* 少し小さくするとさらに短くなります */
}

/* メインコンテンツ全体をヘッダーの分だけ下に下げる */
body {
    padding-top: 60px; /* ヘッダーの高さに合わせて調整（例: 60px 〜 70px） */
}

/* または、最初のセクション（hero）に余白を作る */
.hero {
    padding-top: 80px; 
}

/* ナビバー全体のレイアウト */
.navbar.content-limit {
    max-width: 1200px; /* 前に調整した幅 */
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between; /* これで左と右に分かれる */
    align-items: center;
}

/* ロゴとリンクの並びを微調整 */
.nav-left-group {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 20px;
}

/* 右側のボタンエリア */
.header-controls {
    display: flex;
    align-items: center;
}

/* Discordボタンの元のデザインとアニメーション */
.discord-btn {
    background-color: #5865f2; /* Discordブルー */
    color: #ffffff !important;   /* 文字色を白に固定 */
    padding: 8px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease; /* アニメーションの速度 */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ホバーアニメーションを元に戻す */
.discord-btn:hover {
    background-color: #4752c4;   /* 少し濃い青に */
    color: #ffffff !important;   /* ホバー時も白を維持 */
    transform: translateY(-3px); /* 上に少し浮き上がる */
    box-shadow: 0 6px 12px rgba(88, 101, 242, 0.3); /* 青い影を強調 */
}

/* クリックした瞬間の動き */
.discord-btn:active {
    transform: translateY(-1px);
}

/* テーマ切り替えボタンの強化デザイン */
.header-theme-btn {
    background: var(--card-bg) !important; /* 背景色を持たせる */
    color: var(--text-color);
    border: 1px solid var(--border-color) !important;
    padding: 10px;
    border-radius: 12px; /* 少し角丸に */
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* 影の設定 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    
    transition: all 0.3s ease;
    width: 42px;  /* サイズを固定して形を整える */
    height: 42px;
}

/* ホバー時の動き */
.header-theme-btn:hover {
    transform: translateY(-2px); /* 少し浮かせる */
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    background: var(--nav-hover) !important;
}

/* ダークモード時の影の調整（少し強くする） */
[data-theme="dark"] .header-theme-btn {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    background: #3d3d3d !important;
}

/* 検索結果パネル内のアイテムデザイン */
.search-result-item {
    display: block !important;
    padding: 10px !important;
    border-radius: 8px;
    text-decoration: none !important;
    color: var(--text-color) !important;
    transition: 0.2s;
    margin-bottom: 5px;
    border-left: 3px solid transparent;
}

.search-result-item:hover {
    background: var(--nav-hover);
    border-left: 3px solid #ffcc00; /* 黄色のアクセント線 */
}

/* 検索ワードと一致した太字部分の色 */
.search-result-item b {
    color: #ffcc00;
    font-weight: bold;
    text-decoration: underline;
}

.result-category {
    font-size: 0.65rem;
    color: #ffcc00;
    font-weight: bold;
    display: block;
    margin-bottom: 2px;
    text-transform: uppercase;
}

/* ナビバーを確実に左右いっぱいに使う設定 */
.navbar.content-limit {
    width: 100%;
    max-width: 1400px; /* 最大幅を少し広げて余裕を持たせる */
    padding: 10px 20px;
    box-sizing: border-box;
}

/* 文字リンクが勝手に中央に行かないようにする */
.nav-left-group {
    flex: 1; /* 左側が可能な限り広がるようにする */
    justify-content: flex-start;
}

/* 右側のボタン群が潰れないように固定 */
.header-controls {
    display: flex;
    justify-content: flex-end;
}

/* リンクの文字サイズを微調整（はみ出し防止） */
.nav-links a {
    font-size: 0.85rem;
    white-space: nowrap; /* 途中で改行させない */
}
