/* 座席別チケットの一覧と座席図（V9）。色は app.css の変数を使う。 */
.tb{--tb-line:#e6eaf0;--tb-soft:#f5f7fa;--tb-ok:#1f7a43;--tb-okbg:#e7f5ec;display:grid;grid-template-columns:minmax(380px,36%) minmax(0,1fr);align-items:start;border-bottom:1px solid var(--tb-line);color:var(--ink)}
:where(.tb) button{font:inherit;color:inherit}
.tb [hidden]{display:none!important}

/* 絞り込みバー */
.tb-bar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:12px 16px}
.tb-chip{display:inline-flex;align-items:center;gap:6px;height:38px;padding:0 14px;border:1px solid #d5dce6;border-radius:999px;background:#fff;font-size:13px;font-weight:600;line-height:1;white-space:nowrap;cursor:pointer;flex-shrink:0;transition:border-color .12s,background .12s}
.tb-chip:hover{border-color:#9db4d2}
.tb-chip .icon{width:15px;height:15px;color:#7b8aa0}
.tb-chip-main{border-color:var(--blue);background:var(--pale);color:var(--action)}
.tb-chip-main .icon{color:var(--action)}
.tb-chip.is-active,.tb-check:has(input:checked){border-color:var(--blue);background:var(--pale);color:var(--action)}
.tb-check input{position:absolute;opacity:0;width:1px;height:1px}
.tb-check:has(input:focus-visible),.tb-chip:focus-visible,.tb-select:has(select:focus-visible){outline:2px solid var(--blue);outline-offset:2px}
.tb-select{position:relative;padding:0}
.tb-select select{appearance:none;-webkit-appearance:none;border:0;background:transparent;height:36px;padding:0 32px 0 14px;font:inherit;font-weight:600;color:inherit;cursor:pointer;max-width:170px;text-overflow:ellipsis;outline:0}
.tb-select .icon{position:absolute;right:12px;pointer-events:none}
.tb-pop{position:relative;display:flex;align-items:center;gap:4px;flex-shrink:0}
.tb-chip-clear{width:26px;height:26px;border:0;border-radius:50%;background:#e9eef5;font-size:15px;line-height:1;cursor:pointer}
.tb-chip-clear:hover{background:#d8e1ec}
.tb-pop-panel{position:absolute;top:46px;left:0;z-index:30;width:320px;max-width:calc(100vw - 32px);padding:12px;border:1px solid var(--tb-line);border-radius:14px;background:#fff;box-shadow:0 12px 32px #1b2c4424}
.tb-pop-panel input{width:100%;height:38px;padding:0 12px;border:1px solid #d5dce6;border-radius:9px;font:inherit;font-size:13px}
.tb-pop-list{display:flex;flex-wrap:wrap;gap:6px;max-height:260px;overflow-y:auto;margin-top:10px}
.tb-pop-item{min-width:44px;height:32px;padding:0 10px;border:1px solid #dfe5ed;border-radius:8px;background:#fff;font-size:12px;cursor:pointer}
.tb-pop-item:hover{border-color:#9db4d2}
.tb-pop-item.is-active{border-color:var(--blue);background:var(--pale);color:var(--action);font-weight:600}
.tb-pop-empty{margin:4px 0;font-size:12px;color:var(--muted)}

/* 左は試合名と一覧（ページと一緒に動く）。右は絞り込みと座席図（画面に固定）。 */
.tb-main{min-width:0;padding:0 24px 24px 20px}
.tb-main .match-hero{padding:14px 0 4px}
.tb-main .match-hero .container{width:auto;max-width:none}
.tb-side{position:sticky;top:0;display:flex;flex-direction:column;min-width:0;height:calc(100dvh - var(--tb-top,0px));min-height:440px;border-left:1px solid var(--tb-line);background:var(--tb-soft)}
.tb-list{min-width:0}
.tb-list-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:56px}
.tb-count{display:flex;align-items:baseline;gap:10px;margin:0;font-size:12px;color:var(--muted);min-width:0}
.tb-count strong{font-size:17px;font-weight:700;color:var(--ink);white-space:nowrap}
.tb-count [data-fetch-status]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tb-count .is-stale{color:#9a6a12}
.tb-reload{border:0;background:none;padding:0;font-size:12px;color:var(--action)!important;cursor:pointer;text-decoration:underline;white-space:nowrap}
.tb-sort{position:relative;display:inline-flex;align-items:center;flex-shrink:0;font-size:13px;color:#42536b}
.tb-sort select{appearance:none;-webkit-appearance:none;border:0;background:transparent;padding:6px 22px 6px 4px;font:inherit;font-weight:600;color:inherit;cursor:pointer;text-align-last:right}
.tb-sort .icon{position:absolute;right:2px;width:14px;height:14px;pointer-events:none}
.tb-scroll{min-height:60vh;border-top:1px solid var(--tb-line)}

.tb-card{position:relative;display:grid;grid-template-columns:64px minmax(0,1fr) auto;column-gap:14px;align-items:center;padding:14px 8px 14px 4px;border-bottom:1px solid var(--tb-line);transition:background .12s}
.tb-card.has-link:hover,.tb-card.map-hover{background:#f4f8fe}
.tb-card-link{position:absolute;inset:0;z-index:1;border-radius:4px}
.tb-card-link:focus-visible{outline:2px solid var(--blue);outline-offset:-2px}
.tb-thumb{position:relative;z-index:2;width:64px;height:60px;padding:3px;border:1px solid #e1e7ee;border-radius:10px;background:var(--tb-soft);display:flex;align-items:center;justify-content:center;cursor:pointer}
.tb-thumb:disabled{cursor:default;opacity:.55}
.tb-thumb:not(:disabled):hover{border-color:var(--blue)}
.seat-mini-map{width:100%;height:auto;display:block}
.tb-card-main{min-width:0}
.tb-card-main h3{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0;font-size:16px;font-weight:700;line-height:1.4;overflow-wrap:anywhere}
.tb-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;min-width:0}
.tb-low{padding:2px 7px;border-radius:5px;background:var(--tb-okbg);color:var(--tb-ok);font-size:11px;font-weight:700;line-height:1.5;white-space:nowrap}
.tb-meta{display:flex;flex-wrap:wrap;gap:0 12px;margin:2px 0 0;font-size:13px;color:var(--muted);line-height:1.5}
.tb-tags{display:flex;flex-wrap:wrap;gap:5px;margin:6px 0 0}
.tb-tag{padding:2px 7px;border-radius:5px;background:#f0f3f7;color:#4a5b72;font-size:11px;line-height:1.5}
.tb-tag.ok{background:var(--tb-okbg);color:var(--tb-ok)}
.tb-card-side{display:flex;flex-direction:column;align-items:flex-end;gap:1px;text-align:right}
.tb-price{font-size:19px;font-weight:700;line-height:1.3;font-variant-numeric:tabular-nums;white-space:nowrap}
.tb-price small{margin-left:2px;font-size:11px;font-weight:400;color:var(--muted)}
.tb-price-none{font-size:13px;font-weight:600;color:#55657c}
.tb-sub{font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}
.tb-seller{display:inline-flex;align-items:center;gap:5px;margin-top:5px;font-size:11px;color:#55657c}
.tb-seller em{padding:1px 6px;border-radius:4px;background:#eceff3;color:#5d6b7e;font-style:normal;font-size:10px}
.tb-seller .tb-old{background:#fbf1dc;color:#8a5a07}
.tb-card.is-stale .tb-price{color:#4c5b70}
.tb-notes{position:relative;z-index:2;grid-column:2/-1;margin-top:6px;font-size:12px;color:#5b6a7f}
.tb-notes summary{display:inline-block;cursor:pointer;color:var(--action);font-size:12px}
.tb-notes p{margin:6px 0 0;max-width:520px;overflow-wrap:anywhere;line-height:1.6}
.tb-more{display:block;margin:16px auto;padding:9px 22px;border:1px solid #d5dce6;border-radius:999px;background:#fff;font-size:13px;font-weight:600;cursor:pointer}
.tb-more:hover{border-color:#9db4d2}
.tb-empty{padding:56px 16px;text-align:center}
.tb-empty h3{margin:0 0 16px;font-size:16px;font-weight:700}
.tb-empty .btn{margin:0 4px 8px}

/* 取得中の表示 */
.tb-loading h3{margin:0 0 10px}
.tb-run{position:relative;width:168px;height:30px;margin:0 auto 14px;border-bottom:3px solid #cfe2d8}
.tb-ball{position:absolute;left:0;bottom:0;width:24px;height:24px;border-radius:50%;border:2px solid #1c293d;background:radial-gradient(circle at 50% 50%,#1c293d 0 20%,transparent 21%),radial-gradient(circle at 6% 30%,#1c293d 0 15%,transparent 16%),radial-gradient(circle at 94% 30%,#1c293d 0 15%,transparent 16%),radial-gradient(circle at 24% 98%,#1c293d 0 15%,transparent 16%),radial-gradient(circle at 76% 98%,#1c293d 0 15%,transparent 16%),#fff;animation:tb-roll 1.5s cubic-bezier(.45,0,.55,1) infinite alternate}
@keyframes tb-roll{from{transform:translateX(0) rotate(0)}to{transform:translateX(144px) rotate(540deg)}}
.tb-steps{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;min-height:24px;margin:0 0 18px}
.tb-step{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:999px;background:#f0f3f7;color:#4a5b72;font-size:11px}
.tb-step::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--blue);animation:tb-pulse 1s ease-in-out infinite}
.tb-step.is-done{background:var(--tb-okbg);color:var(--tb-ok)}
.tb-step.is-done::before{background:var(--tb-ok);animation:none}
.tb-step.is-off::before{background:#b3bcc7;animation:none}
@keyframes tb-pulse{50%{opacity:.25}}
.tb-skel{display:grid;grid-template-columns:64px minmax(0,1fr) 72px;gap:14px;align-items:center;padding:14px 8px 14px 4px;border-top:1px solid var(--tb-line)}
.tb-skel i,.tb-skel b,.tb-skel u{display:block;border-radius:8px;background:linear-gradient(90deg,#eef1f5 25%,#f8fafc 40%,#eef1f5 60%);background-size:300% 100%;animation:tb-shimmer 1.3s linear infinite}
.tb-skel i{height:60px}
.tb-skel b{height:16px;width:60%}
.tb-skel u{height:22px}
@keyframes tb-shimmer{from{background-position:100% 0}to{background-position:0 0}}
.tb.is-loading .seat-zone{animation:tb-wave 2.6s linear infinite;animation-delay:var(--tb-d,0s)}
@keyframes tb-wave{0%,26%,100%{fill:#e3e7ec}10%{fill:#9cc7e6}}
.tb-foot{margin:0;padding:12px 4px;font-size:11px;color:#8090a4;line-height:1.6}
.tb-rows:empty~.tb-foot{display:none}

.tb-map-stage{position:relative;flex:1;min-height:0;overflow:hidden}
.tb-map-stage [data-seat-explorer]{height:100%;display:flex;align-items:center;justify-content:center;padding:4px 12px 8px}
.tb-map-tools{position:absolute;right:14px;top:14px;z-index:2;display:flex;flex-direction:column;border-radius:10px;overflow:hidden;background:#fff;box-shadow:0 2px 10px #1b2c441a}
.tb-map-tools button{width:38px;height:38px;border:0;border-bottom:1px solid #edf0f4;background:#fff;font-size:20px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center}
.tb-map-tools button:last-child{border-bottom:0}
.tb-map-tools button:hover{background:var(--pale)}
.tb-map-tools .icon{width:16px;height:16px}
.tb-map-note{display:flex;align-items:center;gap:5px;margin:0;padding:0 16px 10px;font-size:11px;color:#8090a4}
.tb-map-note .icon{width:13px;height:13px}
.tb-no-map{display:block}
.tb-no-map .tb-main{display:contents}
.tb-no-map .tb-side{position:static;height:auto;min-height:0;border-left:0;background:#fff}
.tb-no-map .tb-list{padding:0 20px 24px}
.tb-no-map .tb-map-stage,.tb-no-map .tb-map-note,.tb-no-map .tb-thumb{display:none}
.tb-no-map .tb-card{grid-template-columns:minmax(0,1fr) auto}
.tb-no-map .tb-notes{grid-column:1/-1}

/* 座席図（seat-explorer.js が描くSVG） */
.tb .seat-explorer-svg{width:100%;height:100%;display:block;overflow:visible;touch-action:none;user-select:none;cursor:grab}
.tb .seat-explorer-svg:active{cursor:grabbing}
.tb .seat-zone{fill:#e3e7ec;stroke:#fff;stroke-width:2;cursor:default;transition:fill .1s}
.tb .seat-zone.available{fill:#cfe2d8;cursor:pointer}
.tb .seat-zone.available:hover,.tb .seat-zone.hovered{fill:#9cc7e6}
.tb .seat-zone.selected,.tb .seat-zone:focus-visible{fill:var(--blue);stroke:#e5f1ff;stroke-width:3;outline:none}
.tb .seat-block-number{font:12px system-ui,sans-serif;fill:#75828f}
.tb .seat-area-label{font:14px system-ui,sans-serif;fill:#536a78}
.tb .seat-price-pin rect{fill:#fff;stroke:#dfe4ea;stroke-width:1;filter:drop-shadow(0 1px 3px #2639512b)}
.tb .seat-price-pin text{font:700 15px system-ui,sans-serif;fill:#1c293d}
.tb .seat-price-pin circle.production{fill:#2e9a55}
.tb .seat-price-pin circle.stale{fill:#b3bcc7}
.tb .seat-price-pin circle.sandbox{fill:#fff;stroke:#8093a7;stroke-width:1.5}

/* 枚数の選択 */
.tb-qty{width:min(400px,calc(100vw - 32px));padding:28px 24px 20px;border:0;border-radius:18px;box-shadow:0 24px 64px #0d1b3040;color:var(--ink)}
.tb-qty::backdrop{background:#0d1b3066}
.tb-qty h2{margin:0 0 18px;font-size:19px;font-weight:700;text-align:center}
.tb-qty-close{position:absolute;right:12px;top:10px;width:32px;height:32px;border:0;border-radius:50%;background:none;font-size:20px;cursor:pointer;color:#7b8aa0!important}
.tb-qty-close:hover{background:#eef1f5}
.tb-qty-options{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.tb-qty-options button{height:56px;border:1px solid #d5dce6;border-radius:12px;background:#fff;font-size:19px;font-weight:700;cursor:pointer}
.tb-qty-options button:hover{border-color:var(--blue);background:var(--pale);color:var(--action)}
.tb-qty-more{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;font-size:13px;color:#55657c}
.tb-qty-more select{height:38px;padding:0 10px;border:1px solid #d5dce6;border-radius:9px;background:#fff;font:inherit}
.tb-qty-skip{display:block;margin:16px auto 0;border:0;background:none;font-size:13px;color:var(--action)!important;cursor:pointer;text-decoration:underline}

@media(max-width:900px){
 .tb{display:flex;flex-direction:column;align-items:stretch}
 .tb-main{display:contents}
 .tb-main>.match-hero{order:1;padding:12px 0 8px}
 .tb-main .match-hero .container{width:calc(100% - 28px)}
 .tb-side{order:2;z-index:20;flex-direction:column-reverse;height:auto;min-height:0;border-left:0;border-bottom:1px solid var(--tb-line);background:#fff;box-shadow:0 6px 14px -10px #1b2c4440}
 .tb-map-stage{flex:none;height:clamp(220px,38svh,340px);background:var(--tb-soft)}
 .tb-map-stage [data-seat-explorer]{padding:14px 30px}
 .tb-map-note{display:none}
 .tb-map-tools{right:10px;top:10px}
 .tb-map-tools button{width:34px;height:34px}
 .tb-bar{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;padding:9px 14px}
 .tb-bar::-webkit-scrollbar{display:none}
 .tb-pop{position:static}
 .tb-pop-panel{top:100%;left:14px;right:14px;width:auto;max-width:none;margin-top:6px}
 .tb-list{order:3;padding:0 14px 16px}
 .tb-scroll{min-height:50vh}
 .tb-card{grid-template-columns:52px minmax(0,1fr) auto;column-gap:10px;padding-inline:0}
 .tb-thumb{width:52px;height:50px}
 .tb-card-main h3{font-size:15px}
 .tb-price{font-size:17px}
}
@media(prefers-reduced-motion:reduce){.tb *,.tb *::before{transition:none!important;animation:none!important}}

/* 販売サイトの一覧（試合ページの下部） */
.sl{max-width:860px;margin:28px 0 8px}
.sl h2{margin:0 0 10px;font-size:18px;font-weight:700}
.sl-list{list-style:none;margin:0;padding:0;border-top:1px solid #e6eaf0}
.sl-row{display:grid;grid-template-columns:40px minmax(0,1fr) auto 88px;align-items:center;column-gap:14px;padding:12px 4px;border-bottom:1px solid #e6eaf0}
.sl-logo{display:grid;place-items:center;width:40px;height:40px;border:1px solid #e1e7ee;border-radius:10px;background:#fff;overflow:hidden;font-size:15px;font-weight:700;color:#425e83}
.sl-logo img{width:100%;height:100%;object-fit:contain}
.sl-name{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;min-width:0}
.sl-name strong{font-size:15px;font-weight:700}
.sl-name em{padding:2px 7px;border-radius:5px;background:#f0f3f7;color:#55657c;font-style:normal;font-size:11px;line-height:1.5}
.sl-name .sl-tag{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:#e7f5ec;color:#1f7a43}
.sl-price{text-align:right;font-size:17px;font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap;line-height:1.3}
.sl-price small{display:block;font-size:11px;font-weight:400;color:#67758a}
.sl-price.is-none{font-size:12px;font-weight:400;color:#67758a}
.sl-go{min-height:38px;padding:6px 12px;font-size:13px}
.sl-go .icon{width:14px;height:14px}
.sl-off{text-align:center;font-size:12px;color:#8090a4}
.sl-foot{margin:10px 4px 0;font-size:11px;color:#8090a4}
@media(max-width:640px){
 .sl-row{grid-template-columns:36px minmax(0,1fr) auto 64px;column-gap:10px}
 .sl-logo{width:36px;height:36px}
 .sl-name strong{font-size:14px}
 .sl-price{font-size:15px}
 .sl-go{padding:6px 8px}
 .sl-go .icon{display:none}
}
