/* ===================================================================
   WKF JAPAN — アマチュア競技規則ページ専用スタイル
   style.css のトークン（--red / --ink / --panel …）を継承して使用
   =================================================================== */

.main-nav a.is-current { color: var(--white); }
.main-nav a.is-current .nav-en { color: var(--red); }
.main-nav a.is-current::after { width: 100%; }

/* ===== PAGE HERO ===== */
.page-hero { position: relative; overflow: hidden; padding: 150px 0 84px; }
.page-hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 84% 6%, rgba(224,27,36,.24), transparent 48%),
    radial-gradient(ellipse at 6% 96%, rgba(26,79,160,.30), transparent 56%),
    linear-gradient(160deg, #0d0f14 0%, #151a26 62%, #0b0d12 100%);
}
.page-hero-bg::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(90deg, rgba(255,255,255,.028) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(0deg, rgba(255,255,255,.028) 0 1px, transparent 1px 64px);
  mask-image: radial-gradient(circle at 50% 40%, #000, transparent 78%);
}
.page-hero-watermark {
  position: absolute; right: -28px; bottom: -34px; z-index: 1;
  font-family: var(--font-display);
  font-size: clamp(96px, 19vw, 260px);
  line-height: 1; letter-spacing: 10px;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,.05);
  pointer-events: none; user-select: none;
}
.page-hero-inner { position: relative; z-index: 2; }
.page-hero-title {
  font-weight: 900;
  font-size: clamp(34px, 6.2vw, 68px);
  line-height: 1.2;
  letter-spacing: .02em;
  background: linear-gradient(180deg, #ffffff 55%, #b9c1d6);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-hero-lead { color: #cdd2df; margin-top: 22px; max-width: 700px; font-size: 15px; }
.page-hero-note {
  margin-top: 26px; max-width: 760px;
  font-size: 13px; line-height: 1.95; color: var(--muted);
  border-left: 3px solid var(--red);
  padding: 12px 0 12px 18px;
  background: linear-gradient(90deg, rgba(224,27,36,.08), transparent 70%);
}
.page-hero-note strong { color: var(--text); font-weight: 700; }

.hero-badges { list-style: none; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.badge {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  padding: 9px 16px;
  font-size: 12px; color: var(--text); letter-spacing: .03em; line-height: 1.6;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.badge span {
  font-family: var(--font-en); font-weight: 600;
  font-size: 10px; letter-spacing: 2.5px; color: var(--dim); flex: none;
}
.badge-year {
  border-color: rgba(224,27,36,.55);
  background: linear-gradient(120deg, rgba(224,27,36,.22), rgba(224,27,36,.06));
  color: var(--white); font-weight: 700;
}
.badge-year span { color: #ff8d86; }

/* ===== QUICK REFERENCE ===== */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.quick-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 24px 22px 26px;
  transition: transform .25s var(--ease), border-color .25s;
}
.quick-card::before {
  content: "";
  position: absolute; left: 0; top: 0;
  width: 3px; height: 34px; background: var(--red);
  transition: height .3s var(--ease);
}
.quick-card:hover { transform: translateY(-4px); border-color: #39415a; }
.quick-card:hover::before { height: 100%; }
.quick-label {
  display: block;
  font-size: 11px; font-weight: 700; letter-spacing: 2px;
  color: var(--red);
}
.quick-value {
  font-weight: 900;
  font-size: 22px; color: var(--white);
  line-height: 1.4; margin: 10px 0 8px;
}
.quick-sub { font-size: 12px; color: var(--muted); line-height: 1.85; }

/* ===== LAYOUT: 目次 + 本文 ===== */
.rules-layout { display: grid; grid-template-columns: 244px 1fr; gap: 56px; align-items: start; }

.rules-toc { position: sticky; top: 96px; }
.toc-title { font-weight: 700; color: var(--white); font-size: 15px; margin-bottom: 16px; letter-spacing: .05em; }
.toc-list {
  list-style: none; border-left: 1px solid var(--line);
  max-height: 72vh; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: #39415a transparent;
  overscroll-behavior: contain;
}
.toc-list::-webkit-scrollbar { width: 6px; }
.toc-list::-webkit-scrollbar-track { background: transparent; }
.toc-list::-webkit-scrollbar-thumb { background: #39415a; border-radius: 3px; }
.toc-list::-webkit-scrollbar-thumb:hover { background: #4b5470; }
.toc-list a {
  display: flex; align-items: baseline; gap: 10px;
  padding: 7px 0 7px 16px;
  font-size: 13px; line-height: 1.6; color: var(--muted);
  border-left: 2px solid transparent; margin-left: -1px;
  transition: color .2s, border-color .2s;
}
.toc-list a i {
  font-style: normal; font-family: var(--font-en); font-weight: 600;
  font-size: 11px; letter-spacing: 1.5px; color: var(--dim); flex: none;
}
.toc-list a:hover { color: var(--white); }
.toc-list a:hover i { color: var(--red); }
.toc-list a.active { color: var(--white); border-left-color: var(--red); font-weight: 700; }
.toc-list a.active i { color: var(--red); }

/* ===== 各章 ===== */
.rule { padding: 34px 0 36px; border-bottom: 1px solid var(--line); scroll-margin-top: 96px; }
.rule:first-child { padding-top: 0; }
.rule-title {
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
  font-size: clamp(19px, 2.5vw, 24px); font-weight: 900;
  color: var(--white); letter-spacing: .03em;
  margin-bottom: 18px; line-height: 1.5;
}
.rule-no {
  font-family: var(--font-en); font-weight: 600;
  font-size: 12px; letter-spacing: 2.5px; color: var(--red);
  border: 1px solid rgba(224,27,36,.45);
  padding: 5px 12px; flex: none;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.rule p { color: #cdd2df; font-size: 15px; margin-bottom: 12px; }
.rule p:last-child { margin-bottom: 0; }
.rule strong { color: var(--white); font-weight: 700; }
.rule-lead {
  font-weight: 700; color: var(--white);
  font-size: 14px; letter-spacing: .05em;
  margin: 22px 0 12px;
}
.rule .rule-lead { color: var(--white); font-size: 14px; }
.rule-warn {
  border-left: 3px solid var(--red);
  background: linear-gradient(90deg, rgba(224,27,36,.10), transparent 75%);
  padding: 12px 0 12px 16px;
  font-weight: 700;
  margin-top: 18px;
}
.rule .rule-warn { color: var(--white); font-size: 14px; }

.rule-list { list-style: none; margin: 6px 0 16px; }
.rule-list li {
  position: relative; padding-left: 20px;
  font-size: 14px; color: #cdd2df; line-height: 1.95;
}
.rule-list li::before {
  content: ""; position: absolute; left: 0; top: .82em;
  width: 8px; height: 2px; background: var(--red);
}
.rule-list.cols { columns: 2; column-gap: 36px; }
.rule-list.cols li { break-inside: avoid; }
.rule-list.foul li::before {
  content: "×"; width: auto; height: auto; top: 0;
  background: none; color: var(--red); font-weight: 700; font-size: 13px;
}

/* ===== 表 ===== */
.table-scroll { overflow-x: auto; margin: 14px 0 8px; }
.rule-table { border-collapse: collapse; width: 100%; min-width: 340px; font-size: 14px; }
.rule-table th {
  text-align: left; font-family: var(--font-en); font-weight: 600;
  font-size: 11px; letter-spacing: 2.5px; color: var(--dim);
  padding: 10px 16px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.rule-table td { padding: 13px 16px; border-bottom: 1px solid var(--line); color: #cdd2df; line-height: 1.7; }
.rule-table td.cat {
  font-family: var(--font-en); font-weight: 600; letter-spacing: 1.5px;
  color: var(--white); white-space: nowrap; width: 1%;
  background: rgba(255,255,255,.025);
}
.rule-table tbody tr:hover td { background: rgba(255,255,255,.04); }

/* ===== 第8章 技一覧 ===== */
.tech-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.tech-box { background: var(--panel); border: 1px solid var(--line); padding: 20px 22px 14px; }
.tech-head {
  font-weight: 900; font-size: 14px; letter-spacing: .08em;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.rule .tech-head { color: var(--white); margin-bottom: 12px; font-size: 14px; }
.tech-box .rule-list { margin-bottom: 6px; }

/* ===== 第18章 処分ステップ ===== */
.penalty-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0 18px; }
.penalty-steps li {
  flex: 1 1 180px;
  border: 1px solid var(--line); background: var(--panel);
  padding: 16px 18px;
  border-top: 3px solid var(--red);
}
.pen-en {
  display: block; font-family: var(--font-en); font-weight: 600;
  font-size: 15px; letter-spacing: 1.5px; color: var(--white);
}
.pen-jp { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ===== 第23章 優先順位 ===== */
.priority-chain { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 18px; }
.priority-chain li {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); background: rgba(255,255,255,.03);
  padding: 11px 18px; font-weight: 700; color: var(--white); font-size: 14px;
  clip-path: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
}
.chain-no {
  font-family: var(--font-en); font-weight: 600;
  font-size: 11px; letter-spacing: 2px; color: var(--red);
}

/* ===== 注意 / CTA ===== */
.rule-notice {
  margin-top: 40px; padding: 26px 28px;
  border: 1px solid var(--line); background: var(--ink-2);
}
.notice-head {
  font-family: var(--font-en); font-weight: 600;
  font-size: 11px; letter-spacing: 3px; color: var(--red);
  margin-bottom: 12px;
}
.rule-notice p { font-size: 13px; color: var(--muted); line-height: 1.95; margin-bottom: 10px; }
.rule-notice p:last-child { margin-bottom: 0; }
.rule-notice strong { color: var(--text); }

.rules-cta {
  margin-top: 34px; padding: 30px 32px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px;
  background: linear-gradient(115deg, #16223c, #101725);
  border: 1px solid var(--line);
}
.cta-label {
  font-family: var(--font-en); font-weight: 600;
  font-size: 11px; letter-spacing: 3px; color: var(--red); margin-bottom: 8px;
}
.rules-cta .cta-text p { font-size: 14px; color: #dbe4f5; line-height: 1.8; margin: 0; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1000px) {
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .rules-layout { grid-template-columns: 1fr; gap: 34px; }
  .rules-toc { position: static; }
  .toc-list { max-height: none; columns: 2; column-gap: 28px; }
  .toc-list li { break-inside: avoid; }
}
@media (max-width: 560px) {
  .page-hero { padding: 118px 0 62px; }
  .page-hero-watermark { font-size: 34vw; right: -12px; bottom: -14px; letter-spacing: 4px; }
  .hero-badges { gap: 8px; }
  .badge { font-size: 11px; padding: 8px 13px; }
  .quick-grid { grid-template-columns: 1fr; }
  .tech-grid { grid-template-columns: 1fr; }
  .rule-list.cols, .toc-list { columns: 1; }
  .rule-title { gap: 10px; }
  .rules-cta { padding: 24px 20px; }
  .rules-cta .btn { width: 100%; }
  .rule-notice { padding: 22px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .quick-card:hover { transform: none; }
}

/* ===== 印刷（大会でそのまま出力できるように） ===== */
@media print {
  .site-header, .page-hero-watermark, .page-hero-bg,
  .rules-toc, .rules-cta, .scroll-cue, .footer-nav { display: none !important; }
  body { background: #fff !important; color: #111 !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .section { padding: 0 0 18px !important; }
  .page-hero { padding: 0 0 18px !important; }
  .page-hero-title, .quick-value, .rule-title, .section-title-jp {
    color: #111 !important; -webkit-text-fill-color: #111 !important; background: none !important;
  }
  .section-title-en { -webkit-text-stroke: 0 !important; color: #888 !important; }
  .rule p, .rule-list li, .rule-table td, .quick-sub, .rule-notice p { color: #222 !important; }
  .rules-layout { display: block !important; }
  .rule { break-inside: avoid; border-bottom: 1px solid #ccc; }
  .quick-card, .tech-box, .penalty-steps li, .rule-notice { background: #fff !important; border-color: #ccc !important; }
}
