/* ⚾ ペナントシミュレーションゲーム - プレミアム CSS スタイルシート */

/* フォントと変数定義 */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Noto+Sans+JP:wght@300;400;700;900&display=swap');

:root {
    --bg-dark: #070b19;
    --bg-card: rgba(16, 22, 42, 0.6);
    --bg-card-hover: rgba(22, 30, 57, 0.85);
    --border-light: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(59, 130, 246, 0.25);
    
    --primary: #3b82f6;        /* ネオンブルー */
    --primary-glow: rgba(59, 130, 246, 0.5);
    --secondary: #10b981;      /* ネオングリーン */
    --secondary-glow: rgba(16, 185, 129, 0.5);
    --accent: #fbbf24;         /* ネオンゴールド */
    --accent-glow: rgba(251, 191, 36, 0.5);
    --danger: #f43f5e;         /* ネオンレッド */
    --danger-glow: rgba(244, 63, 94, 0.5);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #0f172a;
    
    --font-outfit: 'Outfit', sans-serif;
    --font-jp: 'Noto Sans JP', sans-serif;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* グローバルスタイル */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-jp);
}

body {
    background: radial-gradient(circle at 50% 50%, #0d1527 0%, var(--bg-dark) 100%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: 50px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-outfit), var(--font-jp);
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* スクロールバー装飾 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* アプリケーションレイアウト */
.app-container {
    max-width: 1350px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 15px;
    margin-bottom: 25px;
    backdrop-filter: blur(10px);
}

.logo h1 {
    font-size: 1.35rem;
    font-weight: 800;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #1d4ed8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ナビゲーションメニュー */
nav {
    display: flex;
    gap: 10px;
}

.nav-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    font-family: var(--font-jp);
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.nav-btn:hover {
    border-color: var(--primary);
    color: var(--text-main);
    background: rgba(59, 130, 246, 0.05);
}

.nav-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 15px var(--primary-glow);
}

/* グラスモーフィズムパネル */
.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transition: var(--transition-smooth);
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* アプリケーションスクリーン制御 */
.screen {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.screen.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* 各種ボタン */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
    color: white;
    border: none;
    font-family: var(--font-jp);
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--primary-glow);
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.7);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(30, 41, 59, 0.6);
    color: var(--text-main);
    border: 1px solid var(--border-light);
    font-family: var(--font-jp);
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-secondary:hover {
    border-color: var(--text-muted);
    background: rgba(30, 41, 59, 0.9);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #be123c 100%);
    color: white;
    border: none;
    font-family: var(--font-jp);
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--danger-glow);
    transition: var(--transition-smooth);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 63, 94, 0.7);
}

/* タイトル画面(Title Screen) */
.title-screen-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 550px;
    text-align: center;
}

.title-logo-container h1 {
    font-size: 3.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #93c5fd 0%, #3b82f6 40%, #1e40af 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
    filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.3));
}

.title-logo-container p {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-family: var(--font-outfit);
    letter-spacing: 0.15em;
    margin-bottom: 40px;
}

.menu-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 280px;
}

.menu-options button {
    font-size: 1.1rem;
    padding: 14px;
    width: 100%;
}

/* チーム選択画面 (Team Select) */
.save-slots-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.save-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 16px;
}

.save-slot-card {
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-card);
}

.save-slot-card.current-save-slot { border-color: var(--primary); }
.save-slot-card h3 { font-size: 1.05rem; overflow-wrap: anywhere; }
.save-slot-card .save-slot-number { margin-bottom: 6px; color: var(--text-muted); font-size: 0.8rem; }
.save-slot-details { min-height: 104px; margin: 16px 0; }
.save-slot-details p { margin-top: 6px; color: var(--text-muted); font-size: 0.88rem; }
.save-slot-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.save-slot-actions button { padding: 9px 14px; }
.save-slot-actions button:disabled { opacity: 0.45; cursor: default; }
.save-slot-actions .save-slot-delete { color: #fda4af; }
.save-slot-label { color: var(--text-muted); font-size: 0.85rem; margin: 0 0 15px; overflow-wrap: anywhere; }

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.team-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.team-card:hover {
    transform: translateY(-5px);
    background: var(--bg-card-hover);
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.team-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.team-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 12px;
    margin-bottom: 15px;
}

.team-logo-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-outfit);
    font-weight: 800;
    font-size: 1.6rem;
    color: white;
}

/* 各種球団カラー */
.color-B { background: linear-gradient(135deg, #1b2845 0%, #0d1527 100%); border-left: 4px solid #d4af37; }
.color-H { background: linear-gradient(135deg, #fcd34d 0%, #d97706 100%); color: var(--text-dark) !important; border-left: 4px solid #000; }
.color-L { background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%); border-left: 4px solid #06b6d4; }
.color-M { background: linear-gradient(135deg, #475569 0%, #0f172a 100%); border-left: 4px solid #f1f5f9; }
.color-E { background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%); border-left: 4px solid #f59e0b; }
.color-F { background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%); border-left: 4px solid #facc15; }

.team-card-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    font-size: 0.85rem;
}

.team-stat-item {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
}

.team-stat-item strong {
    color: var(--text-main);
}

/* メインダッシュボードハブ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
}

/* カレンダー/スケジュール進行 */
.schedule-widget {
    margin-bottom: 20px;
}

.week-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.progress-bar-container {
    background: rgba(255, 255, 255, 0.05);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.control-panel-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 順位表テーブル */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.leaderboard-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
    margin: 0 0 12px;
}

.leaderboard-filters label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.leaderboard-filters select {
    min-width: 150px;
    padding: 8px 10px;
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font: inherit;
}

.records-room-panel {
    min-height: 560px;
}

.records-room-header,
.records-step-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.records-room-header p {
    margin-top: 5px;
    color: var(--text-muted);
}

.records-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.records-category-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    max-width: 720px;
}

.record-choice-button {
    min-height: 92px;
    padding: 18px;
    color: var(--text-main);
    text-align: left;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.record-choice-button:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.12);
}

.record-choice-button strong,
.record-choice-button span {
    display: block;
}

.record-choice-button strong {
    font-size: 1.1rem;
}

.record-choice-button span {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.records-table-section {
    margin-top: 26px;
}

.records-table-section h4 {
    margin-bottom: 8px;
    color: var(--accent);
}

.records-table-scroll {
    max-height: 360px;
    overflow: auto;
    border: 1px solid var(--border-light);
    border-radius: 6px;
}

.records-defense-scroll {
    max-height: 480px;
}

.records-individual-heading {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.compact-record-table {
    margin-top: 0 !important;
    min-width: max-content;
}

.leaderboard-table-scroll {
    max-height: 470px;
    overflow: auto;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    scrollbar-gutter: stable;
}

.leaderboard-table-scroll table {
    margin-top: 0 !important;
    min-width: max-content;
    border-collapse: separate !important;
    border-spacing: 0;
}

.leaderboard-table-scroll thead th,
.records-table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #11182c !important;
    white-space: nowrap;
}

.leaderboard-table-scroll th:first-child,
.leaderboard-table-scroll td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    min-width: 130px;
    background: #0d1427;
}

.leaderboard-table-scroll th:nth-child(2),
.leaderboard-table-scroll td:nth-child(2) {
    position: sticky;
    left: 130px;
    z-index: 3;
    min-width: 68px;
    background: #0d1427;
    box-shadow: 1px 0 0 var(--border-light);
}

.leaderboard-table-scroll thead th:first-child,
.leaderboard-table-scroll thead th:nth-child(2) {
    z-index: 6;
    background: #11182c;
}

@media (max-width: 700px) {
    .logo h1 {
        font-size: 1.05rem;
    }

    .records-room-header,
    .records-step-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .records-category-grid {
        grid-template-columns: 1fr;
    }

    .leaderboard-table-scroll {
        max-height: 420px;
    }
}

table.pawa-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    text-align: center;
}

table.pawa-table th, table.pawa-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
}

table.pawa-table th {
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
}

table.pawa-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

table.pawa-table tr.user-team-row {
    background: rgba(59, 130, 246, 0.12) !important;
    border-left: 3px solid var(--primary);
}

.rank-badge {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    font-weight: 800;
    line-height: 24px;
    text-align: center;
    font-family: var(--font-outfit);
}

tr:nth-child(1) .rank-badge { background: #fbbf24; color: var(--text-dark); }
tr:nth-child(2) .rank-badge { background: #e2e8f0; color: var(--text-dark); }
tr:nth-child(3) .rank-badge { background: #b45309; color: white; }

/* 試合実況ログ */
.feed-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    height: 280px;
    overflow-y: auto;
    padding: 15px;
    font-family: monospace, var(--font-jp);
    font-size: 0.85rem;
    line-height: 1.6;
}

.feed-line {
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.02);
}

/* 試合進行スクリーン (Live Game screen) */
.game-screen-box {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 20px;
}

.scoreboard-container {
    background: #090e1d;
    border: 3px solid #1e293b;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.8);
}

.scoreboard-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: var(--accent);
    font-family: var(--font-outfit);
    font-weight: 600;
}

table.score-grid {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-outfit), var(--font-jp);
}

table.score-grid th, table.score-grid td {
    border: 1px solid #1e293b;
    padding: 8px;
    text-align: center;
    font-weight: 700;
}

table.score-grid th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
}

table.score-grid td.bold {
    font-size: 1.1rem;
    color: var(--accent);
}

/* 野球ダイヤモンドUI */
.diamond-card {
    height: 240px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, rgba(0,0,0,0) 70%);
}

.diamond-field {
    width: 160px;
    height: 160px;
    border: 2px dashed rgba(255, 255, 255, 0.12);
    transform: rotate(45deg);
    position: relative;
}

.base {
    position: absolute;
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid var(--text-muted);
    border-radius: 2px;
    transform: translate(-50%, -50%) rotate(-45deg);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    transition: var(--transition-smooth);
}

.base.occupied {
    background: var(--primary) !important;
    border-color: white !important;
    box-shadow: 0 0 12px var(--primary-glow) !important;
    animation: pulse 1.5s infinite;
}

#base-1 { top: 0%; left: 100%; }
#base-2 { top: 0%; left: 0%; }
#base-3 { top: 100%; left: 0%; }
#base-home { top: 100%; left: 50%; display: none; }

.matchup-box {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 20px;
}

.matchup-player {
    text-align: center;
}

.matchup-player span.role {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
}

.matchup-player strong {
    font-size: 1.15rem;
    color: var(--text-main);
}

.matchup-vs {
    font-family: var(--font-outfit);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--danger);
    text-shadow: 0 0 10px var(--danger-glow);
}

/* 選手カード (Player Card) & ランクバッジ */
.player-card-header { flex-wrap: wrap; gap: 8px; }
.player-card-header > div { min-width: 0; overflow-wrap: anywhere; }
.player-profile-meta { display: block; margin-top: 6px; color: var(--text-muted); font-size: 0.85rem; }

.ability-rank {
    display: inline-block;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    text-align: center;
    line-height: 22px;
    font-family: var(--font-outfit);
    font-weight: 800;
    font-size: 0.9rem;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.rank-S { background: linear-gradient(135deg, #db2777 0%, #ec4899 100%); box-shadow: 0 0 10px rgba(236, 72, 153, 0.6); }
.rank-A { background: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%); box-shadow: 0 0 8px rgba(244, 63, 94, 0.5); }
.rank-B { background: linear-gradient(135deg, #ea580c 0%, #f97316 100%); }
.rank-C { background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%); }
.rank-D { background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%); }
.rank-E { background: linear-gradient(135deg, #475569 0%, #64748b 100%); }
.rank-F { background: linear-gradient(135deg, #334155 0%, #475569 100%); }
.rank-G { background: linear-gradient(135deg, #1e293b 0%, #334155 100%); }

/* 特殊能力のタグ */
.special-ability-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    margin: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.ability-blue {
    background: rgba(37, 99, 235, 0.25);
    border: 1px solid rgba(59, 130, 246, 0.6);
    color: #93c5fd;
}

.ability-red {
    background: rgba(225, 29, 72, 0.25);
    border: 1px solid rgba(244, 63, 94, 0.6);
    color: #fda4af;
}

.ability-green {
    background: rgba(5, 150, 105, 0.25);
    border: 1px solid rgba(16, 185, 129, 0.6);
    color: #a7f3d0;
}

.ability-mixed {
    background: rgba(168, 85, 247, 0.22);
    border: 1px solid rgba(168, 85, 247, 0.55);
    color: #d8b4fe;
}

/* 選手エディタフォームグリッド */
.editor-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

.editor-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.editor-form-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 700;
}

.editor-form-group input, .editor-form-group select {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: white;
    padding: 10px;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}

.editor-form-group input:focus, .editor-form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* アビリティグリッドレイアウト */
.ability-input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

/* 選手リスト（エディタ選択用） */
.editor-player-list {
    max-height: 520px;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

.player-list-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-list-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.player-list-item.selected {
    background: rgba(59, 130, 246, 0.15);
    border-left: 4px solid var(--primary);
}

/* シーズン表彰カード */
.awards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.award-card {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.05) 0%, rgba(217, 119, 6, 0.1) 100%);
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.08);
    text-align: center;
}

.award-title {
    font-size: 0.85rem;
    color: var(--accent);
    text-transform: uppercase;
    font-family: var(--font-outfit);
    font-weight: 800;
    letter-spacing: 0.1em;
}

.award-player {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    margin: 10px 0;
}

.award-val {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* アニメーション */
@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 12px var(--primary-glow); }
    50% { transform: translate(-50%, -50%) scale(1.15); box-shadow: 0 0 20px rgba(59, 130, 246, 0.8); }
    100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 12px var(--primary-glow); }
}

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

/* タブコンテンツのアニメーション適用 */
.tab-content {
    animation: slideIn 0.35s ease forwards;
}

/* レスポンシブ対応 */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .game-screen-box {
        grid-template-columns: 1fr;
    }
    .editor-layout {
        grid-template-columns: 1fr;
    }
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

/* ソート可能なヘッダーのスタイル */
table.pawa-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: var(--transition-smooth);
}

table.pawa-table th.sortable:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-main) !important;
}

table.pawa-table th.sortable::after {
    content: " ↕";
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.3;
    margin-left: 4px;
    display: inline-block;
    transition: var(--transition-smooth);
}

table.pawa-table th.sortable:hover::after {
    opacity: 0.7;
}

table.pawa-table th.sortable.sort-asc::after {
    content: " ▲" !important;
    color: var(--accent) !important;
    opacity: 1 !important;
}

table.pawa-table th.sortable.sort-desc::after {
    content: " ▼" !important;
    color: var(--accent) !important;
    opacity: 1 !important;
}

/* ============================== */
/* 変化球選択グリッド (パワプロ風) */
/* ============================== */
.pitch-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.pitch-item {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 8px 10px;
    transition: var(--transition-smooth);
    cursor: pointer;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.pitch-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--border-light);
    transition: var(--transition-smooth);
}

.pitch-item.active {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.15);
}

.pitch-item.active::before {
    background: var(--primary);
}

.pitch-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.pitch-item-header input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.pitch-item-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
    flex: 1;
}

.pitch-dir-badge {
    font-size: 0.65rem;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    white-space: nowrap;
}

.pitch-level-row {
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.3;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.pitch-item.active .pitch-level-row {
    opacity: 1;
    pointer-events: auto;
}

.pitch-level-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    width: 22px;
    text-align: right;
    flex-shrink: 0;
}

.pitch-level-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.pitch-level-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 6px var(--primary-glow);
    cursor: pointer;
    transition: transform 0.15s;
}

.pitch-level-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.pitch-level-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 6px var(--primary-glow);
    cursor: pointer;
    border: none;
}

.pitch-level-value {
    font-family: var(--font-outfit);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

/* ============================== */
/* 特殊能力チップ選択 (パワプロ風) */
/* ============================== */
.sa-select-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sa-category-label {
    width: 100%;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-top: 8px;
    margin-bottom: 2px;
    padding-left: 2px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.sa-category-label:first-child {
    margin-top: 0;
}

.sa-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    position: relative;
    line-height: 1.3;
}

/* 青特 (金特含む) - ポジティブ特殊能力 */
.sa-chip.sa-type-blue {
    background: rgba(59, 130, 246, 0.08);
    color: rgba(59, 130, 246, 0.6);
    border-color: rgba(59, 130, 246, 0.12);
}

.sa-chip.sa-type-blue.active {
    background: rgba(59, 130, 246, 0.22);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.15);
}

/* 赤特 - ネガティブ特殊能力 */
.sa-chip.sa-type-red {
    background: rgba(244, 63, 94, 0.06);
    color: rgba(244, 63, 94, 0.5);
    border-color: rgba(244, 63, 94, 0.1);
}

.sa-chip.sa-type-red.active {
    background: rgba(244, 63, 94, 0.18);
    color: #fb7185;
    border-color: rgba(244, 63, 94, 0.45);
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.15);
}

/* 緑特 - 補助系特殊能力 */
.sa-chip.sa-type-green {
    background: rgba(16, 185, 129, 0.06);
    color: rgba(16, 185, 129, 0.5);
    border-color: rgba(16, 185, 129, 0.1);
}

.sa-chip.sa-type-green.active {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.45);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

/* 金特 - 超特殊能力 */
.sa-chip.sa-type-gold {
    background: rgba(251, 191, 36, 0.06);
    color: rgba(251, 191, 36, 0.5);
    border-color: rgba(251, 191, 36, 0.1);
}

.sa-chip.sa-type-gold.active {
    background: rgba(251, 191, 36, 0.18);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.45);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.15);
}

/* 赤青特 - 変動能力（+にも-にもなる） */
.sa-chip.sa-type-mixed {
    background: rgba(168, 85, 247, 0.07);
    color: rgba(168, 85, 247, 0.55);
    border-color: rgba(168, 85, 247, 0.12);
}

.sa-chip.sa-type-mixed.active {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.18);
}

.sa-chip:hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
}

.sa-chip .sa-icon {
    font-size: 0.85rem;
}

/* ============================== */
/* グレード式特殊能力 (G～A 選択) */
/* ============================== */
.graded-ability-row {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 7px 10px;
    margin-bottom: 4px;
    transition: var(--transition-smooth);
}

.graded-ability-row:hover {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.38);
}

.graded-ability-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
    min-width: 85px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.grade-btn-group {
    display: flex;
    gap: 3px;
    flex: 1;
    min-width: 175px;
}

.grade-btn {
    flex: 1;
    text-align: center;
    padding: 4px 2px;
    border-radius: 5px;
    font-size: 0.75rem;
    font-family: var(--font-outfit);
    font-weight: 800;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition-smooth);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.25);
    line-height: 1;
}

.grade-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    transform: translateY(-1px);
}

/* G: 最低 (深紅) */
.grade-btn[data-grade="G"].active {
    background: rgba(127, 7, 7, 0.35);
    color: #fca5a5;
    border-color: rgba(185, 28, 28, 0.6);
    box-shadow: 0 0 8px rgba(185, 28, 28, 0.2);
}
/* F: 劣悪 (赤) */
.grade-btn[data-grade="F"].active {
    background: rgba(185, 28, 28, 0.28);
    color: #fca5a5;
    border-color: rgba(220, 38, 38, 0.5);
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.15);
}
/* E: やや悪 (オレンジ) */
.grade-btn[data-grade="E"].active {
    background: rgba(194, 65, 12, 0.28);
    color: #fdba74;
    border-color: rgba(234, 88, 12, 0.5);
    box-shadow: 0 0 8px rgba(234, 88, 12, 0.15);
}
/* D: 普通 (グレー) */
.grade-btn[data-grade="D"].active {
    background: rgba(71, 85, 105, 0.35);
    color: #94a3b8;
    border-color: rgba(100, 116, 139, 0.5);
}
/* C: やや良 (薄青) */
.grade-btn[data-grade="C"].active {
    background: rgba(37, 99, 235, 0.2);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.15);
}
/* B: 良 (青) */
.grade-btn[data-grade="B"].active {
    background: rgba(37, 99, 235, 0.3);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}
/* A: 最高 (金) */
.grade-btn[data-grade="A"].active {
    background: rgba(180, 130, 0, 0.3);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.6);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.2);
}

/* ========================================== */
/* 試合結果詳細モーダル                       */
/* ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 7, 18, 0.85); /* 濃いダーク背景 */
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 90%;
    max-width: 950px;
    max-height: 85vh;
    overflow-y: auto;
    background: rgba(16, 22, 42, 0.95);
    border: 1px solid var(--border-glow);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    border-radius: 16px;
    padding: 25px;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-smooth);
}

.modal-close-btn:hover {
    color: var(--danger);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-scoreboard-summary {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid var(--border-light);
}

.modal-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 10px;
}

.modal-tab-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    font-family: var(--font-jp);
    font-weight: 700;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.modal-tab-btn:hover {
    border-color: var(--primary);
    color: var(--text-main);
}

.modal-tab-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 10px var(--primary-glow);
}

.modal-tab-content {
    animation: slideIn 0.3s ease forwards;
}

.modal-tab-content h3 {
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 10px;
    border-left: 3px solid var(--accent);
    padding-left: 8px;
}
