/* --- General --- */
.text-right {
    text-align: right;
}


.gacha-selector-container {
    display: flex;
    align-items: center;
    padding: 0px 15px;
    gap: 10px;
}

#gacha-select {
    width: 150px;
    height: 32px;
    margin: 4px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

#gacha-select:focus {
    width: max-content;
    max-width: 150px;
    min-width: 150px;
    z-index: 10;
}


/* --- Tabs --- */
.tabs {
    display: flex;
    box-sizing: border-box;
}

.tab-button {
    padding: 10px 25px;
    cursor: pointer;
    background: #f1f1f1;
    border: 1px solid #ccc;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
}

.tab-button.active {
    background: #fff;
    border-bottom: 2px solid #fff;
    margin-bottom: -2px;
}

/* 通知バッジ */
.tab-button.has-updates {
    position: relative;
    padding-right: 30px; /* バッジ分のスペースを確保 */
}

.tab-button.has-updates::after {
    content: '!';
    position: absolute;
    top: 6px;
    right: 6px;
    background-color: #ef4444; /* Red */
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.tab-content {
    display: none;
    border-top: none;
    margin-top: 120px;
    margin-bottom: 20px;
}

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

.tab-content h2 {
    margin-top: 0;
}

/* --- Tables (共通) --- */
table {
    border-collapse: collapse;
    margin-top: 10px;
    margin-bottom: 10px;
    table-layout: fixed;
    margin-left: auto;
    margin-right: auto;
    border: 3px solid black;
}

th,
td {
    border: 1px solid black;
    padding: 0 5px;
    text-align: center;
    vertical-align: middle;
    height: 32px;
    box-sizing: border-box;
}

th {
    background-color: #333333;
    color: #FFFFFF;
}

/* --- Input Cell Styles --- */
.input-cell {
    background-color: #CBE5FF;
}

.no_border {
    border: none;
    outline: none;
    background-color: transparent;
    width: 100%;
    height: 100%;
    padding: 5px;
    box-sizing: border-box;
    font-size: 1em;
    font-family: inherit;
    color: inherit;
    text-align: center;
}

/* 新規マーク */
.new-mark {
    color: #fff;
    font-weight: bold;
    font-size: 0.85em;
    margin-right: 4px;
    vertical-align: middle;
    border: 1px solid #f50057;
    border-radius: 4px;
    padding: 0 3px;
    background-color: #f50057;
    float: left;
    /* 枠の左端に合わせる */
}

.item-count-input.text-right {
    text-align: right;
}

.probability-cell-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.probability-cell-container input {
    text-align: right;
    flex-grow: 1;
}

.probability-cell-container span {
    margin-left: 4px;
    padding-right: 8px;
}

.per-item-prob-cell {
    text-align: right;
}

/* --- Table Specific Sizes --- */
#gacha-base-table {
    width: auto;
}

#gacha-base-table th {
    white-space: nowrap;
}

#gacha-base-table td {
    width: 522px;
}

#rarity-table {
    width: min(620px, 100%);
}

#item-table {
    width: 100%;
}

#draw-targer-table {
    width: auto;
}

#draw-targer-table th {
    width: 140px;
    white-space: nowrap;

}

#draw-targer-table td {
    width: 500px;
}

.result-table {
    width: 100%;
}

.total-summary-table {
    width: 100%;
}

.total-summary-table thead {
    border: 3px solid black;
}

.summary-table {
    width: 100%;
}

.modal-item-table {
    min-width: 600px;
}

.download-table {
    width: 100%;
}

/* --- Column Widths --- */
/* Rarity Table */
.col-rarity-no {
    width: 60px;
}

.col-rarity-name {
    width: 200px;
}

.col-rarity-item-count {
    width: 100px;
}

.col-rarity-probability {
    width: 100px;
}

.col-rarity-per-item {
    width: 100px;
}

.col-rarity-actions {
    width: 60px;
}

/* Item Table */
.col-item-rarity {
    min-width: 120px;
    width: 20%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.rarity-cell-inner {
    min-height: 64px;
    display: flex;
    /* ← 縦並び&センターに便利 */
    flex-direction: column;
    /* 数字 → チェックボックス の縦積み */
    align-items: center;
    /* 水平方向の中央揃え */
    justify-content: center;
}

.col-item-no {
    width: 60px;
}

.comp-wrap {
    display: flex;
    /* ← 縦並び&センターに便利 */
    flex-direction: column;
    /* 数字 → チェックボックス の縦積み */
    align-items: center;
    /* 水平方向の中央揃え */
    justify-content: center;
    /* 垂直方向の中央揃え（セル内で中央） */
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.item-comp-check {
    display: none;
}

/* SVGアイコン共通 */
.svg-check .check-icon {
    width: 30px;
    height: 30px;
    stroke: white;
    stroke-width: 3;
    fill: none;
    border-radius: 6px;
    padding: 3px;
    box-sizing: border-box;
    background: #ef4444;
}

/* 未チェック時：×を表示、✔を非表示 */
.svg-check .check-mark {
    display: none;
}

.svg-check .cross-mark {
    display: block;
}

/* チェック済み：背景を緑にし、×→✔へ切り替え */
.svg-check:has(.item-comp-check:checked) .check-icon {
    background: #45a049;
}

.svg-check:has(.item-comp-check:checked) .cross-mark {
    display: none;
}

.svg-check:has(.item-comp-check:checked) .check-mark {
    display: block;
}

.col-item-name {
    width: auto;
}

.col-item-file {
    width: auto;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.col-item-actions {
    width: 60px;
}

/* History & Result Table */
.col-history-no {
    border-top: 3px solid black;
    width: 60px;
}

.col-history-person {
    border-top: 3px solid black;
}

.col-history-info {
    border-top: 3px solid black;
    width: auto;
}

.col-history-pulls {
    border-top: 3px solid black;
    width: 100px;
}

.col-history-rarity,
.col-download-rarity {
    min-width: 120px;
    width: 15%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.col-history-item-no,
.col-download-item-no {
    width: 45px;
}

.col-history-item-name {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.col-download-item-name {
    width: auto;
    word-break: break-all;
}

.col-history-item-count,
.col-download-item-count {
    width: 100px;
}

.col-history-actions {
    border-top: 3px solid black;
    width: 45px;
}

/* Summary Table */
.col-summary-no {
    border-top: 3px solid black;
    width: 60px;
}

.col-summary-person {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    border-top: 3px solid black;
}

td.col-summary-person,
td.col-summary-link,
td.col-summary-actions {
    background-color: #CFFAE0;
}

.col-summary-actions {
    border-top: 3px solid black;
    width: 120px;
}

.col-summary-link {
    border-top: 3px solid black;
    width: auto;
}

.col-summary-link-actions {
    width: 120px;
}

.col-summary-rarity {
    min-width: 120px;
    width: 15%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.col-summary-item-no {
    width: 45px;
}

.col-summary-item-name {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    width: auto;
}

.col-summary-item-count {
    width: 100px;
}

.original-count {
    display: inline-block;
}

/* ▼▼▼ この行を追加 ▼▼▼ */
.col-test-summary-percentage {
    width: 100px;
}

/* Modal Table */
.col-modal-rarity {
    width: 120px;
}

.col-modal-no {
    width: 60px;
}

.col-modal-name {
    width: auto;
}

.col-modal-original {
    width: 80px;
}

.col-modal-final {
    width: 80px;
}

/* --- Buttons --- */
#add-rarity-btn {
    display: block;
    margin: 0 auto;
}

.gacha-actions,
.form-actions {
    text-align: center;
    display: flex;
    justify-content: center;

}

.delete-btn,
.cancel-btn {
    background-color: #da190b;
    color: white;
    border-color: #da190b;
    margin: 0px 15px;
}

.delete-btn:hover,
.cancel-btn:hover {
    background-color: #f44336;
    color: white;
    border-color: #f44336;
    margin: 0px 15px;
}

button:disabled.delete-btn {
    background-color: #e0e0e0;
    border-color: #ccc;
    color: #999;
}

.save-btn,
.copy-btn {
    background-color: #45a049;
    color: white;
    border-color: #45a049;
    margin: 0px 15px;
}

.save-btn:hover,
.copy-btn:hover {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.delete-gacha-btn,
.copy-gacha-btn {
    display: none;
}

/* --- Modal --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    border-radius: 8px;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #333;
    font-size: 1.2em;
}

.modal-buttons {
    text-align: right;
    margin-top: 20px;
}

.modal-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    margin-left: 10px;
}

.modal-buttons button.cancel-btn {
    background-color: #f44336;
    color: white;
}

.modal-buttons button.save-btn {
    background-color: #4CAF50;
    color: white;
}

.modal-buttons button.cancel-btn:hover {
    background-color: #da190b;
}

.modal-buttons button.save-btn:hover {
    background-color: #45a049;
}

body.modal-open {
    overflow: hidden;
}

.modal-table-wrapper {
    max-height: 50vh;
    overflow-y: auto;
}

/* --- Sticky Controls --- */
.sub-header {
    position: fixed;
    width: min(max(80%, 1024px), 100%);
    top: 70px;
    background-color: #fff;
    z-index: 10;
    display: flex;
    align-items: center;
    border-bottom: 2px solid #ccc;
    box-sizing: border-box;
}

.gacha-selector-container label {
    font-weight: bold;
    white-space: nowrap;
}

/* =================================== */
/* SVG Tweet Icon Button Styles        */
/* =================================== */

/* ボタン自体のスタイル */
.tweet-icon-btn {
    background-color: #000000;
    /* 背景色を黒に変更 */
    border: none;
    /* 枠線なし */
    cursor: pointer;
    /* カーソルを指マークに */
    padding: 5px;
    /* 内側の余白 */
    border-radius: 6px;
    /* 角丸四角に変更 */
    display: inline-flex;
    /* アイコンを中央揃えにするため */
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    /* ホバー時のアニメーション */
}

/* ボタン内のSVGアイコンのスタイル */
.tweet-icon-btn .tweet-svg-icon {
    width: 20px;
    /* アイコンの幅 */
    height: 20px;
    /* アイコンの高さ */
    fill: #FFFFFF;
    /* アイコンの色を白に変更 */
}

/* ボタンにマウスが乗った時のスタイル */
.tweet-icon-btn:hover {
    background-color: #272727;
    /* 少し明るい黒に変更 */
}

/* マウスが乗った時のSVGアイコンのスタイル (色は白のままなので不要) */
/* .tweet-icon-btn:hover .tweet-svg-icon {
    fill: #FFFFFF;
} */

.delete-icon-btn {
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    /* ホバー時のアニメーションを追加 */
}

.delete-icon-btn .delete-svg-icon {
    width: 20px;
    /* Xアイコンと同じサイズ */
    height: 20px;
    /* Xアイコンと同じサイズ */
    fill: #E53E3E;
    /* アイコンの通常時の色を赤に */
    transition: fill 0.2s;
    /* ホバー時のアニメーションを追加 */
}

/* ボタンにマウスが乗った時のスタイル */
.delete-icon-btn:hover {
    background-color: rgba(229, 62, 62, 0.1);
    /* 背景を薄い赤に */
}

/* マウスが乗った時のSVGアイコンのスタイル */
.delete-icon-btn:hover .delete-svg-icon {
    fill: #C53030;
    /* アイコンの色を濃い赤に */
}

.delete-icon-btn:disabled {
    background-color: #f0f0f0;
    /* 背景を薄いグレーに */
    cursor: not-allowed;
    /* カーソルを「進入禁止」に */
    border-radius: 6px;
    /* 角丸を維持 */
}

/* disabled状態のボタン内のSVGアイコンの色を指定 */
.delete-icon-btn:disabled .delete-svg-icon {
    fill: #bbbbbb;
    /* アイコンの色をグレーにする */
}

/* disabled状態のボタンはホバーしてもスタイルが変わらないようにする */
.delete-icon-btn:disabled:hover {
    background-color: #f0f0f0;
}

.delete-icon-btn:disabled:hover .delete-svg-icon {
    fill: #bbbbbb;
}

.add-icon-btn {
    /* 通常時のスタイル (「保存する」ボタンに準拠) */
    background-color: #45a049;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.add-icon-btn .add-svg-icon {
    /* 通常時のアイコンの色 */
    width: 20px;
    height: 20px;
    stroke: #FFFFFF;
    /* 線の色 */
    stroke-width: 3;
    /* ← これで太さを変えられる */
    stroke-linecap: round;
    /* 端を丸くする */
}


/* ボタンにマウスが乗った時のスタイル */
.add-icon-btn:hover {
    background-color: #4CAF50;
    /* 少し濃い緑色 (ホバー時の保存ボタンに準拠) */
}

.summary-icon-btn {
    background-color: white;
    border: 1px solid #ccc;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    vertical-align: middle;
    /* テキストと高さを揃える */
}

.summary-icon-btn .summary-svg-icon {
    width: 20px;
    height: 20px;
    fill: #333;
}

.summary-icon-btn:hover {
    background-color: #f0f0f0;
    border-color: #999;
}

/* 内容更新が必要なボタンのスタイル */
.summary-icon-btn.needs-update-btn,
.summary-icon-btn.not-created-btn {
    border-color: #F59E0B;
    /* Amber 500 */
    background-color: #FFFBEB;
    /* Amber 50 */
}

.summary-icon-btn.needs-update-btn .summary-svg-icon,
.summary-icon-btn.not-created-btn .summary-svg-icon {
    fill: #D97706;
    /* Amber 600 */
}

.summary-icon-btn.needs-update-btn:hover,
.summary-icon-btn.not-created-btn:hover {
    background-color: #FEF3C7;
    /* Amber 100 */
    border-color: #D97706;
}

/* リンクURLのテキストスタイル */
.link-url {
    margin-left: 8px;
    vertical-align: middle;
    color: #007bff;
}

.upload-icon-btn {
    border: 1px solid #ccc;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    vertical-align: middle;
    /* テキストと高さを揃える */
}

.upload-icon-btn .upload-svg-icon {
    width: 20px;
    height: 20px;
    fill: #333;
    /* アイコンの色を濃いグレーに */
}

.upload-icon-btn:hover {
    background-color: #99CCFF;
    border-color: #999;
}

/* ファイル名表示のspanとの間隔を調整 */
.item-file-cell .file-name-span {
    margin-left: 8px;
    vertical-align: middle;
}

/* ファイル名表示のspanとの間隔を調整 */
.item-file-cell .file-name-span {
    margin-left: 8px;
    vertical-align: middle;
}

.auto-calc-cell {
    background-color: #f0f0f0;
    /* Light grey background for the cell */
    cursor: not-allowed;
}

.auto-calc-field {
    background-color: transparent !important;
    /* Make input transparent */
    color: #555;
    font-style: italic;
    cursor: not-allowed;
}

/* --- Download Page Specific Styles --- */
.download-btn {
    display: inline-block;
    text-decoration: none;
    color: white;
    background-color: #5cb85c;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
}

.download-btn:hover {
    background-color: #4cae4c;
}

.no-file-notice {
    display: inline-block;
    padding: 8px 12px;
    font-size: 0.9em;
    color: #888;
    background-color: #f0f0f0;
    border-radius: 6px;
    text-align: center;
}

/* --- Style Overrides for result-table on download page --- */

.download-link {
    text-decoration: underline;
    /* 下線を戻す */
    font-weight: bold;
    color: #007bff;
    /* リンクっぽい青 */
}

.download-link:hover {
    color: #0056b3;
}

.icon-download {
    width: auto;
    /* 横幅は自動 */
    height: 100%;
    /* 親セルの高さにフィット */
    max-height: 1.5em;
    /* 行が広がりすぎるのを防ぐなら制限 */
    vertical-align: middle;
    /* 縦位置を真ん中に */
    fill: #007bff;
    /* テキスト色と同じにする */
}

.no-file-notice-inline {
    font-size: 0.9em;
    color: #888;
    margin-left: 8px;
    font-weight: normal;
}

/* =================================== */
/* File Upload Spinner Styles          */
/* =================================== */
.spinner-container {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    vertical-align: middle;
}

.upload-spinner {
    width: 20px;
    height: 20px;
    fill: #333;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(-360deg);
    }
}

/* =================================== */
/* Draw Action Button Styles           */
/* =================================== */
.draw-actions {
    display: flex;
    align-items: center;
    /* ボタンを中央で揃える */
    justify-content: center;
    gap: 80px;
}

.draw-actions-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.main-draw-buttons {
    display: grid;
    /* グリッドレイアウトを利用 */
    grid-template-columns: 1fr 1fr;
    /* 2つのボタンを均等な幅に */
    gap: 40px;
}

.custom-draw-group {
    display: flex;
}

.custom-num-input {
    flex-grow: 1;
    /* 入力欄が伸びるように */
    width: 100px;
    padding: 10px;
    font-size: 1.1em;
    border: 2px solid #ccc;
    border-radius: 8px 0 0 8px;
    text-align: center;

    /* Firefox用 */
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Chrome, Safari, Edge, Opera 用 */
.custom-num-input::-webkit-inner-spin-button,
.custom-num-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.draw-btn {
    padding: 10px 30px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    color: white;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.custom-draw-group .draw-btn {
    border-radius: 0 8px 8px 0;
    margin-left: -2px;
}

.draw-btn-secondary {
    /* ▼▼▼ 「コンプ」ボタンのスタイルを修正 ▼▼▼ */
    background: linear-gradient(to top, #BF953F, #FCF6BA 50%, #B38728);
    color: white;
    /* 文字を白抜きに変更 */
    border: 1px solid #8c6c22;
    border-radius: 8px;
    box-shadow:
        inset 0 1px 1px #fff3c9,
        inset 0 -1px 1px #775a18,
        0 4px 6px rgba(0, 0, 0, 0.2);
    /* 濃い影を付けて文字を読みやすくする */
    text-shadow: 1px 1px 2px #4a2511, -1px -1px 2px #4a2511, 1px -1px 2px #4a2511, -1px 1px 2px #4a2511;
    padding: 15px 40px;
    /* ボタンを横長にする */
    position: relative;
    overflow: hidden;
    font-weight: bold;
    transition: all 0.1s ease-in-out;
    /* ▲▲▲ ここまで修正 ▲▲▲ */
}

/* 光沢を表現するための疑似要素 */
.draw-btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -85%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    transition: left 0.6s ease;
}

.draw-btn-secondary:hover {
    background: linear-gradient(to top, #c7a14e, #fdf8c7 50%, #bc922e);
    cursor: pointer;
}

.draw-btn-secondary:hover::before {
    left: 150%;
    /* ホバー時に光沢が移動するアニメーション */
}

/* ボタンを押したときの効果 */
.draw-btn-secondary:active {
    background: linear-gradient(to bottom, #BF953F, #FCF6BA 50%, #B38728);
    box-shadow: inset 0 2px 4px #775a18, 0 1px 2px rgba(0, 0, 0, 0.2);
    transform: translateY(2px);
}


/* 全更新ボタン (#update-all-links-btn) のスタイル */
/* ダークグレー背景用に色を反転 */
#update-all-links-btn {
    border-color: #D97706;
    /* Amber 600 (濃いオレンジの境界線) */
    background-color: #F59E0B;
    /* Amber 500 (オレンジの背景) */
}

/* 全更新ボタン内のアイコンの色 */
#update-all-links-btn .summary-svg-icon {
    fill: #FFFFFF;
    /* アイコンを白にする */
}

/* 全更新ボタンのマウスオーバー時 */
#update-all-links-btn:hover {
    background-color: #D97706;
    /* Amber 600 (少し濃いオレンジの背景) */
    border-color: #B45309;
    /* Amber 700 (さらに濃いオレンジの境界線) */
}

/* 全更新メッセージのスタイル */
#update-all-message {
    margin-top: 6px;
    display: inline-block;
    margin-left: 8px;
    font-size: 0.8em;
    vertical-align: middle;
    color: #f97316;
}

/* エラーメッセージ用のクラス (任意) */
#update-all-message.error {
    color: #dc2626;
    /* 例: エラーメッセージを赤色にする */
}

/* =================================== */
/* Responsive Styles for Download Page (Table Layout) */
/* =================================== */
@media (max-width: 768px) {

    body {
        font-size: 12px;
    }

    .sub-header {
        flex-wrap: wrap;
    }



    /* #gacha-select {
        width: 100px;
    }

    #gacha-select:focus {
        max-width: 100px;
        min-width: 100px;
    } */

    .col-rarity-no {
        width: 45px;
    }

    .col-rarity-name {
        width: auto;
    }

    .col-rarity-item-count {
        width: 65px;
    }

    .col-rarity-probability {
        width: 80px;
    }

    .col-rarity-per-item {
        width: 80px;
    }

    .col-rarity-actions {
        width: 45px;
    }

    .col-item-rarity {
        min-width: 100px;
    }


    .col-item-no {
        width: 50px;
    }

    .col-item-actions {
        width: 45px;
    }


    .col-history-no {
        width: 45px;
    }

    .col-history-rarity {
        min-width: 100px;
    }

    .col-history-pulls {
        width: 80px;
    }

    .col-summary-rarity {
        min-width: 100px;
    }

    .col-summary-item-count {
        width: 80px;
    }

    .col-summary-no {
        width: 45px;
    }

    .col-summary-rarity {
        min-width: 100px;
    }

    /* --- スマートフォン表示用のカラム幅に上書き --- */
    /* レアリティ */
    .col-download-rarity {
        width: 15%;
        min-width: 80px;
    }

    .col-history-item-no,
    .col-download-item-no {
        width: 40px;
    }

    /* 景品名 (一番幅を広く取る) */
    .col-download-item-name {
        width: auto;
    }

    /* 獲得数 */
    .col-history-item-count,
    .col-download-item-count {
        width: 80px;
    }


    .draw-actions {
        gap: 40px;
    }

    .draw-btn-secondary {
        padding: 15px 20px;
    }

    /* --- Modal Table Mobile Adjustments --- */
    .modal-item-table {
        min-width: auto;
        /* Reset min-width for mobile */
        width: 100%;
    }

    .col-modal-rarity {
        width: 15%;
        min-width: 60px;
    }

    .col-modal-no {
        width: 35px;
    }

    .col-modal-name {
        width: auto;
    }

    .col-modal-original {
        width: 50px;
    }

    .col-modal-final {
        width: 60px;
    }

    .modal-content {
        width: 95%;
        padding: 10px;
    }
}

@media (max-width: 600px) {
    #contents {
        margin-top: 160px;
    }

    #gacha-select {
        width: 250px;
    }

    #gacha-select:focus {
        max-width: 250px;
        min-width: 250px;
    }

    .tabs {
        width: 100%;
        justify-content: center;
        padding: 0 5px;
    }

    .tab-button {
        flex: 1;
        text-align: center;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 8px;
    }
}