/* ===========================================
   EXVS2IB スマホファースト レスポンシブCSS
=========================================== */

/* 全体背景色 */
#main {
    background-color: #f3f4f6 !important;
}

/* WordPressテーマの1200px固定幅を上書き */
@media screen and (max-width: 767px) {
    #main,
    #header-in,
    #navi-in,
    #body-in,
    #footer-in {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 10px;
        padding-right: 10px;
        box-sizing: border-box;
    }

    body,
    #body,
    #container,
    .entry-content,
    .post {
        max-width: 100% !important;
        width: 100% !important;
        overflow-x: hidden;
    }

    .wrapper {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0px;
    }
}

/* msgbox1を流用した新クラス（横幅制限あり） */
.data-msgbox {
    background: linear-gradient(135deg, #0543a8 0%, #0077ff 100%);
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 4px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

/* 機体カードコンポーネント */
.machine-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.machine-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.machine-card__header {
    display: flex;
    align-items: center;
    padding: 12px;
    background: linear-gradient(135deg, #1e1e1e 0%, #333 100%);
}

.machine-card__image {
    width: 120px;
    height: auto;
    margin-right: 12px;
}

.machine-card__image--large {
    width: 180px;
    margin-right: 0;
}

.machine-card__name {
    color: #fff;
    font-size: 16px;
    font-weight: bold;
}

.machine-card__body {
    padding: 12px;
}

.machine-card__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    text-align: center;
}

.machine-card__stat-item {
    padding: 12px;
    background: #f5f5f5;
    border-radius: 4px;
}

.machine-card__stat-label {
    font-size: 16px;
    color: #666;
    display: block;
    margin-bottom: 4px;
}

.machine-card__stat-value {
    font-weight: bold;
    color: #333;
}

.machine-card__stat-value--win { color: #d62d20; }
.machine-card__stat-value--use { color: #0057e7; }

/* 数値と単位を分けて表示 */
.stat-number {
    font-size: 24px;
    font-weight: bold;
    margin-right: 2px;
}

.stat-unit {
    font-size: 16px;
    font-weight: normal;
}
.machine-card__stat-value--diff-plus { color: #d62d20; }
.machine-card__stat-value--diff-minus { color: #0057e7; }

.machine-card__stat-date {
    display: block;
    font-size: 12px;
    font-weight: normal;
    color: #888;
    margin-top: 2px;
}

/* ナビゲーションタブ */
.exvs2ib-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px;
    background: #1e1e1e;
    border-radius: 8px;
}

.exvs2ib-nav__item {
    padding: 12px 8px;
    text-align: center;
    background: #fff;
    border: 2px solid #ccc;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.exvs2ib-nav__item:hover {
    background: #e8f0fe;
    border-color: #0543a8;
    color: #0543a8;
}

.exvs2ib-nav__item--active {
    background: #0543a8;
    border-color: #0543a8;
    color: #fff;
}

.exvs2ib-nav__item--active:hover {
    background: #0543a8;
    border-color: #0543a8;
    color: #fff;
}

/* PC/スマホ切り替え */
.exvs2ib-desktop { display: none; }
.exvs2ib-mobile { display: block; }

@media screen and (min-width: 768px) {
    .exvs2ib-desktop { display: block; }
    .exvs2ib-mobile { display: none; }

    .exvs2ib-nav {
        grid-template-columns: repeat(4, 1fr);
    }

    .machine-card__image { width: 150px; }
}

/* 機体一覧ソートボタン */
.machine-list-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.machine-list-sort__label {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.machine-list-sort__btn {
    padding: 8px 16px;
    font-size: 16px;
    font-weight: bold;
    border: 2px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.machine-list-sort__btn:hover {
    border-color: #0543a8;
    background: #f0f4ff;
}

.machine-list-sort__btn--active {
    border-color: #0543a8;
    background: #0543a8;
    color: #fff;
}

.machine-list-sort__btn--active:hover {
    background: #0432a8;
    border-color: #0432a8;
}

/* 機体一覧グリッド */
.machine-list-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

@media screen and (min-width: 768px) {
    .machine-list-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 機体リストアイテム（横一列レイアウト） */
.machine-list-item {
    display: flex;
    align-items: center;
    padding: 8px;
    background: #e8f0fe;
    border: 2px solid #c4d7f5;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    cursor: pointer;
}

.machine-list-item:hover {
    border-color: #0543a8;
    background: #d4e4fc;
}

.machine-list-item__image {
    width: 140px;
    height: auto;
    flex-shrink: 0;
}

.machine-list-item__stats {
    display: flex;
    flex: 1;
    margin-left: 8px;
    gap: 6px;
}

.machine-list-item__stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 6px 4px;
    background: #fff;
    border-radius: 4px;
    height: 48px;
}

.machine-list-item__stat-label {
    font-size: 16px;
    color: #666;
    line-height: 1;
}

.machine-list-item__stat-value {
    font-size: 16px;
    font-weight: bold;
    line-height: 1.3;
}

.machine-list-item__stat-value--win {
    color: #d62d20;
}

.machine-list-item__stat-value--use {
    color: #0057e7;
}


/* 週間データページ */
.exvs2ib-week {
    width: 100%;
}

.exvs2ib-week__date-selector {
    margin-bottom: 16px;
}

.exvs2ib-week__date-selector select {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

@media screen and (min-width: 768px) {
    .exvs2ib-week__date-selector select {
        width: auto;
        min-width: 300px;
    }
}

/* サマリーコンテナ（勝ち組・負け組） */
.exvs2ib-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media screen and (min-width: 768px) {
    .exvs2ib-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

.exvs2ib-summary__section {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.exvs2ib-summary__title {
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
}

.exvs2ib-summary__title--win {
    background: linear-gradient(135deg, #d62d20 0%, #ff4444 100%);
    color: #fff;
}

.exvs2ib-summary__title--lose {
    background: linear-gradient(135deg, #0057e7 0%, #0077ff 100%);
    color: #fff;
}

/* 機体詳細ページ */
.exvs2ib-machine-detail {
    width: 100%;
}

.machine-detail__hero {
    text-align: center;
    margin-bottom: 24px;
    padding: 16px;
    background: linear-gradient(135deg, #1e1e1e 0%, #333 100%);
    border-radius: 8px;
}

.machine-detail__hero img {
    max-width: 200px;
    height: auto;
}

.machine-detail__section {
    margin-bottom: 32px;
}

.machine-detail__section h2 {
    font-size: 18px;
    padding: 12px;
    background: #f5f5f5;
    border-left: 4px solid #0543a8;
    margin-bottom: 16px;
}

/* アップデートページ */
.exvs2ib-update {
    width: 100%;
}

.update-date-selector {
    margin-bottom: 16px;
}

.update-date-selector select {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

@media screen and (min-width: 768px) {
    .update-date-selector select {
        width: auto;
        min-width: 200px;
    }
}

/* アップデートカードグリッド */
.update-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media screen and (min-width: 768px) {
    .update-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (min-width: 1200px) {
    .update-card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* アップデートカード 2カラムレイアウト */
.update-stats-columns {
    display: flex;
    gap: 12px;
}

.update-stats-column {
    flex: 1;
    border: 2px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.update-stats-column--use {
    border-color: #0057e7;
}

.update-stats-column--win {
    border-color: #d62d20;
}

.update-stats-column__header {
    padding: 8px 12px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    color: #fff;
}

.update-stats-column--use .update-stats-column__header {
    background: #0057e7;
}

.update-stats-column--win .update-stats-column__header {
    background: #d62d20;
}

.update-stats-column__body {
    padding: 8px;
}

.update-stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border-radius: 4px;
}

.update-stats-row:nth-child(odd) {
    background: #f5f5f5;
}

.update-stats-row__label {
    font-size: 14px;
    color: #666;
}

.update-stats-row__value {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.update-stats-row--diff {
    margin-top: 4px;
    border-top: 1px dashed #ddd;
    padding-top: 10px;
}

.diff-plus {
    color: #d62d20;
}

.diff-minus {
    color: #0057e7;
}

.update-stats-row__value--diff .stat-number {
    font-size: 24px;
}

.diff-plus .stat-number,
.diff-plus .stat-unit {
    color: #d62d20;
}

.diff-minus .stat-number,
.diff-minus .stat-unit {
    color: #0057e7;
}

/* 差分表示 */
.diff-up {
    color: #d62d20;
    font-weight: bold;
}

.diff-down {
    color: #0057e7;
    font-weight: bold;
}

.diff-none {
    color: #666;
}

/* モバイル用機体カード（週間データ・アップデート用） */
.exvs2ib-ranking-card {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 8px;
}

.exvs2ib-ranking-card__rank {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0543a8;
    color: #fff;
    font-weight: bold;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
}

.exvs2ib-ranking-card__rank--gold { background: #ffd700; color: #333; }
.exvs2ib-ranking-card__rank--silver { background: #c0c0c0; color: #333; }
.exvs2ib-ranking-card__rank--bronze { background: #cd7f32; color: #fff; }

.exvs2ib-ranking-card__image {
    width: 70px;
    height: auto;
    margin-right: 12px;
    flex-shrink: 0;
}

.exvs2ib-ranking-card__info {
    flex: 1;
    min-width: 0;
}

.exvs2ib-ranking-card__name {
    font-size: 16px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.exvs2ib-ranking-card__stats {
    display: flex;
    gap: 12px;
    font-size: 16px;
}

.exvs2ib-ranking-card__stat {
    display: flex;
    flex-direction: column;
}

.exvs2ib-ranking-card__stat-label {
    color: #666;
    font-size: 16px;
}

.exvs2ib-ranking-card__stat-value {
    font-weight: bold;
}

/* コスト帯セクション */
.exvs2ib-cost-section {
    margin-bottom: 24px;
}

.exvs2ib-cost-section__title {
    font-size: 18px;
    font-weight: bold;
    padding: 12px 16px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.exvs2ib-cost-section__toggle {
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid currentColor;
    transition: transform 0.3s;
}

.exvs2ib-cost-section.is-collapsed .exvs2ib-cost-section__toggle {
    transform: rotate(-90deg);
}

.exvs2ib-cost-section__content {
    padding-top: 16px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.exvs2ib-cost-section.is-collapsed .exvs2ib-cost-section__content {
    display: none;
}

.exvs2ib-cost-section__title--3000 {
    background: linear-gradient(135deg, #d62d20 0%, #ff4444 100%);
    color: #fff;
}

.exvs2ib-cost-section__title--2500 {
    background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
    color: #fff;
}

.exvs2ib-cost-section__title--2000 {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: #333;
}

.exvs2ib-cost-section__title--1500 {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    color: #fff;
}

/* テーブルのレスポンシブ対応 */
.exvs2ib-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.exvs2ib-table-wrapper table {
    min-width: 600px;
}

/* 週選択ナビゲーション */
.exvs2ib-week-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.exvs2ib-week-nav__btn {
    padding: 8px 16px;
    background: #e5e5e5;
    border: none;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    transition: background 0.2s;
}

.exvs2ib-week-nav__btn:hover {
    background: #0543a8;
    color: #fff;
}

.exvs2ib-week-nav__btn--disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* 機体別グラフ */
.machine-charts {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin: 16px 0;
}

.machine-charts__item {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.machine-charts__title {
    padding: 12px 16px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
}

.machine-charts__title--win {
    background: linear-gradient(135deg, #d62d20 0%, #ff4444 100%);
}

.machine-charts__title--use {
    background: linear-gradient(135deg, #0057e7 0%, #0077ff 100%);
}

@media screen and (min-width: 768px) {
    .machine-charts {
        flex-direction: row;
    }

    .machine-charts__item {
        flex: 1;
    }
}

/* 汎用データテーブル（テキスト寄せは実装側で指定） */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
    font-size: 16px;
}

.data-table th {
    background: linear-gradient(135deg, #1e1e1e 0%, #333 100%);
    color: #fff;
    padding: 10px 8px;
    font-weight: bold;
}

.data-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #eee;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:nth-child(even) td {
    background: #f9f9f9;
}

/* 新機体ページ */
.exvs2ib-new-machine {
    width: 100%;
}

.new-machine-info {
    text-align: center;
    padding: 8px 0;
    margin-bottom: 8px;
    border-bottom: 1px dashed #ddd;
}

.new-machine-info__date {
    font-size: 16px;
    color: #666;
    font-weight: bold;
}

/* ==========================================
   週間データページ用スタイル
========================================== */

/* クラスマッチ回数カード */
.week-match-card {
    background: linear-gradient(135deg, #1e1e1e 0%, #333 100%);
    color: #fff;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 16px;
}

.week-match-card__label {
    font-size: 16px;
    color: #ccc;
}

.week-match-card__value {
    display: block;
    margin: 8px 0;
}

.week-match-card__num {
    font-size: 36px;
    font-weight: bold;
}

.week-match-card__unit {
    font-size: 18px;
    font-weight: normal;
}

.week-match-card__diff {
    font-size: 14px;
}

.week-match-card__diff--plus {
    color: #4ade80;
}

.week-match-card__diff--minus {
    color: #f87171;
}

/* 勝ち組・負け組 機体数カード */
.week-count-cards {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.week-count-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    border-radius: 8px;
    color: #fff;
}

.week-count-card--win {
    background: linear-gradient(135deg, #d62d20 0%, #ff4444 100%);
}

.week-count-card--lose {
    background: linear-gradient(135deg, #0057e7 0%, #0077ff 100%);
}

.week-count-card__label {
    font-size: 16px;
    font-weight: bold;
}

.week-count-card__value {
    display: block;
}

.week-count-card__num {
    font-size: 28px;
    font-weight: bold;
}

.week-count-card__unit {
    font-size: 16px;
    font-weight: normal;
}

/* 週間ランキングコンテナ */
.week-ranking-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
}

@media screen and (min-width: 768px) {
    .week-ranking-container {
        flex-direction: row;
    }
}

/* 週間ランキングテーブル */
.week-ranking-table-wrap {
    flex: 1;
    width: 100% !important;
    min-width: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.week-ranking-table__header {
    padding: 12px 16px;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    text-align: center;
}

.week-ranking-table__header--win {
    background: linear-gradient(135deg, #d62d20 0%, #ff4444 100%);
}

.week-ranking-table__header--lose {
    background: linear-gradient(135deg, #0057e7 0%, #0077ff 100%);
}

.week-ranking-table {
    display: table !important;
    width: 100% !important;
    border-collapse: collapse;
    background: #fff;
    font-size: 16px;
    margin: 0 !important;
}

.week-ranking-table th,
.week-ranking-table td {
    font-size: 16px;
}

.week-ranking-table thead,
.week-ranking-table tbody,
.week-ranking-table tr {
    display: table-row-group;
    width: 100%;
}

.week-ranking-table thead {
    display: table-header-group;
}

.week-ranking-table tr {
    display: table-row;
}

.week-ranking-table th,
.week-ranking-table td {
    display: table-cell;
}

/* 勝ち組テーブル（赤系） */
.week-ranking-table-wrap--win .week-ranking-table thead {
    background: #d62d20;
}

.week-ranking-table-wrap--win .week-ranking-table thead th {
    background: #d62d20;
    color: #fff;
}

.week-ranking-table-wrap--win .week-ranking-table tbody tr:nth-child(odd) {
    background: #fee8e8;
}

.week-ranking-table-wrap--win .week-ranking-table tbody tr:nth-child(even) {
    background: #fff0f0;
}

/* 負け組テーブル（青系） */
.week-ranking-table-wrap--lose .week-ranking-table thead {
    background: #0057e7;
}

.week-ranking-table-wrap--lose .week-ranking-table thead th {
    background: #0057e7;
    color: #fff;
}

.week-ranking-table-wrap--lose .week-ranking-table tbody tr:nth-child(odd) {
    background: #e8f0fe;
}

.week-ranking-table-wrap--lose .week-ranking-table tbody tr:nth-child(even) {
    background: #f0f6ff;
}

.week-ranking-table th {
    padding: 10px 8px;
    font-weight: bold;
    text-align: center;
}

.week-ranking-table td {
    padding: 8px 4px;
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    vertical-align: middle;
}

/* 順位の色付き丸デザイン */
.week-ranking-table__td--rank {
    font-weight: bold;
    font-size: 16px;
}

.week-ranking-table__td--rank .rank-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #666;
    color: #fff;
    font-weight: bold;
}

.week-ranking-table__td--rank .rank-circle--gold { background: #ffd700; color: #333; }
.week-ranking-table__td--rank .rank-circle--silver { background: #c0c0c0; color: #333; }
.week-ranking-table__td--rank .rank-circle--bronze { background: #cd7f32; color: #fff; }

.week-ranking-table__td--machine img {
    width: 140px;
    height: auto;
}

.week-ranking-table__td--num,
.week-ranking-table__td--rate {
    font-weight: bold;
    font-size: 16px;
}

.week-ranking-table__td--win {
    color: #d62d20;
}

.week-ranking-table__td--lose {
    color: #0057e7;
}

/* SP版: テーブル調整 */
@media screen and (max-width: 767px) {
    .week-ranking-table__td--machine img {
        width: 140px;
    }

    .week-ranking-table th,
    .week-ranking-table td {
        padding: 6px 4px;
    }

    .week-ranking-table__td--rank .rank-circle {
        width: 28px;
        height: 28px;
    }
}

/* 勝率ラベル（通常版） */
.winrate-label {
    display: block;
    text-align: center;
    font-weight: 900;
    color: #333;
}

.winrate-num {
    font-size: 28px;
    font-weight: 900;
    color: #fff;
    text-shadow: 1px 1px 0 #000;
}

.winrate-unit {
    font-size: 16px;
    color: #666;
}

/* 勝率ラベル（白黒反転版） */
.winrate-label--inverted {
    display: block;
    text-align: center;
    font-weight: 900;
    color: #fff;
}

.winrate-label--inverted .winrate-num {
    font-size: 28px;
    color: #fff;
    text-shadow: 1px 1px 0 #000;
}

.winrate-label--inverted .winrate-unit {
    font-size: 16px;
    color: #ccc;
}

/* ==========================================
   勝率分布テーブル（新デザイン）
========================================== */
.week-winrate-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 !important;
}

.week-winrate-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    min-width: 600px;
    margin: 0 !important;
    font-size: 16px;
}

/* ヘッダー行：スクロール時固定 */
.week-winrate-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.week-winrate-table th {
    background: #1e1e1e;
    color: #fff;
    padding: 10px 8px;
    text-align: center;
    font-weight: bold;
}

/* 一番左のヘッダーセル */
.week-winrate-table th:first-child {
    position: sticky;
    left: 0;
    z-index: 20;
    background: #1e1e1e;
    font-size: 24px;
    padding-left: 12px;
    padding-right: 12px;
}

/* 一番左のカラム：スクロール時固定、黒背景 */
.week-winrate-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 5;
    background: #1e1e1e;
    padding-top: 18px;
    padding-left: 12px;
    padding-right: 12px;
}

.week-winrate-table td {
    padding: 8px;
    text-align: center;
    vertical-align: top;
    border-bottom: 1px solid #eee;
}

/* 交互の背景色（薄いグレー） */
.week-winrate-table tbody tr:nth-child(odd) td:not(:first-child) {
    background: #fff;
}

.week-winrate-table tbody tr:nth-child(even) td:not(:first-child) {
    background: #fafafa;
}

/* コスト画像 */
.week-winrate-table th img {
    width: 100px;
    height: auto;
}

/* 勝率分布テーブル */
.table_machine_image td:first-child {
    text-align: center;
    vertical-align: middle;
}

/* 勝率分布テーブル - SP: 1列、PC: 2列 */
.exvs2ib-week .yokonarabi {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

@media screen and (min-width: 768px) {
    .exvs2ib-week .yokonarabi {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* 勝率分布テーブル：機体画像とアイコン */
.week-machine-wrap {
    position: relative;
    display: inline-block;
}

.week-machine-img {
    width: 120px;
    height: auto;
}

/* 順位アイコン（1~50位）：左上に配置 */
.week-icon-rank {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
}

/* バッジ（highest, worst, new）：左下に配置 */
.week-icon-badge {
    position: absolute;
    left: 0;
    bottom: 12px;
    width: 50px;
}

/* SP版: アイコンサイズ調整 */
@media screen and (max-width: 767px) {
    .week-icon-rank {
        width: 35px;
    }

    .week-icon-badge {
        width: 50px;
    }
}

/* 勝率分布グリッド */
.week-winrate-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

@media screen and (min-width: 768px) {
    .week-winrate-grid--double {
        grid-template-columns: repeat(2, 1fr);
    }

    .week-winrate-grid--single {
        grid-template-columns: 1fr;
    }
}

/* 勝率分布アイテム */
.week-winrate-item {
    display: flex;
    align-items: center;
    padding: 8px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.week-winrate-item__image-wrap {
    position: relative;
    flex-shrink: 0;
}

.week-winrate-item__image {
    width: 100px;
    height: auto;
}

.week-winrate-item__rank {
    position: absolute;
    top: 0;
    right: 0;
    width: 35px;
}

.week-winrate-item__badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 45px;
}

.week-winrate-item__stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 0 8px;
}

.week-winrate-item__winp {
    font-size: 20px;
    font-weight: bold;
    color: #d62d20;
}

.week-winrate-item__usep {
    font-size: 14px;
    color: #0057e7;
}

/* グラフコンテナ */
.week-chart-container {
    width: 100%;
    height: 450px;
}

@media screen and (min-width: 768px) {
    .week-chart-container {
        height: 350px;
    }
}

/* グラフ凡例 */
.week-chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
    font-size: 14px;
}

.week-chart-legend__item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.week-chart-legend__color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* ==========================================
   プレイ回数ページ
========================================== */
.exvs2ib-play-count {
    width: 100%;
}

/* プレイ回数グラフコンテナ */
.play-count-chart-container {
    width: 100%;
    height: 300px;
    margin-top: 16px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@media screen and (min-width: 768px) {
    .play-count-chart-container {
        height: 400px;
    }
}

/* 統計サマリー */
.play-count-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 16px 0;
}

@media screen and (min-width: 768px) {
    .play-count-stats {
        grid-template-columns: repeat(6, 1fr);
        gap: 12px;
    }
}

.play-count-stats__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 8px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: 80px;
}

.play-count-stats__label {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.play-count-stats__value {
    color: #333;
    text-align: center;
    line-height: 1.3;
}

.play-count-stats__value .stat-number {
    font-size: 24px;
    font-weight: bold;
}

.play-count-stats__value .stat-unit {
    font-size: 14px;
    font-weight: normal;
}

.play-count-stats__item .play-count-stats__date,
small.play-count-stats__date {
    display: block;
    font-size: 12px;
    font-weight: normal;
    color: #888 !important;
    margin-top: 2px;
}

/* 凡例 */
.play-count-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 14px;
}

.play-count-legend__item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.play-count-legend__shape {
    width: 14px;
    height: 14px;
}

.play-count-legend__shape--star {
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

/* ナビゲーション6項目対応 */
@media screen and (min-width: 768px) {
    .exvs2ib-nav {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ==========================================
   機体ランクページ
========================================== */
.exvs2ib-rank {
    width: 100%;
}

.exvs2ib-rank .wrapper {
    width: 100%;
}

/* ランクタイトル */
.exvs2ib-rank .rank_title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    padding: 12px 16px;
    background: #fff;
    border: 2px solid #0543a8;
    border-radius: 8px;
    margin-bottom: 16px;
    outline: none;
}

.exvs2ib-rank .rank_title:focus {
    border-color: #0077ff;
    box-shadow: 0 0 0 3px rgba(5, 67, 168, 0.2);
}

/* 入力フォームエリア */
.exvs2ib-form-area {
    margin-top: 24px;
}

.exvs2ib-form-group {
    margin-bottom: 12px;
}

/* アイコン付き入力 */
.exvs2ib-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.exvs2ib-input-icon {
    position: absolute;
    left: 14px;
    color: #666;
    font-size: 16px;
    z-index: 1;
}

.exvs2ib-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #ccc;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.exvs2ib-input--with-icon,
.exvs2ib-input-wrap .exvs2ib-input {
    padding-left: 42px !important;
}

.exvs2ib-input:focus {
    outline: none;
    border-color: #0543a8;
    box-shadow: 0 0 0 3px rgba(5, 67, 168, 0.2);
}

.exvs2ib-input:focus + .exvs2ib-input-icon,
.exvs2ib-input-wrap:focus-within .exvs2ib-input-icon {
    color: #0543a8;
}

.exvs2ib-input::placeholder {
    color: #999;
}

/* ボタングループ */
.exvs2ib-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

/* ボタン共通 */
.exvs2ib-btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* プライマリボタン（保存） */
.exvs2ib-btn--primary {
    background: linear-gradient(135deg, #0543a8 0%, #0077ff 100%);
    color: #fff;
}

.exvs2ib-btn--primary:hover {
    background: linear-gradient(135deg, #0432a8 0%, #0066ee 100%);
    box-shadow: 0 4px 8px rgba(5, 67, 168, 0.3);
}

/* セカンダリボタン（更新） */
.exvs2ib-btn--secondary {
    background: #fff;
    color: #0543a8;
    border: 2px solid #0543a8;
}

.exvs2ib-btn--secondary:hover {
    background: #e8f0fe;
}

/* 警告ボタン（初期化） */
.exvs2ib-btn--danger {
    background: #fff;
    color: #d62d20;
    border: 2px solid #d62d20;
}

.exvs2ib-btn--danger:hover {
    background: #fee8e8;
}

/* ひな壇表示ボタン */
.exvs2ib-btn--flat {
    background: #fff;
    color: #666;
    border: 2px solid #999;
}

.exvs2ib-btn--flat:hover {
    background: #f0f0f0;
}

/* Twitterシェア */
.exvs2ib-share {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

@media screen and (min-width: 768px) {
    .exvs2ib-input {
        max-width: 400px;
    }
}

/* ランクページ説明文（SEO用） */
.rank-description {
    font-size: 13px;
    color: #888;
    line-height: 1.8;
    margin: 16px 0;
    padding: 0;
}

/* ランクページ注意書き */
.rank-guide {
    background: #f8f9fa;
    border-left: 4px solid #0543a8;
    padding: 12px 16px;
    margin: 16px 0;
    font-size: 14px;
    color: #555;
    line-height: 1.8;
}
