:root {
  --blue: #007fff;
  --head: #0f69f5;
  --link: #1a39c5;
  --red: #e82929;
  --text: #333;
  --line: #ccc;
  --light: #f5f5f5;
  --green: #5cb85c;
  --label-blue: #337ab7;
  --pink-bg: #f2dede;
  --pink-line: #ebccd1;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: #fff; color: var(--text);
  font-family: "ヒラギノ角ゴ ProN W3", "Hiragino Kaku Gothic ProN", "ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", メイリオ, Meiryo, "MS ゴシック", "MS Gothic", sans-serif;
  font-size: 14px; line-height: 1.5;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { vertical-align: middle; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.bar { height: 6px; background: var(--blue); }
.container { width: 1000px; margin: 0 auto; padding: 0 15px; }
.row { display: flex; gap: 30px; align-items: flex-start; }
.col-4 { width: 300px; flex: 0 0 300px; min-width: 0; }
.col-8 { flex: 1 1 auto; min-width: 0; }
.col-6 { flex: 1 1 0; min-width: 0; }
.clearfix::after { content: ""; display: block; clear: both; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.muted { color: #888; }
.small { font-size: 12px; }
.red { color: var(--red); }
.bold { font-weight: bold; }
.mt10 { margin-top: 10px; } .mt20 { margin-top: 20px; } .mt30 { margin-top: 30px; }
.mb10 { margin-bottom: 10px; } .mb20 { margin-bottom: 20px; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; word-break: break-all; }

/* ===== ヘッダー ===== */
header.site { padding: 10px 0 0; }
.head-top { display: flex; align-items: flex-start; gap: 20px; }
.logo { display: block; width: 180px; height: 100px; flex: 0 0 180px; }
.logo img { width: 180px; height: 100px; object-fit: contain; }
.head-mid { flex: 1; padding-top: 14px; }
.toplinks { list-style: none; margin: 0 0 14px; padding: 0; font-size: 13px; color: #cfc9b7; display: flex; flex-wrap: wrap; }
.toplinks li + li::before { content: "|"; margin: 0 6px; }
.search { display: flex; width: 370px; }
.search input { flex: 1; height: 28px; border: 1px solid var(--line); border-right: 0; border-radius: 4px 0 0 4px; padding: 3px 10px; font-size: 13px; }
.search button { height: 28px; padding: 0 12px; border-radius: 0 4px 4px 0; font-size: 13px; }
.head-right { width: 175px; flex: 0 0 175px; padding-top: 5px; }
.head-right .btn-outline { display: block; width: 100%; margin-bottom: 6px; text-align: center; font-weight: bold; font-size: 13px; padding: 3px 4px; border-radius: 4px; background: #fff; }
.btn-outline.blue { color: #1d9bf0; border: 1px solid #1d9bf0; }
.btn-outline.red { color: #e62117; border: 1px solid #e62117; }
.head-user { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 6px; }
.head-user .name { font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }
.head-user-links { font-size: 12px; }
.head-user-links a + a::before { content: "|"; color: #cfc9b7; margin: 0 5px; }

nav.gnav { margin-top: 8px; }
nav.gnav ul { list-style: none; margin: 0; padding: 0; display: flex; border: 1px solid var(--line); border-radius: 5px; box-shadow: 2px 2px 2px #aaa; overflow: hidden; }
nav.gnav li { flex: 1; text-align: center; font-weight: bold; }
nav.gnav li + li { border-left: 1px solid #e7e7e7; }
nav.gnav a { display: block; padding: 9px 4px; color: var(--link); }
nav.gnav a:hover, nav.gnav a.active { background: #e7e7e7; text-decoration: none; }

.notice { margin: 15px 0 0; padding: 12px 15px; background: var(--pink-bg); border: 1px solid var(--pink-line); border-radius: 4px; color: #a94442; font-size: 13px; }
.notice a { text-decoration: underline; font-weight: bold; color: var(--link); }

/* ===== メイン ===== */
main { padding: 15px 0 40px; min-height: 400px; }
.breadcrumb { font-size: 12px; color: #777; margin: 8px 0 4px; padding: 0 2px; }
.breadcrumb a { color: var(--link); }
.breadcrumb span.sep { margin: 0 6px; color: #ccc; }
h1.page { color: var(--red); font-size: 26px; font-weight: 500; border-bottom: 2px solid var(--blue); padding-bottom: 5px; margin-bottom: 10px; line-height: 1.3; word-break: break-all; }
h2.box { background: var(--head); color: #fff; font-size: 20px; font-weight: bold; padding: 8px 10px; line-height: 1.3; }
h2.box small { font-size: 12px; font-weight: normal; margin-left: 8px; }
h3.sub { font-size: 16px; border-left: 5px solid var(--head); padding: 3px 8px; margin: 20px 0 10px; }
.box-body { border: 1px solid var(--line); border-top: 0; padding: 10px; font-size: 13px; }
.box-body + h2.box, .list + h2.box, .section + .section { margin-top: 20px; }
.section { margin-bottom: 20px; }
.intro { font-size: 14px; margin-bottom: 15px; }

.list { border: 1px solid var(--line); border-top: 0; }
.list-row { display: flex; align-items: center; border-top: 1px solid var(--line); padding: 8px 10px; gap: 10px; min-height: 56px; }
.list-row:first-child { border-top: 0; }
.list-row.gray { background: var(--light); }
.list-empty { padding: 15px; text-align: center; color: #888; font-size: 13px; }
.sidebox p + p { margin-top: 10px; }
.sidebox .item { padding: 8px 0; border-top: 1px solid #eee; }
.sidebox .item:first-child { border-top: 0; padding-top: 0; }

/* ラベル・ボタン */
.label { display: inline-block; padding: 1px 6px 2px; font-size: 10.5px; font-weight: bold; color: #fff; border-radius: 3px; line-height: 1.4; white-space: nowrap; }
.label.green { background: var(--green); }
.label.blue { background: var(--label-blue); }
.label.sky { background: #5bc0de; }
.label.gray { background: #999; }
.label.red { background: #d9534f; }
.label.orange { background: #f0ad4e; }
.label.stream { background: #fff; color: #e50202; border: 1px solid #e50202; font-size: 10px; padding: 0 3px; }
.btn { display: inline-block; padding: 6px 14px; border-radius: 4px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 14px; line-height: 1.4; text-align: center; color: var(--text); }
.btn:hover { background: #f0f0f0; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--blue); border-color: #2e6da4; color: #fff; }
.btn-primary:hover { background: #0069d9; }
.btn-success { background: var(--green); border-color: #4cae4c; color: #fff; }
.btn-success:hover { background: #449d44; }
.btn-danger { background: #d9534f; border-color: #d43f3a; color: #fff; }
.btn-danger:hover { background: #c9302c; }
.btn-warning { background: #f0ad4e; border-color: #eea236; color: #fff; }
.btn-lg { font-size: 18px; padding: 10px 16px; font-weight: bold; }
.btn-block { display: block; width: 100%; }
.btn-sm { font-size: 12px; padding: 3px 9px; }

/* フォーム */
.form-group { margin-bottom: 14px; }
.form-group > label { display: block; font-weight: bold; margin-bottom: 4px; font-size: 13px; }
.form-control { width: 100%; padding: 6px 10px; border: 1px solid var(--line); border-radius: 4px; background: #fff; font-size: 14px; }
.form-control:focus { outline: none; border-color: #66afe9; box-shadow: 0 0 0 3px rgba(102,175,233,.3); }
textarea.form-control { min-height: 90px; resize: vertical; }
.help { font-size: 12px; color: #777; margin-top: 3px; }
.inline-checks label { display: inline-flex; align-items: center; gap: 4px; margin-right: 14px; font-weight: normal; }
.alert { padding: 10px 14px; border-radius: 4px; margin-bottom: 14px; font-size: 13px; }
.alert-danger { background: var(--pink-bg); border: 1px solid var(--pink-line); color: #a94442; }
.alert-info { background: #d9edf7; border: 1px solid #bce8f1; color: #31708f; }
.alert-success { background: #dff0d8; border: 1px solid #d6e9c6; color: #3c763d; }
.alert-warning { background: #fcf8e3; border: 1px solid #faebcc; color: #8a6d3b; }

/* アバター・ファイターチップ */
.avatar { display: inline-block; flex: 0 0 auto; border-radius: 3px; overflow: hidden; background: #ccc; position: relative; vertical-align: middle; }
.avatar svg { width: 100%; height: 100%; display: block; }
.fchip { display: inline-flex; align-items: center; justify-content: center; height: 20px; min-width: 36px; padding: 0 4px; border-radius: 3px; font-size: 10px; font-weight: bold; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.35); white-space: nowrap; vertical-align: middle; line-height: 1; }
.fchip.lg { height: 26px; font-size: 12px; padding: 0 8px; }
.fchip.empty { background: #fff; border: 1px solid #ddd; color: #bbb; text-shadow: none; }
.uname { font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.wired { color: #555; font-size: 12px; }
.pcell { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 0; }
.pcell .info { min-width: 0; flex: 1; }
.pcell .info .line { border-bottom: 1px solid #eee; padding-bottom: 2px; margin-bottom: 3px; display: flex; align-items: center; gap: 3px; min-width: 0; }
.pcell .info .line .wired { flex: 0 0 auto; }
.rowno { width: 70px; flex: 0 0 70px; text-align: center; font-weight: bold; font-size: 13px; }
.rowno .ago { font-size: 11px; color: var(--red); font-weight: bold; }

/* ランキング */
.rank-row .rank { width: 40px; flex: 0 0 40px; font-size: 20px; font-weight: bold; text-align: center; color: #333; }
.rank-row .rate { width: 60px; flex: 0 0 60px; text-align: right; font-weight: bold; color: #777; }
.rank-row.top1 .rank { color: #d4a500; } .rank-row.top2 .rank { color: #8a9aa8; } .rank-row.top3 .rank { color: #b0683a; }

/* 大会 */
.t-row { display: block; border-top: 1px solid var(--line); padding: 8px 10px; }
.t-row:first-child { border-top: 0; }
.t-row .t-title { font-weight: bold; }
.t-row .t-desc { font-size: 12px; color: #555; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.t-row .t-foot { display: flex; justify-content: flex-end; align-items: center; gap: 12px; font-size: 12px; margin-top: 3px; flex-wrap: wrap; }
.countdown b { font-size: 18px; color: var(--red); margin: 0 1px; }

/* 日記 */
.d-row { display: block; border-top: 1px solid var(--line); padding: 8px 10px; }
.d-row:first-child { border-top: 0; }
.d-row .d-title { font-weight: bold; }
.d-row .d-ex { font-size: 12px; color: #555; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.d-row .d-foot { text-align: right; font-size: 12px; }
.newmark { color: var(--red); font-weight: bold; font-size: 12px; margin-left: 4px; }
.diary-body { font-size: 14px; line-height: 1.8; padding: 15px; border: 1px solid var(--line); border-top: 0; white-space: pre-wrap; word-break: break-word; }

/* コメント */
.comments { border: 1px solid var(--line); border-top: 0; max-height: 420px; overflow-y: auto; background: #fafafa; }
.comment { display: flex; gap: 8px; padding: 8px 10px; border-top: 1px solid #eee; }
.comment:first-child { border-top: 0; }
.comment .c-body { flex: 1; min-width: 0; }
.comment .c-head { font-size: 12px; color: #777; }
.comment .c-text { white-space: pre-wrap; word-break: break-word; }
.comment.mine { background: #eef6ff; }
.comment.system { background: #fff8e1; font-size: 12px; color: #8a6d3b; }
.comment-form { display: flex; gap: 6px; margin-top: 8px; }
.comment-form textarea { min-height: 40px; height: 40px; }
.comment-form .btn { flex: 0 0 auto; white-space: nowrap; }

/* ユーザーページ */
.u-card { display: flex; gap: 10px; align-items: flex-start; }
.u-card .u-name { font-size: 18px; font-weight: bold; word-break: break-all; }
.kv { width: 100%; border-collapse: collapse; font-size: 13px; }
.kv th, .kv td { border-top: 1px solid #eee; padding: 7px 4px; text-align: left; vertical-align: top; }
.kv tr:first-child th, .kv tr:first-child td { border-top: 0; }
.kv th { width: 40%; color: #555; font-weight: bold; }
.u-links a { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-top: 1px solid #eee; }
.u-links a:first-child { border-top: 0; }
.badge { display: inline-block; min-width: 18px; padding: 1px 6px; font-size: 11px; font-weight: bold; color: #fff; background: #777; border-radius: 10px; text-align: center; }
.graph { width: 100%; height: 260px; display: block; }
.plus { color: #1a8f2a; font-weight: bold; } .minus { color: var(--red); font-weight: bold; }

/* レート対戦ルーム */
.vs { display: flex; align-items: stretch; gap: 10px; }
.vs .player { flex: 1; border: 1px solid var(--line); padding: 10px; min-width: 0; }
.vs .player.me { background: #f4f9ff; }
.vs .mid { display: flex; align-items: center; font-size: 26px; font-weight: bold; color: var(--red); }
.player .p-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.player .p-name { font-size: 16px; font-weight: bold; word-break: break-all; }
.arena-box { border: 3px solid var(--blue); background: #f4f9ff; padding: 14px; text-align: center; margin: 15px 0; }
.arena-box .arena-id { font-size: 34px; font-weight: bold; letter-spacing: 6px; color: #003f8c; font-family: Consolas, "Courier New", monospace; }
.arena-box .pw { font-size: 16px; margin-top: 4px; }
.arena-form { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.arena-form input { width: 140px; text-transform: uppercase; font-size: 20px; text-align: center; letter-spacing: 4px; font-family: Consolas, monospace; }
.waiting-box { text-align: center; padding: 20px 10px; border: 1px solid var(--line); border-top: 0; }
.spinner { width: 36px; height: 36px; border: 4px solid #d6e6ff; border-top-color: var(--blue); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.stages { display: flex; flex-wrap: wrap; gap: 6px; }
.stage { border: 1px solid var(--line); border-radius: 3px; padding: 4px 8px; font-size: 13px; background: #fff; }
.stage.x { background: #eee; color: #aaa; text-decoration: line-through; }
.report-btns { display: flex; gap: 8px; }
.report-btns .btn { flex: 1; font-weight: bold; }
.result-big { font-size: 22px; font-weight: bold; text-align: center; padding: 14px; }

/* ファイター一覧 */
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.fcard { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); padding: 6px; font-size: 12px; border-radius: 3px; color: var(--text); }
.fcard:hover { background: #f4f9ff; text-decoration: none; }
.fcard .fname { font-weight: bold; color: var(--link); }

/* 表 */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
table.tbl th { background: #f5f5f5; }

/* 静的ページ */
.doc { font-size: 14px; line-height: 1.85; }
.doc h3 { font-size: 17px; border-left: 5px solid var(--head); padding: 2px 10px; margin: 26px 0 10px; }
.doc p, .doc ul, .doc ol { margin: 0 0 10px; }
.doc ul, .doc ol { padding-left: 22px; }
.doc .point { background: #fff8e1; border: 1px solid #f3dfa2; padding: 10px 14px; border-radius: 4px; }

.pager { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }

/* フッター */
footer.site { border-top: 1px solid #e0e0e0; border-bottom: 1px solid #e0e0e0; padding: 15px 0; text-align: center; font-size: 11px; color: #666; line-height: 1.7; }
footer.site a { color: var(--link); }
footer .flinks { margin-bottom: 6px; font-size: 12px; }
footer .flinks a + a::before { content: "|"; color: #ccc; margin: 0 6px; }

/* トースト */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: rgba(0,0,0,.82); color: #fff; padding: 10px 18px; border-radius: 6px; font-size: 14px; z-index: 1000; max-width: 90vw; }
.toast.err { background: rgba(190,30,30,.92); }

/* モーダル */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 900; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 6px; width: 100%; max-width: 480px; max-height: 90vh; overflow: auto; }
.modal h2.box { border-radius: 6px 6px 0 0; font-size: 17px; }
.modal .m-body { padding: 14px; }
.modal .m-foot { padding: 10px 14px; border-top: 1px solid #eee; display: flex; justify-content: flex-end; gap: 8px; }

/* ===== スマホ ===== */
@media (max-width: 1029px) {
  .container { width: 100%; }
}
@media (max-width: 767px) {
  .container { padding: 0 10px; }
  .head-top { flex-wrap: wrap; gap: 8px; }
  .logo, .logo img { width: 120px; height: 66px; flex-basis: 120px; }
  .head-mid { order: 3; flex: 1 1 100%; padding-top: 0; }
  .toplinks { display: none; }
  .search { width: 100%; }
  .head-right { margin-left: auto; width: 150px; flex-basis: 150px; }
  nav.gnav ul { flex-wrap: wrap; }
  nav.gnav li { flex: 1 1 33.33%; border-top: 1px solid #e7e7e7; }
  nav.gnav li:nth-child(-n+3) { border-top: 0; }
  nav.gnav li:nth-child(4) { border-left: 0; }
  nav.gnav a { padding: 8px 2px; font-size: 13px; }
  .row { flex-direction: column; gap: 20px; }
  .col-4, .col-8, .col-6 { width: 100%; flex: 1 1 auto; }
  h1.page { font-size: 22px; }
  h2.box { font-size: 17px; }
  .list-row { flex-wrap: wrap; gap: 8px; }
  .rowno { width: 56px; flex-basis: 56px; }
  .vs { flex-direction: column; }
  .vs .mid { justify-content: center; font-size: 20px; }
  .arena-box .arena-id { font-size: 28px; }
}

/* 外部アカウントログイン */
.btn-outline.x { color: #000; border: 1px solid #000; }
.btn-outline.google { color: #e62117; border: 1px solid #e62117; }
.btn-outline.discord { color: #5865f2; border: 1px solid #5865f2; }
.oauth-btns { display: flex; flex-direction: column; gap: 8px; }
.oauth-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border-radius: 4px; font-weight: bold; font-size: 15px; color: #fff; }
.oauth-btn:hover { text-decoration: none; opacity: .9; }
.oauth-btn.x { background: #000; }
.oauth-btn.google { background: #fff; color: #333; border: 1px solid #ccc; }
.oauth-btn.discord { background: #5865f2; }
.oauth-btn .mark { font-family: Arial, sans-serif; font-weight: 900; }
.divider { display: flex; align-items: center; gap: 10px; color: #999; font-size: 12px; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid #ddd; }
.linked-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid #eee; }
.linked-row:first-child { border-top: 0; }

/* ファイターアイコン */
.ficon { height: 20px; width: auto; max-width: 40px; vertical-align: middle; border-radius: 2px; }
.ficon.lg { height: 30px; max-width: 56px; }
.ficon-lg { display: inline-flex; align-items: center; gap: 6px; font-weight: bold; font-size: 13px; }
.fcard .ficon { height: 28px; max-width: 48px; }

/* 試用運用中のお知らせ（トップ） */
.trial-box { position: relative; margin: 14px 0 6px; padding: 22px 24px 20px; border: 3px solid var(--red); border-radius: 8px; background: linear-gradient(180deg, #fff6f6 0%, #fff 100%); text-align: center; }
.trial-badge { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--red); color: #fff; font-weight: bold; font-size: 13px; padding: 2px 16px; border-radius: 14px; letter-spacing: 2px; }
.trial-title { font-size: 28px; font-weight: bold; color: var(--red); margin: 4px 0 10px; word-break: auto-phrase; }
.trial-body { font-size: 15px; line-height: 1.9; max-width: 760px; margin: 0 auto; }
.trial-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }

/* お知らせバー */
.notice + .notice { margin-top: 8px; }
.notice.maint { background: #fcf8e3; border-color: #faebcc; color: #8a6d3b; font-weight: bold; }
.notice-btn { display: inline-block; margin-left: 8px; padding: 1px 10px; border-radius: 12px; background: var(--red); color: #fff !important; text-decoration: none !important; font-size: 12px; }

/* サイト更新のお知らせ */
.update-banner { position: fixed; left: 50%; top: 10px; transform: translateX(-50%); z-index: 1100; background: #003f8c; color: #fff; padding: 10px 16px; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.25); font-size: 14px; max-width: calc(100vw - 32px); }
.update-banner button { background: #fff; color: #003f8c; border: 0; border-radius: 4px; padding: 3px 10px; font-weight: bold; cursor: pointer; }

/* アクセス数 */
.access { text-align: center; font-size: 11px; color: #999; margin-top: 30px; }

/* マナー・足跡 */
.manners td .warn { color: var(--red); font-weight: bold; }
.code-box { font-family: Consolas, "Courier New", monospace; font-size: 22px; font-weight: bold; letter-spacing: 2px; text-align: center; background: #f4f9ff; border: 2px dashed var(--blue); padding: 12px; margin: 10px 0; user-select: all; word-break: break-all; }
.status-done { opacity: .55; }

@media (max-width: 767px) {
  .trial-box { padding: 20px 12px 16px; }
  .trial-title { font-size: 21px; }
  .trial-body { font-size: 14px; text-align: left; }
}

/* 検索エンジン向けに最初のHTMLへ入れる本文（JavaScriptが動くとすぐ置き換わる） */
.prerender { padding: 20px 15px; }
.prerender h2 { font-size: 18px; margin: 18px 0 6px; }
.prerender ul, .prerender ol { padding-left: 22px; }
