.baseball-setup-topbar { position: relative; padding-right: 138px; }
.baseball-custom-setting { position: absolute; top: 0; right: 0; min-width: 124px; height: 38px; padding: 0 12px; border: 1px solid rgba(126, 176, 221, .58); border-radius: 7px; background: linear-gradient(180deg, rgba(23, 37, 52, .96), rgba(11, 21, 34, .98)); color: #9ec4e8; font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 18px rgba(0,0,0,.18); }
.baseball-custom-setting.is-saved { border-color: #d7edff; background: linear-gradient(180deg, #d7edff, #86b7df); color: #111820; }
.baseball-order-btn:disabled, .baseball-cleanup-group-btn:disabled { cursor: not-allowed; opacity: .54; transform: none; }
.baseball-custom-dialog { box-sizing: border-box; width: min(920px, calc(100vw - 20px)); max-height: 92dvh; padding: 20px; border: 1px solid rgba(126, 176, 221, .56); border-radius: 8px; background: #0b1522; color: #dcecff; overflow: auto; font-family: inherit; box-shadow: 0 24px 70px rgba(0,0,0,.58); }
.baseball-custom-dialog::backdrop { background: rgba(3, 8, 14, .82); }
.baseball-custom-dialog * { box-sizing: border-box; letter-spacing: 0; }
.baseball-custom-heading, .baseball-custom-group header, .baseball-custom-result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.baseball-custom-heading { position: relative; min-height: 40px; padding-right: 50px; }
.baseball-custom-heading h2 { margin: 0; color: #e4f3ff; font-size: 22px; }
.baseball-custom-dialog button { color: inherit; font: inherit; cursor: pointer; }
.baseball-custom-heading button, .baseball-custom-dialog footer button { border: 1px solid rgba(126, 176, 221, .48); border-radius: 6px; background: #172534; padding: 8px 16px; }
.baseball-custom-heading > button[data-close] { position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; }
.baseball-custom-search { display: grid; gap: 6px; margin: 18px 0 10px; font-size: 13px; }
.baseball-custom-search input { width: 100%; padding: 12px; border: 1px solid rgba(126, 176, 221, .44); border-radius: 6px; background: #121d2b; color: #fff; font: inherit; }
.baseball-custom-result-head { min-height: 28px; color: #b7cee3; font-size: 12px; }
.baseball-custom-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); height: 124px; margin-bottom: 12px; overflow: auto; align-content: start; border-block: 1px solid rgba(126, 176, 221, .28); }
.baseball-custom-results button { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 5px; border: 1px solid transparent; background: transparent; text-align: left; }
.baseball-custom-results button[aria-pressed="true"] { border-color: #9ec4e8; background: #1c3043; }
.baseball-custom-results img { width: 38px; height: 38px; object-fit: contain; }
.baseball-custom-results span { min-width: 0; overflow-wrap: anywhere; font-size: 12px; }
.baseball-custom-results small { display: block; color: #86a9c8; }
.baseball-custom-dialog button:disabled { opacity: .4; cursor: not-allowed; }
.baseball-custom-empty { padding: 14px; grid-column: 1 / -1; }
.baseball-custom-group { padding: 12px 0; border-bottom: 1px solid rgba(126, 176, 221, .26); }
.baseball-custom-group header { margin-bottom: 8px; color: #e4f3ff; font-size: 13px; }
.baseball-custom-group header span { color: #86a9c8; }
.baseball-custom-group header .is-valid, .baseball-custom-balance.is-valid { color: #9fe1bd; }
.baseball-custom-slots { display: grid; gap: 8px; }
.baseball-custom-slots.is-normal { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.baseball-custom-slots.is-cleanup { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 50%; }
.baseball-custom-slot { position: relative; min-width: 0; }
.baseball-custom-card { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 10 / 16; padding: 0; overflow: hidden; border: 1px dashed rgba(126, 176, 221, .48); border-radius: 6px; background: #111e2c; }
.baseball-custom-card.is-selected { outline: 2px solid #9ec4e8; outline-offset: 1px; }
.baseball-custom-frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.baseball-custom-lineup-number { position: absolute; top: 2%; left: 8%; display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid rgba(215, 237, 255, .72); border-radius: 50%; background: rgba(11, 21, 34, .84); color: #e4f3ff; font-size: 10px; font-weight: 900; z-index: 3; }
.baseball-custom-name { position: absolute; top: 17%; left: 12%; width: 76%; overflow: hidden; color: #fff; font-size: 8px; text-align: center; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 3px #000; z-index: 2; }
.baseball-custom-art { position: absolute; top: 32%; left: 15%; width: 70%; height: 31%; object-fit: contain; z-index: 1; }
.baseball-custom-code { position: absolute; bottom: 17%; left: 16%; width: 68%; color: #fff; font-size: 15px; font-weight: 900; text-align: center; text-shadow: 0 1px 3px #000; z-index: 2; }
.baseball-custom-type { position: absolute; right: 8%; bottom: 3%; display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid rgba(215, 237, 255, .72); border-radius: 50%; background: rgba(11, 21, 34, .84); color: #e4f3ff; font-size: 10px; font-weight: 900; z-index: 3; }
.baseball-custom-slot-number { color: #9ec4e8; font-size: 18px; font-weight: 800; }
.baseball-custom-remove { display: block; width: 30px; height: 28px; margin: 4px 0 0 auto; padding: 0; border: 1px solid rgba(126, 176, 221, .48); border-radius: 5px; background: #172534; }
.baseball-custom-balance { padding: 10px 0 2px; color: #ffbf7a; font-size: 12px; font-weight: 800; text-align: right; }
.baseball-custom-dialog footer { padding-top: 12px; text-align: right; }
.baseball-custom-dialog footer p { min-height: 38px; color: #b7cee3; font-size: 12px; line-height: 1.6; text-align: left; }
.baseball-custom-dialog [data-save]:enabled { border-color: #9ec4e8; background: #294c6a; color: #fff; }
@media (max-width: 540px) {
    .baseball-setup-topbar { min-height: 54px; padding-right: 0; }
    .baseball-setup-topbar h2 { margin-bottom: 7px !important; padding-right: 96px; font-size: 18px !important; line-height: 1.2; }
    .baseball-setup-topbar #baseball-setup-status { margin: 0; font-size: 10px !important; line-height: 1.35; }
    .baseball-custom-setting { top: 0; right: 0; min-width: 88px; height: 28px; padding: 0 8px; font-size: 8px; }
    .baseball-custom-dialog { padding: 12px; }
    .baseball-custom-heading h2 { font-size: 18px; }
    .baseball-custom-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .baseball-custom-slots.is-normal, .baseball-custom-slots.is-cleanup { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 5px; }
    .baseball-custom-name { font-size: 6px; }
    .baseball-custom-code { bottom: 19%; font-size: 11px; }
    .baseball-custom-type, .baseball-custom-lineup-number { width: 15px; height: 15px; font-size: 8px; }
    .baseball-custom-remove { width: 28px; height: 28px; }
}
