:root{
    --match-award-gradient:linear-gradient(110deg,#fffabc,#ffd12e,#f29928,#ffd12e);
    --accent-win:#1cd660;
    --accent-lose:#f13232;
    --accent-draw:#f97316;
    /* ほか rank 用の変数があれば続けてOK */
}

.match-awards { display:none; }
.match-award { display:none; }


    .site-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 12px 24px;
    min-height: calc(100vh - 140px);
    }
    /* ===== ガチバトルページ ===== */
    .ranked-page {
    width: 100%;
    }

    /* ページヘッダ */
    .ranked-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    }

    .ranked-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    }

    .ranked-title {
    font-size: 22px;
    font-weight: 700;
    }

    .ranked-sub {
    font-size: 13px;
    color: var(--text-sub);
    }

    .ranked-api-warning {
    margin: 0 0 10px;
    padding: 9px 12px;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    background: #fffbeb;
    color: #92400e;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
    }

    /* === プレイヤー概要ボックス === */
    .player-summary {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid var(--border-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    }

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

    .player-summary-avatar-stack {
    display: flex;
    flex: 0 0 64px;
    width: 64px;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    }

    .player-summary-icon {
    width: 58px;
    height: 58px;
    border-radius: 0;
    object-fit: contain;
    background: transparent;
    flex: 0 0 auto;
    display: block;
    }

    .player-summary-identity {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    gap: 3px;
    }

    .player-name-line {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 16px;
    font-weight: 700;
    }

    .player-summary-tag {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text-sub);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
    text-align: center;
    text-overflow: clip;
    }

    .player-summary .player-badges {
    flex: 0 0 auto;
    margin-left: 0;
    }

    .player-name-stack {
    display: grid;
    flex: 0 1 auto;
    gap: 2px;
    min-width: 0;
    max-width: 100%;
    }

    .player-original-name {
    color: var(--text-sub);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    opacity: .78;
    }

    .player-name-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-sub);
    margin-right: 6px;
    }

    .player-name {
    display: block;
    font-size: 16px;
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    }

    .player-club-line,
    .player-tag-line {
    font-size: 12px;
    color: var(--text-sub);
    }

    a.player-club-line {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    color: var(--text-sub);
    text-decoration: none;
    }

    a.player-club-line:hover strong,
    a.player-club-line:focus-visible strong {
    color: #2563eb;
    text-decoration: underline;
    }

    .player-club-line strong,
    .player-tag-line strong {
    font-weight: 600;
    color: var(--text-main);
    }

    .player-club-tag {
    margin-left: 4px;
    color: var(--text-sub);
    }

    .player-summary-right {
    display: flex;
    flex-direction: column;
    flex: 1 1 520px;
    gap: 8px;
    align-items: stretch;
    min-width: 0;
    }

    /* ガチバトル 現在 / 最高 */
    .player-ranked-box {
    display: flex;
    flex-direction: column;
    /* ★縦方向に並べる */
    align-items: flex-start;
    gap: 4px;
    font-size: 13px;
    }

    .player-ranked-label {
    font-size: 12px;
    color: var(--text-sub);
    }

    .player-ranked-rows {
    display: flex;
    flex-direction: column;
    gap: 2px;
    }

    .player-ranked-row {
    display: flex;
    align-items: center;
    gap: 4px;
    }

    .player-ranked-icon {
    width: 22px;
    height: 22px;
    }

    .player-ranked-points {
    font-weight: 600;
    }

    /* 自動追跡ボタン */
    .player-summary-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    }

    .player-summary-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    padding: 4px 7px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f8fafc;
    font-size: 11px;
    line-height: 1.15;
    }

    .player-summary-stat img {
    width: 19px;
    height: 19px;
    object-fit: contain;
    flex: 0 0 auto;
    }

    .player-summary-stat span {
    color: var(--text-sub);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    }

    .player-summary-stat strong {
    margin-left: auto;
    color: var(--text-main);
    font-size: 12px;
    white-space: nowrap;
    }

    @media (max-width: 900px) {
    .player-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .player-summary-main,
    .player-summary-right,
    .player-summary-stats {
        width: 100%;
    }

    .player-summary-main,
    .player-summary-right {
        flex: 0 0 auto;
    }

    .player-summary-main {
        align-items: flex-start;
        min-height: 0;
    }

    .player-summary-right {
        flex-basis: auto;
        align-items: stretch;
    }

    .player-summary-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    }

    .player-summary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    }

    .player-summary-actions .manual-update-btn,
    .player-summary-actions .auto-track-btn {
    width: 100%;
    margin-right: 0;
    justify-content: center;
    min-height: 28px;
    height: auto;
    min-width: 0;
    padding: 4px 8px;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.15;
    text-align: center;
    }

    .refresh-limit-notice {
        color: #64748b;
        font-weight: 750;
        line-height: 1.45;
    }

    .player-summary-actions .refresh-limit-notice {
        grid-column: 1 / -1;
        min-height: 16px;
        font-size: 11px;
        text-align: left;
    }

    .refresh-limit-notice a {
        color: #2563eb;
        font-weight: 900;
        text-decoration: none;
    }

    .refresh-limit-notice a:hover {
        text-decoration: underline;
    }

    .auto-track-btn {
    font-size: 11px;
    border-radius: 999px;
    padding: 4px 8px;
    border: 1px solid var(--border-soft);
    background: #ffffff;
    cursor: pointer;
    color: var(--text-main);
    white-space: normal;
    line-height: 1.15;
    word-break: keep-all;
    overflow-wrap: anywhere;
    }

    .auto-track-btn[data-enabled="1"] {
    border-color: #22c55e;
    background: #ecfdf3;
    }

    .auto-track-btn:disabled {
    opacity: .6;
    cursor: default;
    }

    /* ページネーション */
    .ranked-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin: 8px 0 16px;
    }

    .ranked-pagination button {
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: #ffffff;
    color: var(--text-main);
    font-size: 12px;
    padding: 4px 10px;
    cursor: pointer;
    }

    .ranked-pagination button:disabled {
    opacity: .4;
    cursor: default;
    }

    .ranked-page-info {
    font-size: 12px;
    color: var(--text-sub);
    }

    /* ===== カードグリッド：横2×縦10で20件 ===== */
    .matches-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
    align-content: start;
    min-height: 0;
    }

    @media(max-width:900px) {
    .matches-grid {
        grid-template-columns: 1fr;
        min-height: 0;
    }
    }

    /* 外枠 */
    .match-frame {
    border-radius: var(--mc-r);
    padding: 0px;
    border: 3px solid #fecaca;
    border-width: var(--mf-b);     /* 念のため固定 */
    overflow: hidden;
    }

    .match-frame--victory {
    border-color: #86efac;
    }

    .match-frame--defeat {
    border-color: #fecaca;
    }

    .match-frame--draw {
    border-color: #fed7aa;
    }

    .match-frame--championship-breakthrough {
    border-color: #facc15 !important;
    background:#f59e0b;
    box-shadow:
        0 0 0 2px rgba(250, 204, 21, .35),
        0 10px 28px rgba(245, 158, 11, .28);
    }

    .match-frame--championship-eliminated {
    border-color: #ef4444 !important;
    background:#dc2626;
    box-shadow:
        0 0 0 2px rgba(239, 68, 68, .28),
        0 10px 28px rgba(185, 28, 28, .22);
    }

    /* 内側 */
    .match-inner {
    background: var(--bg-card);
    border-radius: calc(var(--mc-r) - var(--mf-b)) !important;
    border: 1px solid var(--border-soft);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    }

    /* 上部（モード＋結果＋ランク） */
    .match-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: relative;
    /* ★追加 */
    }

    .match-top-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
    }

    .match-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    }

    .match-mode {
    font-size: 14px;
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    }

    .match-map {
    font-size: 12px;
    color: var(--text-sub);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    }

    .match-top-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    }

    .match-result-main {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.15em;
    }

    .match-result-diff {
    margin-top: 1px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.2;
    white-space: nowrap;
    }

    .match-result-diff-pos {
    color: var(--accent-win);
    }

    .match-result-diff-neg {
    color: var(--accent-lose);
    }

    .match-result-diff-zero {
    color: var(--text-sub);
    }

    .result-text-victory {
    color: var(--accent-win);
    }

    .result-text-defeat {
    color: var(--accent-lose);
    }

    .result-text-draw {
    color: var(--accent-draw);
    }

    /* 右上：ランクアイコン＋ポイント */
.match-top-right {
    min-width: 92px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 4px;
    }

    .bp-widget {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: 12px;
    }

    .brawler-streak-widget {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 24px;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid rgba(245, 158, 11, .28);
    background: rgba(255, 247, 237, .94);
    color: #92400e;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
    }

    .brawler-streak-widget img {
    width: 14px;
    height: 14px;
    object-fit: contain;
    display: block;
    }

    .championship-widget {
    max-width: 170px;
    }

    .championship-season {
    color: var(--text-sub);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.1;
    text-align: right;
    }

    .championship-summary {
    color: var(--text-main);
    font-weight: 900;
    line-height: 1.25;
    text-align: right;
    white-space: normal;
    }

    .championship-status .icon-row-diff-value {
    font-size: 15px;
    font-weight: 950;
    }

    .championship-status-breakthrough {
    color: #b45309;
    text-shadow: 0 1px 0 rgba(255,255,255,.55);
    }

    .championship-status-eliminated {
    color: #dc2626;
    text-shadow: 0 1px 0 rgba(255,255,255,.55);
    }

    .championship-status-active {
    color: var(--text-main);
    }

    .bp-row-main {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
    }

    .bp-range-row {
    gap: 6px;
    white-space: nowrap;
    }

    .bp-point {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-width: 0;
    }

    .bp-arrow {
    color: var(--text-sub);
    font-weight: 900;
    line-height: 1;
    }

    .bp-label {
    font-weight: 600;
    }

    .bp-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    }

    .bp-points {
    font-weight: 600;
    }

    /* ===== アイコン列＋中央の変動表示 ===== */
    .icon-row {
    margin-top: 4px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    }

    .icon-row-team {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 4px;
    /* ここ追加：中の .enemy がちゃんと縮むようにする */
    min-width: 0;
    }

    .icon-row-team--enemy {
    justify-content: flex-end;
    }

    .icon-row--hawkins-hunt {
    justify-content: center;
    }

    .icon-row-team--hawkins-hunt {
    flex: 0 1 auto;
    justify-content: center;
    }

    .icon-row--void-boss {
    justify-content: center;
    }

    .icon-row-team--void-boss {
    display: flex !important;
    flex: 0 1 auto !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 6px !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-inline: auto !important;
    grid-template-columns: none !important;
    }

    .icon-row-team--void-boss .enemy {
    flex: 0 0 auto !important;
    width: 44px !important;
    max-width: 44px !important;
    min-width: 0 !important;
    }

    .icon-row-team--void-boss .enemy-icon-wrap {
    width: 28px !important;
    height: 28px !important;
    }

    .icon-row-team--void-boss .enemy-name {
    max-width: 44px !important;
    font-size: 7px !important;
    line-height: 1.05 !important;
    }

@media (max-width:640px){
  .icon-row.icon-row--void-boss,
  .icon-row.icon-row--hawkins-hunt {
    justify-content: center !important;
  }
  .icon-row-team.icon-row-team--void-boss,
  .icon-row-team.icon-row-team--hawkins-hunt {
    flex: 0 1 auto !important;
    justify-content: center !important;
    width: auto !important;
    margin-inline: auto !important;
    gap: 4px !important;
  }
  .icon-row-team--void-boss .enemy{
    width: 34px !important;
    max-width: 34px !important;
  }
  .icon-row-team--void-boss .enemy-icon-wrap{
    width: 24px !important;
    height: 24px !important;
  }
  .icon-row-team--void-boss .enemy-name{
    max-width: 34px !important;
    font-size: 6.5px !important;
  }
}

    .icon-row-diff {
    min-width: 90px;
    align-self: center;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    }

    .icon-row-diff-label {
    display: block;
    font-size: 11px;
    color: var(--text-sub);
    margin-bottom: 1px;
    }

    .icon-row-diff-value {
    font-size: 15px;
    }

    .icon-row-diff-pos {
    color: #16a34a;
    }

    .icon-row-diff-neg {
    color: #dc2626;
    }

    .icon-row-diff-zero {
    color: #6b7280;
    }

    /* キャラアイコン（細め） */
    .enemy {
    /* アイコン＋名前1人分の幅を固定して、長い名前でも横に伸びすぎないようにする */
    flex: 0 0 70px;
    /* 好きに 64～80 くらいで調整してOK */
    max-width: 70px;
    min-width: 0;
    text-align: center;
    }

    .enemy-name {
    font-size: 9px;
    color: var(--text-sub);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    width: 100%;
    /* 親 .enemy の幅に合わせて省略記号を効かせる */
    }

    /* キャラアイコン枠（ME/MVPでもズレない最終版） */
    .enemy-icon-wrap{
    width: 30px;
    height: 30px;
    margin: 0 auto 1px;
    border-radius: 6px;
    background: #ffffff;
    overflow: visible;

    box-sizing: border-box;
    border: 2px solid transparent;   /* 常に2pxで固定 */
    position: relative;
    }

    .enemy-icon-wrap img{
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    }

    .enemy-icon-wrap.mvp{
    border-color: #facc15;
    box-shadow: 0 0 0 2px rgba(250,204,21,.3);
    background: #fffbe6;
    }

    .enemy-icon-wrap.me{
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,.25);
    background: #eff6ff;
    }

    .member-ranked-badge{
    position: absolute;
    top: -10px;
    left: -9px;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    pointer-events: none;
    z-index: 5;
    }

    .member-ranked-badge[hidden]{
    display: none !important;
    }

    .enemy-icon-wrap .member-ranked-badge-icon{
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 1px 2px rgba(15,23,42,.35));
    }


    .mvp-label {
    display: block;
    margin-top: 0;
    max-width: 100%;
    overflow: hidden;
    font-size: 7px;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #b45309;
    }

    /* ===== ラウンドバー（最終版） ===== */
.rounds-box{
  margin-top: 6px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
}

.round-row{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 800;
}

.round-label{
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.round-time{
  font-size: 12px;
  font-weight: 700;
  color: rgba(15,23,42,.85);
}

.round-result{
  min-width: 56px;
  text-align: right;
}

/* 明るめだけど見やすい色 */
.round-win{
  background: #22c55e;
  color: #0f172a;
}

.round-lose{
  background: #ef4444;
  color: #0f172a;
}

.round-draw{
  background: #f97316;
  color: #0f172a;
}

/* 行の区切り */
.round-row + .round-row{
  border-top: 1px solid rgba(15,23,42,.18);
}


    /* カード下部情報 */
    .match-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-sub);
    padding-top: 4px;
    }

    .footer-left span+span {
    margin-left: 6px;
    }

    .footer-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    text-align: right;
    width: 100%;
    }

    .match-footer-time {
    min-width: 0;
    }

    .match-favorite-btn {
    width: auto;
    min-height: 26px;
    padding: 3px 8px;
    gap: 4px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, .42);
    background: rgba(255, 255, 255, .9);
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
    align-self: center;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease;
    }

    .match-favorite-btn:hover,
    .match-favorite-btn.is-favorite {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, .55);
    background: rgba(254, 243, 199, .92);
    }

    .match-favorite-btn:active {
    transform: scale(.96);
    }

    /* メッセージ */
    .info-message {
    font-size: 13px;
    color: var(--text-sub);
    text-align: center;
    margin-top: 40px;
    }

    @media (max-width: 640px) {

    /* プレイヤー情報を縦並びに */
    .player-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 11px;
    }

    .player-summary-right {
        align-items: stretch;
        width: 100%;
    }

    .player-summary-main {
        width: 100%;
        flex: none;
        align-items: flex-start;
    }

    .player-summary-icon {
        width: 50px;
        height: 50px;
    }

    .player-summary-avatar-stack {
        flex-basis: 56px;
        width: 56px;
    }

    .player-summary-tag {
        font-size: 9px;
    }

    .player-summary-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .player-summary-stat {
        display: grid;
        grid-template-columns: 19px minmax(0, 1fr) auto;
        min-height: 44px;
        padding: 6px 7px;
    }

    .player-summary-stat span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 10px;
        line-height: 1.15;
    }

    .player-summary-actions {
        width: 100%;
    }

    .refresh-limit-notice {
        text-align: left;
    }

    /* カード上部：モード/結果/ポイントを縦に */
    .match-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .match-top-center {
        position: static;
        left: auto;
        transform: none;
        margin-top: 4px;
        text-align: left;
    }

    .match-top-right {
        width: 100%;
        justify-content: flex-start;
        margin-top: 4px;
    }

    /* アイコン行を縦並びにして、名前同士がぶつからないように */
    .icon-row {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .icon-row-team {
        justify-content: flex-start;
    }

    .icon-row-team--enemy {
        justify-content: flex-start;
    }

    /* フッター（時間と勝敗数）も縦並び */
    .match-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    }
    /* =========================
    画像のつぶれ防止（共通）
    ========================= */
    .ranked-page img {
    display: block;          /* inline画像の余計なズレを消す */
    }

    /* 固定サイズアイコンは aspect を守って収める */
    .player-ranked-icon,
    .bp-icon {
    object-fit: contain;
    aspect-ratio: 1 / 1;
    }

/* モードアイコン（CDN画像） */
    .match-type-mode-icons{
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
    }

    .battle-type-thumb{
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    }

    .battle-type-thumb img{
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    }

    .battle-type-mode-separator{
    color: var(--text-sub);
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    opacity: .7;
    }

    .playlist-thumb{
    width: 28px;
    height: 28px;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    }

    .playlist-thumb img{
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: transparent;
    }


    /* タブレット帯：absolute中央表示をやめて崩れ防止 */
    @media (max-width: 900px) {
    .match-top {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .match-top-center {
        position: static;
        left: auto;
        transform: none;
        width: 100%;
        margin-top: 4px;
        text-align: left;
    }

    .match-top-right {
        min-width: 0;
    }
    }

    /* さらに小さい端末：結果文字の圧縮など */
    @media (max-width: 480px) {
    .match-result-main {
        font-size: 18px;
        letter-spacing: 0.08em;
    }

    .match-result-diff {
        font-size: 10px;
        letter-spacing: 0.02em;
    }

    .icon-row-diff {
        min-width: 0;
    }
    }
/* =========================
   Ranked UI hotfix (append)
   ========================= */

/* 4) タブレット/スマホで詰まる問題を緩和 */
@media (max-width: 900px){
  .icon-row-diff{ min-width: 72px; }
  .icon-row-diff-value{ font-size: 14px; }

  .icon-row-team{ gap: 2px; flex-wrap: wrap; }
  .enemy{ flex: 0 0 54px; max-width: 54px; }
  .enemy-icon-wrap{ width: 28px; height: 28px; }
  .enemy-name{ font-size: 8px; }
}

/* 5) タブレットで top-center の絶対配置がキツい時の保険 */
@media (max-width: 860px){
  .match-top{ flex-wrap: wrap; }
  .match-top-center{
    position: static;
    transform: none;
    order: 3;
    width: 100%;
    text-align: left;
    margin-top: 4px;
  }
  .match-top-right{
    min-width: 0;
  }
}

/* 6) スマホではラウンドを “タップで開く” 表示用（details） */
@media (max-width: 640px){
  .rounds-details{
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    margin-top: 8px;
  }
  .rounds-summary{
    list-style: none;
    cursor: pointer;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-main);
    background: #f3f4f6;
  }
  .rounds-details > summary::-webkit-details-marker{ display:none; }
  .rounds-details[open] .rounds-summary{
    border-bottom: 1px solid var(--border-soft);
  }

  /* rounds-box の “二重枠” になりやすいのでスマホだけ枠を弱める */
  .rounds-details .rounds-box{
    border: 0;
    margin-top: 0;
  }
}

/* =========================================================
   Ranked Responsive Fix (mobile/tablet compact mode)
   - Mobile: result on the right of playlist info
             BP under playlist info
             icon row stays 3v3 + diff in one row
             single-round rows are hidden; duration stays in footer
   - Tablet (2-column): shrink enemy blocks to avoid overlap
   ========================================================= */

@media (max-width: 640px){
  /* --- Header layout: left=playlist, right=result, below=BP --- */
  .match-top{
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-rows: auto auto !important;
    align-items: start !important;
    gap: 6px 10px !important;
  }

  .match-top-left{
    grid-column: 1 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
  }

  .match-top-center{
    grid-column: 2 !important;
    grid-row: 1 !important;
    position: static !important;
    transform: none !important;
    width: auto !important;
    margin: 0 !important;
    text-align: right !important;
    justify-self: end !important;
    align-self: start !important;
  }

  .match-top-right{
    grid-column: 1 / span 2 !important;
    grid-row: 2 !important;
    width: 100% !important;
    min-width: 0 !important;
    justify-content: flex-start !important;
    margin: 0 !important;
  }
  .bp-widget{
    align-items: flex-start !important;
  }

  /* --- Icon row: keep 3v3+diff in one row, shrink widths --- */
  .icon-row{
    flex-direction: row !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 6px !important;
  }
  .icon-row-team{
    flex-wrap: nowrap !important;
    gap: 2px !important;
  }
  .icon-row-diff{
    min-width: 56px !important;
    font-size: 12px !important;
    align-self: flex-start !important;
    padding-top: 2px !important;
  }
  .icon-row-diff-label{ font-size: 10px !important; }
  .icon-row-diff-value{ font-size: 13px !important; }

  .enemy{
    flex: 0 0 44px !important;
    max-width: 44px !important;
  }
  .enemy-icon-wrap{
    width: 24px !important;
    height: 24px !important;
    border-radius: 6px !important;
  }
  .member-ranked-badge{
    top: -8px !important;
    left: -7px !important;
    width: 20px !important;
    height: 20px !important;
  }
  .enemy-icon-wrap .member-ranked-badge-icon{
    width: 18px !important;
    height: 18px !important;
  }
  .enemy-name{
    font-size: 7px !important;
    line-height: 1.1 !important;
  }

  /* Meta/footers: slightly denser */
  .match-inner{ padding: 10px 10px !important; }
  .match-mode{ font-size: 13px !important; }
  .match-map{ font-size: 11px !important; }
  .match-result-main{
    font-size: 18px !important;
    letter-spacing: 0.10em !important;
  }
  .match-result-diff{
    font-size: 10px !important;
  }
}

/* iPad landscape～small laptop: 2-column card width is tight */
@media (min-width: 901px) and (max-width: 1100px){
  .icon-row{ gap: 6px !important; }
  .icon-row-diff{ min-width: 72px !important; }
  .enemy{
    flex: 0 0 56px !important;
    max-width: 56px !important;
  }
  .enemy-icon-wrap{ width: 28px !important; height: 28px !important; }
  .enemy-name{ font-size: 8px !important; }
  .icon-row-team{ gap: 2px !important; flex-wrap: nowrap !important; }
}

/* safety: don't force icon-row to column on mobile */
@media (max-width: 640px){
  .icon-row-team--enemy{ justify-content: flex-end !important; }
}


/* アイコン列の最小幅を “画面に合わせて縮む” ようにする */
@media (max-width: 420px) {
  .match-inner {
    padding: 8px 10px; /* 横paddingを少し削る */
  }

  .icon-row {
    gap: 6px;
    min-width: 0;
  }

  .icon-row-team {
    gap: 3px;
    min-width: 0;
  }

  /* 1枠を clamp で縮める（横並びは維持） */
  .enemy {
    width: clamp(34px, 10.5vw, 44px);
    flex: 0 0 clamp(34px, 10.5vw, 44px);
    max-width: clamp(34px, 10.5vw, 44px);
  }

  .enemy-icon-wrap {
    width: clamp(20px, 6.4vw, 24px);
    height: clamp(20px, 6.4vw, 24px);
  }

  .enemy-name {
    font-size: 6.5px;
    line-height: 1.1;
  }

  .enemy-lp {
    font-size: 9px;
    line-height: 1;
  }

  .icon-row-diff {
    min-width: clamp(44px, 14vw, 56px);
  }
}

/* =========================
   Overflow fix for small phones
   ========================= */

/* 念のため：border/padding を幅計算に含める */
*, *::before, *::after { box-sizing: border-box; }

@media (max-width: 420px){
  /* カード内の横paddingを少しだけ削って余白を作る */
  .match-inner{ padding: 10px 9px !important; }

  /* 1行レイアウトのまま “確実に収まる” ように縮める */
  .icon-row{ gap: 4px !important; }
  .icon-row-team{ gap: 2px !important; }

  /* 3人枠：端末幅に応じて縮む */
  .enemy{
    flex: 0 0 clamp(36px, 9.6vw, 42px) !important;
    max-width: clamp(36px, 9.6vw, 42px) !important;
  }
  .enemy-icon-wrap{
    width: clamp(22px, 6.0vw, 24px) !important;
    height: clamp(22px, 6.0vw, 24px) !important;
  }
  .enemy-name{
    font-size: 7px !important;
    line-height: 1.1 !important;
  }

  /* diff枠も少しだけ可変に */
  .icon-row-diff{
    min-width: clamp(44px, 12vw, 52px) !important;
  }
}

/* =========================
   Match card corner radius fix
   ========================= */

/* 外枠（勝敗色ボーダー）をちゃんと角丸に */
.match-frame{
  border-radius:var(--ui-radius-card) !important;
  overflow: hidden !important;
}

/* 内側カードも外枠との差分ぶんだけ角丸を小さく */
.match-inner{
  border-radius:calc(var(--ui-radius-card) - 3px) !important;
}

/* 念のため：中の要素が角丸を破らないように */
.match-inner > *{
  min-width: 0;
}

/* =========================
   Filters (B-1)
   ========================= */
.ranked-filters{
  margin: 10px 0 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
}

.rf-row{
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
  align-items: flex-end;
}

.rf-field{
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: initial;
}

.rf-field--date{
  min-width: 0;
  flex: initial;
}

.rf-label{
  font-size: 11px;
  color: var(--text-sub);
  font-weight: 700;
}

.rf-input{
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: #fff;
  color: var(--text-main);
  font-size: 13px;
  min-width: 0;
}

.rf-actions{
  display: flex;
  gap: 8px;
  margin-left: 0;
  flex-wrap: wrap;
  grid-column: span 2;
}

.rf-btn{
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: #fff;
  color: var(--text-main);
  font-size: 12px;
  padding: 0 12px;
  cursor: pointer;
}

.rf-btn--primary{
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.rf-btn--favorite{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.rf-btn--favorite.is-active{
  color: #92400e;
  border-color: rgba(245, 158, 11, .55);
  background: #fef3c7;
}

.rf-meta{
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-sub);
}

.rf-meta.is-loading{
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #1d4ed8;
}

.rf-meta.is-loading::before{
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid rgba(37, 99, 235, .22);
  border-top-color: #2563eb;
  border-radius: 999px;
  animation: rfMetaSpin .8s linear infinite;
}

@keyframes rfMetaSpin{
  to { transform: rotate(360deg); }
}

/* =========================
   Summary (B-4)
   ========================= */
.ranked-summary{
  margin: 10px 0 14px;
}

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

.rs-card{
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 10px 12px;
}

.rs-k{
  font-size: 11px;
  color: var(--text-sub);
  font-weight: 700;
}

.rs-v{
  margin-top: 4px;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .02em;
}

@media (max-width: 900px){
  .rf-row{
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .rs-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px){
  .rf-actions{ margin-left: 0; width: 100%; }
  .footer-right{
    justify-content: flex-end;
    text-align: right;
  }
  .match-favorite-btn{
    width: auto;
    min-height: 24px;
    padding: 2px 7px;
  }
}

/* =========================
   A-1 Analytics
   ========================= */
.ranked-analytics{
  margin: 12px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px; /* ← ここで一律管理 */
}
.ranked-page [hidden]{
  display: none !important;
}

.ranked-analytics > *{ margin: 0; }

.ra-card{
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-soft, rgba(0,0,0,.10));
  border-radius: 14px;
  padding: 12px;
}

.ra-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.ra-title{
  margin: 0;
  font-size: 14px;
  font-weight: 900;
  color: var(--text-main, #111);
}

.ra-controls{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
}

.ra-control{
  display:flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--text-sub, #555);
  font-weight: 800;
}

.ra-control select{
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border-soft, rgba(0,0,0,.10));
  background: #fff;
  color: var(--text-main, #111);
  font-size: 13px;
  font-weight: 800;
}

.ra-visual-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:12px;
  margin-bottom:12px;
}

.ra-visual-card{
  min-height: 190px;
}

.ra-visual-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:12px;
}

.ra-visual-note{
  color:var(--text-sub, #64748b);
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
}

.battle-donut-layout{
  display:grid;
  grid-template-columns: 108px 1fr;
  gap:14px;
  align-items:center;
}

.battle-donut{
  position:relative;
  width:108px;
  height:108px;
  border-radius:50%;
  background:#e5e7eb;
  display:grid;
  place-items:center;
  box-shadow: inset 0 0 0 1px rgba(2,6,23,.08);
}

.battle-donut::after{
  content:"";
  position:absolute;
  inset:18px;
  border-radius:50%;
  background:var(--bg-card, #fff);
  box-shadow:0 0 0 1px rgba(2,6,23,.08);
}

.battle-donut span{
  position:relative;
  z-index:1;
  color:var(--text-main, #0f172a);
  font-size:20px;
  font-weight:950;
}

.battle-donut-legend{
  display:grid;
  gap:7px;
}

.battle-legend-row{
  display:grid;
  grid-template-columns: 10px 1fr auto auto;
  gap:7px;
  align-items:center;
  font-size:12px;
  color:var(--text-main, #0f172a);
}

.battle-legend-row i{
  width:10px;
  height:10px;
  border-radius:50%;
  box-shadow:0 0 0 1px rgba(2,6,23,.08);
}

.battle-legend-row b{
  font-weight:900;
  text-align:right;
}

.battle-legend-row em{
  min-width:42px;
  color:var(--text-sub, #64748b);
  font-style:normal;
  font-weight:800;
  text-align:right;
}

.recent-result-strip{
  display:grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap:8px;
  align-content:start;
}

.recent-result-dot{
  height:24px;
  border-radius:8px;
  background:#cbd5e1;
  box-shadow: inset 0 -2px 0 rgba(2,6,23,.14);
}

.recent-result-dot.is-win{ background:#22c55e; }
.recent-result-dot.is-loss{ background:#ef4444; }
.recent-result-dot.is-draw{ background:#64748b; }
.recent-result-dot.is-unknown{ background:#cbd5e1; }

.visual-bar-list,
.visual-brawler-list{
  display:grid;
  gap:10px;
}

.visual-bar-row{
  display:grid;
  grid-template-columns: minmax(72px, 1fr) 1.3fr auto;
  gap:8px;
  align-items:center;
}

.visual-bar-label{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--text-main, #0f172a);
  font-size:12px;
  font-weight:900;
}

.visual-bar-track{
  height:10px;
  border-radius:999px;
  background:rgba(2,6,23,.09);
  overflow:hidden;
}

.visual-bar-track i{
  display:block;
  height:100%;
  width:0%;
  border-radius:999px;
  background:var(--ui-primary);
}

.visual-bar-value{
  color:var(--text-main, #0f172a);
  font-size:12px;
  font-weight:900;
  text-align:right;
}

.visual-bar-sub{
  grid-column: 2 / 4;
  color:var(--text-sub, #64748b);
  font-size:11px;
  font-weight:800;
  margin-top:-5px;
}

.visual-brawler-row{
  display:grid;
  grid-template-columns: 34px 1fr;
  gap:9px;
  align-items:center;
}

.visual-brawler-row img{
  width:34px;
  height:34px;
  object-fit:contain;
}

.visual-brawler-main{
  min-width:0;
  display:grid;
  gap:4px;
}

.visual-brawler-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  font-size:12px;
}

.visual-brawler-top b{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-weight:950;
}

.visual-brawler-top span,
.visual-brawler-sub{
  color:var(--text-sub, #64748b);
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
}

.visual-empty{
  color:var(--text-sub, #64748b);
  font-size:12px;
  font-weight:800;
  padding:12px 0;
}

.ra-table-wrap{ overflow-x: auto; }
.ra-table{
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.ra-table th, .ra-table td{
  padding: 10px 8px;
  border-top: 1px solid rgba(0,0,0,.08);
  vertical-align: middle;
  white-space: nowrap;
}

.ra-table thead th{
  border-top: 0;
  font-size: 11px;
  color: var(--text-sub, #666);
  font-weight: 900;
}

.ra-num{ text-align: right; }

.ra-bar{
  height: 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.08);
  overflow: hidden;
  min-width: 140px;
}

.ra-bar > i{
  display:block;
  height: 100%;
  width: 0%;
  background: rgba(17,24,39,.85);
  border-radius: 999px;
}

.ra-chip{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 900;
  color: var(--text-main, #111);
}

.ra-sub{
  display:block;
  font-size: 11px;
  color: var(--text-sub, #666);
  font-weight: 800;
}

@media (max-width: 640px){
  .ra-card{ padding: 10px; }
  .ra-title{ font-size: 13px; }
}

@media (max-width: 1180px){
  .ra-visual-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px){
  .ra-visual-grid{ grid-template-columns: 1fr; }
  .ra-visual-card{ min-height: 0; }
  .battle-donut-layout{ grid-template-columns: 96px 1fr; }
  .battle-donut{ width:96px; height:96px; }
  .battle-donut span{ font-size:18px; }
  .recent-result-strip{ grid-template-columns: repeat(10, 1fr); gap:6px; }
  .recent-result-dot{ height:20px; border-radius:7px; }
}

/* ===== A-1 table readability ===== */

.ra-table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 760px;
  background: #fff;
}

/* ヘッダー固定 + 見やすい背景 */
.ra-table thead th{
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  border-bottom: 1px solid rgba(0,0,0,.10);
}

/* 左寄せを基本にして、数字だけ右寄せ */
.ra-table th,
.ra-table td{
  text-align: left;
  padding: 10px 10px;
  border-top: 1px solid rgba(0,0,0,.08);
  white-space: nowrap;
}

/* 縦線（列の区切り） */
.ra-table th + th,
.ra-table td + td{
  border-left: 1px solid rgba(0,0,0,.08);
}

.ra-num{ text-align: right; }

/* ゼブラ */
.ra-table tbody tr:nth-child(even){
  background: #fbfdff;
}
.ra-table tbody tr:hover{
  background: #f1f5f9;
}

/* 名前セル */
.ra-name-cell{
  display: flex;
  align-items: center;
  gap: 10px;
}
.ra-brawler-ico{
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: block;
  object-fit: contain;
  object-position: center;
  aspect-ratio: 1 / 1;
}
.ra-name-wrap{ display:flex; flex-direction: column; gap: 2px; }

/* 使用率バーは “使用率” だと分かる見せ方に */
.ra-bar{
  height: 8px;
  min-width: 160px;
  background: rgba(0,0,0,.10);
}
.ra-bar > i{
  background: rgba(2,6,23,.85);
}

/* =========================
   A-2/A-3 layout
   ========================= */
/* A-2/A-3 を縦配置に固定 */
.ra-split{
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.ra-table--compact{
  min-width: 640px;
}

@media (max-width: 980px){
  .ra-split{ grid-template-columns: 1fr; }
}

/* ===== Prevent grid items from forcing page overflow ===== */
.ra-split { max-width: 100%; }
.ra-split > * { min-width: 0; }          /* これが超重要 */
.ra-card { min-width: 0; }               /* 念のため */

/* ===== Table horizontal scroll (mobile friendly) ===== */
.ra-table-wrap{
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

/* 長いマップ名だけは折り返し許可（横スクロールもできるが、無駄に横を押さない） */
.ra-table--compact td:first-child,
.ra-table--compact th:first-child{
  white-space: normal;
  max-width: 260px;
}

/* ===== Collapsible (details/summary) ===== */
.ra-fold{
  border: 1px solid var(--border-soft, rgba(0,0,0,.10));
  border-radius: 14px;
  background: var(--bg-card, #fff);
  overflow: hidden;
}

.ra-fold + .ra-fold{ margin-top: 0; }

.ra-fold-summary{
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
}

.ra-fold-summary::-webkit-details-marker{ display:none; }

.ra-fold-title{
  margin: 0;
  font-size: 14px;
  font-weight: 900;
  color: var(--text-main, #111);
}

.ra-fold-inner{ padding: 0 12px 12px; }

/* ===== A-2: モード列を小さめに（長い場合は省略） ===== */
#a2Fold .ra-table--compact th:first-child,
#a2Fold .ra-table--compact td:first-child{
  width: 120px;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== A-3: マップ列を小さめに（改行は許可） ===== */
#a3Fold .ra-table--compact th:first-child,
#a3Fold .ra-table--compact td:first-child{
  width: 200px;
  max-width: 200px;
  white-space: normal;
  word-break: break-word;
}

@media (max-width: 640px){
  #a2Fold .ra-table--compact th:first-child,
  #a2Fold .ra-table--compact td:first-child{
    width: 92px;
    max-width: 92px;
  }

  #a3Fold .ra-table--compact th:first-child,
  #a3Fold .ra-table--compact td:first-child{
    width: 140px;
    max-width: 140px;
  }
}
/* =========================
   A-5 Hourly bars
   ========================= */
.a5-bars{
  display: grid;
  gap: 8px;
}

.a5-row{
  display: grid;
  grid-template-columns: 56px 1fr 64px;
  gap: 10px;
  align-items: center;
}

.a5-hour{
  font-weight: 900;
  font-size: 12px;
  color: var(--text-main, #111);
}

.a5-bar{
  position: relative;
  height: 16px;
  border-radius: 999px;
  background: rgba(0,0,0,.08);
  overflow: hidden;
}

.a5-bar .a5-games{
  position:absolute;
  inset:0 auto 0 0;
  width: 0%;
  background: rgba(2,6,23,.18);
}

.a5-bar .a5-win{
  position:absolute;
  inset:0 auto 0 0;
  width: 0%;
  background: rgba(2,6,23,.75);
}

.a5-rate{
  text-align: right;
  font-weight: 900;
  font-size: 12px;
  color: var(--text-main, #111);
}
/* =========================
   A-6 Duration vs Winrate
   ========================= */
.a6-bars{
  display: grid;
  gap: 10px;
}

.a6-row{
  display: grid;
  grid-template-columns: 72px 1fr 64px;
  gap: 10px;
  align-items: center;
}

.a6-label{
  font-weight: 900;
  font-size: 12px;
  color: var(--text-main, #111);
}

.a6-bar{
  position: relative;
  height: 16px;
  border-radius: 999px;
  background: rgba(0,0,0,.08);
  overflow: hidden;
}

.a6-bar > i{
  position:absolute;
  inset:0 auto 0 0;
  width: 0%;
  background: rgba(2,6,23,.75);
}

.a6-bar--games > i{ background: rgba(2,6,23,.28); }
.a6-bar--win   > i{ background: rgba(2,6,23,.75); }

.a6-rate{
  text-align: right;
  font-weight: 900;
  font-size: 12px;
  color: var(--text-main, #111);
}

@media (max-width: 640px){
  .a6-row{ grid-template-columns: 64px 1fr 56px; }
}

/* small helper note */
.a4-note{
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-sub, #666);
  font-weight: 800;
  margin: 6px 0 0;
}
.a6-meta{
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-sub, #666);
}
/* =========================
   Filters (B-1) 追加調整
   ========================= */

/* 入力をラベル幅いっぱいに */
.rf-input{
  width: 100%;
}

/* 適用ボタンは非表示（JSも後述の通り変更推奨） */
#applyFiltersBtn{
  display: none;
}

/* スマホは2列グリッドにして詰まりを防止（項目が増えても崩れにくい） */
@media (max-width: 640px){
  .rf-row{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
  }
  .rf-field,
  .rf-field--date{
    min-width: 0;
    flex: initial;
  }

  /* リセット等の操作は1行を使う */
  .rf-actions{
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    width: 100%;
    margin-left: 0;
  }

  .rf-actions .rf-btn{
    width: 100%;
  }
}

/* さらに狭い端末は1列 */
@media (max-width: 380px){
  .rf-row{
    grid-template-columns: 1fr;
  }

  #filterFromWrap,
  #filterToWrap{
    grid-column: 1 / -1;
  }
}

#applyFiltersBtn{ display:none !important; }

/* === player page tabs === */
.player-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin: 10px 0 14px;
}

.player-tab{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: #fff;
  color: var(--text-main);
  font-weight: 700;
  text-decoration: none;
  font-size: 13px;
  line-height: 1;
}

.player-tab.is-active{
  background: var(--text-main);
  color:#fff;
  border-color: var(--text-main);
}

@media (max-width: 640px){
  /* 2列にして縦伸びしにくくする */
  .player-tab{ flex: 1 1 calc(50% - 8px); }
}

.battle-history-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin: -4px 0 12px;
  padding: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
}

.battle-history-tab{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-height:34px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background:#fff;
  color: var(--text-main);
  font-size:13px;
  font-weight:800;
  line-height:1;
  text-decoration:none;
}

.battle-history-tab-icon{
  width:18px;
  height:18px;
  object-fit:contain;
  flex:0 0 auto;
}

.battle-history-tab.is-active{
  background: #0f172a;
  border-color:#0f172a;
  color:#fff;
}

.stats-choice-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin: -4px 0 12px;
  padding: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
}

.stats-choice-tab{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background:#fff;
  color: var(--text-main);
  font-size:13px;
  font-weight:800;
  line-height:1;
  text-decoration:none;
}

.stats-choice-tab.is-active{
  background:#0f172a;
  border-color:#0f172a;
  color:#fff;
}

@media (max-width: 640px){
  .battle-history-tab{ flex: 1 1 calc(50% - 8px); }
  .stats-choice-tab{ flex: 1 1 calc(50% - 8px); }
}

.enemy-more-wrap{
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
}

.manual-update-btn {
  font-size: 12px;
  border-radius: 999px; /* 丸角 */
  min-height: 32px;
  height: 32px;
  padding: 0 11px;
  line-height: 1;
  border: 1px solid var(--border-soft);
  background: #ffffff;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 6px; /* 右のボタンとの隙間 */
  transition: background 0.2s;
}

.manual-update-btn:hover:not(:disabled) {
  background: #f9fafb;
}

.manual-update-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f3f4f6; /* 無効時は少しグレーに */
}

/* 回転アニメーション（更新中アイコン用） */
.spin-anim {
  animation: spin 1s linear infinite;
}

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

/* =========================
   Quick Check (直近戦績ダイジェスト)
   ========================= */
.quick-check-section {
  margin-bottom: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px 14px;
}

.qc-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* スマホでも崩れないグリッドレイアウトに変更 */
.qc-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 6px;
  width: 100%;
}

.qc-item {
  aspect-ratio:1 / 1;
  min-height:0;
  width: 100%;

  border-radius: 0;
  background: #f3f4f6;
  border: 1px solid #e5e7eb; /* 外枠（薄いグレー） */

  /* ★重要: 勝敗ごとのカラーライン */
  border-bottom: 3px solid transparent;

  display: flex;
  align-items: center;
  justify-content: center;

  position: relative;
  transition: transform 0.1s;
  overflow:hidden;
  cursor:pointer;
  color:#111827;

  /* ★重要: 画像が枠を隠さないよう、内側に余白を強制的に持たせる */
  padding: 5px;
  box-sizing: border-box;
}

/* 勝利（緑） */
.qc-item.is-victory {
  border-bottom-color: #22c55e;
  background: #f0fdf4; /* ごく薄い緑 */
}

/* 敗北（赤） */
.qc-item.is-defeat {
  border-bottom-color: #ef4444;
  background: #fff1f2; /* ごく薄い赤 */
}

/* 引き分け（オレンジ） */
.qc-item.is-draw {
  border-bottom-color: #f59e0b;
  background: #fffbeb;
}

/* 画像の設定 */
.qc-item img {
  /* 枠内に収め、背景色を隠さない */
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter:none;
}

.qc-item:focus-visible{outline:3px solid var(--primary, #2563eb);outline-offset:2px;}
.qc-item .qc-mode-icon{width:22px;height:22px;}
.qc-item .qc-brawler-icon{position:absolute;right:0;bottom:0;width:15px;height:15px;filter:none;}
.qc-item .qc-rank{position:absolute;left:0;bottom:0;display:flex;align-items:center;justify-content:center;width:13px;height:13px;}
.qc-item .qc-rank img{width:13px;height:13px;flex:none;filter:none;}
.match-card{scroll-margin-top:90px;}
.match-card:focus{outline:2px solid var(--primary, #2563eb);outline-offset:3px;}

/* === タブレット・スマホでの微調整 === */
@media (max-width: 768px) {
  .qc-list {
    gap: 4px; /* 隙間を詰める */
    /* アイコンサイズを少し小さくしてもOKならここを調整 */
    grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  }
  
  .qc-item {
    /* モバイルでは下線を少し細くしてバランスを取る */
    border-bottom-width: 3px;
    padding: 4px; /* 余白を確保 */
  }
}

@media (max-width: 640px){
  .rf-field--period{
    grid-column: 1 / -1;
  }

  #filterFromWrap{
    grid-column: 1;
  }

  #filterToWrap{
    grid-column: 2;
  }
}

/* Ranked layout overrides 2026-04-19 */
.match-list-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:8px 0 12px;
  min-height:40px;
}

.match-list-toolbar .ranked-pagination{
  margin:0;
}

.match-list-refresh{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.refresh-limit-notice--list{
  flex:1 1 auto;
  margin:0;
  min-width:0;
  font-size:12px;
  line-height:1.35;
  text-align:left;
}

.ranked-pagination--bottom{
  justify-content:center;
  margin:14px 0 0;
  min-height:32px;
}

.manual-update-btn--list{
  margin-right:0;
  white-space:nowrap;
}

.rf-btn--favorite{
  white-space:nowrap;
  min-width:max-content;
}

@media (max-width: 640px){
  .rf-row{
    grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
  }

  .rf-field,
  .rf-field--date,
  .rf-field--period,
  .rf-field--season{
    grid-column:auto !important;
    width:100%;
    min-width:0 !important;
  }

  .rf-actions{
    grid-column:1 / -1 !important;
    grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
    align-items:center;
  }

  .rf-actions .rf-btn{
    width:100%;
    min-width:0;
    padding-inline:8px;
    height:40px;
    min-height:40px;
  }

  .ranked-filters .rf-input,
  .rf-field select.rf-input,
  .rf-field input.rf-input{
    box-sizing:border-box;
    height:40px;
    min-height:40px;
    max-height:40px;
    padding-block:0;
    line-height:normal;
  }

  .match-list-toolbar{
    align-items:stretch;
    flex-direction:column;
  }

  .match-list-refresh{
    align-items:stretch;
    flex-direction:column;
    gap:6px;
    width:100%;
  }

  .match-list-toolbar .manual-update-btn,
  .match-list-toolbar .ranked-pagination{
    width:100%;
  }

  .match-list-toolbar .ranked-pagination,
  .ranked-pagination--bottom{
    justify-content:space-between;
  }

  .ranked-pagination button{
    flex:1 1 0;
    min-width:0;
  }

  .ranked-page-info{
    flex:0 0 auto;
    min-width:42px;
    text-align:center;
  }
}

@media (max-width: 360px){
  .rf-btn--favorite{
    font-size:11px;
  }
}

/* Solo Showdown has up to 10 independent teams. Keep it inside the card. */
.icon-row--solo-showdown{
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  gap:6px !important;
  width:100%;
  min-width:0;
}

.icon-row-team--solo-showdown{
  display:grid !important;
  grid-template-columns:repeat(5, minmax(0, 1fr)) !important;
  gap:6px 4px !important;
  width:100%;
  max-width:620px;
  margin:0 auto;
  min-width:0;
  justify-items:center !important;
  align-items:start !important;
}

.icon-row-team--solo-showdown .enemy{
  flex:none !important;
  width:100% !important;
  max-width:58px !important;
  min-width:0 !important;
}

.icon-row-team--solo-showdown .enemy-icon-wrap{
  width:30px !important;
  height:30px !important;
}

.icon-row--duo-showdown{
  display:flex !important;
  flex-direction:row !important;
  align-items:center !important;
  justify-content:center !important;
  gap:4px 6px !important;
  width:100%;
  min-width:0;
}

.icon-row--duo-showdown > .icon-row-diff{
  flex:none;
  align-self:center !important;
  padding-top:0 !important;
  min-width:48px !important;
}

.icon-row-team--duo-showdown{
  display:flex !important;
  flex-direction:column !important;
  flex:none !important;
  flex-wrap:nowrap !important;
  align-items:center !important;
  justify-content:flex-start !important;
  gap:4px !important;
  width:auto !important;
  max-width:none;
  margin:0;
  min-width:0;
}

.icon-row-vs{
  flex:none;
  align-self:center;
  width:18px;
  height:18px;
  padding:0;
  line-height:0;
  user-select:none;
}

.icon-row-vs img{
  display:block;
  width:100%;
  height:100%;
  object-fit:contain;
}

.icon-row-team--duo-showdown .enemy{
  flex:none !important;
  width:100% !important;
  max-width:58px !important;
  min-width:0 !important;
}

.icon-row-team--duo-showdown .enemy-icon-wrap{
  width:30px !important;
  height:30px !important;
}

.icon-row--trio-showdown{
  display:grid !important;
  grid-template-columns:minmax(0, 1fr) auto minmax(0, 1fr) !important;
  grid-template-areas:
    "tl mid tr"
    "bl mid br";
  gap:8px 10px !important;
  width:100%;
  max-width:420px;
  margin:0 auto;
  min-width:0;
  justify-items:center !important;
  align-items:center !important;
}

.icon-row--trio-showdown > .icon-row-diff{
  grid-area:mid;
  align-self:center !important;
  justify-self:center;
  min-width:52px !important;
  padding-top:0 !important;
}

.icon-row-team--trio-tl{ grid-area:tl; }
.icon-row-team--trio-tr{ grid-area:tr; }
.icon-row-team--trio-bl{ grid-area:bl; }
.icon-row-team--trio-br{ grid-area:br; }

.icon-row-team--trio-showdown{
  display:flex !important;
  flex:none !important;
  flex-direction:row !important;
  flex-wrap:nowrap !important;
  justify-content:center !important;
  gap:2px !important;
  width:100%;
  min-width:0;
}

.icon-row-team--trio-showdown .enemy{
  flex:none !important;
  width:100% !important;
  max-width:58px !important;
  min-width:0 !important;
}

.icon-row-team--trio-showdown .enemy-icon-wrap{
  width:30px !important;
  height:30px !important;
}

@media (max-width:640px){
  .icon-row-team--solo-showdown{
    gap:5px 2px !important;
  }

  .icon-row-team--solo-showdown .enemy{
    max-width:48px !important;
  }

  .icon-row-team--solo-showdown .enemy-icon-wrap{
    width:25px !important;
    height:25px !important;
  }

  .icon-row--duo-showdown,
  .icon-row--trio-showdown{
    justify-content:center !important;
    align-items:center !important;
  }

  .icon-row--duo-showdown > .icon-row-diff{
    min-width:40px !important;
  }

  .icon-row-team--duo-showdown{
    gap:4px !important;
  }

  .icon-row-team--duo-showdown .enemy{
    max-width:48px !important;
  }

  .icon-row-team--duo-showdown .enemy-icon-wrap{
    width:25px !important;
    height:25px !important;
  }

  .icon-row-vs{
    width:14px;
    height:14px;
  }

  .icon-row--trio-showdown{
    max-width:340px;
    gap:6px 6px !important;
  }

  .icon-row--trio-showdown > .icon-row-diff{
    min-width:44px !important;
  }

  .icon-row-team--trio-showdown .enemy{
    max-width:48px !important;
  }

  .icon-row-team--trio-showdown .enemy-icon-wrap{
    width:25px !important;
    height:25px !important;
  }
}

@media (max-width:360px){
  .icon-row-team--solo-showdown .enemy{
    max-width:42px !important;
  }

  .icon-row-team--solo-showdown .enemy-icon-wrap{
    width:23px !important;
    height:23px !important;
  }

  .icon-row-team--duo-showdown .enemy{
    max-width:42px !important;
  }

  .icon-row-team--duo-showdown .enemy-icon-wrap{
    width:23px !important;
    height:23px !important;
  }

  .icon-row-vs{
    width:12px;
    height:12px;
  }

  .icon-row-team--trio-showdown .enemy{
    max-width:42px !important;
  }

  .icon-row-team--trio-showdown .enemy-icon-wrap{
    width:23px !important;
    height:23px !important;
  }
}

.profile-social-links{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:6px;
  margin-top:7px;
}
.profile-social-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:32px;
  height:32px;
  padding:0;
  border:1px solid var(--border, #d7dce5);
  border-radius:999px;
  color:inherit;
  background:var(--card, #fff);
  font-size:17px;
  text-decoration:none;
  transition:transform .15s ease, opacity .15s ease;
}
.profile-social-icon{
  display:block;
  width:18px;
  height:18px;
  fill:currentColor;
  flex:0 0 18px;
}
.profile-social-link:hover{
  transform:translateY(-1px);
  opacity:.88;
}
.profile-social-link--x{
  color:#111;
}
.profile-social-link--youtube{
  color:#fff;
  border-color:#ff0033;
  background:#ff0033;
}

/* 5v5 match cards: show all five brawlers without overflowing.
   Layout is 3 icons on the first row and 2 icons centered between them. */
.icon-row-team--five-stack{
  flex:0 1 156px !important;
  max-width:156px !important;
  min-width:0 !important;
  display:grid !important;
  grid-template-columns:repeat(6, minmax(0, 1fr)) !important;
  gap:3px 0 !important;
  align-items:start !important;
  justify-items:center !important;
  justify-content:center !important;
}

.icon-row-team--five-stack.icon-row-team--enemy{
  justify-content:center !important;
}

.icon-row-team--five-stack .enemy{
  flex:none !important;
  width:42px !important;
  max-width:42px !important;
  min-width:0 !important;
}

.icon-row-team--five-stack .enemy:nth-child(1){ grid-column:1 / span 2; grid-row:1; }
.icon-row-team--five-stack .enemy:nth-child(2){ grid-column:3 / span 2; grid-row:1; }
.icon-row-team--five-stack .enemy:nth-child(3){ grid-column:5 / span 2; grid-row:1; }
.icon-row-team--five-stack .enemy:nth-child(4){ grid-column:2 / span 2; grid-row:2; }
.icon-row-team--five-stack .enemy:nth-child(5){ grid-column:4 / span 2; grid-row:2; }

.icon-row-team--five-stack .enemy-icon-wrap{
  width:25px !important;
  height:25px !important;
}

.icon-row-team--five-stack .enemy-name{
  max-width:42px !important;
  font-size:7px !important;
  line-height:1.05 !important;
}

@media (max-width:640px){
  .icon-row--five-stack{
    gap:4px !important;
  }

  .icon-row-team--five-stack{
    flex-basis:122px !important;
    max-width:122px !important;
  }

  .icon-row-team--five-stack .enemy{
    width:34px !important;
    max-width:34px !important;
  }

  .icon-row-team--five-stack .enemy-icon-wrap{
    width:23px !important;
    height:23px !important;
  }

  .icon-row-team--five-stack .enemy-name{
    max-width:34px !important;
    font-size:6.5px !important;
  }

  .icon-row--five-stack .icon-row-diff{
    min-width:42px !important;
  }
}

@media (max-width:380px){
  .icon-row-team--five-stack{
    flex-basis:112px !important;
    max-width:112px !important;
  }

  .icon-row-team--five-stack .enemy{
    width:31px !important;
    max-width:31px !important;
  }

  .icon-row-team--five-stack .enemy-icon-wrap{
    width:21px !important;
    height:21px !important;
  }

  .icon-row--five-stack .icon-row-diff{
    min-width:36px !important;
  }
}

/* Brawler win streak should be plain text/icon, not a bordered pill. */
.brawler-streak-widget{
  height:auto !important;
  padding:0 !important;
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  color:#92400e !important;
  box-shadow:none !important;
}

.bp-widget .ranked-streak-widget{
  margin-top: 1px;
  max-width: 100%;
  justify-content: flex-end;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

.bsc-tournament-archive {
  margin: 0 0 16px;
  padding: 16px;
  border: 1px solid #d4dbe5;
  border-radius: 14px;
  background: #fff;
}

.bsc-tournament-archive-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.bsc-tournament-archive-copy,
.bsc-tournament-archive-status {
  margin: 0;
  color: #536174;
  font-size: 13px;
  line-height: 1.65;
}

.bsc-tournament-archive-copy {
  max-width: 780px;
  color: #1e293b;
  font-weight: 700;
}

.bsc-tournament-archive-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.bsc-tournament-archive-status {
  margin-top: 12px;
  width: fit-content;
  padding: 6px 9px;
  border-radius: 8px;
  background: #f1f5f9;
  font-weight: 800;
}

.bsc-tournament-archive-status:empty {
  display: none;
}

.bsc-tournament-archive-status.is-error {
  background: #fff1f2;
  color: #be123c;
}

.bsc-tournament-archive-status.is-success {
  background: #ecfdf3;
  color: #08783e;
}

.bsc-tournament-archive-status.is-running {
  background: #eff6ff;
  color: #1d4ed8;
}

.bsc-tournament-import-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 14px;
  background: #0f172a;
  color: #fff;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.bsc-tournament-import-button:hover {
  background: #1e293b;
  color: #fff;
  text-decoration: none;
}

.bsc-tournament-import-button[hidden] {
  display: none;
}

.bsc-tournament-import-button:disabled {
  opacity: .55;
  cursor: wait;
}

.match-frame--has-tournament-details {
  cursor: pointer;
}

.tournament-match-detail-toggle {
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.tournament-match-detail-toggle:hover,
.tournament-match-detail-toggle[aria-expanded="true"] {
  border-color: #64748b;
  background: #f1f5f9;
  color: #0f172a;
}

.match-favorite-btn,
.tournament-match-detail-toggle {
  width: auto !important;
  min-height: 28px !important;
  height: 28px !important;
  padding: 0 9px !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  line-height: 1 !important;
  white-space: nowrap;
}

.tournament-match-detail-panel {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid #dbe2ea;
  cursor: default;
}

.tournament-match-detail-panel[hidden] {
  display: none;
}

.tournament-match-detail-panel.is-message {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.tournament-match-detail-panel.is-error {
  color: #be123c;
}

.tournament-round-detail + .tournament-round-detail {
  margin-top: 10px;
}

.tournament-round-detail > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: #334155;
  font-size: 12px;
}

.tournament-round-detail > header span {
  font-weight: 700;
}

.tournament-round-detail > header span.is-victory {
  color: #15803d;
}

.tournament-round-detail > header span.is-defeat {
  color: #dc2626;
}

.tournament-round-detail > header span.is-draw {
  color: #64748b;
}

.tournament-stats-table {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 36px repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #dbe3ec;
  border-radius: 10px;
  background: #fff;
}

.tournament-stats-table.is-ally-only {
  grid-template-columns: 52px repeat(5, minmax(0, 1fr));
}

.tournament-stats-table.is-five-v-five {
  grid-template-columns: repeat(5, minmax(0, 1fr)) 36px repeat(5, minmax(0, 1fr));
}

.tournament-stats-player,
.tournament-stats-value,
.tournament-stats-axis {
  min-width: 0;
  border-right: 1px solid #edf2f7;
  border-bottom: 1px solid #edf2f7;
}

.tournament-stats-table.is-three-v-three .tournament-stats-player:nth-child(7n),
.tournament-stats-table.is-three-v-three .tournament-stats-value:nth-child(7n),
.tournament-stats-table.is-three-v-three .tournament-stats-axis:nth-child(7n),
.tournament-stats-table:not([class*="is-"]) .tournament-stats-player:nth-child(7n),
.tournament-stats-table:not([class*="is-"]) .tournament-stats-value:nth-child(7n),
.tournament-stats-table:not([class*="is-"]) .tournament-stats-axis:nth-child(7n) {
  border-right: 0;
}

.tournament-stats-table.is-ally-only .tournament-stats-player:nth-child(6n),
.tournament-stats-table.is-ally-only .tournament-stats-value:nth-child(6n) {
  border-right: 0;
}

.tournament-stats-table.is-ally-only .tournament-stats-axis {
  border-right: 1px solid #edf2f7;
}

.tournament-stats-table.is-five-v-five .tournament-stats-player:nth-child(11n),
.tournament-stats-table.is-five-v-five .tournament-stats-value:nth-child(11n),
.tournament-stats-table.is-five-v-five .tournament-stats-axis:nth-child(11n) {
  border-right: 0;
}

.tournament-stats-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  padding: 6px 3px 4px;
  background: #f8fafc;
  text-align: center;
}

.tournament-stats-player.is-player-team,
.tournament-stats-value.is-player-team {
  background: #eff6ff;
}

.tournament-stats-player.is-empty,
.tournament-stats-value.is-empty {
  background: #f8fafc;
}

.tournament-stats-player img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.tournament-stats-name {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  color: #0f172a;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tournament-stats-value {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 2px;
  color: #0f172a;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tournament-stats-axis {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 1px;
  background: #e8eef6;
  color: #475569;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-align: center;
}

.tournament-stats-axis.is-head {
  background: #e8eef6;
  border-bottom: 1px solid #edf2f7;
}

.tournament-stats-table.is-ally-only .tournament-stats-axis {
  justify-content: flex-start;
  padding-left: 6px;
  padding-right: 4px;
  text-align: left;
}

.tournament-stats-table.is-ally-only .tournament-stats-axis.is-head {
  font-size: 10px;
}

.tournament-round-detail.is-total {
  padding-top: 8px;
  border-top: 1px dashed #cbd5e1;
}

@media (max-width: 700px) {
  .bsc-tournament-archive {
    padding: 13px;
  }

  .bsc-tournament-archive-head {
    display: block;
  }

  .bsc-tournament-archive-actions {
    margin-top: 10px;
  }

  .bsc-tournament-import-button {
    width: 100%;
  }

  .tournament-stats-table {
    grid-template-columns: repeat(3, minmax(0, 1fr)) 28px repeat(3, minmax(0, 1fr));
  }

  .tournament-stats-table.is-ally-only {
    grid-template-columns: 42px repeat(5, minmax(0, 1fr));
  }

  .tournament-stats-table.is-five-v-five {
    grid-template-columns: repeat(5, minmax(0, 1fr)) 28px repeat(5, minmax(0, 1fr));
  }

  .tournament-stats-player {
    padding: 5px 2px 3px;
  }

  .tournament-stats-player img {
    width: 22px;
    height: 22px;
  }

  .tournament-stats-name {
    font-size: 8px;
  }

  .tournament-stats-value {
    padding: 2px 1px;
    font-size: 9px;
  }

  .tournament-stats-axis {
    font-size: 8px;
  }
}
