/* D:\Game\pangya\WebServer\www\style.css */

body { 
    font-family: 'Meiryo', sans-serif; 
    background-image: url("../img/main_bg_5.jpg");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    margin: 0; padding: 0;
    display: flex;
}

header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 70px;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

nav {
    position: fixed;
    top: 70px; left: 0; bottom: 0;
    width: 220px;
    background: rgba(255, 255, 255, 0.9);
    border-right: 2px solid #e2e8f0;
    padding: 30px 20px;
    z-index: 900;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column; /* 縦に並べる */
    gap: 20px;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto; /* コンテンツが溢れたらスクロール */
    min-width: 0;     /* flexの子要素が突き抜けるのを防ぐ */
}

/* ステータスエリア */
.user-status-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 500px;
}

.status-row {
    display: flex;
    gap: 8px; /* 左右の枠の間隔 */
}

/* 個別の枠（紺色ベース ＋ 透明度） */
.status-box-unit {
    /* 紺色に 0.85 (85%) の透明度を適用 */
    background: rgba(30, 41, 59, 0.9); 
    
    /* 枠線も少し透かせると馴染みがよくなります */
    border: 1px solid rgba(51, 65, 85, 0.5);
    
    border-radius: 8px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    
    /* 背後を少しぼかす（モダンなブラウザ向け） */
    backdrop-filter: blur(4px);
    
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.05);
}

/* 左側の項目 (Rank, Name) の幅 */
.unit-left {
    min-width: 180px; 
}

/* 右側の項目 (CP, PP) の幅 */
.unit-right {
    min-width: 240px;
    justify-content: space-between;
}

/* ラベル (Rank, Nameなど) */
/* ラベル (Rank, Nameなど) - 明るい水色で視認性を確保 */
.status-box-unit small {
    color: #7dd3fc; 
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: bold;
    margin-right: 12px;
    border-right: 1px solid #475569;
    padding-right: 8px;
    width: 38px;
    display: inline-block;
}

/* メインの文字色（白） */
.status-box-unit span {
    font-size: 0.85rem;
    font-weight: bold;
    color: #f8fafc; /* オフホワイト */
}

/* CP(Cookie)の数値：明るいオレンジで強調 */
.cp-color span.status-value-unit {
    color: #fb923c; 
}

/* PP(Pang)の数値：明るい黄緑で強調 */
.pp-color span.status-value-unit {
    color: #4ade80;
}

/* 数値部分を等幅にして右寄せ */
.status-value-unit {
    font-family: 'Consolas', 'Courier New', monospace;
    text-align: right;
    flex-grow: 1;
}

.status-item {
    font-size: 0.85rem;
    font-weight: bold;
    color: #334155;
    white-space: nowrap;
}

.status-item small {
    color: #64748b;
    font-size: 0.65rem;
    text-transform: uppercase;
    margin-right: 5px;
    display: inline-block;
    width: 35px;
}

/* 左側の項目（RankやName）のスタイル */
.status-item:first-child {
    min-width: 140px; /* 名前の長さに合わせて調整。余裕を持たせます */
    margin-right: 20px; /* 数値エリアとの間に最低限の余白を確保 */
    display: inline-block;
}

/* 数値エリア（CPやPP）のスタイル */
.status-item:last-child {
    flex: 1; /* 残りのスペースを使い切る */
    display: flex;
    justify-content: flex-end; /* 数値を右端に寄せる */
    align-items: center;
}

/* 数値のズレを直す設定 */
.status-value {
    display: inline-block;
    width: 130px; 
    text-align: right;
    font-family: 'Consolas', 'Courier New', monospace;
    margin-left: 5px; /* ラベル(CP/PP)との間にも少し隙間 */
}

.cp-color { color: #ea580c; }
.pp-color { color: #16a34a; }

/* 共通パーツ */
.header-logo { height: 50px; }

.logout-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.75rem;
    line-height: 1;
}

.login-card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 350px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
}

.menu-item {
    display: block;
    padding: 12px;
    color: #0369a1;
    text-decoration: none;
    font-weight: bold;
    border-radius: 10px;
    margin-bottom: 10px;
}

.menu-item:hover { background: #f0f9ff; }

.online-info {
    font-size: 0.8rem;
    color: #22c55e;
    font-weight: bold;
    margin-top: 20px;
}

input { width: 100%; padding: 12px; margin: 10px 0; border: 1px solid #ddd; border-radius: 8px; box-sizing: border-box; }
.btn-primary { width: 100%; padding: 12px; border: none; border-radius: 50px; cursor: pointer; font-weight: bold; background: #0ea5e9; color: white; }

/* サイドバーのステータスエリア */
.sidebar-status-card {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
    border: 1px solid #e2e8f0;
}

.status-label {
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 5px;
}

.status-value-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-indicator {
    font-size: 0.85rem;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.status-dot {
    height: 10px;
    width: 10px;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

/* 点滅アニメーション（稼働中のみ） */
.blink {
    animation: blink-animation 1.5s infinite;
}
@keyframes blink-animation {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

.content-panel {
    background: rgba(255, 255, 255, 0.8);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    
    /* 修正ポイント */
    width: 100%;       /* 親（main）の幅いっぱいにする */
    max-width: 1200px; /* 必要なら最大幅を指定、なければ none */
    box-sizing: border-box;
    
    /* 他の要素と重ならないように位置をリセット */
    position: relative;
    z-index: 1;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* ランキングテーブルの全体デザイン */
.ranking-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px; /* 行の間に少し隙間を空ける */
    margin-top: 20px;
}

.ranking-table th {
    background: rgba(30, 41, 59, 0.9); /* ヘッダーとお揃いの紺色 */
    color: #7dd3fc;
    padding: 12px;
    font-size: 0.8rem;
    text-transform: uppercase;
    border-radius: 5px;
}

.ranking-table td {
    padding: 15px 12px; /* 少し上下に余裕を持たせる */
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    background: rgba(255, 255, 255, 0.7);
}

/* 1行目の左端と右端を丸める */
.ranking-table td:first-child { border-radius: 10px 0 0 10px; }
.ranking-table td:last-child { border-radius: 0 10px 10px 0; }

/* マウスホバーで少し浮き上がる演出 */
.ranking-table tr:hover td {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.01);
    transition: 0.2s;
    cursor: default;
}

/* メダルの色設定 */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.rank-1 { background: linear-gradient(45deg, #ffd700, #ff8c00); } /* 金 */
.rank-2 { background: linear-gradient(45deg, #c0c0c0, #708090); } /* 銀 */
.rank-3 { background: linear-gradient(45deg, #cd7f32, #8b4513); } /* 銅 */
.rank-other { background: #94a3b8; width: 22px; height: 22px; line-height: 22px; font-size: 0.7rem; }

/* サムネイルのホバー演出 */
.guide-thumb-img:hover {
    transform: scale(1.05);
    border-color: #0ea5e9 !important;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

/* モーダルオーバーレイ */
.image-modal-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.85); /* ダークな背景 */
    backdrop-filter: blur(8px); /* 背景をぼかす */
    cursor: zoom-out;
}

/* 拡大画像本体の修正 */
.modal-main-img {
    display: block;
    max-width: 100%;           /* ボタンとの干渉を防ぐため少し小さめに */
    max-height: 85vh;         /* 画面の高さに収まるように制限 */
    width: auto;
    height: auto;
    object-fit: contain;      /* アスペクト比を維持 */
    border: 4px solid #fff;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    animation: modalZoom 0.25s ease-out;
    
    /* 以前の top/transform は不要なので削除または上書き */
    top: 0 !important;
    transform: none !important;
}

@keyframes modalZoom {
    from { transform: translateY(-50%) scale(0.9); opacity: 0; }
    to { transform: translateY(-50%) scale(1); opacity: 1; }
}

/* 閉じるボタン */
.modal-close-btn {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #f8fafc;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

/* モーダル内のナビゲーションコンテナを画面いっぱいに広げる */
.modal-nav-container {
    display: flex;
    align-items: center;      /* 垂直方向の中央揃え */
    justify-content: center;   /* 水平方向の中央揃え */
    width: 100%;
    height: 100vh;            /* 画面の高さ100%に固定 */
    gap: 30px;
    padding: 0 40px;
    box-sizing: border-box;
}

/* Next/Prev ボタンの位置微調整（画像に被りにくくする） */
.modal-nav-btn {
    flex-shrink: 0;           /* 画像に押されてボタンが潰れないように固定 */
    background: rgba(15, 23, 42, 0.6);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    padding: 20px;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 50%;       /* 丸いボタンに */
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.modal-nav-btn:hover {
    background: rgba(14, 165, 233, 0.8); /* パンヤブルー */
    border-color: #fff;
    transform: scale(1.1);
}

/* スマホ等で画像が小さい時のための調整 */
@media (max-width: 768px) {
    .modal-nav-container {
        flex-direction: column-reverse; /* 縦並びにして画像を優先 */
        gap: 10px;
    }
    .modal-nav-btn {
        padding: 10px 30px;
    }
}

.settings-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #64748b; /* 落ち着いたグレー系 */
    color: white;
    padding: 8px;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s;
}

.settings-btn:hover {
    background-color: #475569;
}

.updated-flash {
    animation: highlight-flash 1.5s ease-out !important;
}

@keyframes highlight-flash {
    0% { background-color: rgba(255, 255, 0, 0.8); } /* 最初はハッキリ黄色 */
    100% { background-color: transparent; }
}

/* 案2：横スクロールを有効にし、改行を禁止する */
.tab-menu {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
    
    /* 💡 重要設定 */
    overflow-x: auto;           /* 横方向のはみ出しをスクロール可能に */
    flex-wrap: nowrap !important; /* 改行を強制的に禁止 */
    -webkit-overflow-scrolling: touch; /* iOSでのスクロールを滑らかに */
}

/* 案1：フォントサイズと余白を微調整して1段の密度を上げる */
.tab-item {
    flex-shrink: 0;             /* タブが横に潰れるのを防ぐ */
    padding: 6px 10px;          /* 余白を少しスリムに (元: 8px 12px) */
    text-decoration: none;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 5px 5px 0 0;
    font-size: 0.8rem;          /* 文字を少し小さく (元: 0.85rem) */
    border: 1px solid #e2e8f0;
    border-bottom: none;
    white-space: nowrap;        /* タブ内の文字も改行させない */
    transition: all 0.2s;
}

/* アクティブなタブの強調（視認性アップ） */
.tab-item.active {
    background: white;
    color: #3b82f6;
    font-weight: bold;
    border-top: 3px solid #3b82f6;
    margin-top: -2px;
}

/* スクロールボタンの基本スタイル */
/* スクロールボタン：高さをタブにピッタリ合わせる */
.tab-scroll-btn {
    background: rgba(255, 255, 255, 0.6); /* タブに近い透明感 */
    border: 1px solid #e2e8f0;
    border-bottom: none; /* 下の青い線の上に載せるため */
    color: #3b82f6;
    padding: 0 10px;
    cursor: pointer;
    font-weight: bold;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1rem;
    
    /* 💡 修正のキモ：親の高さ（タブの高さ）に自動で合わせる */
    align-self: stretch; 
}

.tab-scroll-btn:hover {
    background: #fff;
    color: #2563eb;
}

.btn-left { border-radius: 8px 0 0 0; }
.btn-right { border-radius: 0 8px 0 0; }

/* タブメニュー本体のスクロールバーを完全に消す */
.tab-menu::-webkit-scrollbar { display: none; }
.tab-menu { -ms-overflow-style: none; scrollbar-width: none; }

/* 既存の .tab-item も少し調整（下線を消して親に任せる） */
.tab-item {
    margin-bottom: 0 !important; /* 親のborderに密着させる */
}

#console-box {
    background: #1e1e1e; color: #00ff00; font-family: 'Consolas', monospace; 
    padding: 15px; border-radius: 8px; margin-bottom: 20px; font-size: 0.9rem; line-height: 1.5; 
    border: 1px solid #333; box-shadow: inset 0 0 10px #000;
}
.log-entry { margin-bottom: 2px; }
.log-success { color: #ffffff; font-weight: bold; }
.log-error { color: #ef4444; font-weight: bold; }
.log-warn { color: #f97316; }