:root {
  --paper: #f6f7fb;
  --paper-2: #eceef4;
  --card: #fff;
  --ink: #1f2433;
  --sumi: #3a4052;
  --mute: #6b7183;
  --line: #e1e4ec;
  --red: #e23a3f;
  --red-soft: #fdecec;
  --gold: #c99a2e;
  --ok: #24804a;
  --ok-soft: #e4f4ea;
  --warn: #8a5a00;
  --warn-soft: #fff4d6;
  --radius: 8px;
  --serif: var(--sans);
  --sans: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
  /* 地方の色（未設定のときは赤） */
  --rc: #e23a3f; --rc-dk: #c0262c; --rc-soft: #fdecec; --rc-on: #fff;
  --rc-grad: linear-gradient(120deg, #c9d3fa 0%, #e0cff6 35%, #f9cbd5 68%, #fbeaa6 100%);
}
/* EAST＝青 / CENTRAL＝緑 / WEST＝紫 / SOUTH＝赤 / NORTH＝黄 */
.rg-east, html[data-region=east] { --rc: #3d5ad6; --rc-dk: #2b44b3; --rc-soft: #ebeffd; --rc-on: #fff; --rc-grad: linear-gradient(160deg, #8ea0ee 0%, #c3cdf8 55%, #eef1fd 100%); }
.rg-central, html[data-region=central] { --rc: #2e9a4f; --rc-dk: #217a3c; --rc-soft: #e8f6ec; --rc-on: #fff; --rc-grad: linear-gradient(160deg, #8fd3a0 0%, #c6ebcf 55%, #f0faf3 100%); }
.rg-west, html[data-region=west] { --rc: #8a4fd0; --rc-dk: #6c37ae; --rc-soft: #f3ecfc; --rc-on: #fff; --rc-grad: linear-gradient(160deg, #b593e6 0%, #d8c4f3 55%, #f6f0fd 100%); }
.rg-south, html[data-region=south] { --rc: #e2364f; --rc-dk: #bb2539; --rc-soft: #fdedf0; --rc-on: #fff; --rc-grad: linear-gradient(160deg, #f190a4 0%, #f7c2ce 55%, #fdf0f3 100%); }
.rg-north, html[data-region=north] { --rc: #f2b600; --rc-dk: #a87c00; --rc-soft: #fff7dc; --rc-on: #2a2100; --rc-grad: linear-gradient(160deg, #f6cf47 0%, #fae49a 55%, #fffaea 100%); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.75;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ── ヘッダー ── */
.site-head {
  position: relative;
  text-align: center;
  padding: 28px 16px 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.site-head a.logo { display: inline-block; }
.site-head .logo img { width: min(300px, 62vw); margin: 0 auto; }
.site-head .sub {
  margin-top: 6px;
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: .2em;
  font-size: 14px;
  color: var(--ink);
}
.site-head.small { padding: 14px 16px 10px; }
.site-head.small .logo img { width: 150px; }

.wrap { max-width: 860px; margin: 0 auto; padding: 24px 16px 64px; }
.wrap.wide { max-width: 1240px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.4; margin: 0; }
h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
.page-title { text-align: center; margin: 6px 0 20px; }
.page-title small { display: block; font-family: var(--sans); font-size: 13px; color: var(--mute); font-weight: 400; margin-top: 4px; letter-spacing: 0; }

.section-title {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--serif); font-size: 19px; margin: 36px 0 14px;
}
.section-title::before { content: ""; width: 5px; height: 1.1em; border-radius: 3px; background: var(--rc); }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 1px 2px rgba(31, 36, 51, .04);
}
.card + .card { margin-top: 16px; }

.muted { color: var(--mute); }
.small { font-size: 13px; }
.center { text-align: center; }
.red { color: var(--red); }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }

/* ── 大会カード ── */
.event-card { padding: 0; overflow: hidden; }
.event-card .ev-head {
  padding: 16px 20px 14px;
  background: var(--rc-grad);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px;
}
.ev-vol { font-family: var(--serif); font-size: 24px; font-weight: 700; letter-spacing: .04em; }
.rg-chip { display: inline-block; vertical-align: 4px; margin-right: 10px; font-size: 12px; font-weight: 900; letter-spacing: .14em; line-height: 1; padding: 6px 9px 6px 10px; border-radius: 4px; background: var(--rc); color: var(--rc-on); }
.ev-vol .bar { color: var(--mute); margin: 0 .35em; font-weight: 400; }
.ev-body { padding: 16px 20px 20px; }
.ev-meta { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; font-size: 14px; margin: 0 0 14px; }
.ev-meta dt { color: var(--mute); }
.ev-meta dd { margin: 0; }

.badge {
  display: inline-block; font-size: 12px; font-weight: 700; line-height: 1;
  padding: 6px 9px; border-radius: 3px; letter-spacing: .05em; white-space: nowrap;
  background: var(--paper-2); color: var(--sumi);
}
.badge.open { background: #fff; color: var(--rc-dk); box-shadow: inset 0 0 0 1.5px var(--rc); }
.badge.soon { background: var(--ink); color: #fff; }
.badge.closed { background: #8f95a5; color: #fff; }
.badge.wait { background: var(--warn-soft); color: var(--warn); }
.badge.in { background: var(--ok-soft); color: var(--ok); }
.badge.off { background: #eee; color: #888; }

.divs { list-style: none; margin: 0 0 16px; padding: 0; border-top: 1px dashed var(--line); }
.divs li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.divs .dname { font-weight: 700; min-width: 7em; }
.divs .dcount { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.meter { flex: 1; max-width: 160px; height: 6px; background: var(--paper-2); border-radius: 3px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--rc); }
.meter.full i { background: var(--rc-dk); }

/* ── ボタン ── */
.steps { display: grid; gap: 10px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 52px; padding: 10px 18px;
  border: 1.5px solid var(--ink); border-radius: var(--radius);
  background: var(--ink); color: #fff;
  font-weight: 700; text-decoration: none; cursor: pointer; text-align: center; line-height: 1.4;
}
.btn:hover { background: #10131c; }
.btn .step { font-size: 12px; letter-spacing: .14em; padding-right: 12px; border-right: 1px solid rgba(255, 255, 255, .4); font-weight: 700; }
.btn.line { background: #fff; color: var(--ink); border-color: #c9cdd8; }
.btn.line .step { border-color: var(--line); }
.btn.line:hover { background: rgba(0, 0, 0, .04); }
.btn.red { background: var(--rc); border-color: var(--rc); color: var(--rc-on); }
.btn.red:hover { background: var(--rc-dk); border-color: var(--rc-dk); }
.btn.red .step { border-color: currentColor; border-right-color: rgba(127, 127, 127, .45); }
.btn[disabled], .btn.disabled { background: #e6e8ee; border-color: #e6e8ee; color: #858b9a; cursor: default; pointer-events: none; }
.btn.disabled .step { border-color: rgba(0, 0, 0, .15); }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 13px; gap: 6px; display: inline-flex; }
.btn.xs { min-height: 28px; padding: 3px 9px; font-size: 12px; gap: 4px; display: inline-flex; border-width: 1px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ── 注意事項 ── */
.notes { font-size: 14px; }
.notes h3 { margin: 18px 0 6px; font-size: 15px; }
.notes ul { margin: 0; padding-left: 1.2em; }
.notes li + li { margin-top: 4px; }

/* ── フォーム ── */
.form-row { margin-bottom: 20px; }
.form-row > label, .form-row > .label { display: block; font-weight: 700; margin-bottom: 6px; }
.req { display: inline-block; font-size: 11px; color: #fff; background: var(--red); padding: 1px 6px; border-radius: 2px; margin-left: 6px; vertical-align: 2px; font-weight: 700; }
.help { font-size: 13px; color: var(--mute); margin: -2px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=datetime-local], input[type=number], input[type=url], select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid #c9cdd8; border-radius: var(--radius); background: #fff;
  font-size: 16px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--rc); outline-offset: -1px; }
.choices { display: grid; gap: 6px; }
.choice { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid #c9cdd8; border-radius: var(--radius); background: #fff; cursor: pointer; }
.choice input { margin-top: 5px; accent-color: var(--rc); }
.choice:has(input:checked) { border-color: var(--rc); box-shadow: inset 0 0 0 1px var(--rc); background: var(--rc-soft); }
.choice .cnote { display: block; font-size: 12px; color: var(--mute); }
.choice .cwait { display: block; font-size: 12px; color: var(--warn); font-weight: 700; }
.field-error { color: var(--red); font-size: 13px; margin-top: 4px; }
.alert { padding: 12px 14px; border-radius: var(--radius); font-size: 14px; border: 1px solid; }
.alert.err { background: var(--red-soft); border-color: #e4b7b1; color: #7d1a14; }
.alert.warn { background: var(--warn-soft); border-color: #e7d2a4; color: #5f3f00; }
.alert.ok { background: var(--ok-soft); border-color: #b9d4b6; color: #1f4a28; }
.alert.info { background: #fff; border-color: var(--line); }

.done-box { text-align: center; }
.done-box .no { font-family: var(--serif); font-size: 40px; font-weight: 700; margin: 6px 0; }

/* ── 表 ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th, table.list td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.list th { background: var(--rc-soft); color: var(--ink); font-weight: 700; font-size: 13px; white-space: nowrap; }
table.list tr:last-child td { border-bottom: 0; }
table.list td.num { text-align: center; font-variant-numeric: tabular-nums; width: 3.5em; }
table.list tr.wait td { background: #fff9e8; }
table.list tr.off td { color: #9aa0ad; background: #f4f5f8; }
table.list tr.off td .pname { text-decoration: line-through; }

.tabs { display: flex; gap: 0; border-bottom: 1.5px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button {
  border: 0; background: transparent; padding: 10px 16px; cursor: pointer; font-weight: 700; color: var(--mute); white-space: nowrap;
  border-bottom: 3px solid transparent; margin-bottom: -1.5px;
}
.tabs button.on { color: var(--ink); border-bottom-color: var(--rc); }

.foot { text-align: center; font-size: 12px; color: var(--mute); padding: 24px 16px 40px; }
.foot a { color: var(--mute); }

.loading { text-align: center; padding: 48px 0; color: var(--mute); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: var(--radius); font-size: 14px; z-index: 100;
  max-width: calc(100% - 32px);
}
.toast.err { background: var(--red); }

/* ── 管理系 ── */
.admin-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  background: #fff; color: var(--ink); padding: 8px 16px; font-size: 14px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40;
}
.admin-bar .title { font-weight: 700; margin-right: auto; display: flex; align-items: center; gap: 10px; }
.admin-bar .title::before { content: ""; width: 74px; height: 28px; background: url(img/logo_blk.png) left center / contain no-repeat; }
.admin-bar a, .admin-bar button { color: var(--ink); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

dialog {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 0; max-width: min(560px, calc(100% - 24px)); width: 100%;
  background: var(--card);
}
dialog::backdrop { background: rgba(0, 0, 0, .45); }
dialog .dlg-head { padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 700; display: flex; align-items: center; }
dialog .dlg-head button { margin-left: auto; border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; }
dialog .dlg-body { padding: 18px; max-height: 70vh; overflow: auto; }
dialog .dlg-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

.copy-line { display: flex; gap: 8px; align-items: center; }
.copy-line input { font-size: 13px; padding: 7px 9px; }

/* ── トーナメント ── */
.bk-scroll { overflow: auto; -webkit-overflow-scrolling: touch; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.bk { position: relative; }
.bk svg { position: absolute; inset: 0; overflow: visible; }
.bk svg path { fill: none; stroke: #9aa0ad; stroke-width: 1.4; }
.bk svg path.win { stroke: var(--rc); stroke-width: 4; }
.bk-round { position: absolute; top: 0; height: 26px; line-height: 26px; text-align: center; font-size: 12px; font-weight: 700; color: var(--rc-on); background: var(--rc); border-radius: 2px; letter-spacing: .1em; }
.bk-box {
  position: absolute; background: #fff; border: 1.5px solid #3a4052; border-radius: 5px;
  display: flex; flex-direction: column; justify-content: center; padding: 0 10px; overflow: hidden; line-height: 1.25;
}
.bk-name { font-weight: 900; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-team { font-size: 11px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-team i { font-style: normal; }
.bk-yomi { font-size: 13px; color: var(--rc-dk); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .04em; }
.bk.mc .bk-name { font-size: 20px; }
.bk.mc .bk-team { font-size: 12px; }
.bk.mc .bk-yomi { font-size: 15px; }
.bk-box.tbd { border-style: dashed; border-color: #b8bdc9; background: transparent; }
.bk-box.empty { border-style: dashed; border-color: #d3d7e0; background: transparent; }
.bk-box.lost { background: #eef0f4; border-color: #c4c9d4; color: #8d93a1; }
.bk-box.lost .bk-yomi, .bk-box.lost .bk-team { color: #a3a8b4; }
.bk-box.won { border-color: var(--rc); box-shadow: inset 0 0 0 1px var(--rc); }
.bk-box.champ { background: var(--rc); color: var(--rc-on); border-color: var(--rc-dk); box-shadow: inset 0 0 0 2px var(--rc-dk); }
.bk-box.champ .bk-team, .bk-box.champ .bk-yomi { color: inherit; opacity: .85; }
.bk-box.now { outline: 3px solid var(--rc); outline-offset: 2px; }
.bk-box.next { outline: 2px dashed var(--ink); outline-offset: 2px; }
.bk-box.click { cursor: pointer; }
.bk-box.click:hover { background: var(--rc-soft); }
.bk-box.sel { background: #fff0c2 !important; outline: 3px solid #e0a400; }
.bk-tag { position: absolute; right: 4px; top: 3px; font-size: 10px; line-height: 1; padding: 3px 5px; border-radius: 2px; background: var(--rc); color: var(--rc-on); letter-spacing: .05em; }
.bk-tag.next { background: var(--ink); }
.bk-tag.champ { background: var(--ink); color: #fff; }
.div-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.div-tabs button { border: 1.5px solid #c9cdd8; background: #fff; padding: 7px 16px; border-radius: 999px; font-weight: 700; cursor: pointer; }
.div-tabs button.on { background: var(--rc); border-color: var(--rc); color: var(--rc-on); }
.copy-line .btn { flex-shrink: 0; white-space: nowrap; }

/* ── 上部メニュー ── */
.topnav { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96); color: var(--ink); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 16px; min-height: 52px; }
.topnav .tn-logo img { height: 30px; width: auto; }
.topnav ul { list-style: none; margin: 0 0 0 auto; padding: 0; display: flex; flex-wrap: wrap; }
.topnav ul a { display: block; padding: 15px 12px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 700; }
.topnav ul a:hover { color: var(--rc); }
.topnav ul a.on { box-shadow: inset 0 -3px 0 var(--rc); }
.tn-toggle { display: none; margin-left: auto; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; padding: 12px 10px; }
.tn-toggle span { display: block; height: 2px; background: var(--ink); margin: 4px 0; transition: transform .2s, opacity .2s; }
.topnav.open .tn-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.topnav.open .tn-toggle span:nth-child(2) { opacity: 0; }
.topnav.open .tn-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
@media (max-width: 900px) {
  .tn-toggle { display: block; }
  .topnav ul { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; flex-direction: column; padding: 4px 0 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); box-shadow: 0 8px 16px rgba(31,36,51,.08); }
  .topnav.open ul { display: flex; }
  .topnav ul a { padding: 12px 20px; font-size: 15px; }
  .topnav ul a.on { box-shadow: inset 3px 0 0 var(--rc); }
}
.divs li.total { background: rgba(0,0,0,.025); }


/* 地方の凡例（エントリートップ） */
.rg-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-top: 10px; font-size: 12px; font-weight: 700; letter-spacing: .1em; }
.rg-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rg-legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--rc); }

/* ページ内メニュー（エントリートップ） */
.page-menu { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.page-menu .pm-in { max-width: 860px; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.pm-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border: 1.5px solid #c9cdd8; border-radius: 999px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; line-height: 1.2; }
.pm-btn:hover { border-color: var(--rc); background: var(--rc-soft); }
.pm-btn b { font-size: 10px; letter-spacing: .12em; padding: 3px 6px; border-radius: 3px; background: var(--rc); color: var(--rc-on); }
.pm-btn .pm-vol { font-size: 12px; color: var(--mute); font-weight: 700; }
.event-card { scroll-margin-top: 130px; }
#notes { scroll-margin-top: 130px; }
@media (max-width: 600px) {
  /* スマホは全部見えるように折り返し、上に固定はしない */
  .page-menu { position: static; }
  .page-menu .pm-in { gap: 6px; }
  .pm-btn { padding: 7px 11px; font-size: 13px; }
  .event-card, #notes { scroll-margin-top: 12px; }
  html { scroll-padding-top: 0; }
  .divs .dcount { white-space: normal; text-align: right; }
  .divs .dcount .badge { display: table; margin: 4px 0 0 auto; }
}

/* キャンセル待ちの案内（フォーム上部） */
.wait-info { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--rc); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px; font-size: 14px; }
.wait-info h2 { font-size: 16px; margin-bottom: 6px; }
.wait-info ul { margin: 0; padding-left: 1.2em; }
.wait-info li + li { margin-top: 3px; }
.wait-info .wi-now { margin: 0 0 8px; padding: 8px 12px; border-radius: 6px; background: var(--warn-soft); color: #5f3f00; font-weight: 700; }
.wait-info.full { border-left-color: #e0a400; }

/* キービジュアル（公式サイトと同じ画像。ロゴ入り） */
.site-head.kv {
  position: relative;
  height: clamp(180px, 26vw, 400px);
  padding: 0;
  background: url(img/kv.jpg) center 50% / cover no-repeat #e9e9e9;
  border-bottom: 1px solid var(--line);
}
.site-head.kv.small { height: clamp(120px, 16vw, 240px); padding: 0; }
.site-head.kv a.logo { position: absolute; inset: 0; display: block; }
.site-head.kv .logo img { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.site-head.kv .sub { display: none; }
