/* 公式サイト（tsuricra.net）に合わせた見た目。index.html・scores.html の <style> のあとに読む。
   色はページ側の変数（--bg など）を上書きするだけなので、ページの JS はそのまま動く。 */
:root {
  --bg: #d0e3f6; --panel: #ffffff; --panel-2: #eef5fc; --line: #bcd3ea;
  --ink: #1d3b5c; --ink-2: #275382; --ink-3: #6b7f99; --accent: #00398f;
  --navy: #00398f; --yellow: #e6ff0a; --border: #275382; --sky: #68c2ed;
  --t5: #8e9bab; --t6: #d9a300;              /* 白・黄チームは明るい背景で見えるように */
  --cmp-a: #1f7fd1; --cmp-b: #e07a1f;
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 720 28' preserveAspectRatio='none'%3E%3Cpath d='M0 0H720V12C630 26 540 26 450 14 360 2 270 2 180 14 90 26 0 26 0 12Z'/%3E%3C/svg%3E");
}
body {
  background: var(--bg);
  color: var(--ink);
  font: 500 14px/1.6 "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Meiryo", sans-serif;
  font-feature-settings: "palt";
}

/* ===== ヘッダー（紺の帯＋下に波） ===== */
header.site {
  position: relative; display: flex; align-items: center; gap: 14px 22px; flex-wrap: wrap;
  background: var(--navy); color: #fff; border: 0;
  padding: 14px max(18px, env(safe-area-inset-right, 0px)) 40px max(18px, env(safe-area-inset-left, 0px));
  overflow: hidden;
}
header.site::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 26px; background: var(--bg);
  transform: scaleY(-1); -webkit-mask: var(--wave) 0 0/720px 26px repeat-x; mask: var(--wave) 0 0/720px 26px repeat-x;
}
header.site .bub { position: absolute; border-radius: 50%; background: #2b7fd6; opacity: .55; pointer-events: none; }
header.site .brand { position: relative; display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
header.site .brand img { height: 46px; width: auto; display: block; filter: drop-shadow(0 3px 0 rgba(0, 20, 70, .35)); }
header.site .brand b { display: block; font-weight: 900; font-size: 20px; letter-spacing: .08em; line-height: 1.2; }
header.site .brand small { display: block; font: 900 10px/1 "Lato", sans-serif; letter-spacing: .24em; color: var(--yellow); }
header.site .meta { position: relative; color: #cfe3ff; font-size: 12px; font-weight: 700; }
header.site nav { position: relative; display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; }
header.site nav a {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  background: #fff; color: var(--border); font-weight: 800; font-size: 13.5px; line-height: 1;
  padding: 9px 16px; border-radius: 999px; border: 3px solid #fff; box-shadow: 3px 3px 0 var(--yellow);
  transition: transform .15s, box-shadow .15s, background .15s;
}
header.site nav a:hover { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--yellow); }
header.site nav a.on { background: var(--yellow); border-color: var(--yellow); color: #123766; box-shadow: none; }
header.site nav a.ext { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .6); box-shadow: none; }
@media (max-width: 640px) {
  header.site .brand img { height: 36px; }
  header.site .brand b { font-size: 17px; }
  header.site nav { margin-left: 0; width: 100%; }
  header.site nav a { padding: 8px 12px; font-size: 12.5px; }
}

/* ===== パネル（白いカード・紺の縁・黄色い影） ===== */
.wrap { padding: 4px max(14px, env(safe-area-inset-right, 0px)) 28px max(14px, env(safe-area-inset-left, 0px)); gap: 16px; }
.panel { background: var(--panel); border: 4px solid var(--border); border-radius: 18px; padding: 14px; box-shadow: 5px 5px 0 var(--yellow); }
.panel h2 {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 900; color: var(--navy); letter-spacing: .04em; margin: 0 0 10px;
}
.panel h2::before { content: ""; width: 6px; height: 16px; border-radius: 3px; background: var(--sky); flex: none; }

/* 入力・ボタン */
input[type=search], input[type=date], select, .controls button, .controls select, .an-head select, .tabs button, button {
  font-family: inherit;
}
.gfilter, .controls input[type=date], .controls input[type=search], .controls select, .an-head select, .controls button, button {
  background: #fff; color: var(--ink); border: 2px solid var(--line); border-radius: 10px; font-weight: 700;
}
.gfilter:focus, select:focus, input:focus { outline: none; border-color: var(--navy); }
#play, .controls button {
  background: var(--navy); color: #fff; border: 3px solid var(--navy); border-radius: 999px; padding: 6px 16px;
  box-shadow: 3px 3px 0 var(--yellow); font-weight: 900;
}
input[type=range] { accent-color: var(--navy); }

/* 大会一覧 */
.game { background: #fff; border: 2px solid var(--line); border-radius: 12px; color: var(--ink); transition: border-color .15s, transform .15s; }
.game:hover { border-color: var(--border); transform: translateX(2px); }
.game.on { border: 3px solid var(--navy); box-shadow: 3px 3px 0 var(--yellow); background: #f4f9ff; }
.game .t { font-weight: 900; color: var(--navy); }
.badge, .tag { background: var(--panel-2); color: var(--ink-2); border: 1px solid var(--line); font-weight: 700; }

/* 地図 */
.mapbox { border-radius: 14px; border: 3px solid var(--border); background: #0b2a3a; }
.empty { color: #fff; font-weight: 700; }

/* グラフ */
.chart, .cmp-chart svg { background: #fff; border: 2px solid var(--line); border-radius: 12px; }

/* タブ・切り替え */
.tabs { gap: 6px; flex-wrap: wrap; }
.tabs button { background: #fff; color: var(--ink-2); border: 2px solid var(--line); border-radius: 999px; padding: 4px 14px; font-weight: 800; }
.tabs button.on { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 2px 2px 0 var(--yellow); }
.seg { border: 2px solid var(--navy); border-radius: 999px; }
.seg button { background: #fff; color: var(--ink-2); font-weight: 800; }
.seg button.on { background: var(--navy); color: #fff; }

/* 数字のカード */
.kpi { background: var(--panel-2); border: 0; border-radius: 12px; border-left: 5px solid var(--sky); }
.kpi .v { color: var(--navy); font-weight: 900; }
.kpi .l { font-weight: 700; }

/* 表 */
.tbl th { color: var(--navy); background: var(--panel-2); font-weight: 800; }
.tbl th.sorted { color: var(--navy); background: #dcebf9; }
.tbl tr:hover td, .tbl tbody tr:hover td { background: #f4f9ff; }
.tbl tr.on td { background: #fbffd6; box-shadow: inset 0 2px 0 var(--navy), inset 0 -2px 0 var(--navy); }
.bar { background: var(--panel-2); }
.bar i { background: var(--navy); }
.chips span { background: var(--panel-2); border-color: var(--line); color: var(--ink-2); font-weight: 700; }

/* プレイヤー・行動 */
.pl:hover, .pl.hl, .tm-row:hover, .tm-row.hl { background: var(--panel-2); }
.ev b { color: var(--navy); font-weight: 800; }
.note { font-weight: 700; }

/* 成績ページ */
svg.spark polyline { stroke: var(--navy); }
svg.spark circle { fill: var(--navy); }
.sliders { border-top: 2px dashed var(--line); }

/* フッター */
footer.site { position: relative; margin-top: 36px; background: var(--navy); color: #cfe3ff; text-align: center; font-size: 12px; font-weight: 700; padding: 44px 16px 28px; }
footer.site::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 26px; background: var(--bg); -webkit-mask: var(--wave) 0 0/720px 26px repeat-x; mask: var(--wave) 0 0/720px 26px repeat-x; }
footer.site img { height: 40px; display: block; margin: 0 auto 8px; }
footer.site a { color: #fff; }

/* スマホで横にはみ出さないように（表や地図を枠の中に収める） */
.wrap > * { min-width: 0; }
@media (max-width: 1100px) { .wrap { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .wrap { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .controls label { flex-wrap: wrap; width: 100%; } }

/* 成績ページ: 自分用・管理用のリンクで見ているとき（Discord の /成績 自分・管理用） */
.viewbanner { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; font-weight: 800; font-size: 13px; background: var(--panel-2); border-left: 6px solid var(--sky); }
.viewbanner.admin { background: #fff4e5; border-left-color: #e07a1f; color: #7a3f00; }
.viewbanner.self { background: #f1fbd0; border-left-color: #8cb800; }
.viewbanner.warn { background: #fff0f0; border-left-color: #d64545; color: #8a1f1f; }
.tag.me { margin-left: 6px; background: var(--yellow); color: #123766; border-color: #c6dc00; }
.tag.off { margin-left: 6px; background: #fff4e5; color: #7a3f00; border-color: #f0c08a; }
