:root {
  color-scheme: light;
  --display-font: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "YuGothic", sans-serif;
  --ink: #1c1714;
  --muted: #675f58;
  --line: #ded8ce;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --clay: #a84f32;
  --clay-dark: #6f3124;
  --straw: #d9b66f;
  --aqua: #1f7a7a;
  --green: #3f7a45;
  --red: #b74132;
  --shadow: 0 20px 50px rgba(52, 35, 20, 0.14);
}

/* 老眼鏡なしでも読めるよう、html の基準サイズから底上げする。
   rem ベースで書かれている子要素はすべてここを軸に拡大される。 */
html {
  font-size: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Noto Sans JP",
    "Hiragino Sans",
    "Yu Gothic",
    sans-serif;
}

button {
  font: inherit;
}

.site-header {
  position: relative;
  display: grid;
  min-height: 430px;
  place-items: end start;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(25, 18, 13, 0.88), rgba(25, 18, 13, 0.48) 52%, rgba(25, 18, 13, 0.08)),
    url("https://commons.wikimedia.org/wiki/Special:FilePath/Dohyo-sumo-clipart.png?width=1200") center right 12% / min(74vw, 720px) auto no-repeat,
    linear-gradient(135deg, #5d2b22, #d9b66f);
}

.header-visual {
  position: absolute;
  inset: auto 0 0;
  height: 72px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 1px, transparent 1px 26px);
  opacity: 0.34;
}

.header-content {
  position: relative;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0 44px;
  color: #fffaf2;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--straw);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.section-kicker {
  font-size: 0.78rem;
}

/* eyebrow（場所名+日数）はページ最上部の主要メタ情報なので大きめに */
.eyebrow {
  margin: 0;
  font-size: clamp(1.15rem, 2.6vw, 1.55rem);
  letter-spacing: 0.02em;
}

.today-date {
  margin: 6px 0 18px;
  color: rgba(255, 250, 242, 0.86);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

h1,
h2 {
  margin: 0;
  line-height: 1.08;
  font-family: var(--display-font);
  font-weight: 900;
}

h1 {
  max-width: 680px;
  font-size: clamp(2.55rem, 6.6vw, 5.3rem);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.16);
  /* 「放駒部屋 取組結果」を単語ごとにまとめ、半角スペースの位置でだけ改行する */
  word-break: keep-all;
  overflow-wrap: break-word;
}

.lead {
  max-width: 620px;
  margin: 18px 0 0;
  font-size: 1.05rem;
  line-height: 1.8;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(86px, 1fr));
  gap: 10px;
  width: min(620px, 100%);
  margin-top: 32px;
}

.summary-grid div {
  padding: 14px 16px;
  border: 1px solid rgba(255, 250, 242, 0.28);
  background: rgba(255, 250, 242, 0.12);
  backdrop-filter: blur(8px);
}

.summary-grid span {
  display: block;
  font-size: 1.8rem;
  font-weight: 900;
}

.summary-grid small {
  color: rgba(255, 250, 242, 0.78);
  font-weight: 700;
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.toolbar h2,
.notes h2 {
  font-size: 1.42rem;
}

.kicker-link {
  margin: 6px 0 0;
}

.kicker-link a {
  color: var(--clay-dark);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.kicker-link a:hover {
  color: var(--clay);
}

.kyujo-links {
  display: block;
  margin-top: 6px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.kyujo-links a {
  color: var(--clay-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.kyujo-links a:hover {
  color: var(--clay);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-button,
.close-button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.filter-button {
  min-height: 38px;
  padding: 0 14px;
  font-weight: 800;
}

.filter-button.active {
  border-color: var(--clay);
  background: var(--clay);
  color: #fffaf2;
}

.results-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.table-head,
.rikishi-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.5fr 0.7fr;
  gap: 14px;
  align-items: center;
}

.table-head {
  padding: 13px 18px;
  background: #f1ece4;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.rikishi-row {
  width: 100%;
  min-height: 72px;
  padding: 14px 18px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.rikishi-row:hover,
.rikishi-row:focus-visible {
  background: #fff8ec;
  outline: none;
}

.name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display-font);
  font-size: 1.05rem;
  font-weight: 900;
}

.rank,
.today,
.record {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

/* === 番付解説ページ（banzuke.html）専用スタイル === */
.page-banzuke .banzuke-header {
  padding: 56px 0 36px;
  background:
    linear-gradient(135deg, #5d2b22, #a84f32 60%, #d9b66f);
  color: #fffaf2;
}

.banzuke-header-inner {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto;
}

.banzuke-header h1 {
  margin: 6px 0 14px;
  max-width: 720px;
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  word-break: keep-all;
  overflow-wrap: break-word;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.16);
}

.banzuke-header .lead {
  max-width: 720px;
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.85;
}

.banzuke-header .back-link {
  margin: 22px 0 0;
}

.banzuke-header .back-link a {
  color: #fffaf2;
  text-decoration: underline;
  font-weight: 800;
}

.banzuke-section {
  width: min(880px, calc(100% - 32px));
  margin: 38px auto 0;
}

.banzuke-section h2 {
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  margin-bottom: 14px;
}

.banzuke-section p {
  line-height: 1.85;
}

.tier-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 14px;
}

.tier-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.tier-item .badge {
  margin-top: 4px;
}

.tier-body {
  min-width: 0;
}

.tier-title {
  margin: 0 0 6px;
  font-family: var(--display-font);
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--ink);
}

.tier-body p {
  margin: 0 0 6px;
}

.tier-meta {
  margin-top: 8px !important;
  color: var(--clay-dark);
  font-weight: 700;
}

.compare-table {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
}

.compare-table th,
.compare-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.6;
}

.compare-table thead th {
  background: #f1ece4;
  color: var(--muted);
}

.compare-table tbody th {
  width: 30%;
  background: #faf5eb;
  color: var(--clay-dark);
  font-weight: 800;
}

.bullets {
  margin: 14px 0 0;
  padding-left: 24px;
  line-height: 1.95;
}

.bullets li {
  margin-bottom: 6px;
}

.caption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 760px) {
  .page-banzuke .banzuke-header {
    padding: 44px 0 28px;
  }

  .tier-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .tier-item .badge {
    align-self: start;
    margin-top: 0;
  }

  .compare-table th,
  .compare-table td {
    padding: 10px 12px;
  }

  .compare-table tbody th {
    width: 38%;
  }
}

/* 番付バッジ：幕内/幕下/三段目/序二段/序ノ口 を pill で直接表示 */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 5px 11px;
  border-radius: 14px;
  flex: 0 0 auto;
  background: var(--muted);
  color: #fffaf2;
  font-family: var(--display-font);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}

/* 番付ごとの背景色。幕内は朱橙、序ノ口に向かって徐々に落ち着いた色味へ */
.badge--makuuchi  { background: var(--clay); }
.badge--juryo     { background: #c46a4a; }
.badge--makushita { background: #8b5a3c; }
.badge--sandanme  { background: #6e4730; }
.badge--jonidan   { background: #5b6b4b; }
.badge--jonokuchi { background: #5d5851; }

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 900;
}

.status.win {
  background: rgba(63, 122, 69, 0.13);
  color: var(--green);
}

.status.loss {
  background: rgba(183, 65, 50, 0.12);
  color: var(--red);
}

.status.rest {
  background: rgba(103, 95, 88, 0.13);
  color: var(--muted);
}

.status.none {
  background: rgba(31, 122, 122, 0.12);
  color: var(--aqua);
}

.notes {
  margin-top: 24px;
  padding: 20px;
  border-left: 5px solid var(--clay);
  background: #f4efe7;
  color: var(--muted);
  line-height: 1.75;
}

.notes a {
  color: var(--clay-dark);
  font-weight: 800;
}

.profile-drawer {
  position: fixed;
  inset: 0;
  display: none;
  place-items: stretch end;
  background: rgba(28, 23, 20, 0.42);
  padding: 16px;
  z-index: 10;
}

.profile-drawer.open {
  display: grid;
}

.drawer-card {
  position: relative;
  width: min(420px, 100%);
  height: 100%;
  overflow: auto;
  padding: 30px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.close-button {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
}

.drawer-card h2 {
  margin: 0 44px 24px 0;
  font-size: 2rem;
}

.profile-data {
  display: grid;
  gap: 14px;
  margin: 0;
}

.profile-data div {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.profile-data dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.profile-data dd {
  margin: 0;
  line-height: 1.55;
}

@media (max-width: 760px) {
  /* スマホでは老眼鏡なしでも読めるサイズまで底上げ。
     html の基準を 21px まで上げると rem ベースの全要素が一気にスケールする */
  html {
    font-size: 21px;
  }

  body {
    line-height: 1.7;
  }

  .site-header {
    min-height: 480px;
    background:
      linear-gradient(180deg, rgba(25, 18, 13, 0.88), rgba(25, 18, 13, 0.48) 62%, rgba(25, 18, 13, 0.16)),
      url("https://commons.wikimedia.org/wiki/Special:FilePath/Dohyo-sumo-clipart.png?width=900") center top 24px / 76vw auto no-repeat,
      linear-gradient(135deg, #5d2b22, #d9b66f);
  }

  .header-content {
    padding-top: 160px;
  }

  .section-kicker {
    font-size: 0.88rem;
  }

  .today-date {
    font-size: 1.05rem;
    margin-bottom: 16px;
  }

  .lead {
    font-size: 1.05rem;
    line-height: 1.7;
  }

  .summary-grid span {
    font-size: 1.7rem;
  }

  .summary-grid small {
    font-size: 0.95rem;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar {
    display: block;
  }

  .toolbar h2,
  .notes h2 {
    font-size: 1.5rem;
  }

  .controls {
    margin-top: 14px;
  }

  .filter-button {
    min-height: 44px;
    padding: 0 16px;
    font-size: 1rem;
  }

  .table-head {
    display: none;
  }

  .rikishi-row {
    grid-template-columns: 1fr;
    gap: 6px;
    align-items: start;
    min-height: 84px;
    padding: 16px 18px;
  }

  .name {
    font-size: 1.15rem;
  }

  .rank,
  .today,
  .record {
    font-size: 1rem;
    line-height: 1.55;
  }

  .status {
    font-size: 0.92rem;
    padding: 4px 10px;
  }

  .badge {
    min-width: 72px;
    padding: 6px 13px;
    font-size: 0.95rem;
    border-radius: 16px;
  }

  .rank::before {
    content: "番付: ";
    font-weight: 900;
  }

  .today::before {
    content: "今日: ";
    font-weight: 900;
  }

  .record::before {
    content: "今場所: ";
    font-weight: 900;
  }

  .notes {
    font-size: 1rem;
    line-height: 1.85;
  }

  .profile-drawer {
    padding: 0;
  }

  .drawer-card h2 {
    font-size: 1.7rem;
  }

  .profile-data dt {
    font-size: 0.85rem;
  }

  .profile-data dd {
    font-size: 1.05rem;
  }
}
