/* wagonsmith bracket UI。site.css の変数を使用。クラスは wsb- 接頭辞。 */
.wsb { display: block; }
.wsb [hidden] { display: none !important; }
.wsb-banner { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 12px; margin-bottom: 12px; background: var(--ws-accent-soft); border: 1px solid var(--ws-line); border-radius: var(--ws-radius); }
.wsb-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.wsb-field { display: flex; flex-direction: column; gap: 4px; font-size: .95rem; min-width: 0; }
.wsb-field-events { flex: 1 1 220px; }
.wsb-field select, .wsb-field input, .wsb-field textarea, .wsb-opt select, .wsb-opt input[type=number] {
  font: inherit; color: var(--ws-text); background: var(--ws-surface); border: 1px solid var(--ws-line); border-radius: var(--ws-radius); padding: 8px 10px; max-width: 100%; box-sizing: border-box;
}
.wsb-field textarea { width: 100%; resize: vertical; line-height: 1.5; }
.wsb-state { font-size: .85rem; color: var(--ws-muted); padding-bottom: 8px; }
.wsb-settings { border: 1px solid var(--ws-line); border-radius: var(--ws-radius); padding: 12px; background: var(--ws-surface); }
.wsb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 12px; }
.wsb-count { color: var(--ws-muted); font-size: .85rem; }
.wsb-opts { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 12px 0; }
.wsb-opt { display: flex; align-items: center; gap: 8px; font-size: .95rem; }
.wsb-opt-check input { width: 18px; height: 18px; }
.wsb-opt input[type=number] { width: 6.5em; }
.wsb-buttons, .wsb-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.wsb-import { position: relative; cursor: pointer; overflow: hidden; }
.wsb-file { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.wsb-danger { color: var(--ws-warn); }
.wsb-share { margin-top: 12px; }
.wsb-share input { width: 100%; font: inherit; font-size: .85rem; padding: 8px 10px; border: 1px solid var(--ws-line); border-radius: var(--ws-radius); background: var(--ws-surface); color: var(--ws-text); box-sizing: border-box; }
.wsb-results { margin-top: 20px; }
.wsb-board-title { margin: 0 0 8px; font-size: 1.3rem; }
.wsb-champion { margin: 0 0 8px; padding: 10px 12px; background: var(--ws-accent-soft); border-radius: var(--ws-radius); font-size: 1.1rem; }
.wsb-trophy { color: var(--ws-accent-dark); font-weight: 700; margin-right: 6px; }
.wsb-placements { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .95rem; }
.wsb-place-no { font-weight: 700; margin-right: 4px; }
.wsb-board { overflow-x: auto; max-width: 100%; padding-bottom: 8px; }
.wsb-section { margin-bottom: 24px; }
.wsb-sec-title { margin: 12px 0 8px; font-size: 1.1rem; }
.wsb-rounds { display: flex; gap: 20px; align-items: stretch; }
.wsb-round { display: flex; flex-direction: column; min-width: 210px; flex: 0 0 auto; }
.wsb-round-title { margin: 0 0 8px; font-size: .9rem; color: var(--ws-muted); font-weight: 600; }
.wsb-round-matches { display: flex; flex-direction: column; justify-content: space-around; gap: 12px; flex: 1; }
.wsb-kind-league .wsb-rounds, .wsb-kind-swiss .wsb-rounds { flex-wrap: wrap; }
.wsb-match { border: 1px solid var(--ws-line); border-radius: var(--ws-radius); background: var(--ws-surface); padding: 6px 8px; font-size: .92rem; }
.wsb-match[data-status=waiting] { opacity: .65; }
.wsb-match[data-status=bye], .wsb-match[data-status=void] { opacity: .55; border-style: dashed; }
.wsb-match[data-stale] { outline: 2px solid var(--ws-warn); }
.wsb-mid { font-size: .72rem; color: var(--ws-muted); margin-bottom: 2px; min-height: 1em; }
.wsb-rest { margin: 0 0 8px; font-size: .85rem; color: var(--ws-muted); }
.wsb-slot-empty { color: var(--ws-muted); opacity: .6; }
.wsb-seedtie { margin-left: 2px; color: var(--ws-muted); }
.wsb-note { margin: 4px 0 0; font-size: .85rem; color: var(--ws-muted); }
.wsb-standings abbr[title] { text-decoration: underline dotted; cursor: help; }
.wsb-side { display: flex; align-items: center; gap: 6px; padding: 3px 0; }
.wsb-side + .wsb-side { border-top: 1px dashed var(--ws-line); }
.wsb-seed { flex: 0 0 1.4em; font-size: .75rem; color: var(--ws-muted); text-align: right; }
.wsb-slot { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.wsb-side.wsb-win .wsb-slot { font-weight: 700; color: var(--ws-accent-dark); }
.wsb-score { width: 3.4em; font: inherit; text-align: center; padding: 4px; color: var(--ws-text); background: var(--ws-bg); border: 1px solid var(--ws-line); border-radius: 4px; box-sizing: border-box; }
.wsb-score:disabled { opacity: .75; }
.wsb-mfoot { display: flex; align-items: center; gap: 8px; min-height: 0; }
.wsb-clear { font: inherit; font-size: .75rem; color: var(--ws-muted); background: none; border: 0; padding: 2px 4px; cursor: pointer; text-decoration: underline; }
.wsb-merr { font-size: .78rem; color: var(--ws-warn); }
.wsb-table-scroll { overflow-x: auto; max-width: 100%; margin: 10px 0; }
.wsb-standings td, .wsb-standings th, .wsb-matrix td, .wsb-matrix th { text-align: center; white-space: nowrap; padding: 6px 8px; }
.wsb-standings .wsb-pname, .wsb-matrix th[scope=row] { text-align: left; }
.wsb-standings tr[data-tied] .wsb-rank::after { content: "="; color: var(--ws-muted); }
.wsb-cw { background: var(--ws-accent-soft); }
.wsb-x { color: var(--ws-muted); background: var(--ws-bg); }

@media (max-width: 480px) {
  .wsb-round { min-width: 190px; }
  .wsb-top .ws-btn { flex: 1 1 auto; }
  .ws-prose .ws-table { display: block; overflow-x: auto; }
}

@media print {
  header, footer, nav, .ws-related, .ws-ad, .ad-slot, .ws-actions, .wsb-settings, .wsb-top, .wsb-actions, .wsb-share, .wsb-banner, .wsb-clear, .wsb-merr, .ws-lead, .ws-prose, .wsb-trophy:empty, [data-wsb="faq"] { display: none !important; }
  .wsb-results { margin: 0; }
  .wsb-board { overflow: visible; }
  .wsb-rounds { flex-wrap: wrap; }
  .wsb-match { break-inside: avoid; background: #fff; color: #000; opacity: 1 !important; }
  .wsb-score, .wsb-score:disabled { border: 0 !important; background: transparent !important; color: #000; opacity: 1; box-shadow: none; appearance: none; -webkit-appearance: none; }
  .wsb-score[hidden] { display: none !important; }
  body { background: #fff; color: #000; }
}
