/* ========== styles/1_base.css ========== */
/* 基盤スタイル・共通コンポーネント */
/* Premium Redesign v5 適用済み */

/* =====================================================
   CSS Variables - Premium Design System
   ===================================================== */
:root {
    /* Gold - 黄金色 */
    --gold: #d4a520;
    --gold-bright: #e8bf3e;
    --gold-rich: #b8860b;
    --gold-glow: rgba(212, 165, 32, 0.35);

    /* Win = Blue */
    --win: #3b9eff;
    --win-bright: #60b0ff;
    --win-glow: rgba(59, 158, 255, 0.2);

    /* Loss = Red */
    --loss: #ff4466;
    --loss-bright: #ff6b88;
    --loss-glow: rgba(255, 68, 102, 0.2);

    /* =====================================================
       z-index 階層（Phase 2W R20-H 〜 R20-H-4 完成形）
       memory `feedback_distortion_warning.md` 「歪みは全部直す」
       既存の散在値（1, 10, 100, 1000, 2000, 3000, 9000, 9999, 10000, 10001,
       10005, 10006, 10007, 10010, 99998, 99999, 100000, 100001, 100002, 999999）を
       単一窓口で体系化。新規 UI 追加時は必ず var(--z-X) を使うこと。
       数値は既存実装と完全互換（数値変更ゼロ・ミス防止）。

       履歴:
       - R20-H (#167): 19 variables 初期定義
       - R20-H-2 (#168): リネーム --z-modal-trading → --z-toast + 5 件補完
       - R20-H-3 (#169-#172): 全リポ z-index 直書きを var() 化（62 件）
       - R20-H-4 (本 PR): 命名違和感 11 件の整理
         - 新規 3 個追加: --z-overlay-mid / --z-overlay-high / --z-overlay-critical
           （同値だが用途別の変数として分岐）
         - 同値共有の意図をコメントで明示

       同値変数のペア:
       - 9999  = --z-banner-warning（banner 用）+ --z-overlay-mid（dropdown/modal overlay 用）
       - 99999 = --z-banner-emergency（banner 用）+ --z-overlay-high（overlay/indicator 用）
       - 100000 = --z-banner-critical（banner 用）+ --z-overlay-critical（container 用）
       ===================================================== */

    /* Layer 0: 通常コンテンツ・スタッキングコンテキスト基盤 */
    --z-base: 1;                  /* 通常浮動（.container 等） */
    --z-elevated: 2;              /* 軽い重ね合わせ（.trade-actions / .image-fullscreen-close 等） */
    --z-card: 5;                  /* カード・チップ・favorite-select-btn 等の小要素 */
    --z-tooltip-base: 10;         /* ツールチップ・ボタン浮動・削除アイコン badge 等 */

    /* Layer 1: 浮動 UI 要素（dropdown / sticky） */
    --z-sticky: 100;              /* sticky ヘッダー等 */
    --z-dropdown: 100;            /* dropdown menu（標準） */

    /* Layer 2: モーダル系（標準〜上級） */
    --z-modal: 1000;              /* 標準モーダル / favorite-dropdown / autocomplete dropdown */
    --z-modal-image: 1001;        /* imageAddModal / TradeEdit favorite dropdown（modal 内の追加 overlay） */
    --z-toast: 2000;              /* showToast（.toast） */
    --z-modal-top: 3000;          /* トップレベルモーダル（現在未参照・将来予約。R20-H-5 で .image-modal 重複定義削除後 dead variable 化したが、3000 帯の予約として残存） */

    /* Layer 3: 中規模オーバーレイ・モーダル群 */
    --z-sync-indicator: 9000;     /* SyncStatusIndicatorModule（同期状態） */
    --z-banner-warning: 9999;     /* 警告バナー（オレンジ系）— banner 用途のみ */
    --z-overlay-mid: 9999;        /* modal overlay / modal 内 dropdown（ClosedMonthHelp / favoritePairDropdown / edit-autocomplete-dropdown 等）。
                                     banner-warning と同値だが用途が異なるため別変数。 */
    --z-modal-auth: 10000;        /* 認証・主要モーダル / 汎用 confirm / .day-tooltip / .image-fullscreen-modal */
    --z-modal-nested: 10001;      /* ネストモーダル（auth 上に重ねる確認等） */
    --z-modal-storage: 10005;     /* StorageQuotaModalModule / .note-autosave-indicator（同レイヤーで自然） */
    --z-modal-backup: 10006;      /* BackupRecoveryModule（バックアップ復旧） */
    --z-modal-deadletter: 10007;  /* DeadLetterRecoveryModule（DLQ 復旧） */
    --z-modal-progress: 10010;    /* エクスポート進捗モーダル */

    /* Layer 4: フルスクリーン・最上位 */
    --z-banner-deadletter: 99998; /* DeadLetterRecovery banner（紫系） */
    --z-banner-emergency: 99999;  /* 緊急通知バナー（赤系・private-mode-suspect 黄系 banner）— banner 用途のみ */
    --z-overlay-high: 99999;      /* payment overlay / pull-to-refresh インジケーター / アプリロード msg。
                                     banner-emergency と同値だが用途が異なるため別変数。 */
    --z-banner-critical: 100000;  /* CRITICAL banner（private-browsing 赤系 banner）— banner 用途のみ */
    --z-overlay-critical: 100000; /* PaymentModule コンテナ（モーダル風）。
                                     banner-critical と同値だが用途が異なるため別変数。 */
    --z-overlay-progress: 100001; /* 決済・処理中オーバーレイ */
    --z-overlay-delete: 100002;   /* アカウント削除オーバーレイ */

    /* Layer 5: PWA リロード・更新中フルスクリーン（最強・他を全て覆う） */
    --z-update-overlay: 999999;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: #050810;
    color: #fff;
    /* R21-E hotfix (2026-05-18): PWA standalone モードで status bar / notch / home indicator
       領域にヘッダー UI がめり込む歪みを解消（モバイル PWA でタイトル切れ報告）。
       env() は通常ブラウザでは 0 を返すので影響なし・PWA 時のみ status bar 高さ加算。 */
    padding-top: calc(20px + env(safe-area-inset-top, 0px));
    padding-right: calc(20px + env(safe-area-inset-right, 0px));
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    padding-left: calc(20px + env(safe-area-inset-left, 0px));
    /* PR-D-21 (2026-05-08・H-4): iOS Safari の 100vh はアドレスバー込みで実画面より大きいため
       画面下が見切れる/モーダル下端ボタンが押せない問題が出る。
       100dvh（dynamic viewport height）でアドレスバー考慮。
       100vh はフォールバック（古いブラウザ用）。 */
    min-height: 100vh;
    min-height: 100dvh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: var(--z-base);
}

/* サイバー背景演出 */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 700px 500px at 8% 8%, rgba(0, 255, 136, 0.05) 0%, transparent 60%),
        radial-gradient(ellipse 500px 400px at 92% 85%, rgba(59, 158, 255, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse 250px 250px at 80% 10%, rgba(212, 165, 32, 0.025) 0%, transparent 50%),
        linear-gradient(rgba(0, 255, 136, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 136, 0.018) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 100% 100%, 80px 80px, 80px 80px;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    opacity: 0.018;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* ãƒ˜ãƒƒãƒ€ãƒ¼ï¼ˆç›®æ¨™è¡¨ç¤ºè¿½åŠ ï¼‰ */
.header { 
    margin-bottom: 30px; 
}

.header-content { 
    display: flex; 
    align-items: center; 
    gap: 20px;
    flex-wrap: wrap;
}

/* ==========================================
   ãƒ¦ãƒ¼ã‚¶ãƒ¼ã‚¢ã‚¤ã‚³ãƒ³ ã‚µã‚¤ã‚ºåˆ¶é™ï¼ˆ2025-01-14è¿½åŠ ï¼‰
   ========================================== */
.user-icon {
    width: 128px;
    height: 128px;
    flex-shrink: 0;
}

.user-icon img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid rgba(0, 255, 136, 0.35);
    cursor: pointer;
    transition: all 0.4s ease;
    object-fit: cover;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.08);
}

.user-icon img:hover {
    transform: scale(1.05);
    border-color: var(--gold);
    box-shadow: 0 0 30px var(--gold-glow), 0 0 60px rgba(212, 165, 32, 0.1);
}

.header-info {
    flex: 1;
    min-width: 200px;
}

.header-title {
    font-size: 2.8rem;
    font-weight: bold;
    background: linear-gradient(135deg, #ffffff 30%, #00ff88 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: pointer;
    transition: filter 0.4s ease;
    margin-bottom: 5px;
}

.header-title:hover {
    background: linear-gradient(135deg, #ffffff 15%, var(--gold-bright) 55%, var(--gold) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.header-subtitle {
    color: #7a8599;
    font-size: 1.1rem;
    cursor: pointer;
    letter-spacing: 0.04em;
}

.header-subtitle:hover {
    color: #aaa;
}

/* ç›®æ¨™è¡¨ç¤ºï¼ˆæ–°è¦è¿½åŠ ï¼‰ */
.goals-display {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-left: auto;
}

.goal-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(0, 255, 136, 0.15);  /* ç·‘è‰²ã®èƒŒæ™¯ */
    border: 1px solid rgba(0, 255, 136, 0.5);  /* ç·‘è‰²ã®ãƒœãƒ¼ãƒ€ãƒ¼ */
    border-radius: 25px;
    transition: all 0.3s ease;
    cursor: default;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);  /* å¸¸ã«å…‰ã‚‹åŠ¹æžœ */
    animation: glow 2s ease-in-out infinite;  /* è„ˆå‹•ã™ã‚‹å…‰ */
}

/* è„ˆå‹•ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³ */
@keyframes glow {
    0% {
        box-shadow: 0 0 12px rgba(0, 255, 136, 0.08);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 136, 0.15);
    }
    100% {
        box-shadow: 0 0 12px rgba(0, 255, 136, 0.08);
    }
}

/* ç›®æ¨™é”æˆæ™‚ã®ã‚¹ã‚¿ã‚¤ãƒ«ã‚‚å¼·èª¿ */
.goal-item.achieved {
    background: rgba(0, 255, 136, 0.3);  /* 0.2 â†’ 0.3 ã«æ¿ƒãã™ã‚‹ */
    border-color: #00ff88;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);  /* å…‰ã‚‹åŠ¹æžœã‚’è¿½åŠ  */
}

/* ãƒ›ãƒãƒ¼æ™‚ã¯ã•ã‚‰ã«å¼·èª¿ */
.goal-item:hover {
    transform: translateY(-3px) scale(1.05);  /* å°‘ã—æ‹¡å¤§ */
    background: rgba(0, 255, 136, 0.25);
    border-color: #00ff88;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.6);
}

/* ãƒ¬ã‚¹ãƒãƒ³ã‚·ãƒ–å¯¾å¿œ â†’ 6_responsive.css ã¸ç§»å‹• */

/* ç›®æ¨™ãŒæœªè¨­å®šã®å ´åˆã¯æŽ§ãˆã‚ã« */
.goal-item:has(.goal-text:empty),
.goal-item:has(.goal-text:contains('ç›®æ¨™ã‚’è¨­å®š')) {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: none;
    animation: none;
}

.goal-item:has(.goal-text:empty) .goal-text,
.goal-item:has(.goal-text:contains('ç›®æ¨™ã‚’è¨­å®š')) .goal-text {
    text-shadow: none;
    color: #7a8599;
    font-weight: 400;
}

.goal-text {
    font-size: 1.2rem;  /* å¤§ãã‚ã®ãƒ•ã‚©ãƒ³ãƒˆ */
    color: #fff;
    font-weight: 600;  /* å¤ªã‚ã®ãƒ•ã‚©ãƒ³ãƒˆ */
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);  /* ãƒ†ã‚­ã‚¹ãƒˆã‚‚å…‰ã‚‹ */
}

.goal-check {
    font-size: 1.1rem;
    color: #7a8599;
    transition: all 0.3s ease;
}

.goal-item.achieved .goal-check {
    color: #00ff88;
}

/* ã‚¿ãƒ–ãƒŠãƒ“ã‚²ãƒ¼ã‚·ãƒ§ãƒ³ */
.tab-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);  /* âœ… 4 â†’ 3 ã«å¤‰æ›´ */
    grid-template-rows: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 30px;
    background: #0a0e16;
    padding: 15px;
    border-radius: 15px;
    border: 1px solid rgba(0, 255, 136, 0.08);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

/* タブナビ底辺サイバースキャンライン */
.tab-nav::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -30%;
    width: 30%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #00ff88, var(--gold-bright), transparent);
    animation: cyberScan 8s linear infinite;
}

@keyframes cyberScan {
    0% { left: -30%; }
    100% { left: 100%; }
}

/* ã‚¿ãƒ–ãƒ¬ãƒƒãƒˆå¯¾å¿œ â†’ 6_responsive.css ã¸ç§»å‹• */

.tab-btn {
    padding: 15px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: 10px;
    color: #7a8599;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
}

/* ã‚¿ãƒ–ãƒ¬ãƒƒãƒˆå¯¾å¿œ â†’ 6_responsive.css ã¸ç§»å‹• */

.tab-btn.active {
    background: linear-gradient(135deg, #00ff88 0%, #00dd77 100%);
    color: #000;
    font-weight: bold;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.25), inset 0 1px 0 rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
}

/* アクティブタブの金色キラリ */
.tab-btn.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 165, 32, 0.3), transparent);
    animation: tabGoldSweep 6s ease-in-out infinite;
}

@keyframes tabGoldSweep {
    0% { left: -40%; opacity: 0; }
    8% { opacity: 1; }
    30% { left: 120%; opacity: 1; }
    40% { opacity: 0; }
    100% { opacity: 0; }
}

.tab-btn:hover:not(.active) {
    background: rgba(0, 255, 136, 0.06);
    border-color: rgba(0, 255, 136, 0.15);
    color: #e8ecf2;
}

/* ã‚¿ãƒ–ã‚³ãƒ³ãƒ†ãƒ³ãƒ„ */
.tab-content { 
    display: none; 
    animation: fadeIn 0.3s ease;
}

.tab-content.active { 
    display: block; 
}

/* 統計ボックス金色シマー */
@keyframes goldShimmer {
    0% { left: -60%; opacity: 0; }
    8% { opacity: 1; }
    35% { left: 100%; opacity: 1; }
    45% { left: 100%; opacity: 0; }
    100% { left: 100%; opacity: 0; }
}

/* =====================================================
   クイック統計（新規エントリータブ上部）
   ===================================================== */
.quick-stats { margin-bottom: 24px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.stat-box {
    background: #101420;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 15px;
    padding: 22px 16px;
    text-align: center;
    transition: all 0.35s ease;
    position: relative;
    overflow: hidden;
}

/* 上辺グリーンライン */
.stat-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15%;
    right: 15%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00ff88, transparent);
    opacity: 0.5;
}

/* 金色シマー */
.stat-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-bright), var(--gold), transparent);
    animation: goldShimmer 7s ease-in-out infinite;
    opacity: 0;
}
.stat-box:nth-child(1)::after { animation-delay: 0s; }
.stat-box:nth-child(2)::after { animation-delay: 1.8s; }
.stat-box:nth-child(3)::after { animation-delay: 3.5s; }
.stat-box:nth-child(4)::after { animation-delay: 5.2s; }

.stat-box:hover {
    border-color: rgba(0, 255, 136, 0.15);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.stat-number {
    display: block;
    /* Phase 2W R20-H-1: dotted zero 解消（Cascadia Code が「0」の真ん中に・を表示する問題）
       システムフォント + tabular-nums で「桁揃え」を維持しつつ「・なし 0」を実現 */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: 1.8rem;
    font-weight: 600;
    color: #00ff88;
    margin-bottom: 6px;
    white-space: nowrap;  /* 「+¥250,000」の改行防止 */
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: #7a8599;
}

/* モバイル幅: 4列維持しつつ「今月の収支」(¥xxx,xxx) を1行に収める */
/* 「百万まで対応」想定: +¥1,000,000 (10文字) が iPhone 幅でも収まるサイズ */
@media (max-width: 480px) {
    .quick-stats .stats-grid {
        gap: 4px;
    }
    .quick-stats .stat-box {
        padding: 12px 2px;
    }
    .quick-stats .stat-number {
        font-size: 0.7rem;
        letter-spacing: -0.03em;  /* 数字を詰めて長い金額に対応 */
    }
    .quick-stats .stat-label {
        font-size: 0.6rem;
    }
}

/* Win/Loss カラーユーティリティ */
.color-win { color: var(--win) !important; }
.color-loss { color: var(--loss) !important; }
.color-accent { color: #00ff88 !important; }
.color-gold { color: var(--gold-bright) !important; }

/* =====================================================
   共通ユーティリティクラス（インラインstyle除去用）
   ===================================================== */

/* ヒントテキスト（旧 color: #888） */
.text-hint {
    color: #7a8599;
}

/* アクセントラベル（旧 color: #00ff88 / #4ade80） */
.text-accent {
    color: #00ff88;
}

/* サブセクション背景（旧 background: #1a1a1a + border: #333） */
.subsection-box {
    background: #0c1018;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* カード背景（旧 background: #2a2a2a） */
.card-bg {
    background: #101420;
}

/* カード枠線（旧 border: 1px solid #444） */
.border-subtle {
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* セパレータ（旧 border-bottom: 1px solid #333 / #444） */
.border-separator {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.border-separator-top {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes spin { 
    100% { transform: rotate(360deg); } 
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes editingPulse {
    0% { box-shadow: 0 0 20px rgba(102, 126, 234, 0.2); }
    50% { box-shadow: 0 0 30px rgba(102, 126, 234, 0.4); }
    100% { box-shadow: 0 0 20px rgba(102, 126, 234, 0.2); }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ã‚»ã‚¯ã‚·ãƒ§ãƒ³å…±é€šã‚¹ã‚¿ã‚¤ãƒ« */
.section {
    background: #0c1018;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(0, 255, 136, 0.08);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

/* セクション左辺アクセントライン */
.section::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 0;
    bottom: 30px;
    width: 3px;
    background: linear-gradient(180deg, #00ff88, rgba(0, 255, 136, 0.08), transparent);
    border-radius: 0 3px 3px 0;
}

/* 左辺を走る金色パルス */
.section::after {
    content: '';
    position: absolute;
    left: 0;
    top: 30px;
    width: 3px;
    height: 50px;
    background: linear-gradient(180deg, transparent, var(--gold), var(--gold-bright), transparent);
    border-radius: 0 3px 3px 0;
    animation: goldPulseDown 9s ease-in-out infinite;
    animation-delay: 4s;
    opacity: 0;
}

@keyframes goldPulseDown {
    0% { top: 30px; opacity: 0; }
    4% { opacity: 0.9; }
    35% { top: calc(100% - 80px); opacity: 0.9; }
    45% { opacity: 0; }
    100% { opacity: 0; }
}

.section h2 {
    margin-bottom: 25px;
    color: #00ff88;
    font-size: 1.5rem;
}

.section h3 {
    margin-bottom: 15px;
    color: #fff;
    font-size: 1.2rem;
}

/* å…¥åŠ›ã‚°ãƒªãƒƒãƒ‰ */
/* リスクリワード表示のサイバーライン */
.risk-reward-display {
    position: relative;
    overflow: hidden;
}

.risk-reward-display::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--loss) 20%,
        var(--gold) 50%,
        var(--win) 80%,
        transparent 100%
    );
    opacity: 0.4;
}

.responsive-grid {
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 30px;
}

/* å¤§ç”»é¢å¯¾å¿œ â†’ 6_responsive.css ã¸ç§»å‹• */

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;  /* 2åˆ—ã«å¤‰æ›´ */
    gap: 20px; 
    margin-bottom: 20px;
}

.input-group { 
    display: flex; 
    flex-direction: column; 
}

.input-group label { 
    color: #7a8599;
    font-size: 0.9rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.input-group input, 
.input-group select, 
.input-group textarea {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.input-group select option { 
    background: #0c1018;
    color: #fff;
}

.input-group input:focus, 
.input-group select:focus, 
.input-group textarea:focus {
    outline: none;
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.03);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.06), 0 0 16px rgba(0, 255, 136, 0.03);
}

textarea { 
    resize: vertical; 
    min-height: 100px; 
    line-height: 1.5;
}

/* ãƒœã‚¿ãƒ³ */
.button-group { 
    display: flex; 
    gap: 15px; 
    margin-top: 25px; 
    flex-wrap: wrap; 
}

.btn {
    padding: 12px 24px; 
    border: none; 
    border-radius: 10px;
    font-size: 1rem; 
    font-weight: bold; 
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #00ff88 0%, #00dd77 100%);
    color: #000;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.18);
    position: relative;
    overflow: hidden;
}

/* 保存ボタンの金色スイープ */
.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 165, 32, 0.35), transparent);
    animation: btnGoldSweep 6s ease-in-out infinite;
    animation-delay: 2.5s;
}

@keyframes btnGoldSweep {
    0% { left: -50%; opacity: 0; }
    12% { opacity: 1; }
    35% { left: 120%; opacity: 1; }
    45% { opacity: 0; }
    100% { opacity: 0; }
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 255, 136, 0.3);
    filter: brightness(1.08);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #00ff88;
}

.btn-danger {
    background: rgba(255, 68, 68, 0.2); 
    color: #ff4444;
    border: 1px solid #ff4444;
}

.btn-danger:hover { 
    background: rgba(255, 68, 68, 0.3); 
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

/* Phase 2K K-B-2 (R8B-CRITICAL-002・WCAG AA 2.4.7):
   旧: ボタンに :focus / :focus-visible スタイルが完全に欠落 → キーボードユーザーが
   現在フォーカス中のボタンを視認できない致命的 a11y 問題。
   修正: :focus-visible（キーボード操作時のみ outline 表示・マウスクリック時は非表示）で
   WCAG 2.1 推奨パターンを実装。各ボタン色に合わせた可視リング。
   :focus-visible は近代ブラウザ全対応（Safari 15.4+/Chrome 86+/Firefox 85+）。 */
.btn:focus-visible {
    outline: 3px solid #00ff88;
    outline-offset: 2px;
}
.btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.5), 0 4px 20px rgba(0, 255, 136, 0.3);
}
.btn-secondary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4);
    border-color: #00ff88;
}
.btn-danger:focus-visible {
    outline: 3px solid #ff4444;
    outline-offset: 2px;
}
.btn-small:focus-visible {
    outline: 2px solid #00ff88;
    outline-offset: 2px;
}
/* タブボタンと汎用 button 要素にも適用（modal close 等） */
.tab-btn:focus-visible,
button:focus-visible {
    outline: 3px solid #00ff88;
    outline-offset: 2px;
}

/* ãƒ¢ãƒ¼ãƒ€ãƒ« */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: var(--z-modal);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: #0c1018;
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(0, 255, 136, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-header h2 {
    color: #00ff88;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: #7a8599;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* ç”»åƒãƒ¢ãƒ¼ãƒ€ãƒ« */
/* .image-modal は styles/6_responsive.css:4498 で定義（最後 load されるため、ここの定義は dead code だった）。
   Phase 2W R20-H-5 (2026-05-17) で重複定義を解消し削除した。
   display は JS (script.js: showImageModalWithCaption / closeImageModal) が inline style で制御している。 */

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ã‚¹ã‚¯ãƒ­ãƒ¼ãƒ«ãƒãƒ¼ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 136, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 136, 0.3);
}

/* ãƒ­ãƒ¼ãƒ‡ã‚£ãƒ³ã‚° */
.loading {
    display: inline-block; 
    width: 20px; 
    height: 20px;
    border: 2px solid #00ff88; 
    border-radius: 50%;
    border-top-color: transparent; 
    animation: spin 1s linear infinite;
}

/* ã‚¨ãƒ©ãƒ¼ãƒ»æˆåŠŸãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #0c1018;
    color: #fff;
    padding: 15px 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: var(--z-toast);
    opacity: 0;                           /* ã“ã‚Œã ã‘æ®‹ã™ */
    visibility: hidden;                   /* è¿½åŠ  */
    transform: translateY(20px);          /* è¿½åŠ :ä¸‹ã‹ã‚‰å‡ºç¾åŠ¹æžœ */
    transition: opacity 0.3s ease, 
                visibility 0.3s ease, 
                transform 0.3s ease;      /* ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³ */
}

.toast.success {
    border-color: #00ff88;
}

.toast.error {
    border-color: #ff4444;
}

/* è¡¨ç¤ºçŠ¶æ…‹ */
.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ãƒ¬ã‚¹ãƒãƒ³ã‚·ãƒ– â†’ 6_responsive.css ã¸ç§»å‹• */

/* =====================================================
   ä»®å®Ÿè£…è¡¨ç¤º(Coming Soon)
   ===================================================== */

/* Part 6, 7ã®ä»®å®Ÿè£…ç”¨ */
.coming-soon-box {
    background: #0c1018;
    border: 2px dashed rgba(0, 255, 136, 0.2);
    border-radius: 10px;
    padding: 40px 30px;
    text-align: center;
    margin: 20px auto;
    max-width: 600px;
    animation: pulse 2s infinite;
}

.coming-soon-box h3 {
    color: #00ff88;
    margin-bottom: 25px;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.coming-soon-box .coming-soon-icon {
    font-size: 48px;
    margin-bottom: 20px;
    animation: spin 4s linear infinite;
}

.coming-soon-box p {
    color: #7a8599;
    margin-bottom: 25px;
    font-size: 16px;
    line-height: 1.6;
}

.coming-soon-box ul {
    list-style: none;
    padding: 0;
    max-width: 400px;
    margin: 25px auto 0;
    text-align: left;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 20px;
}

.coming-soon-box li {
    padding: 10px 0;
    color: #ccc;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 10px;
}

.coming-soon-box li:last-child {
    border-bottom: none;
}

.coming-soon-box li::before {
    content: "âœ“";
    color: #00ff88;
    font-weight: bold;
}

/* ãƒ—ãƒ­ã‚°ãƒ¬ã‚¹ãƒãƒ¼(ã‚ªãƒ—ã‚·ãƒ§ãƒ³) */
.development-progress {
    margin-top: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.development-progress h4 {
    color: #00ff88;
    margin-bottom: 15px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.1);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #00ff88 0%, #00cc6a 100%);
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* =====================================================
   æ–°è¦ã‚¨ãƒ³ãƒˆãƒªãƒ¼ - ãƒãƒ£ãƒ¼ãƒˆç”»åƒã‚³ãƒ³ãƒ†ãƒŠï¼ˆPCç”¨ï¼‰
   ===================================================== */
.chart-images-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.chart-images-container .image-upload-area {
    flex: 0 0 auto !important;
    width: 180px !important;
    height: 120px !important;
    min-height: 120px !important;
    max-height: 120px !important;
    border: 2px dashed rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.015);
}

.chart-images-container .image-upload-area:hover {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.02);
    box-shadow: 0 0 16px rgba(0, 255, 136, 0.05);
}

.chart-images-container .image-upload-area.has-image {
    border-style: solid;
    border-color: #333;
}

.chart-images-container .image-upload-area p {
    color: #666;
    font-size: 0.85rem;
    margin: 0;
    z-index: 0;
}

.chart-images-container .image-upload-area.has-image p {
    display: none;
}

.chart-images-container .image-upload-area img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

/* =====================================================
   prefers-reduced-motion 対応（Phase 2W R21-A-1・2026-05-17）
   WCAG 2.1 Level AA 2.3.3 Animation from Interactions 準拠
   前庭機能障害・乗り物酔いユーザー・OS で「視覚効果を減らす」設定の
   ユーザーに対し、アニメーションを実質無効化する。

   完全無効化（animation: none）ではなく 0.01ms に短縮する理由:
   - 視覚的にはほぼ瞬時に完了（ユーザー体感は無効化と同等）
   - JS の transitionend / animationend イベントは正常発火する
   - 既存の状態変化検知ロジック（モーダル開閉等）を破壊しない

   検証: F12 → Rendering → "Emulate CSS media feature prefers-reduced-motion" → reduce
   または OS 設定（macOS: アクセシビリティ > 動作を減らす / Windows: アニメーションを表示しない）
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========== 1_base.css çµ‚äº† ========== */