/* home layout, the stage, panels, rank badges */
/* home layout */
.home { display: grid; grid-template-columns: minmax(0, 1fr) clamp(300px, 24vw, 380px); grid-template-rows: minmax(0, 1fr); gap: clamp(24px, 2.5vw, 40px); align-items: stretch; flex: 1; min-height: 0; }
.side-panel { overflow-y: auto; scrollbar-width: none; }
.side-panel::-webkit-scrollbar { display: none; }
.ring { min-height: 0; display: flex; flex-direction: column; }
/* the stage, at every width: header pinned, transcript rolls beneath it; the page itself does not
   scroll. Heights fall out of flex (body > main > stage), never a sum of header and footer pixels. */
body:has(.home), body:has(.bout-page) { height: 100vh; height: 100dvh; overflow: hidden; overscroll-behavior: none; }
body:has(.home) main, body:has(.bout-page) main { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-bottom: 0; }
@media (min-width: 861px) { .home, .bout-page { min-height: 480px; } }
.ring article.bout, .bout-page article.bout { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.bout-page { display: flex; flex-direction: column; flex: 1; min-height: 0; width: 100%; }
.bout-page > p, .bout-page > details { flex: none; }
article.bout .tachiai, article.bout .result { flex: none; }
article.bout .transcript { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 56px, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(180deg, transparent 0, #000 56px, #000 calc(100% - 24px), transparent); }
article.bout .transcript::-webkit-scrollbar { display: none; }
article.bout .transcript { padding-top: 40px; max-width: 1140px; width: 100%; margin-left: auto; margin-right: auto; }
.side-panel { display: flex; flex-direction: column; gap: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; transition: border-color var(--mid) var(--ease); }
.panel:hover { border-color: #3a3a45; }
.panel h2 { margin-bottom: 10px; }
.panel .more { display: block; margin-top: 10px; color: var(--dim); border: 0; font-size: 12px; }
.panel.stats { display: flex; gap: 16px; justify-content: space-between; color: var(--dim); font-size: 12px; }
.panel.stats b { color: var(--fg); font-size: 16px; display: block; }
.banzuke-mini, .recent { list-style: none; margin: 0; padding: 0; }
.banzuke-mini li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; margin: 0 -6px; border-radius: 4px; border-bottom: 1px solid var(--line); transition: background var(--fast) var(--ease); }
.banzuke-mini li:hover, .recent li:hover, table.ladder tr:hover td, table.bouts tr:hover td { background: rgba(255, 255, 255, .025); }
td { transition: background var(--fast) var(--ease); }
.banzuke-mini li:last-child, .recent li:last-child { border-bottom: 0; }
.banzuke-mini a { border: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banzuke-mini .elo { color: var(--dim); font-size: 12px; }
.recent li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.recent a { border: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.recent li .dim { white-space: nowrap; flex: none; }
li.empty { color: var(--dim); font-size: 12px; }
.empty-ring { position: relative; padding: 70px 20px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); overflow: hidden; }
.empty-ring::before { content: ""; position: absolute; left: 50%; top: 50%; width: 320px; height: 320px; margin: -160px 0 0 -160px; border-radius: 50%; border: 6px solid var(--gold); opacity: .08; animation: breathe 6s var(--ease-io) infinite; pointer-events: none; }
@keyframes breathe { 0%, 100% { transform: scale(.96); opacity: .06; } 50% { transform: scale(1); opacity: .12; } }
.empty-ring > * { position: relative; }
.empty-ring h1 { font-size: 28px; }
.empty-ring p { max-width: 50ch; margin: 0 auto 20px; color: var(--dim); }

/* rank tags: a medal ramp so the tier reads at a glance — gold, gold, silver, bronze, then white, grey, dim */
.rank { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 1px 6px; border-radius: 3px; border: 1px solid currentColor; white-space: nowrap; }
.rank.yokozuna { color: var(--bg); background: var(--gold); border-color: var(--gold); font-weight: 700; box-shadow: 0 0 10px -2px rgba(201, 162, 74, .6); }
.rank.ozeki { color: var(--gold); background: rgba(201, 162, 74, .10); font-weight: 600; }
.rank.sekiwake { color: #c8ccd6; background: rgba(200, 204, 214, .08); }
.rank.komusubi { color: #c99a6b; background: rgba(201, 154, 107, .08); }
.rank.maegashira { color: var(--fg); border-color: #55555f; }
.rank.juryo { color: var(--dim); border-color: #3a3a45; }
.rank.makushita { color: #6a6a74; border-color: #2f2f38; }
.rank.unranked { color: var(--dim); }
.banzuke-mini .rank { font-size: 10px; padding: 0 5px; }

/* an upset: won from below */
.tag.upset { color: var(--gold); border: 1px solid var(--gold); border-radius: 3px; font-size: 10.5px; padding: 0 5px; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.rank.retired { color: var(--dim); border-color: var(--line); }
tr.retired-row td, tr.retired-row a { color: var(--dim); }
tr.retired-row .crest svg { opacity: .5; }
/* up next: east, a beat, west — the marks say who is in the ring already */
.upcoming li { justify-content: flex-start; }
.upcoming li > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
