/* Lovely clan site. Cherry blossom on warm paper; night blossom (yozakura) when a visitor
   picks dark mode with the header switch (light is the default, whatever the device prefers).
   Fraunces for display and numbers, IBM Plex Sans for text; both self-hosted (SIL OFL,
   see fonts-license.txt), since the CSP keeps everything on this origin. */

@font-face { font-family: "Fraunces"; src: url(fraunces.woff2) format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url(fraunces-italic-400.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url(plex-sans-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url(plex-sans-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url(plex-sans-600.woff2) format("woff2"); font-weight: 600 700; font-display: swap; }

:root {
  --paper: #fbf4ef;      /* warm rice paper */
  --paper-2: #f5e7e3;    /* hovered rows, quiet blocks */
  --ink: #2f1f28;        /* plum black */
  --ink-2: #5d4752;
  --muted: #8d7682;
  --rule: #e8d4d3;
  --blossom: #f0b3c4;
  --accent: #b83c66;     /* deep sakura, links and highlights */
  --bark: #5e4038;
  --win: #4a7444;        /* new leaves */
  --loss: #a8392f;
  --petal-core: #d9577f; --petal-mid: #f2a9bd; --petal-edge: #fff4f6;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --text: "Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #1b1418; --paper-2: #261c22; --ink: #f6e9ec; --ink-2: #d6c1c9; --muted: #a08b95;
  --rule: #3b2c34; --blossom: #e892ab; --accent: #f497b4; --bark: #8c6a5f;
  --win: #9cc98a; --loss: #f2867a;
  --petal-core: #e0668c; --petal-mid: #f0a7bc; --petal-edge: #fde7ee;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 15.5px/1.55 var(--text);
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration: none; }
main a:not(.now):hover, .link { color: var(--accent); }
.link { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.muted { color: var(--muted); }
.gold { color: var(--accent); }
.win { color: var(--win); } .loss { color: var(--loss); }
.empty { color: var(--muted); font-style: italic; font-family: var(--display); font-size: 19px; margin: 40px 0; }

/* ---------------------------------------------------------------- masthead */
.mast { position: relative; max-width: 1040px; margin: 0 auto; padding: 44px 20px 30px; overflow: hidden; }
.branch { position: absolute; top: -4px; right: -18px; width: 470px; height: auto; pointer-events: none; }
.branch .bark path { fill: none; stroke: var(--bark); stroke-linecap: round; }
.branch .petal-core { stop-color: var(--petal-core); }
.branch .petal-mid { stop-color: var(--petal-mid); }
.branch .petal-edge { stop-color: var(--petal-edge); }
.branch .stamens path { fill: none; stroke: var(--petal-core); stroke-width: .8; }
.branch .stamens circle { fill: #c9871f; }
.branch .eye { fill: var(--petal-core); }
.branch .bud { fill: var(--petal-core); }
.branch .calyx { fill: var(--bark); }
.branch .loose { opacity: .85; }

.mast-in { position: relative; display: flex; align-items: flex-start; gap: 22px; }
.badge { width: 92px; height: 92px; margin-top: 8px; flex: none; }
.kicker {
  margin: 0; font: 600 11.5px/1.3 var(--text); letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
}
.mast h1 {
  margin: 2px 0 4px; font: italic 400 76px/0.95 var(--display); letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144;
}
.mast .sub { margin: 0 0 16px; color: var(--ink-2); }
.mast .sub span { white-space: nowrap; }
.join {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border: 1.5px solid var(--ink); border-radius: 3px;
  font-weight: 600; font-size: 14px; transition: background .15s, color .15s, border-color .15s;
}
.join:hover { background: var(--ink); color: var(--paper); }
.join .discord { width: 20px; height: 20px; fill: #5865f2; flex: none; }
.mode {
  margin-left: 14px; padding: 0; border: 0; background: none; color: var(--ink-2); cursor: pointer;
  font: 500 14px var(--text); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 4px;
}
.mode:hover { color: var(--accent); text-decoration-color: currentColor; }

/* ---------------------------------------------------------------- nav */
nav {
  position: sticky; top: 0; z-index: 5; background: var(--paper);
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule);
}
nav .in { display: flex; gap: 28px; max-width: 1040px; margin: 0 auto; padding: 0 20px; overflow-x: auto; scrollbar-width: none; }
nav .in::-webkit-scrollbar { display: none; }
nav a {
  padding: 13px 0 11px; border-bottom: 2px solid transparent; white-space: nowrap;
  font-weight: 500; font-size: 14.5px; color: var(--ink-2);
}
nav a:hover { color: var(--ink); }
nav a.on { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------------------------------------------------------------- page */
main { max-width: 1040px; margin: 0 auto; padding: 8px 20px 20px; }
h2 {
  margin: 44px 0 14px; font: 500 28px/1.15 var(--display); letter-spacing: -0.01em;
  font-variation-settings: "opsz" 72;
}
h2 small { font: 400 14px var(--text); color: var(--muted); letter-spacing: 0; margin-left: 8px; }
h3 { margin: 28px 0 10px; font: 600 11.5px/1.3 var(--text); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
main > :first-child { margin-top: 28px; }
p { max-width: 68ch; }
.note { color: var(--ink-2); font-size: 14px; }
.back { display: inline-block; margin-top: 26px; font-size: 14px; color: var(--ink-2); }

.lede {
  margin: 30px 0 4px; max-width: 34em; font: italic 400 23px/1.4 var(--display); color: var(--ink-2);
}
.lede::before { content: "\201C"; color: var(--accent); margin-right: 2px; }
.lede::after { content: "\201D"; color: var(--accent); margin-left: 1px; }
.tags { color: var(--muted); font-size: 14px; margin: 6px 0 0; }

/* A row of figures between rules, like the stats box in a newspaper sports page. */
.ledger { margin: 26px 0 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); overflow: hidden; }
.ledger .in { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 0 0 -1px -1px; }
.ledger.three .in { grid-template-columns: repeat(3, 1fr); }
.ledger .in > div { padding: 14px 18px 12px; border-left: 1px solid var(--rule); border-bottom: 1px solid var(--rule); min-width: 0; }
.ledger b {
  display: block; font: 500 27px/1.15 var(--display); font-variation-settings: "opsz" 72;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ledger b a:hover { color: var(--accent); }
.ledger b img.star { width: 20px; height: 20px; vertical-align: 1px; }
.ledger .in > div > span { display: block; margin-top: 4px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); column-gap: 44px; }

/* ---------------------------------------------------------------- tables */
.sheet { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th {
  text-align: left; padding: 8px 10px 7px; border-bottom: 1px solid var(--ink);
  font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap; user-select: none;
}
th.sort { cursor: pointer; }
th.sort:hover { color: var(--ink); }
th[data-dir]::after { content: " ↓"; color: var(--accent); }
th[data-dir="1"]::after { content: " ↑"; }
td { padding: 9px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; vertical-align: middle; }
tbody tr:hover td { background: var(--paper-2); }
td.num, th.num { text-align: right; }
td:first-child, th:first-child { padding-left: 2px; }
td:last-child, th:last-child { padding-right: 2px; }
td.wrap { white-space: normal; min-width: 180px; }
tr.left td { color: var(--muted); }

img.th { width: 26px; height: 26px; vertical-align: middle; }
img.th.small { width: 20px; height: 20px; }
img.star { width: 15px; height: 15px; vertical-align: -2px; }
img.league { width: 22px; height: 22px; vertical-align: middle; margin-right: 5px; }

.rank { display: inline-block; min-width: 26px; font: italic 400 18px/1 var(--display); color: var(--muted); }
.rank.r1 { color: var(--accent); }
.ranks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.ranks li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 8px;
            padding: 8px 2px; border-bottom: 1px solid var(--rule); }
.ranks .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranks .who small { display: block; margin: 1px 0 0 25px; font-size: 12.5px; color: var(--muted); }
.ranks .value { font: 500 21px/1 var(--display); white-space: nowrap; }
.ranks .value img.star { vertical-align: 1px; }

/* Results as words, not badges. */
.res { font: italic 400 16px/1 var(--display); }
.res.W { color: var(--win); } .res.L { color: var(--loss); } .res.T { color: var(--muted); }
.res.inWar { color: var(--accent); } .res.preparation { color: var(--muted); }
.role { font-size: 14px; }
.role.leader { color: var(--accent); font-weight: 600; }
.role.coLeader { font-weight: 600; }
.role.admin { color: var(--ink-2); }
.role.member { color: var(--muted); }
.perfect { color: var(--accent); font: italic 400 15px var(--display); }
/* A blossom marks a perfect CWL season. */
.perfect::before {
  content: ""; display: inline-block; width: 14px; height: 14px; margin: 0 3px 0 4px; vertical-align: -2px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-12 -12 24 24'%3E%3Cg fill='%23e0668c'%3E%3Cpath transform='rotate(0)' d='M0 0C-4.2-2-5.6-7-3.3-10.6L0-9.2 3.3-10.6C5.6-7 4.2-2 0 0Z'/%3E%3Cpath transform='rotate(72)' d='M0 0C-4.2-2-5.6-7-3.3-10.6L0-9.2 3.3-10.6C5.6-7 4.2-2 0 0Z'/%3E%3Cpath transform='rotate(144)' d='M0 0C-4.2-2-5.6-7-3.3-10.6L0-9.2 3.3-10.6C5.6-7 4.2-2 0 0Z'/%3E%3Cpath transform='rotate(216)' d='M0 0C-4.2-2-5.6-7-3.3-10.6L0-9.2 3.3-10.6C5.6-7 4.2-2 0 0Z'/%3E%3Cpath transform='rotate(288)' d='M0 0C-4.2-2-5.6-7-3.3-10.6L0-9.2 3.3-10.6C5.6-7 4.2-2 0 0Z'/%3E%3C/g%3E%3Ccircle r='2.2' fill='%23f6d27a'/%3E%3C/svg%3E") no-repeat center / contain;
}
.was { color: var(--muted); font-size: 13px; }
.perfect-n { color: var(--accent); font-weight: 600; }
[dir="auto"] { unicode-bidi: plaintext; text-align: left; }

/* Names in running text instead of pills. */
.names { line-height: 2.1; max-width: none; }
.names .n { white-space: nowrap; }
.names .n + .n::before { content: "·"; color: var(--muted); margin: 0 10px; }

/* ---------------------------------------------------------------- scoreboard */
.scoreboard { margin: 26px 0 0; padding: 18px 0 20px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
a.now { display: block; }
a.now:hover .side .clan { color: var(--accent); }
.scoreboard .status { margin: 0 0 12px; font-size: 14px; color: var(--ink-2); }
.scoreboard .status b { color: var(--accent); font-weight: 600; }
.sb { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; }
.side { display: flex; align-items: center; gap: 14px; min-width: 0; }
.side.them { justify-content: flex-end; text-align: right; }
.side img.cb { width: 54px; height: 54px; flex: none; }
.side .clan { font: 500 22px/1.15 var(--display); overflow: hidden; text-overflow: ellipsis; }
.side .clan small { display: block; font: 400 13px var(--text); color: var(--muted); margin-top: 3px; }
.sb .pts { font: 500 64px/1 var(--display); font-variation-settings: "opsz" 144; white-space: nowrap; letter-spacing: -0.02em; }
.sb .pts img.star { width: 30px; height: 30px; vertical-align: 6px; margin: 0 6px; }
.sb .pts .dash { color: var(--muted); margin: 0 6px; font-weight: 400; }
.scoreboard .detail { display: flex; justify-content: space-between; margin: 12px 0 0; font-size: 14px; color: var(--ink-2); max-width: none; }

/* The big way into the CWL war on now. */
.war-button {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "what what" "vs score" "note go";
  gap: 6px 24px; align-items: end; margin: 26px 0 0; padding: 22px 26px 20px; border-radius: 4px;
  background: var(--ink); color: var(--paper); transition: background .15s;
}
main a.war-button:hover { color: var(--paper); background: var(--accent); }
.war-button:hover .wb-what { color: var(--paper); }
.wb-what { grid-area: what; font: 600 11.5px/1.3 var(--text); letter-spacing: .14em; text-transform: uppercase; color: var(--blossom); }
.wb-vs { grid-area: vs; font: 500 30px/1.15 var(--display); font-variation-settings: "opsz" 96; overflow-wrap: anywhere; }
.wb-score { grid-area: score; font: 500 54px/1 var(--display); font-variation-settings: "opsz" 144; white-space: nowrap; text-align: right; }
.wb-score img.star { width: 26px; height: 26px; vertical-align: 6px; margin: 0 6px; }
.wb-note { grid-area: note; font-size: 14px; opacity: .8; }
.wb-go {
  grid-area: go; justify-self: end; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 8px 16px 8px 10px; border-radius: 3px; background: var(--accent); color: #fff; font-weight: 600; font-size: 15px;
  transition: background .15s, color .15s;
}
.war-button:hover .wb-go { background: var(--paper); color: var(--ink); }

/* Crossed swords (the game's war icon) on anything that opens a war. */
.swords { width: 30px; height: 30px; flex: none; overflow: visible; }
.swords .bl { fill: #e3e9f0; stroke: #221a20; stroke-width: 2.6; stroke-linejoin: round; }
.swords .fu { stroke: #a9b6c4; stroke-width: 2.2; stroke-linecap: round; }
.swords .gd { fill: #f2b632; stroke: #221a20; stroke-width: 2.6; }
.swords .gr { fill: #8a5a2b; stroke: #221a20; stroke-width: 2.6; }
a.now { position: relative; }
.sb-go {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 7px 14px 7px 9px; border-radius: 3px;
  border: 1.5px solid var(--ink); font-weight: 600; font-size: 14px; transition: background .15s, color .15s;
}
.sb-go .swords { width: 26px; height: 26px; }
a.now:hover .sb-go { background: var(--ink); color: var(--paper); }

.group tr.us td { background: var(--paper-2); font-weight: 600; }
.group td:nth-child(2) { white-space: normal; }
td.mid, th.mid { text-align: center; }
table.grid td.mid, table.grid th.mid { padding-left: 4px; padding-right: 4px; min-width: 38px; }
.cell { font: 500 17px/1 var(--display); }
.cell.s3 { color: var(--accent); }
.cell.s0 { color: var(--muted); }
.cell.missed { color: var(--loss); font: 600 14px var(--text); }
.cell.later { color: var(--muted); font: 400 14px var(--text); }
.roundnav { display: flex; justify-content: space-between; gap: 16px; margin-top: 26px; font-size: 14px; color: var(--ink-2); }
.roundnav span { display: flex; gap: 18px; }

/* CWL rounds, as a fixture list. */
.fixtures a { display: grid; grid-template-columns: 34px 60px 1fr auto auto; align-items: baseline; gap: 14px;
              padding: 10px 2px; border-bottom: 1px solid var(--rule); }
.fixtures a:first-child { border-top: 1px solid var(--ink); }
.fixtures a:hover { background: var(--paper-2); }
.fixtures .rd { font: italic 400 17px var(--display); color: var(--muted); }
.fixtures .opp { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.fixtures .sc { font: 500 18px var(--display); }
.fixtures .pc { color: var(--muted); font-size: 13.5px; min-width: 92px; text-align: right; }

.subnav { display: flex; gap: 22px; margin: 26px 0 0; font-size: 14.5px; }
.subnav a { color: var(--ink-2); padding-bottom: 3px; border-bottom: 1px solid transparent; }
.subnav a.on { color: var(--ink); border-bottom-color: var(--accent); }

.aside {
  margin: 26px 0 0; padding: 12px 16px; background: var(--paper-2); border-left: 3px solid var(--blossom);
  font-size: 14.5px; max-width: none;
}

/* Destroyed win streaks: the number, the clan, the proof. */
.streaks { margin-top: 18px; border-top: 1px solid var(--ink); }
.streaks article { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 18px; align-items: center;
                   padding: 16px 0; border-bottom: 1px solid var(--rule); }
.streaks .len { display: flex; align-items: baseline; gap: 6px; }
.streaks .len b { font: 500 44px/1 var(--display); font-variation-settings: "opsz" 144; letter-spacing: -0.02em; }
.streaks .len > span:last-child { color: var(--muted); font-size: 13px; }
.streaks .len .rank { min-width: 22px; font-size: 16px; }
.streaks h3 { text-align: left; unicode-bidi: plaintext; margin: 0; font: 500 21px/1.25 var(--display); letter-spacing: 0; text-transform: none; color: var(--ink);
              overflow-wrap: anywhere; }
.streaks .what p { margin: 3px 0 0; color: var(--ink-2); font-size: 14px; }
.streaks .proof { display: flex; gap: 8px; }
.streaks .proof img { display: block; width: 104px; height: 64px; object-fit: cover; border: 1px solid var(--rule);
                      transition: border-color .15s, transform .15s; }
.streaks .proof a:hover img { border-color: var(--accent); transform: translateY(-1px); }

/* The screenshot viewer: always dark, whatever the theme, like a photo lightbox. */
.viewer {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 20px 16px;
  border: 0; background: rgba(22, 15, 19, .97); color: #f6e9ec; overflow: hidden;
}
.viewer::backdrop { background: transparent; }
.viewer[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.viewer img {
  display: block; max-width: min(1600px, 100%); max-height: calc(100dvh - 150px); object-fit: contain;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
}
.viewer .vcap { margin: 0 56px 14px; font: 500 19px/1.3 var(--display); text-align: center; unicode-bidi: plaintext; }
.viewer .vx {
  position: fixed; top: 10px; right: 12px; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%;
  background: none; color: #fff; font: 300 38px/48px var(--text); cursor: pointer;
}
.viewer .vx:hover, .viewer .vx:focus-visible { background: rgba(255, 255, 255, .12); }
.viewer .vbar { display: flex; align-items: center; gap: 18px; margin-top: 14px; font-size: 14px; color: #d6c1c9; }
.viewer .vbar button {
  width: 44px; height: 36px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 3px;
  background: none; color: #fff; font-size: 18px; cursor: pointer;
}
.viewer .vbar button:hover { border-color: #f497b4; color: #f497b4; }
.viewer.single .vbar { display: none; }
body:has(.viewer[open]) { overflow: hidden; }

select {
  background: var(--paper); color: var(--ink); border: 1px solid var(--rule); border-bottom-color: var(--ink);
  border-radius: 0; padding: 7px 10px; font: inherit; margin: 0 10px 0 0;
}
.controls { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.player-head { display: flex; align-items: center; gap: 18px; margin-top: 28px; }
.player-head img.th { width: 72px; height: 72px; }
.player-head h2 { margin: 0; font-size: 40px; }
.player-head p { margin: 4px 0 0; color: var(--ink-2); }

footer { max-width: 1040px; margin: 56px auto 0; padding: 18px 20px 40px; border-top: 1px solid var(--rule);
         color: var(--muted); font-size: 12.5px; }
footer p { margin: 0 0 6px; max-width: 80ch; }

@media (max-width: 720px) {
  .mast { padding: 96px 16px 22px; }
  .branch { width: 250px; right: -34px; top: -8px; }
  .mast-in { gap: 14px; }
  .badge { width: 64px; height: 64px; margin-top: 4px; }
  .mast h1 { font-size: 52px; }
  nav .in { -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); }
  nav .in { padding: 0 16px; gap: 22px; }
  main { padding: 8px 16px 16px; }
  h2 { font-size: 24px; margin-top: 36px; }
  .ledger b { font-size: 21px; white-space: normal; }
  .ledger .in, .ledger.three .in { grid-template-columns: repeat(2, 1fr); }
  .ledger .in > div { padding: 12px 14px 10px; }
  .side img.cb { display: none; }
  .side .clan { font-size: 17px; }
  .sb { gap: 10px; }
  .sb .pts { font-size: 42px; }
  .sb .pts img.star { width: 20px; height: 20px; vertical-align: 3px; margin: 0 3px; }
  .scoreboard .detail { flex-direction: column; gap: 2px; }
  .fixtures a { grid-template-columns: 26px 48px 1fr auto; }
  .war-button { grid-template-areas: "what what" "vs vs" "score score" "note go"; padding: 18px 18px 16px; }
  .wb-vs { font-size: 24px; }
  .wb-score { text-align: left; font-size: 44px; margin: 4px 0 2px; }
  .streaks article { grid-template-columns: 84px minmax(0, 1fr); gap: 4px 14px; }
  .streaks .len b { font-size: 36px; }
  .streaks .proof { grid-column: 2; flex-wrap: wrap; margin-top: 8px; }
  .streaks .proof img { width: 88px; height: 54px; }
  .fixtures .pc { display: none; }
  td, th { padding-left: 7px; padding-right: 7px; }
  .lede { font-size: 20px; }
  .player-head h2 { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
