/* front/css/home.css */
/* 基本的なリセット */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Hiragino Sans', 'Noto Sans CJK JP', sans-serif;
    background-color: #000;
    color: white;
    overflow: hidden; /* スクロールバーを非表示に */
}

/* Three.jsのキャンバスを配置するコンテナ */
#canvas-container {
    position: fixed; /* 全画面表示の基準 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* UIより下に配置 */
}

/* UI要素の共通スタイル */
.ui-button {
    background-color: rgba(255, 255, 255, 0.7); /* ★ 白ベースに変更 */
    backdrop-filter: blur(5px);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer; /* カーソルをポインターに */
    transition: background-color 0.2s; /* スムーズな色の変化 */
}
.ui-text {
    background-color: rgba(30, 30, 30, 0.7); /* 半透明の背景 */
    backdrop-filter: blur(5px);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}


.ui-button:hover {
    background-color: rgba(255, 255, 255, 0.9); /* ★ ホバー時も白ベース */
}

/* UIの配置 */
.ui-top-left {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 2; /* キャンバスより上 */
}

/* ▼▼▼ 右上ボタンコンテナのスタイル ▼▼▼ */
.ui-top-right {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 20; /* メニューが他の要素より上に来るように */
}

/* ▼▼▼ ハンバーガーメニュー関連のスタイル (追加・変更) ▼▼▼ */
.menu-container {
    position: relative;
    display: inline-block;
}

#menu-btn {
    width: 60px;
    height: 60px;
    padding: 0;
    background-color: #170633; /* 濃い紺色/紫色 */
    border-radius: 10px; /* 角丸四角形 */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s;
    backdrop-filter: none; /* ガラス効果は解除 */
    color: white;
    border: 2px solid white; /* 白い枠線を追加 */
}

#menu-btn:hover {
    background-color: #403d61; /* ホバー色 */
}

#menu-btn svg {
    stroke: white; /* 線を白に */
    width: 32px;
    height: 32px;
    stroke-width: 2;
}

/* ドロップダウンメニュー */
.menu-dropdown {
    display: none;
    position: absolute;
    top: 70px; /* ボタンの下 */
    right: 0;
    background-color: rgba(23, 6, 51, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    min-width: 140px;
    flex-direction: column;
    z-index: 21;
}

.menu-dropdown.is-visible {
    display: flex;
}

.menu-item {
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s;
    text-align: center;
    white-space: nowrap;
    font-weight: bold;
}

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

.menu-item:hover {
    background-color: #403d61;
}
/* ▲▲▲ 追加・変更ここまで ▲▲▲ */


.ui-bottom-left {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 2;
}

.ui-bottom-right {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2;
    background-color: rgba(0, 0, 0, 0.5); /* こちらは少し暗く */
}

/* front/css/home.css */

/* --- 惑星選択モーダル（全体） --- */
#select-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 20, 0.6); /* 少し青みがかった背景 */
    backdrop-filter: blur(8px);
    z-index: 10;

    display: flex; /* Flexboxで中央揃え */
    flex-direction: column; /* ★ 変更: 縦並びに変更 */
    justify-content: center;
    align-items: center;
    gap: 50px; /* ★ 追加: 上の2つのボタンと下のボタンの間隔 */

    /* 表示・非表示のアニメーション */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
}

#select-modal.is-visible {
    opacity: 1;
    visibility: visible;
}

/* --- ボタン3つを横に並べるコンテナ --- */
.select-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 200px; /* ボタン間のスペース */
    width: 80%;
    max-width: 900px;
}

/* --- 各ボタンのラッパー（ボタンとラベルをまとめる） --- */
.planet-button-wrapper {
    text-align: center;
    position: relative;
}

/* --- 惑星ボタン本体のスタイル --- */
.planet-button {
    display: block;
    text-decoration: none;
}

.planet-icon {
    width: 160px;
    height: 160px;
    border-radius: 50%; /* 完全な円に */
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.planet-icon:hover {
    transform: scale(1.05); /* ホバー時に少し大きく */
}

/* アイコン（SVG）のサイズ */
.planet-icon svg {
    width: 60px;
    height: 60px;
}

/* 惑星のリング（擬似要素で作成） */
.planet-icon::before {
    content: '';
    position: absolute;
    width: 120%;
    height: 120%;
    border-radius: 50%;
    border: 3px solid;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotateX(75deg); /* 傾ける */
    opacity: 0.5;
}

/* 色のバリエーション */
.planet-icon.pink {
    background: radial-gradient(circle, #ff80c0, #e04090);
}
.planet-icon.pink::before {
    border-color: #ff80c0;
}

.planet-icon.blue {
    background: radial-gradient(circle, #70d0ff, #3090f0);
}
.planet-icon.blue::before {
    border-color: #70d0ff;
}

/* ボタンの下のテキストラベル */
.planet-label {
    margin-top: 20px;
    color: #e0e0e0;
    font-size: 16px;
    font-weight: bold;
}

/* ★ 追加・変更: 「自分の星に戻る」ボタンのスタイル */
/* ★ 最初の状態（白い文字・白い枠線・暗い半透明背景）に戻す */
.return-planet-button {
    display: block;
    text-decoration: none;
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    padding: 15px 50px;
    background-color: rgba(20, 20, 40, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 10px; /* 長方形風の角丸 */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.return-planet-button:hover {
    background-color: rgba(255, 255, 255, 0.9);
    color: #111;
    
}

/* ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ */
/* ★ 最小限の変更点: 未ログイン時コンテナのスタイル ★ */
/* ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ */
#not-logged-in-container {
    display: none; /* デフォルトは非表示 */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    
    /* 縦に並べて中央揃え */
    flex-direction: column;
    align-items: center;
    gap: 30px; /* テキストとボタンの間隔 */
}

/* ★ 最小限の変更点: 未ログイン時テキストのスタイル ★ */
#not-logged-in-text {
    color: #e0e0e0;
    font-size: 1.7rem; /* 20px */
    font-weight: 500;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
    margin: 0;
}

/* ★ 最小限の変更点: ログインボタンのスタイル ★ */
#login-button {
    /* welcome.css のボタンデザインを流用 */
    background-color: rgba(10, 10, 10, 0.85); 
    border: 2px solid white;
    border-radius: 30px;
    padding: 12px 35px; /* 少し調整 */
    color: white;
    font-size: 1.4rem; /* 18px */
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

#login-button:hover {
    background-color: white;
    color: black;
}


/* ここから追加: 流れ星ボタンのスタイル */

#open-select-modal-btn {
    /* 既存の .ui-button スタイルを上書き */
    width: 60px;  /* ボックスの幅 */
    height: 60px; /* ボックスの高さ */
    padding: 0; /* 画像を中央に配置するため余白は0 */
    background-color: #2c2a4a; /* 濃い紺色/紫色 */
    border-radius: 10px; /* 角丸四角形 */
    
    /* 画像をボタンの中央に配置するためのFlexbox設定 */
    display: flex;
    justify-content: center;
    align-items: center;

    /* 既存の .ui-button から持ってくるスタイル */
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s;
    backdrop-filter: none; /* ガラス効果は解除 */
}

#open-select-modal-btn:hover {
    background-color: #403d61; /* ホバー色 */
}

/* ボタン内の画像にスタイルを適用 */
#open-select-modal-btn img {
    width: 100%; /* ボタンの幅いっぱいに広げる */
    height: 100%; /* ボタンの高さに合わせる */
    object-fit: contain; /* 画像がボタン内に収まるように調整 */
    /* 画像がボタンの角丸からはみ出ないように */
    border-radius: 5px; /* ボタンの角丸(10px)より少し小さく */
}

/* ▼▼▼ 変更点 (ここから) ▼▼▼ */
/* 惑星オーナー表示 (テキストとボタン) のコンテナ */
#planet-owner-container {
    position: fixed;
    top: 20px; /* Y軸 (上から20px) */
    left: 50%; /* X軸 (中央) */
    transform: translateX(-50%); /* X軸の中央揃え */
    z-index: 2; /* 他UIと合わせる */
    
    display: flex; /* 中身を横並び */
    align-items: center; /* 縦方向中央揃え */
    gap: 10px; /* テキストとボタンの間隔 */
}

/* 惑星オーナーテキスト */
#planet-owner-display {
    display: none; /* JSで表示するまで非表示 */
    font-weight: bold;
    font-size: 1.1rem;
    color: #f0f0f0;
    /* position, top, left, transform, z-index は親コンテナに移動 */
}

/* GitHub プロフィールリンクボタン */
.github-link {
    width: 44px; /* ★ 変更点: 44px -> 50px */
    height: 44px; /* ★ 変更点: 44px -> 50px */
    padding: 0; /* paddingをリセット */
    border-radius: 14px; /* ★ 変更点: 12px -> 14px */
    
    background-color: rgba(255, 255, 255, 0.9); /* 白い背景 */
    color: #333; /* GitHubアイコンの色（暗い色） */
    
    display: flex; /* SVGを中央揃え */
    justify-content: center;
    align-items: center;
    
    /* ui-button の :hover を上書き */
    transition: background-color 0.2s, color 0.2s;
}

/* ★★★ アイコンを大きくするためのCSSを追加 ★★★ */
.github-link svg {
    width: 34px; /* ★ 変更点: 28px -> 34px */
    height: 34px; /* ★ 変更点: 28px -> 34px */
}
/* ★★★ 変更点ここまで ★★★ */


.github-link:hover {
    background-color: rgba(255, 255, 255, 1.0); /* ホバー時：不透明な白 */
    color: #000; /* アイコンの色は黒 */
}
/* ▲▲▲ 変更点 (ここまで) ▲▲▲ */


#planet-details-panel {
    position: fixed;
    top: 50%; /* 画面の縦方向中央に配置 */
    transform: translateY(-50%); /* 自身の高さの半分だけ上にずらして中央揃え */
    height: 400px; /* ★パネルの固定高さ */
    max-height: calc(100vh - 80px); /* 画面の高さ-上下の余白(40px*2)を超えないように */

    left: -320px; /* 初期状態は完全に画面外 */
    width: 300px; /* パネルの幅 */
    background-color: rgba(30, 30, 60, 0.9); /* 少し暗い青紫の背景 */
    backdrop-filter: blur(8px);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    z-index: 5; /* 他のUIより手前に */
    transition: left 0.4s ease-out; /* スライドアニメーション */
    display: flex;
    flex-direction: column; /* 要素を縦に並べる */
    
    border-radius: 0 5px 5px 0; /* 右側は角丸、左側は直線を追加 */
    border: 3px solid white; /* 白い枠線を追加 */
    box-sizing: border-box; /* paddingとborderをwidth/heightに含める */
}

/* パネルが開いている状態 */
#planet-details-panel.is-open {
    left: 0; /* 画面内にスライドイン */
}

/* パネルヘッダー */
.details-header {
    background-color: #2c2a4a; /* ヘッダーの背景色 (ボタンと同じ) */
    padding: 15px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    /* ヘッダーが縮まないようにする */
    flex-shrink: 0; 
}

.details-header h3 {
    margin: 0;
    font-size: 1.6rem;
    color: white;
}

/* パネルコンテンツ */
.details-content {
    flex-grow: 1; /* 残りのスペースを埋める */
    padding: 20px;
    display: flex;
    flex-direction: column;
    /* gap: 15px; */ /* ★ gap を削除し、個別のマージン制御に切り替え */
    overflow: hidden; /* 内容がはみ出た場合に備える */
}

/* ★ 修正: .planet-name 以外の p タグにだけ flex を適用 */
/* ★ .planet-title も除外する */
.details-content p:not(.planet-name):not(.planet-title) {
    margin: 0;
    display: flex;
    justify-content: space-between; /* ラベルと値を左右に配置 */
    align-items: center;
    color: #e0e0e0;
    font-size: 1.2rem;
    line-height: 1.8;
}

/* ★ 修正: span (右側の値) のスタイルはここにまとめる */
.details-content p:not(.planet-name):not(.planet-title) span {
    font-weight: bold;
    color: white;
    font-size: 1.2rem;
    line-height: 1.8;
}

/* コントリビューション数（commit-count）の下に余白を強制的に入れる */
.details-content .commit-count {
    margin-bottom: 27px !important; /* 30pxの部分をお好みの広さに調整してください */
}

.language-stats {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
    /* ★ 「コミット数」との間隔を 10px に設定 (ご希望の「少し上」) */
    margin-bottom: 10px; 
    flex-shrink: 0; /* 縮まないように */
}

.language-stats p {
    margin-bottom: 8px;
}
.language-stats p:last-child {
    margin-bottom: 0;
}

/* ★追加: 称号のスタイル */
.planet-title {
    display: block;
    text-align: center;
    margin-top: auto; /* ここで下へ押しやる */
    margin-bottom: 5px; /* 名前との間隔 */
    font-size: 0.9rem;
    color: #aaa; /* 名前より目立たなくする */
    font-weight: bold;
}

.planet-name {
    display: block; 
    text-align: center; /* ★ 中央揃え */
    margin-top: 0; /* ★ 上のマージンはリセット */
    margin-bottom: 50px; /* ★ パネル下部との余白 */

    font-size: 1.3rem;
    font-weight: bold;
}


/* パネル開閉ボタン */
#toggle-details-btn {
    position: fixed;
    top: 50%; /* 画面中央に配置 */
    left: 0px; /* ★ 初期位置を 0px に変更 (パネルと重ならないように) */
    transform: translateY(-50%);
    width: 40px; /* ボタンの幅 */
    height: 60px; /* ボタンの高さ */
    padding: 0;
    background-color: #2c2a4a; /* 濃い紺色/紫色 */
    border: 3px solid white;
    border-radius: 0 10px 10px 0; /* 左側は直線、右側は角丸 */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 6; /* パネルより手前 */
    transition: left 0.4s ease-out; /* パネルと連動するアニメーション */
}

/* パネルが開いている時のボタンの位置 */
#toggle-details-btn.is-open {
    left: 300px; /* パネルの幅分右に移動 */
    border-radius: 10px 0 0 10px; /* 矢印の向きに合わせて角丸の方向を変える */
}

/* 矢印SVGのスタイル */
.arrow-icon {
    width: 24px;
    height: 24px;
    fill: white;
    transition: transform 0.4s; /* 矢印回転のアニメーション */
}

/* 右向き矢印 (デフォルト) */
.arrow-icon.right {
    transform: rotate(0deg);
}

/* 左向き矢印 (パネルが開いている時) */
.arrow-icon.left {
    transform: rotate(180deg);
}

/* ★★★ 追記: ロゴ、テキスト、ボタンのスタイル ★★★ */

/* ロゴ画像 */
.welcome-logo {
    width: 300px; /* サイズを調整 (350px -> 300px) */
    height: auto;
    margin-bottom: 20px; /* ロゴと見出しの間 */
}

/* 見出し (GitHub Planetへようこそ) */
.welcome-modal h2 {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #fff;
    margin-top: 0; /* デフォルトマージンをリセット */
}

/* 説明文 */
.welcome-modal p {
    font-size: 15px;
    line-height: 1.7; /* 行間を少し広めに */
    margin-bottom: 30px;
    text-align: left; /* 説明文は左揃え */
}

/* OKボタン */
.ok-button {
    display: inline-block;
    padding: 10px 50px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    background-color: rgba(80, 80, 80, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    border: none;
}

.ok-button:hover {
    background-color: rgba(100, 100, 100, 0.9);
    transform: scale(1.05);
}
.ok-button {
    display: inline-block;
    /* <a>タグや<button>をボタン風に */
    padding: 10px 50px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    background-color: rgba(80, 80, 80, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px; /* 画像のような楕円形 */
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.ok-button:hover {
    background-color: rgba(100, 100, 100, 0.9);
    transform: scale(1.05); /* ホバー時に少し拡大 */
}

/* ★★★ 追記: フォローボタンのスタイル ★★★ */
#follow-btn {
    font-weight: bold;
    border: none;
    color: #333;
    transition: background-color 0.2s, color 0.2s;
    min-width: 80px;
}

/* 未フォロー時（Follow） */
#follow-btn:not(.is-following) {
    background-color: rgba(255, 255, 255, 0.9);
}

/* フォロー中（Following） */
#follow-btn.is-following {
    background-color: rgba(100, 100, 255, 0.8);
    color: white;
}

#follow-btn:hover {
    transform: scale(1.05);
}

/* ========================================= */
/* ここから下は index.html から移動してきたスタイル */
/* ========================================= */

/* ウェルカムモーダル用のスタイル（ホーム画面専用） */
.welcome-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 450px;
    /* ガラス効果 */
    background-color: rgba(25, 25, 30, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 25px 30px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    z-index: 100;
    text-align: center;
    color: #e0e0e0;
    display: none;
}

.welcome-logo {
    width: 350px;
    max-width: 100%;
    height: auto;
    margin-bottom: 20px;
}

.welcome-modal h2 {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #fff;
    margin-top: 0;
}

.welcome-modal p {
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 30px;
    text-align: left;
}