/* 基本的なスタイル */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f8;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}
.container {
    max-width: 1400px;
    margin: 20px auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
h1 {
    color: #660066;
    text-align: center;
    border-bottom: 2px solid #660066;
    padding-bottom: 10px;
    margin-top: 0;
    font-size: 1.8em;
}
a {
    color: #660066;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* ヘッダー */
.global-header {
    background-color: #660066;
    color: #fff;
    padding: 10px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header-left, .header-right {
    flex-basis: 32px; /* アイコンの幅に合わせて調整 */
    flex-shrink: 0;
    display: flex; /* 中央揃えのため */
    align-items: center; /* 垂直中央揃え */
}
.header-left { justify-content: flex-start; } /* 左寄せ */
.header-right { justify-content: flex-end; } /* 右寄せ */

/* ★★★ 修正: ヘッダーロゴ (192.png) のスタイル ★★★ */
.header-logo img { /* クラス名を header-logo に変更 */
    height: 40px; /* 画像の高さを指定 */
    width: auto; /* 幅は自動調整 */
    max-width: 72px; /* 最大幅を指定 */
    vertical-align: middle; /* 垂直方向中央揃え */
    /* border-radius: 4px; ロゴ画像には角丸不要かもしれないのでコメントアウト */
    transition: opacity 0.2s;
    opacity: 0.9;
}
.header-logo:hover img { /* クラス名を header-logo に変更 */
    opacity: 1;
}
/* ★★★ 修正ここまで ★★★ */

.header-title {
    font-size: 1.8em;
    font-weight: bold;
    text-align: center;
    flex-grow: 1;
    margin: 0 10px; /* 左右に少しマージンを追加 */
    white-space: nowrap; /* タイトルが折り返さないように */
    overflow: hidden; /* はみ出した部分を隠す */
    text-overflow: ellipsis; /* 省略記号(...)を表示 */
}
.header-title a {
    color: #fff;
    text-decoration: none;
}
.menu-container { position: relative; display: inline-block; }
.menu-icon { font-size: 1.8em; cursor: pointer; padding: 5px 10px; border-radius: 4px; transition: background-color: 0.3s; }
.menu-content { display: none; position: absolute; right: 0; background-color: #f9f9f9; min-width: 160px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); z-index: 1; border-radius: 4px; }
.menu-content a { color: black; padding: 12px 16px; text-decoration: none; display: block; font-size: 1em; }
.menu-content a:hover { background-color: #f1f1f1; }
.menu-container:hover .menu-content { display: block; }
.menu-container:hover .menu-icon { background-color: rgba(255, 255, 255, 0.2); }

/* PC用テーブル */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
thead {
    background-color: #660066;
    color: #fff;
}
th, td {
    text-align: left;
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
    vertical-align: middle;
}
tbody tr:nth-child(odd) {
    background-color: #f9f9f9;
}
tbody tr:hover {
    background-color: #f1f1f1;
}

/* index.php と secret_tournaments.php */
.filter-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.search-wrapper {
    display: flex;
}
.search-wrapper input[type="search"] {
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
    border-right: none;
    min-width: 200px;
}
.search-wrapper button {
    padding: 5px 15px;
    border: 1px solid #660066;
    background-color: #660066;
    color: white;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color: 0.2s;
}
.search-wrapper button:hover {
    background-color: #550055;
}
.year-filter-wrapper select {
    padding: 7px;
    border-radius: 4px;
    border: 1px solid #ccc;
}
.tournament-list {
    margin-top: 20px;
}
.tournament-list .list-header {
    display: flex;
    background-color: #660066;
    color: #fff;
    padding: 12px 15px;
    font-weight: bold;
}
.tournament-list .list-header .col-date { width: 120px; text-align: center; }
.tournament-list .list-header .col-name { flex: 1; }
.tournament-list .list-header .col-loc { width: 30%; }
.tournament-card {
    display: flex;
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
    color: #333;
    text-decoration: none;
    transition: background-color: 0.2s;
    align-items: center; /* 垂直方向の中央揃えを確実に適用 */
}
.tournament-card:hover {
    background-color: #f1f1f1;
    text-decoration: none;
}
.list-body > a.tournament-card:nth-child(odd) {
    background-color: #f9f9f9;
}
.list-body > a.tournament-card:nth-child(odd):hover {
    background-color: #f1f1f1;
}
.card-date { width: 120px; text-align: center; flex-shrink: 0; }
.card-info { flex: 1; display: flex; }
.card-name {
    flex: 1;
    /* ★★★ 追加: バッジと名前を垂直方向に中央揃えにする */
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* スマホで名前が長い場合に備える */
}
/* ★★★ 追加: 大会種別バッジのスタイル */
.badge {
    font-size: 0.75em;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 12px;
    margin-right: 8px;
    color: #fff;
    flex-shrink: 0; /* バッジが縮まないようにする */
}
.secret-badge {
    background-color: #8e44ad; /* 部内共有 (紫系) */
}
.public-badge {
    background-color: #3498db; /* 全体公開 (青系) */
}
/* ★★★ 追加ここまで ★★★ */
.card-loc { width: 30%; }
.date-month-year { display: block; font-size: 0.9em; color: #666; }
.date-day { display: block; font-size: 1.8em; font-weight: bold; line-height: 1.2; color: #660066; }

/* detail.php */
.detail-header { background-color: #660066; color: #fff; padding: 20px; border-radius: 8px 8px 0 0; text-align: center; }
.detail-header h1 { color: #fff; border-bottom: none; }
.page-links { width: 100%; text-align: center; padding: 15px 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; } /* ★★★ 修正: flexboxで中央揃えと折り返し */
.page-links a { display: inline-block; background-color: #8e44ad; color: #fff; padding: 10px 20px; border-radius: 5px; text-decoration: none; font-weight: bold; transition: background-color: 0.3s; white-space: nowrap; } /* ★★★ 修正: white-space追加 */
.page-links a:hover { background-color: #660066; }
.event-container { display: flex; justify-content: space-between; gap: 20px; }
.event-container > div { flex: 1; }
.event-container h3 { color: #660066; border-bottom: 2px solid #660066; padding-bottom: 5px; }
.event-container table tr td:first-child { transition: background-color: 0.2s; }
.event-container table tr:hover td:first-child { background-color: #e9e9e9; }
.event-container table td.event-name-cell { cursor: pointer; width: 95%; }
.event-container table td.event-action-cell { width: 5%; text-align: center; vertical-align: middle; }
.event-container table td.event-action-cell img { width: 24px; height: auto; border: none; opacity: 0.7; transition: opacity: 0.2s; }
.event-container table td.event-action-cell a:hover img { opacity: 1; }
.final-link { margin-top: 5px; font-size: 0.9em; }
.final-link a { background-color: #7a2f9c; color: white; padding: 3px 8px; border-radius: 3px; text-decoration: none; display: inline-block;}
.final-link a:hover { background-color: #660066; }

/* eventduac.php & shooting_order.php */
.all-details-btn-container { text-align: right; margin-bottom: 15px; }
.details-btn { background-color: #555; color: white; padding: 8px 15px; border-radius: 5px; border: none; cursor: pointer; }
.score-breakdown-wrapper { padding: 15px; background-color: #f0f2f5; }
.score-breakdown { width: 100%; margin: 0 auto; font-size: 1.1em; table-layout: fixed; }
.score-breakdown td { text-align: center; padding: 8px; font-family: monospace, monospace; border: none;}
.scoresheet-icon-cell { text-align: center; }
.scoresheet-icon-cell a img { border: none; width: 24px; height: auto; vertical-align: middle; }
.ranking-card.main-row { cursor: pointer; } /* ★★★ 修正: main-rowにカーソル設定 ★★★ */
.p.no-data, .no-data { padding: 20px; text-align: center; color: #777; }
.session-container { margin-bottom: 30px; }
.session-container h3 { color: #660066; border-bottom: 2px solid #660066; padding-bottom: 5px; }

/* eventduac.php & shooting_order.php PC用リストスタイル */
.ranking-list { margin-top: 10px; }
.ranking-list .list-header {
    display: flex;
    background-color: #660066;
    color: #fff;
    padding: 12px 15px;
    font-weight: bold;
    align-items: center;
}
.ranking-list .list-body .ranking-card-wrapper,
.ranking-list .list-body .ranking-card {
    border-bottom: 1px solid #ddd;
}
/* ★★★ 修正: wrapper と card 両方に last-child を適用 */
.ranking-list .list-body .ranking-card-wrapper:last-child,
.ranking-list .list-body .ranking-card:last-child {
    border-bottom: none;
}
.list-body .ranking-card {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    transition: background-color: 0.2s;
}
.list-body .ranking-card.main-row:hover { /* ★★★ 修正: main-row の hover スタイル */
    background-color: #f1f1f1;
}
.list-body > .ranking-card-wrapper:nth-child(odd) .ranking-card,
.list-body > .ranking-card:nth-child(odd) {
    background-color: #f9f9f9;
}
.list-body > .ranking-card-wrapper:nth-child(odd) .ranking-card.main-row:hover, /* ★★★ 修正 */
.list-body > .ranking-card:nth-child(odd):hover {
    background-color: #f1f1f1;
}
.col-rank { width: 5%; text-align: center; font-weight: bold; flex-shrink: 0; } /* ★★★ 修正: flex-shrink追加 */
.col-player-name { flex: 1; }
.col-affiliation { width: 20%; }
.col-score { width: 7%; text-align: center; flex-shrink: 0; } /* ★★★ 修正: flex-shrink追加 */
.col-action { width: 5%; text-align: center; flex-shrink: 0; } /* ★★★ 修正: flex-shrink追加 */
.col-action img { width: 24px; vertical-align: middle; }
.scores-mobile { display: none; }
.shooting-order-list .col-target { width: 15%; text-align: center; }
.shooting-order-list .col-affiliation { width: 30%; }

/* 団体戦のPC用スタイル */
.team-ranking .col-team-name {
    /* ★★★ 修正: width削除、flex: 1; を追加 ★★★ */
    flex: 1;
    font-weight: bold;
    align-self: center; /* 垂直中央揃え */
    padding-right: 15px; /* 右側に少し余白 */
}
/* ★★★ 削除: col-team-players は details-row に移動するため不要 ★★★ */
.team-scores-mobile { display: none; }
/* ★★★ 追加: 団体戦詳細表示用のスタイル ★★★ */
.team-details-row {
    padding: 10px 15px;
    background-color: #f0f2f5; /* 背景色をscore-breakdown-wrapperに合わせる */
    font-size: 0.9em;
}
.team-details-header {
    display: flex;
    font-weight: bold;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
    margin-bottom: 5px;
    color: #333;
}
.team-details-header > div:first-child { flex: 1; } /* 選手名 */
.team-details-header > div:not(:first-child) { width: 60px; text-align: center; } /* スコア、10+X、X */
.team-player-detail {
    display: flex;
    padding: 3px 0;
}
.team-player-detail > div:first-child { flex: 1; } /* 選手名 */
.team-player-detail > div:not(:first-child) { width: 60px; text-align: center; } /* スコア、10+X、X */
/* ★★★ 追加ここまで ★★★ */


/* =============================================== */
/* 決勝トーナメント用のスタイル (参考画像準拠) */
/* =============================================== */

.bracket-container {
    width: 100%;
    overflow-x: auto;
    padding: 30px 20px;
    -webkit-overflow-scrolling: touch;
    background: linear-gradient(135deg, #f9f4f9 0%, #fefefe 100%);
    border: 1px solid #ddd;
    border-radius: 12px;
    box-sizing: border-box;
}

.tournament-bracket {
    display: flex;
    gap: 80px;
    min-width: max-content;
    align-items: center;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    position: relative;
}

.round-header {
    text-align: center;
    font-weight: bold;
    color: #660066;
    font-size: 1.1em;
    margin: 0 0 25px 0;
    padding: 8px;
    background: linear-gradient(135deg, #f0e6f0 0%, #faf5fa 100%);
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.round-matches {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    flex: 1;
    gap: 15px;
}

.match-group {
    position: relative;
    display: flex;
    align-items: center;
}

.match-box {
    background-color: #fff;
    border: 2px solid #c5a3c5;
    border-radius: 8px;
    width: 400px;
    box-shadow: 0 2px 6px rgba(102, 0, 102, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.match-box:hover {
    box-shadow: 0 4px 12px rgba(102, 0, 102, 0.15);
    transform: translateX(-2px);
}

.player-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    min-height: 50px;
    transition: background-color: 0.2s ease;
}

.player-row:first-child {
    border-bottom: 1px solid #e5d4e5;
}

.player-row.winner {
    background: linear-gradient(90deg, #fdf5ff 0%, #fff 100%);
}

.player-row.winner .player-name {
    font-weight: 700;
    color: #660066;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.rank-badge {
    font-size: 0.85em;
    color: #888;
    min-width: 26px;
    text-align: center;
    font-weight: 600;
    background-color: #f5f5f5;
    padding: 4px 7px;
    border-radius: 4px;
    flex-shrink: 0;
}

.player-row.winner .rank-badge {
    background-color: #660066;
    color: white;
}

.player-name {
    font-size: 0.95em;
    white-space: nowrap;
    flex: 1;
}

.score-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
    margin-left: 15px;
}

.set-score {
    font-size: 1.6em;
    font-weight: bold;
    color: #333;
    line-height: 1;
}

.player-row.winner .set-score {
    color: #660066;
}

.set-details {
    font-size: 0.8em;
    color: #666;
    font-family: 'Courier New', monospace;
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 140px;
}

.set-details span {
    min-width: 18px;
    text-align: center;
    padding: 1px 3px;
    background-color: #f8f8f8;
    border-radius: 2px;
}

.set-details .shootoff {
    font-weight: bold;
    color: #c00;
    background-color: #ffe6e6;
}

/* 接続線の描画 */
.match-connector {
    position: absolute;
    right: -80px;
    top: 50%;
    width: 40px;
    height: 2px;
    background-color: #c5a3c5;
    transform: translateY(-1px);
    z-index: 1;
}

/* 2つの試合をペアにして線を引く */
.match-group:nth-child(4n+1) .match-connector::after,
.match-group:nth-child(4n+2) .match-connector::after {
    content: '';
    position: absolute;
    right: 40px;
    width: 2px;
    background-color: #c5a3c5;
}

/* 1番目の試合: 下方向に線を伸ばす */
.match-group:nth-child(4n+1) .match-connector::after {
    top: 0;
    height: 300%;
}

/* 2番目の試合: 上方向に線を伸ばす */
.match-group:nth-child(4n+2) .match-connector::after {
    bottom: 0;
    height: 300%;
}

/* 次のラウンドへの水平線 */
.match-connector::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    width: 40px;
    height: 2px;
    background-color: #c5a3c5;
    transform: translateY(-1px);
}

/* ラウンドごとに間隔を調整 */
.bracket-round:nth-child(2) .round-matches {
    gap: 80px;
}

.bracket-round:nth-child(3) .round-matches {
    gap: 200px;
}

.bracket-round:nth-child(4) .round-matches {
    gap: 450px;
}

/* 決勝・3決 */
.final-matches-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    padding: 30px 20px 20px;
    margin-top: 30px;
    border-top: 3px solid #e5d4e5;
    background-color: rgba(255, 255, 255, 0.5);
}

.bronze-match-box,
.gold-match-box {
    width: 400px;
    max-width: 100%;
}

.final-header {
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    margin: 0 0 12px 0;
    padding: 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.final-header.gold {
    color: #660066;
    background: linear-gradient(135deg, #f0e6f0 0%, #faf5fa 100%);
}

.final-header.bronze {
    color: #a98059;
    background: linear-gradient(135deg, #f5f0eb 0%, #faf8f5 100%);
}

.match-box.bronze {
    border-color: #c9b89a;
}

.match-box.bronze .player-row.winner {
    background: linear-gradient(90deg, #fffbf5 0%, #fff 100%);
}

.match-box.bronze .player-row.winner .player-name {
    color: #a98059;
}

.match-box.bronze .player-row.winner .rank-badge {
    background-color: #a98059;
    color: white;
}

.match-box.bronze .player-row.winner .set-score {
    color: #a98059;
}

/* 決勝・3決のコンテナ */
.final-matches-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    padding: 30px 20px;
    margin-top: 30px;
    border-top: 3px solid #e5d4e5;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 0 0 12px 12px;
}

.gold-match-container,
.bronze-match-container {
    width: 320px;
    max-width: 100%;
}

.round-header {
    text-align: center;
    font-size: 1.3em;
    font-weight: bold;
    color: #660066;
    margin: 0 0 15px 0;
    padding: 10px;
    background: linear-gradient(135deg, #f0e6f0 0%, #faf5fa 100%);
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bronze-match-container .round-header {
    color: #a98059;
    background: linear-gradient(135deg, #f5f0eb 0%, #faf8f5 100%);
}

.bronze-match-container .match-content {
    border-color: #c9b89a;
    box-shadow: 0 3px 8px rgba(169, 128, 89, 0.12);
}

.bronze-match-container .player.winner {
    background: linear-gradient(90deg, #fffbf5 0%, #fff 100%);
}

.bronze-match-container .player.winner .player-name {
    color: #a98059;
}

.bronze-match-container .player.winner .player-rank {
    background-color: #a98059;
    color: white;
}

.bronze-match-container .player.winner .player-set-score {
    color: #a98059;
}

/* パンくずリスト */
.breadcrumbs {
    list-style: none;
    padding: 10px 0;
    margin: 0 0 20px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
    display: flex;
    flex-wrap: wrap;
}
.breadcrumbs li {
    display: inline;
    color: #555;
}
.breadcrumbs li a {
    color: #660066;
    text-decoration: none;
}
.breadcrumbs li a:hover {
    text-decoration: underline;
}
.breadcrumbs li+li::before {
    content: '>';
    margin: 0 0.6em;
    color: #999;
}
.breadcrumbs li.active {
    font-weight: bold;
    color: #333;
}

/* フッター */
.site-footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    border-top: 1px solid #eee;
    color: #777;
    font-size: 0.9em;
}

/* =============================================== */
/* スマートフォン用のレスポンシブスタイル */
/* =============================================== */
@media (max-width: 768px) {
    body { font-size: 16px; -webkit-text-size-adjust: 100%; }
    .container { margin: 0; padding: 10px; border-radius: 0; box-shadow: none; background-color: #f4f4f8;}
    h1 { font-size: 1.5em; text-align: left; padding: 0 5px; border: none;}

    .filter-container { flex-direction: column; align-items: stretch; gap: 10px; }

    .tournament-list .list-header { display: none; }
    .tournament-list .list-body { border: 1px solid #ddd; border-radius: 8px; background-color: #fff; overflow: hidden; }
    .tournament-card { flex-direction: row; align-items: center; padding: 12px; }
    .tournament-card:last-child { border-bottom: none; }
    .card-date { width: 80px; padding-right: 12px; border-right: 1px solid #eee; }
    .date-day { font-size: 1.5em; }
    .card-info { flex-direction: column; padding-left: 12px; flex: 1; overflow: hidden; }
    .card-name {
        width: 100%;
        font-weight: bold;
        white-space: normal;
        align-items: flex-start; /* スマホでは上揃えに戻す */
    }
    /* ★★★ 追加: スマホ用のバッジスタイル調整 */
    .badge {
        margin-bottom: 4px; /* 名前が改行された場合に備える */
    }
    /* ★★★ 追加ここまで ★★★ */
    .card-loc { width: 100%; font-size: 0.9em; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

    /* eventduac.php & shooting_order.php スマホ用スタイル */
    .ranking-list { background-color: #fff; border: 1px solid #ddd; border-radius: 8px; overflow: hidden; }
    .ranking-list .list-header { display: none; }
    .ranking-list .list-body .ranking-card-wrapper,
    .ranking-list .list-body .ranking-card { border-bottom: 1px solid #eee; }
    .ranking-list .list-body .ranking-card-wrapper:last-child,
    .ranking-list .list-body .ranking-card-wrapper:last-child .ranking-card { border-bottom: none; } /* ★★★ 修正 */
    .list-body .ranking-card { padding: 12px; flex-wrap: wrap; position: relative;}
    .hide-on-mobile { display: none !important; }

    /* 個人戦 */
    .individual-ranking .col-rank { width: 40px; font-size: 1.2em; order: 1; }
    .individual-ranking .col-player-name { width: calc(100% - 80px); order: 2; font-weight: bold; }
    .individual-ranking .col-affiliation { width: 100%; order: 3; padding-left: 40px; font-size: 0.9em; color: #555; }
    .individual-ranking .scores-mobile {
        display: flex;
        order: 4;
        width: 100%;
        justify-content: space-around;
        background-color: #f8f8f8;
        margin-top: 10px;
        padding: 8px 5px;
        border-radius: 4px;
        font-size: 0.9em;
    }
    .scores-mobile .score-item { text-align: center; }
    .scores-mobile .score-item::before { content: attr(data-label); display: block; font-size: 0.8em; color: #666; }
    .scores-mobile .score-item.total { font-weight: bold; font-size: 1.1em; }
    .individual-ranking .col-action { position: absolute; top: 10px; right: 10px; order: 2; width: 40px; }

    /* 団体戦のスマホ用スタイル */
    .team-ranking .ranking-card { flex-wrap: wrap; }
    .team-ranking .col-rank { width: 40px; font-size: 1.2em; order: 1; }
    .team-ranking .col-team-name { width: calc(100% - 120px); order: 2; }
    .team-ranking .team-scores-mobile {
        width: 80px;
        order: 3;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        font-size: 0.9em;
    }
    .team-ranking .team-scores-mobile strong { font-size: 1.2em; }
    /* ★★★ 追加: 団体詳細のスマホスタイル ★★★ */
    .team-details-row { padding: 8px 10px; font-size: 0.85em; }
    .team-details-header > div:not(:first-child) { width: 45px; }
    .team-player-detail > div:not(:first-child) { width: 45px; }
    /* ★★★ 追加ここまで ★★★ */

    /* ★★★ 削除: 立ち順ページのスマホ用スタイル ★★★ */
    /* ★★★ 削除ここまで ★★★ */


    /* 詳細表示 */
    /* 個人戦 */
    .individual-ranking .details-row > td { padding: 0; }
    .score-breakdown-wrapper { background-color: #e9e9f3; padding: 10px 8px; } /* 少しパディング調整 */
    .score-breakdown { display: block; font-size: 0.95em; } /* 少しフォントサイズ調整 */
    .score-breakdown tbody, .score-breakdown tr { display: block; }
    .score-breakdown tr { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; } /* wrap追加 */
    .score-breakdown tr:first-child { margin-bottom: 5px; }
    .score-breakdown td { padding: 4px; flex: 1; text-align: center; min-width: 30px; } /* min-width追加 */
    .score-breakdown td:first-child { font-weight: bold; text-align: left; flex-grow: 0; min-width: 50px; }
    .score-breakdown td b { font-weight: bold; }

    /* その他 */
    .event-container { flex-direction: column; gap: 25px; }

    /* 決勝トーナメントのスマホ対応 */
    .bracket-container {
        padding: 15px 10px;
    }

    .tournament-bracket {
        gap: 60px;
    }

    .match-box {
        width: 280px;
    }

    .round-header {
        font-size: 1em;
        margin-bottom: 20px;
    }

    .player-row {
        padding: 10px 12px;
        min-height: 45px;
    }

    .player-name {
        font-size: 0.9em;
    }

    .rank-badge {
        font-size: 0.8em;
        min-width: 22px;
        padding: 3px 5px;
    }

    .set-score {
        font-size: 1.3em;
    }

    .set-details {
        font-size: 0.75em;
        max-width: 120px;
    }

    .match-connector {
        right: -60px;
        width: 30px;
    }

    .match-connector::before {
        width: 30px;
    }

    .match-group:nth-child(4n+1) .match-connector::after {
        right: 30px;
    }

    .match-group:nth-child(4n+2) .match-connector::after {
        right: 30px;
    }

    .bracket-round:nth-child(2) .round-matches {
        gap: 60px;
    }

    .bracket-round:nth-child(3) .round-matches {
        gap: 150px;
    }

    .bracket-round:nth-child(4) .round-matches {
        gap: 350px;
    }

    /* 決勝・3決 */
    .final-matches-container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        padding: 20px 10px;
    }

    .bronze-match-box,
    .gold-match-box {
        width: 100%;
        max-width: 300px;
    }

    .bronze-match-box .match-box,
    .gold-match-box .match-box {
        width: 100%;
    }

    .final-header {
        font-size: 1.05em;
    }
} /* @media (max-width: 768px) */

/* =============================================== */
/* タブレット対応 (768px - 1024px) */
/* =============================================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .tournament-bracket {
        gap: 45px;
    }

    .match-box {
        width: 260px;
    }

    .bronze-match-box .match-box,
    .gold-match-box .match-box {
        width: 300px;
    }
}

/* =============================================== */
/* 印刷用スタイル */
/* =============================================== */
@media print {
    .bracket-container {
        background: white;
        border: none;
        box-shadow: none;
        overflow: visible;
    }

    .match-box {
        box-shadow: none;
        page-break-inside: avoid;
    }

    .match-box:hover {
        transform: none;
    }

    .final-matches-container {
        page-break-before: always;
    }
}

