/* ── Variables ─────────────────────────────────────────────── */
:root {
  --navy:       #1a3a6b;
  --navy-dark:  #0f2347;
  --navy-mid:   #1e4080;
  --navy-light: #2d5fa3;
  --red:        #c0392b;
  --gold:       #d4a017;
  --gold-light: #f0cc5a;
  --green:      #27ae60;
  --white:      #ffffff;
  --g50:        #f8f9fa;
  --g100:       #f0f2f5;
  --g200:       #e4e8ed;
  --g300:       #cbd2db;
  --g400:       #9aa4b2;
  --g600:       #5a6478;
  --g800:       #2d3748;
  --radius:     8px;
  --shadow:     0 2px 8px rgba(0,0,0,.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.16);
  --trans:      .15s ease;
}

/* ── Reset / Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo', sans-serif;
       background: var(--g100); color: var(--g800); min-height: 100vh; }
a { color: var(--navy-light); text-decoration: none; }
a:hover { text-decoration: underline; }
input, select, textarea, button { font: inherit; }
.hidden { display: none !important; }

/* ── Layout ────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,.45);
  font-size: .72rem;
  letter-spacing: .04em;
  margin-top: 3rem;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: .75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer-copy   { font-weight: 600; color: rgba(255,255,255,.6); }
.footer-powered { color: rgba(255,255,255,.3); }

/* ── Header ────────────────────────────────────────────────── */
.site-header { background: var(--navy); color: var(--white); box-shadow: 0 2px 4px rgba(0,0,0,.3); }
.header-inner { max-width: 1100px; margin: 0 auto; padding: .75rem 1rem;
                display: flex; align-items: center; justify-content: space-between; }
/* ── Logo 案① ホームベース下線型 ──────────────────────────── */
.site-title { display: inline-flex; flex-direction: column; align-items: flex-start;
              line-height: 1; gap: 0; }
.logo-row   { display: flex; align-items: center; gap: .35rem;
              font-size: 1.3rem; font-weight: 900; letter-spacing: .1em;
              font-family: 'Arial Black', 'Impact', 'Yu Gothic UI', sans-serif; }
.logo-plate { width: 100%; height: 7px; background: var(--red); margin-top: 4px;
              clip-path: polygon(8% 0%, 92% 0%, 100% 52%, 50% 100%, 0% 52%); }
.logo-sub   { font-size: .46rem; letter-spacing: .2em; margin-top: 3px;
              color: rgba(255,255,255,.42); font-weight: 500; }
.admin-badge { background: var(--red); font-size: .65rem; padding: .14rem .4rem;
               border-radius: 4px; margin-left: .3rem; font-weight: 700;
               letter-spacing: .02em; vertical-align: middle; }
.header-nav   { display: flex; gap: .5rem; }
.header-login { display: flex; gap: .5rem; flex-shrink: 0; }
/* ハンバーガーボタン（デスクトップでは非表示） */
.hamburger { display: none; flex-direction: column; justify-content: center; gap: 5px;
             background: none; border: none; cursor: pointer; padding: .4rem .5rem; }
.hamburger span { display: block; width: 22px; height: 2px;
                  background: var(--white); border-radius: 1px; transition: .2s; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: .3rem; padding: .5rem 1rem;
       border: none; border-radius: var(--radius); cursor: pointer; font-weight: 600;
       font-size: .875rem; transition: background var(--trans), opacity var(--trans); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary   { background: var(--navy-light); color: var(--white); }
.btn-primary:hover   { background: var(--navy); }
.btn-secondary { background: var(--g200); color: var(--g800); }
.btn-secondary:hover { background: var(--g300); }
.btn-danger    { background: var(--red); color: var(--white); }
.btn-danger:hover    { opacity: .85; }
.btn-ghost     { background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,.3); }
.btn-ghost:hover     { background: rgba(255,255,255,.1); }
.btn-sm  { padding: .3rem .75rem; font-size: .8rem; }
.btn-back { color: var(--g600); border-color: var(--g300); background: var(--white); }
.btn-back:hover { background: var(--g50); color: var(--g800); }

/* ── Cards ─────────────────────────────────────────────────── */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; }

/* ── List header ───────────────────────────────────────────── */
.list-header { display: flex; justify-content: space-between; align-items: center;
               margin-bottom: 1.25rem; flex-wrap: wrap; gap: .5rem; }
.list-header h2 { font-size: 1.3rem; color: var(--navy-dark); }
.section-title { font-size: 1.3rem; color: var(--navy-dark); margin-bottom: 1.25rem; }

/* ── Competition grid ──────────────────────────────────────── */
.comp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.comp-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
             overflow: hidden; display: flex; flex-direction: column;
             transition: box-shadow var(--trans); cursor: pointer; }
.comp-card:hover { box-shadow: var(--shadow-lg); }
.comp-card-stripe { height: 5px; }
.stripe-new     { background: var(--g300); }
.stripe-ongoing { background: var(--navy-light); }
.stripe-done    { background: var(--gold); }
.comp-card-body { padding: 1rem; flex: 1; }
.comp-card-name { font-size: 1.05rem; font-weight: 700; color: var(--navy-dark); margin: .4rem 0 .5rem; }
.comp-card-info { font-size: .8rem; color: var(--g600); display: flex; flex-direction: column; gap: .2rem; }
.comp-card-note { font-size: .8rem; color: var(--g600); margin-top: .5rem; border-top: 1px solid var(--g200); padding-top: .4rem; }
.comp-rankings { margin-top: .45rem; display: flex; flex-direction: column; gap: .2rem; }
.comp-ranking-row { display: flex; align-items: center; flex-wrap: wrap; gap: .15rem .4rem; font-size: .82rem; }
.ranking-div-label { font-size: .72rem; color: var(--g600); background: var(--g100);
                     padding: .05rem .35rem; border-radius: 3px; margin-right: .1rem; }
.comp-card-footer { padding: .75rem 1rem; background: var(--g50); border-top: 1px solid var(--g200);
                    display: flex; justify-content: space-between; align-items: center; }
.comp-card-actions { display: flex; gap: .4rem; }

/* ── Status badges ─────────────────────────────────────────── */
.status-badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: .15rem .5rem;
                border-radius: 4px; margin-right: .3rem; }
.badge-new     { background: var(--g200); color: var(--g600); }
.badge-ongoing { background: var(--navy-light); color: var(--white); }
.badge-done    { background: var(--gold); color: #5a3800; }
.badge-regs      { background: #e8f4e8; color: #2a7a2a; }
.badge-published { background: #d4edda; color: #155724; }
.badge-draft     { background: var(--g200); color: var(--g500); font-style: italic; }

/* ── Publish button in detail header ───────────────────────── */
.btn-publish-on  { background: #d4edda; color: #155724; border: 1px solid #b8dac5;
                   font-weight: 600; }
.btn-publish-on:hover  { background: #c3e6cb; }
.btn-publish-off { background: #fff3cd; color: #856404; border: 1px solid #ffc107;
                   font-weight: 600; }
.btn-publish-off:hover { background: #ffe69c; }
.btn-unpublish   { background: transparent; color: var(--g500);
                   border: 1px solid var(--g300); font-size: .75rem; }
.btn-unpublish:hover   { background: #fff5f5; color: #c0392b; border-color: #e74c3c; }
.publish-controls { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }
.publish-alert { display: inline-flex; align-items: center; gap: .25rem;
                 font-size: .75rem; font-weight: 600;
                 color: #856404; background: #fff3cd; border: 1px solid #ffc107;
                 border-radius: var(--radius); padding: .2rem .55rem;
                 animation: pulse-alert 2.5s ease-in-out infinite; white-space: nowrap; }
@keyframes pulse-alert {
  0%, 100% { opacity: 1; }
  50%       { opacity: .55; }
}
.season-current-btn { background: none; border: 1px solid var(--g300); color: var(--g600); white-space: nowrap; }
.season-current-btn.active { background: #fff3cd; color: #856404; border-color: #ffc107; font-weight: 700; }
.comp-season-tag { display: inline-block; font-size: .7rem; font-weight: 600; padding: .15rem .5rem;
                   border-radius: 4px; background: var(--g100); color: var(--g600);
                   border: 1px solid var(--g200); margin-right: .3rem; }

/* ── Color dot ─────────────────────────────────────────────── */
.cdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%;
        flex-shrink: 0; vertical-align: middle; margin-right: 4px; }

/* ── Detail header ─────────────────────────────────────────── */
.detail-header         { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.detail-header-top     { display: flex; align-items: flex-start; gap: .6rem; }
.detail-header-actions { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.detail-title-area     { flex: 1; min-width: 0; }
.detail-title-area h2  { font-size: 1.4rem; color: var(--navy-dark);
                          white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-meta { font-size: .85rem; color: var(--g600); margin-top: .25rem; }

/* ── Division tabs ─────────────────────────────────────────── */
.div-tab-bar { display: flex; align-items: center; gap: .5rem;
               background: var(--white); padding: .5rem 1rem;
               border: 1px solid var(--g200); border-radius: var(--radius); margin-bottom: .5rem; }
.div-tabs { display: flex; gap: .3rem; flex-wrap: wrap; flex: 1; }
.div-tab-btn { padding: .3rem .8rem; border-radius: 6px; border: 1px solid var(--g300);
               background: var(--g50); color: var(--g600); cursor: pointer;
               font-size: .85rem; font-weight: 600; transition: all var(--trans); }
.div-tab-btn:hover { background: var(--g200); }
.div-tab-btn.active { background: var(--navy-light); color: var(--white); border-color: var(--navy-light); }
.div-tab-btn .div-tab-edit { margin-left: .3rem; opacity: .5; font-size: .75rem; }
.div-tab-btn .div-tab-edit:hover { opacity: 1; }
.div-tab-btn .div-tab-del { margin-left: .2rem; opacity: .6; font-size: .75rem; }
.div-tab-btn .div-tab-del:hover { opacity: 1; }

/* ── Sub-tabs (dtab) ────────────────────────────────────────── */
.dtab-bar { display: flex; gap: 0; border-bottom: 2px solid var(--g200); margin-bottom: 1rem; }
.dtab-btn { padding: .6rem 1.1rem; border: none; background: none; cursor: pointer;
            font-size: .9rem; color: var(--g600); border-bottom: 3px solid transparent;
            margin-bottom: -2px; font-weight: 600; transition: all var(--trans); }
.dtab-btn:hover { color: var(--navy); }
.dtab-btn.active { color: var(--navy-light); border-bottom-color: var(--navy-light); }

/* ── Tables ─────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; background: var(--white);
              border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table th { background: var(--navy); color: var(--white); padding: .6rem .75rem;
                  text-align: left; font-size: .8rem; font-weight: 700; }
.data-table td { padding: .55rem .75rem; border-bottom: 1px solid var(--g200); font-size: .875rem; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--g50); }
.global-badge { display: inline-block; font-size: .65rem; padding: .1rem .35rem;
                background: var(--navy-light); color: var(--white); border-radius: 3px; margin-left: .3rem; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-stack { display: flex; flex-direction: column; gap: .75rem; }
.form-row   { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem;
        font-weight: 600; color: var(--g600); }
.indent-label { padding-left: 1.5rem; }
.checkbox-label { flex-direction: row; align-items: center; gap: .5rem;
                  font-weight: 400; color: var(--g800); cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
input[type="text"], input[type="date"], input[type="time"], input[type="password"],
input[type="number"], select, textarea {
  padding: .45rem .65rem; border: 1px solid var(--g300); border-radius: 6px;
  background: var(--white); font-size: .875rem; transition: border var(--trans);
  width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-light); }
input[type="color"] { padding: .2rem .3rem; height: 2rem; width: 3rem; cursor: pointer; }
input[type="number"] { width: 5rem; text-align: center; }
textarea { resize: vertical; min-height: 80px; }
.form-actions { display: flex; gap: .5rem; margin-top: .5rem; }
.form-error { color: var(--red); font-size: .8rem; }
.required { color: var(--red); }

/* ── Team form (inline) ─────────────────────────────────────── */
.team-form { margin-bottom: 1rem; }
.teams-controls { display: flex; gap: .5rem; margin-bottom: .75rem; flex-wrap: wrap; }
.bracket-controls { display: flex; gap: .5rem; margin-bottom: .75rem; align-items: center; }

/* ── Modals ─────────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45);
                  display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lg);
         padding: 1.5rem; max-width: 480px; width: calc(100% - 2rem);
         max-height: 90vh; overflow-y: auto; position: relative; }
.modal-sm  { max-width: 380px; }
.modal-lg  { max-width: 560px; }
.modal h3  { font-size: 1.1rem; color: var(--navy-dark); margin-bottom: 1rem; }
.modal-close { position: absolute; top: .75rem; right: .75rem; background: none; border: none;
               cursor: pointer; font-size: 1.1rem; color: var(--g400); padding: .2rem .4rem; }
.modal-close:hover { color: var(--g800); }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; }
.modal-subtitle { font-size: .85rem; color: var(--g600); margin: -.5rem 0 .75rem; }

/* ── Empty state ────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--g400); }
.empty-state p { font-size: .95rem; }

/* ── Bracket ────────────────────────────────────────────────── */
.bracket-scroll { overflow-x: auto; padding-bottom: 1rem; }
.bracket { display: flex; gap: 0; align-items: flex-start; }
.bracket-round { display: flex; flex-direction: column; min-width: 160px; }
.bracket-round-label { font-size: .75rem; font-weight: 700; color: var(--g600);
                       text-align: center; padding: .3rem; margin-bottom: .5rem;
                       background: var(--g100); border-radius: 4px; }
.bracket-seeds { display: flex; flex-direction: column; flex: 1; }
.bracket-seed { display: flex; align-items: center; position: relative;
                padding: 0 26px 0 12px; }

/* Connectors */
.bracket-round:not(.bracket-final) .bracket-seed:nth-child(odd)::after {
  content: ''; position: absolute; right: 0; top: 50%;
  width: 26px; height: calc(50% + 1px);
  border-top: 2px solid var(--g300); border-right: 2px solid var(--g300);
}
.bracket-round:not(.bracket-final) .bracket-seed:nth-child(even)::after {
  content: ''; position: absolute; right: 0; top: 0;
  width: 26px; height: 50%;
  border-bottom: 2px solid var(--g300); border-right: 2px solid var(--g300);
}
.bracket-round:not(:first-child) .bracket-seed::before {
  content: ''; position: absolute; left: 0; top: calc(50% - 1px);
  width: 12px; height: 2px; background: var(--g300);
}

.bracket-match { display: flex; align-items: center; gap: .3rem; width: 100%; padding: .3rem .4rem;
                  border: 1px solid var(--g200); border-radius: 6px; background: var(--white);
                  box-shadow: 0 1px 3px rgba(0,0,0,.06); font-size: .82rem; min-width: 130px;
                  transition: box-shadow var(--trans); }
.bracket-match:not(.no-click) { cursor: pointer; }
.bracket-match:not(.no-click):hover { box-shadow: 0 2px 8px rgba(0,0,0,.12); border-color: var(--navy-light); }
.bracket-match.is-bye { background: var(--g50); color: var(--g400); cursor: default; }
.bracket-match.is-winner { background: #f0f8ff; border-color: var(--navy-light); }
.bracket-team-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bracket-score { font-weight: 700; min-width: 1.5rem; text-align: center; color: var(--navy); }
.bracket-score.winner-score { color: var(--green); }
.bye-label { color: var(--g400); font-size: .78rem; font-style: italic; }

/* Match memo & bottomX (x suffix) */
.bracket-match-wrap { display: flex; flex-direction: column; align-items: stretch; width: 100%; gap: 2px; }
/* メモ: slot1の底辺に絶対配置し、translateYで半分下にずらして境界線上に表示 */
.match-memo-row { font-size: .64rem; color: var(--g500); text-align: right;
                  white-space: nowrap; overflow: visible; text-overflow: ellipsis;
                  line-height: 1.3; position: absolute; bottom: 0; right: 28px;
                  transform: translateY(50%); z-index: 1; pointer-events: none; }
.third-place-memo { font-size: .82rem; color: var(--g500); text-align: center;
                    margin: .15rem 0; }
.score-x { font-size: .75em; color: var(--g500); margin-left: 1px; font-weight: 400; }
/* xトグルボタン（サヨナラ入力） */
.x-toggle-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; font-size: .78rem; font-weight: 700;
  background: var(--g100); color: var(--g400);
  border: 1px solid var(--g300); border-radius: 4px;
  cursor: pointer; transition: background var(--trans), color var(--trans);
  flex-shrink: 0;
}
.x-toggle-btn:hover { background: var(--g200); color: var(--g600); }
.x-toggle-btn.active { background: #fff0cd; color: #a06000; border-color: #d4a017; }
.result-scores-dash { font-size: 1.1rem; font-weight: 600; color: var(--g400); }
.result-x-note { font-size: .78rem; color: var(--g500); text-align: center; margin-top: .3rem; }
.lottery-mark { font-size: .72em; color: var(--g500); margin-left: 1px; font-weight: 400; }
.sched-match-memo { font-size: .75rem; color: var(--g500); font-weight: 400;
                    margin-left: .35rem; white-space: nowrap; }

/* モーダル：抽選勝者行 */
.result-lottery-row { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
                      margin-top: .6rem; padding: .45rem .6rem;
                      background: #fff8e6; border: 1px solid #f5c842; border-radius: 6px;
                      font-size: .84rem; }
.lottery-row-label { color: var(--g700); font-size: .78rem; white-space: nowrap; font-weight: 600; }
.result-lottery-row label { display: flex; align-items: center; gap: .3rem; cursor: pointer; font-weight: 600; }
.result-lottery-row input[type=radio] { width: auto; margin: 0; accent-color: var(--navy); }

/* モーダル：x チェックボックス・メモ欄 */
.mi-x-label { display: flex; align-items: center; gap: .3rem; font-size: .88rem;
              white-space: nowrap; cursor: pointer; margin-left: .25rem; }
.mi-x-label input[type=checkbox] { width: auto; margin: 0; }
.result-memo-row { margin-top: .6rem; }
.result-memo-row label { display: flex; flex-direction: column; gap: .3rem;
                          font-size: .82rem; color: var(--g600); }
.result-memo-row input { width: 100%; }

/* Champion display */
.bracket-champion { text-align: center; padding: .75rem 1rem; background: #fffbee;
                    border: 2px solid var(--gold); border-radius: var(--radius); margin-top: .5rem; }
.bracket-champion .champ-line { display: flex; align-items: center; justify-content: center; gap: .45rem; }
.bracket-champion .trophy { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }
.bracket-champion .champ-label { font-size: .88rem; color: var(--g600); white-space: nowrap; }
.bracket-champion .champ-name { font-size: 1.1rem; font-weight: 700; color: var(--navy-dark); }
.bracket-champion .runner-up-line { margin-top: .35rem; font-size: .96rem; color: var(--g600); border-top: 1px solid var(--gold-light); padding-top: .35rem; }
.bracket-champion .runner-up-line .runner-name { font-weight: 700; color: var(--navy-dark); }

/* Header org name */
.header-org-name { font-size: .58rem; letter-spacing: .12em; color: rgba(255,255,255,.8);
                   margin-top: 2px; font-weight: 600; display: none; }
.header-org-name:not(:empty) { display: block; }

/* 3位決定戦 */
.bracket-third-place { text-align: center; padding: .75rem 1.25rem; background: var(--g50);
                        border: 1px solid var(--g200); border-radius: var(--radius); margin-top: .5rem; }
.bracket-third-place.clickable { cursor: pointer; }
.bracket-third-place.clickable:hover { background: var(--g100); }
.third-place-title  { font-size: .8rem; font-weight: 700; color: var(--g600); margin-bottom: .35rem; }
.third-place-row    { display: flex; align-items: center; justify-content: center;
                      gap: .4rem; flex-wrap: wrap; font-size: .85rem; }
.third-place-score  { font-weight: 700; color: var(--navy); padding: 0 .3rem; }
.third-place-winner { margin-top: .35rem; font-size: .82rem; color: var(--g600); }

/* ── Schedule ───────────────────────────────────────────────── */
.schedule-view-toggle { display: flex; gap: .4rem; margin-bottom: 1rem; }
.schedule-view-toggle .btn.active { background: var(--navy-light); color: var(--white); }

/* カード型日程リスト */
.sched-card-list { display: flex; flex-direction: column; gap: .4rem; }
.sched-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

/* メイン行：ラウンド名・チーム・スコアを1行に */
.sched-card-main { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .5rem;
                   padding: .5rem .75rem; }
.sched-card-main .sched-round { font-size: .73rem; font-weight: 700; color: var(--g500);
                                  white-space: nowrap; flex-shrink: 0; }
.sched-teams { display: flex; align-items: center; gap: .3rem;
               font-size: .88rem; font-weight: 600; }
.sched-vs    { color: var(--g400); font-size: .75rem; font-weight: 700; padding: 0 .1rem; flex-shrink: 0; }
.sched-score { font-size: .88rem; font-weight: 700; color: var(--navy-light); white-space: nowrap; flex-shrink: 0; }
/* 設定ボタンを右端に寄せる（スコアはチームの横） */
.sched-card-main > .sched-edit-btn { margin-left: auto; }

/* 詳細行 */
.sched-card-details { padding: .2rem .75rem .5rem; font-size: .78rem; color: var(--g600);
                      line-height: 1.8; border-top: 1px solid var(--g100); }
.sched-di  { }
.sched-sep { }
.sched-edit-btn { color: var(--navy-light); background: none; border: none;
                  cursor: pointer; font-size: .8rem; white-space: nowrap; flex-shrink: 0; }
.sched-no-date      { color: var(--g400); font-style: italic; }
.sched-team-unknown { color: var(--g500); font-style: italic; }
.sched-pending-team { color: var(--g500); font-style: italic; font-size: .85em; }

/* 印刷時のみ表示：大会名ヘッダー */
.comp-print-header { display: none; }
@media print {
  .comp-print-header { display: block; margin-bottom: 1rem; border-bottom: 2px solid var(--navy); padding-bottom: .5rem; }
  .comp-print-header h2 { font-size: 1.3rem; font-weight: 700; color: var(--navy-dark); }
  .comp-print-header p  { font-size: .85rem; color: var(--g600); margin-top: .2rem; }
}

/* スケジールモーダル内チーム選択欄 */
.sm-teams-note { font-size: .78rem; color: var(--g500); margin: 0 0 .4rem; line-height: 1.4; }
#sm-teams-row { background: var(--g50); border-radius: var(--radius);
                padding: .55rem .65rem .45rem; margin-bottom: .3rem; }
#sm-teams-row label { display: flex; flex-direction: column; gap: .2rem;
                       font-size: .82rem; margin-bottom: .35rem; }
#sm-teams-row select { font-size: .85rem; padding: .3rem .4rem;
                        border: 1px solid var(--g300); border-radius: var(--radius); }

/* Season filter */
.season-filter-bar { margin: .25rem 0 .75rem; }
.season-filter { display: flex; align-items: center; }
.season-filter label { display: flex; align-items: center; gap: .5rem;
                       font-size: .85rem; color: var(--g600); font-weight: 600; }
.season-filter select { padding: .35rem .6rem; border: 1px solid var(--g300);
                        border-radius: var(--radius); font-size: .85rem;
                        background: var(--white); cursor: pointer; color: var(--g900); }
.season-filter select:focus { outline: none; border-color: var(--navy-light); }

/* Auto-schedule modal round rows */
.as-round-row { display: flex; flex-direction: column; align-items: stretch;
                gap: .35rem; padding: .5rem 0; border-bottom: 1px solid var(--g100); }
.as-round-row:last-child { border-bottom: none; }
.as-round-name { font-size: .88rem; font-weight: 600; }
.as-cnt { font-size: .75rem; color: var(--g500); font-weight: 400; }
.as-round-inputs { display: flex; gap: .4rem; flex-wrap: wrap; }
.as-venue-note  { width: 100%; resize: vertical; font-size: .85rem;
                  border: 1px solid var(--g300); border-radius: 4px;
                  padding: .35rem .5rem; line-height: 1.5; color: var(--g800);
                  background: var(--white); font-family: inherit; }
.as-venue-note::placeholder { color: var(--g400); }
.as-round-inputs input[type="date"],
.as-round-inputs select { font-size: .82rem; padding: .3rem .45rem;
                           border: 1px solid var(--g300); border-radius: var(--radius);
                           background: var(--white); }

/* Calendar */
.cal-header { display: flex; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.cal-month { font-size: 1.1rem; font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.cal-day-label { text-align: center; font-size: .75rem; font-weight: 700; color: var(--g600); padding: .3rem 0; }
.cal-cell { background: var(--white); min-height: 70px; padding: .3rem; border-radius: 4px;
            border: 1px solid var(--g200); font-size: .8rem; cursor: pointer; transition: background var(--trans); }
.cal-cell:hover { background: var(--g50); }
.cal-cell.other-month { opacity: .4; }
.cal-cell.has-matches { border-color: var(--navy-light); }
.cal-cell .cal-date { font-weight: 700; margin-bottom: .2rem; }
.cal-match-dot { height: 6px; border-radius: 3px; margin-bottom: 2px; }

/* ── Regulations ─────────────────────────────────────────────── */
.regs-disabled { text-align: center; padding: 2.5rem 1rem; }
.regs-enable-area { display: flex; gap: .75rem; align-items: center; justify-content: center; margin-top: 1rem; }
.regs-toolbar { display: flex; justify-content: space-between; align-items: center;
                margin-bottom: 1rem; flex-wrap: wrap; gap: .5rem; }
.regs-toolbar-right { display: flex; gap: .5rem; }
.regs-mode-toggle { display: flex; gap: .3rem; }
.regs-mode-toggle .btn.active { background: var(--navy-light); color: var(--white); }

/* Fields (edit mode) */
.regs-field-row { background: var(--white); border: 1px solid var(--g200); border-radius: var(--radius);
                   padding: .75rem 1rem; margin-bottom: .5rem; display: flex; gap: .75rem; }
.regs-field-row.hidden-field { opacity: .45; }
.regs-field-label-col { width: 130px; flex-shrink: 0; }
.regs-field-label { font-size: .85rem; font-weight: 700; color: var(--navy-dark); }
.regs-field-hint { font-size: .73rem; color: var(--g400); margin-top: .1rem; }
.regs-field-input-col { flex: 1; }
.regs-field-actions { display: flex; flex-direction: column; gap: .2rem; }
.regs-field-actions button { background: none; border: none; cursor: pointer; font-size: .75rem;
                              color: var(--g400); padding: .15rem; }
.regs-field-actions button:hover { color: var(--g800); }

/* Fixed display mode */
.regs-fixed-doc { max-width: 820px; margin: 0 auto; background: var(--white); padding: 2rem;
                  box-shadow: var(--shadow); border-radius: var(--radius); }
.regs-doc-title { font-size: 1.3rem; font-weight: 700; text-align: center; color: var(--navy-dark);
                  margin-bottom: 1.5rem; padding-bottom: .75rem; border-bottom: 2px solid var(--navy); }
.regs-doc-table { width: 100%; border-collapse: collapse; }
.regs-doc-table td { padding: .6rem .75rem; border: 1px solid var(--g300); vertical-align: top;
                      font-size: .9rem; line-height: 1.7; }
.regs-doc-table .reg-label { width: 140px; background: var(--g50); font-weight: 700;
                              color: var(--navy-dark); white-space: nowrap; }
.regs-doc-table .reg-value { white-space: pre-wrap; }

/* ── Global teams view ──────────────────────────────────────── */

/* ── Division master checkboxes in comp modal ───────────────── */
.cm-divisions-label { font-size: .82rem; font-weight: 600; color: var(--g600);
                      margin: 0 0 .35rem; }
.cm-divisions-checks { display: flex; flex-wrap: wrap; gap: .3rem .8rem;
                        background: var(--g50); border-radius: var(--radius);
                        padding: .55rem .65rem; }
.cm-divisions-checks .checkbox-label { font-size: .85rem; }

/* ── Team select modal ──────────────────────────────────────── */
.tsm-toolbar { display: flex; gap: .4rem; margin-bottom: .35rem; }
.team-select-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--g200);
                    border-radius: var(--radius); margin: .5rem 0; }
.team-select-item { display: flex; align-items: center; gap: .5rem; padding: .55rem .75rem;
                    border-bottom: 1px solid var(--g100); cursor: pointer; }
.team-select-item:last-child { border-bottom: none; }
.team-select-item:hover { background: var(--g50); }
.team-select-item input[type="checkbox"] { flex-shrink: 0; }
.ts-abbr { font-size: .8rem; color: var(--g600); }

/* ── Seed order modal ───────────────────────────────────────── */
.seed-list        { display: flex; flex-direction: column; gap: .2rem;
                    max-height: 60vh; overflow-y: auto; margin: .5rem 0; }
.seed-group-label { font-size: .75rem; font-weight: 700; color: var(--navy);
                    background: var(--g100); padding: .25rem .7rem;
                    border-radius: 4px; margin-top: .5rem; }
.seed-match-row   { display: flex; align-items: center; gap: .4rem; padding: .2rem 0; }
.seed-match-num   { font-size: .75rem; color: var(--g600); width: 58px; flex-shrink: 0; }
.seed-select      { flex: 1; min-width: 0; font-size: .85rem; }
.seed-vs          { font-size: .78rem; color: var(--g400); font-weight: 700; flex-shrink: 0; }

/* ── Result modal ───────────────────────────────────────────── */
.result-teams { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem;
                background: var(--g50); padding: .75rem; border-radius: var(--radius); }
.result-team  { flex: 1; display: flex; align-items: center; gap: .4rem; font-weight: 600;
                font-size: .9rem; overflow: hidden; }
.result-vs    { font-size: .85rem; color: var(--g400); font-weight: 700; flex-shrink: 0; }
.result-scores { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-bottom: .75rem; }
.result-scores span { color: var(--g600); font-weight: 700; }

/* ── Print ─────────────────────────────────────────────────── */
/* モバイル：日程詳細を1行ずつ表示 */
@media (max-width: 640px) {
  .sched-sep { display: none; }
  .sched-di  { display: block; line-height: 2; }
}

/* PDF出力用ページ設定 */
@page { size: A4 portrait; margin: 15mm; }

@media print {
  .no-print { display: none !important; }
  body { background: white; }
  .site-header { display: none; }
  .container { padding: 0; }
  .comp-grid { display: block; }
  .bracket-scroll { overflow: visible; }
  .bracket-match { box-shadow: none; }
  .regs-fixed-doc { box-shadow: none; padding: 0; }
  .sched-card { box-shadow: none; border: 1px solid var(--g300); break-inside: avoid; }
  /* 大会要項：印刷時は固定表示モードのみ */
  #regs-edit-pane  { display: none !important; }
  #regs-fixed-pane { display: block !important; }
}

/* ── 審判チップ ──────────────────────────────────────────────── */
.referee-chips { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .35rem; }
.chip { padding: .2rem .55rem; border: 1px solid var(--g300); border-radius: 99px;
        background: var(--g100); color: var(--g800); font-size: .76rem;
        cursor: pointer; transition: background var(--trans), color var(--trans); }
.chip:hover { background: var(--navy-light); color: var(--white); border-color: var(--navy-light); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  /* ハンバーガーメニュー */
  .hamburger { display: flex; }
  .site-header { position: relative; }
  .header-nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: var(--navy-dark); padding: .5rem 1rem .75rem; gap: .15rem;
    z-index: 200; border-top: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 4px 12px rgba(0,0,0,.4);
  }
  .header-nav.open { display: flex; }
  .header-nav .btn-ghost { text-align: left; border: none; padding: .65rem .5rem; font-size: .95rem; }

  /* レイアウト */
  .comp-grid { grid-template-columns: 1fr; }
  .bracket-match { min-width: 110px; font-size: .78rem; }
  .detail-header { flex-wrap: wrap; }
  .regs-field-row { flex-direction: column; }
  .regs-field-label-col { width: auto; }
  .regs-doc-table .reg-label { width: 100px; }

  /* トップページ日程 */
  .top-sched-match { flex-wrap: wrap; gap: .25rem .4rem; }
}

/* ── リーグ戦 ───────────────────────────────────────────── */
/* 順位表 */
.standings-table th, .standings-table td { text-align: center; padding: .3rem .4rem; }
.standings-table td:nth-child(2) { text-align: left; }
.standings-rank { font-weight: 700; color: var(--g600); }
.standings-leader td { background: #fffbe6; }
.standings-public { font-size: .9rem; margin-bottom: 1rem; }

/* 星取表 */
.matrix-wrap { overflow-x: auto; }
.matrix-table { border-collapse: collapse; font-size: .82rem; white-space: nowrap; }
.matrix-table th, .matrix-table td { border: 1px solid var(--border); padding: .3rem .45rem; text-align: center; }
.matrix-team-header { text-align: left; background: var(--g100); min-width: 6rem; }
.matrix-col-header  { background: var(--g100); font-weight: 600; }
.matrix-team-name   { text-align: left; font-weight: 600; background: var(--g50); }
.matrix-self        { background: var(--g200); color: var(--g400); font-size: 1rem; }
.matrix-empty       { color: var(--g300); }
.matrix-cell        { min-width: 5rem; }
.matrix-win         { color: #d32f2f; font-weight: 700; }
.matrix-loss        { color: #1565c0; font-weight: 700; }
.matrix-draw        { color: var(--g500); }
.matrix-pending     { color: var(--g300); font-size: .78rem; }
.matrix-stat        { font-variant-numeric: tabular-nums; min-width: 2.5rem; }
.matrix-rate        { font-weight: 700; }

/* 管理: 対戦表 */
.league-match-actions { display: flex; gap: .5rem; margin-bottom: 1rem; }
.league-round-section { margin-bottom: 1.5rem; }
.league-round-header  { display: flex; align-items: center; justify-content: space-between;
                        border-bottom: 1px solid var(--g200); padding-bottom: .3rem;
                        margin-bottom: .5rem; }
.league-round-label   { font-size: .82rem; font-weight: 700; color: var(--g600); }
.league-match-row     { display: flex; align-items: center; gap: .5rem; padding: .4rem 0;
                        border-bottom: 1px solid var(--g100); flex-wrap: wrap; }
.lg-match-date        { font-size: .78rem; color: var(--g500); min-width: 100px; }
.lg-match-teams       { flex: 1; display: flex; align-items: center; gap: .4rem; font-size: .9rem; }
.lg-vs                { color: var(--g400); font-size: .8rem; }
.lg-winner            { font-weight: 700; color: var(--navy); }
.lg-score-pending     { font-size: .78rem; color: var(--g400); }
.lg-score-result      { font-weight: 600; font-size: .9rem; color: var(--g800);
                        min-width: 60px; text-align: center; }
.lg-match-actions     { display: flex; gap: .3rem; margin-left: auto; }

/* 部門モーダル: リーグ設定 */
.league-settings-section { background: var(--g50); border: 1px solid var(--g200);
                            border-radius: var(--radius); padding: .75rem; }
.rank-criteria-list       { display: flex; flex-direction: column; gap: .3rem; }
.rank-criterion-row       { display: flex; align-items: center; gap: .4rem; font-size: .85rem; }
.rank-criterion-row span  { flex: 1; }

/* ── トップページ: 掲示物共通 ────────────────────────────── */
.top-news-section,
.top-bulletin-section,
.top-sched-section {
  margin-bottom: 2rem;
}
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  border-left: 4px solid var(--navy);
  padding-left: .6rem;
  margin-bottom: 1rem;
}

/* お知らせ */
.top-news-item {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  padding: .55rem .75rem;
  background: var(--white);
  border: 1px solid var(--g200);
  border-radius: var(--radius);
  margin-bottom: .4rem;
  line-height: 1.5;
}
.top-news-date {
  flex-shrink: 0;
  font-size: .8rem;
  color: var(--g600);
  white-space: nowrap;
  min-width: 6em;
}
.top-news-title {
  font-weight: 700;
  font-size: .92rem;
  color: var(--navy);
  white-space: nowrap;
}
.top-news-content {
  font-size: .92rem;
  color: var(--g800);
  white-space: pre-wrap;
  word-break: break-word;
}

/* 注意事項 */
.top-caution-item {
  padding: .6rem .9rem;
  background: #fff8e0;
  border-left: 4px solid #f0c030;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: .5rem;
  font-size: .92rem;
  color: #5a4000;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

/* 資料・ダウンロード */
.top-doc-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .75rem;
  background: var(--white);
  border: 1px solid var(--g200);
  border-radius: var(--radius);
  margin-bottom: .4rem;
}
.top-doc-link {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: .92rem;
  font-weight: 600;
  color: var(--navy-light);
  text-decoration: none;
  flex: 1;
}
.top-doc-link:hover { text-decoration: underline; }
.top-doc-icon { font-size: 1.1rem; flex-shrink: 0; }
.top-doc-name { word-break: break-all; }
.top-doc-date {
  flex-shrink: 0;
  font-size: .78rem;
  color: var(--g400);
  white-space: nowrap;
}

/* 管理画面: 掲示物管理 */
.blt-filter-bar {
  display: flex;
  gap: .4rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.blt-filter-bar .btn.active {
  background: var(--navy-light);
  color: var(--white);
}
.blt-type-badge {
  display: inline-block;
  font-size: .73rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 4px;
  white-space: nowrap;
}
.blt-notice   { background: #e8effa; color: var(--navy); }
.blt-caution  { background: #fff3cd; color: #856404; }
.blt-document { background: #d4edda; color: #155724; }
.blt-preview-cell { font-size: .88rem; color: var(--g800); }
.blt-file-name { color: var(--navy-light); }
.blt-current-file-note { font-size: .82rem; color: var(--g500); margin-top: .25rem; }

/* ── トップページ: 日程 ──────────────────────────────────── */
.top-sched-empty-msg {
  color: var(--g400);
  font-size: .88rem;
  padding: .5rem 0;
}
.top-sched-comp {
  background: var(--white);
  border: 1px solid var(--g200);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
}
.top-sched-comp-name {
  background: var(--navy);
  color: var(--white);
  font-weight: 700;
  font-size: .92rem;
  padding: .45rem .85rem;
  letter-spacing: .03em;
}
.top-sched-date-group {
  border-bottom: 1px solid var(--g100);
}
.top-sched-date-group:last-child { border-bottom: none; }
.top-sched-date {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
  font-size: .8rem;
  font-weight: 700;
  color: var(--navy-light);
  background: var(--g50);
  padding: .3rem .85rem;
  border-bottom: 1px solid var(--g100);
}
.top-sched-date-text {
  flex-shrink: 0;
}
.top-sched-matches {
  padding: .3rem 0;
}
.top-sched-match {
  display: flex;
  align-items: center;
  gap: .3rem .5rem;
  padding: .35rem .85rem;
  font-size: .88rem;
  border-bottom: 1px dotted var(--g100);
  flex-wrap: wrap;
}
.top-sched-match:last-child { border-bottom: none; }
.top-sched-round {
  flex-shrink: 0;
  font-size: .73rem;
  color: var(--navy-light);
  font-weight: 600;
  white-space: nowrap;
}
.top-sched-time {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  color: var(--g600);
  font-size: .82rem;
  min-width: 3.2em;
}
.top-sched-venue {
  flex-shrink: 0;
  font-size: .78rem;
  color: var(--g500);
  background: var(--g100);
  border-radius: 3px;
  padding: 0 .35rem;
  white-space: nowrap;
}
.top-sched-venue-note {
  font-size: .8rem;
  color: #7a5800;
  background: #fff8e0;
  border-left: 3px solid #f0c030;
  padding: .3rem .85rem;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}
.top-sched-divbadge {
  flex-shrink: 0;
  font-size: .73rem;
  color: var(--navy);
  background: #e8effa;
  border-radius: 3px;
  padding: 0 .35rem;
  white-space: nowrap;
}
.top-sched-teams {
  flex: 1;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.top-sched-vs {
  font-size: .72rem;
  font-weight: 400;
  color: var(--g400);
  flex-shrink: 0;
}
/* 試合結果カード */
.top-sched-match--result {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  padding: .35rem .5rem;
}
.top-sched-result-team {
  font-weight: 600;
  font-size: .88rem;
  white-space: nowrap;
}
/* スコア＋メモを縦積みにしてスコアの中心＝メモの中心 */
.top-sched-score-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}
.top-sched-score {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--navy);
  font-size: .9rem;
  white-space: nowrap;
}
.top-sched-memo {
  font-size: .75rem;
  color: var(--g500);
  white-space: nowrap;
}
.top-sched-ref {
  flex-basis: 100%;
  font-size: .75rem;
  color: var(--g500);
  padding-left: .4rem;
  white-space: nowrap;
}
.top-sched-note {
  flex-basis: 100%;
  font-size: .75rem;
  color: var(--g600);
  padding-left: .4rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── お知らせ管理テーブル ────────────────────────────────── */
.news-content-cell {
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 480px;
  font-size: .88rem;
  line-height: 1.55;
}
