/* ==========================================================================
   Tenka 天下 — "sakura dusk" design system
   Match /design/overview-reference.html for palette, type, component look.
   ========================================================================== */

:root {
  /* ink + neutrals */
  --plum: #2e1e44;
  --plum-soft: #5f4f78;
  --mauve: #8c7ba8;
  --peri: #8e88c4;
  --peri-deep: #655e9e;
  /* accent */
  --sakura: #dd6fa5;
  --sakura-deep: #c24483;
  --sakura-soft: #f2b4cf;
  --blush: #fbe9f1;
  --peach: #f8dcc4;
  /* surfaces */
  --washi: #fdf6f1;
  --snow: #f4eff8;
  --line: rgba(46, 30, 68, .10);

  --font-display: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-body: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;

  --radius-card: 18px;
  --shadow-card: 0 18px 40px -22px rgba(46, 30, 68, .45);
  --sidebar-w: 232px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: var(--font-body);
  color: var(--plum);
  background: linear-gradient(158deg, #f7eef4, #f3e8f0, #f7ede5);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--sakura-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--sakura-deep);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Shell: dark plum sidebar + content column
   -------------------------------------------------------------------------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, #33224d, #2a1c40);
  color: #efe8f6;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0.9rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: .35em;
  color: #fff;
  padding: 0 .75rem .25rem;
}

.wordmark small {
  display: block;
  font-family: var(--font-body);
  font-size: .68rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--sakura-soft);
  margin-top: .3rem;
}

.sidebar nav { margin-top: 2rem; display: flex; flex-direction: column; gap: .2rem; }

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem .75rem;
  border-radius: 10px;
  color: #cfc4e2;
  font-size: .9rem;
}

.nav-item:hover { background: rgba(255, 255, 255, .06); text-decoration: none; }

.nav-item[aria-current="page"] {
  background: rgba(221, 111, 165, .18);
  color: #fff;
}

.nav-item .kanji {
  font-family: var(--font-display);
  font-size: 1.05rem;
  width: 1.6rem;
  text-align: center;
  color: var(--sakura-soft);
}

.nav-item[aria-current="page"] .kanji { color: var(--sakura); }

.nav-item.is-disabled { opacity: .38; pointer-events: none; }

.sidebar .spacer { flex: 1; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .75rem;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: .85rem;
  color: #cfc4e2;
}

.sidebar-user img { width: 30px; height: 30px; border-radius: 50%; }

.sidebar-user a { color: var(--sakura-soft); font-size: .78rem; }

.content { flex: 1; min-width: 0; padding: 1.6rem 2rem 3rem; }

/* --------------------------------------------------------------------------
   HERO — the signature: sunset sky, misty Fuji, drifting petals
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: linear-gradient(180deg, #b7a6dd 0%, #d99bc8 42%, #f2b1b6 68%, #f8d9bd 100%);
  box-shadow: var(--shadow-card);
  min-height: 220px;
  display: flex;
  align-items: flex-end;
}

.hero-mountains { position: absolute; inset: auto 0 0 0; width: 100%; display: block; }

.hero-inner {
  position: relative;
  z-index: 2;
  padding: 2rem 2.2rem 1.6rem;
  color: var(--plum);
}

.hero-kicker {
  font-size: .75rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: rgba(46, 30, 68, .75);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  line-height: 1.15;
  margin: .3rem 0 .4rem;
}

.hero p { max-width: 46ch; font-size: .95rem; color: rgba(46, 30, 68, .8); }

/* petals */
.petal {
  position: absolute;
  top: -24px;
  width: 12px;
  height: 12px;
  background: radial-gradient(circle at 30% 30%, #fff0f6, var(--sakura-soft));
  border-radius: 60% 0 60% 60%;
  opacity: .8;
  z-index: 1;
  animation: petal-fall linear infinite;
}

.petal:nth-child(1) { left: 12%; animation-duration: 13s; animation-delay: 0s; }
.petal:nth-child(2) { left: 34%; animation-duration: 17s; animation-delay: 4s; width: 9px; height: 9px; }
.petal:nth-child(3) { left: 58%; animation-duration: 15s; animation-delay: 2s; }
.petal:nth-child(4) { left: 76%; animation-duration: 19s; animation-delay: 7s; width: 10px; height: 10px; }
.petal:nth-child(5) { left: 90%; animation-duration: 14s; animation-delay: 1s; width: 8px; height: 8px; }

@keyframes petal-fall {
  0%   { transform: translate3d(0, -24px, 0) rotate(0deg); }
  25%  { transform: translate3d(-18px, 90px, 0) rotate(80deg); }
  50%  { transform: translate3d(14px, 180px, 0) rotate(160deg); }
  75%  { transform: translate3d(-10px, 270px, 0) rotate(240deg); }
  100% { transform: translate3d(8px, 380px, 0) rotate(320deg); opacity: 0; }
}

/* --------------------------------------------------------------------------
   Cards + section headers
   -------------------------------------------------------------------------- */

.card {
  background: var(--washi);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.25rem 1.4rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  margin-bottom: .9rem;
}

.section-head .kanji {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--sakura-deep);
}

.section-head h2 {
  font-size: .8rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--plum-soft);
  font-weight: 600;
}

.section-head .aside { margin-left: auto; font-size: .78rem; color: var(--mauve); }

/* pill metric tiles */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: .9rem; margin: 1.4rem 0; }

.metric {
  background: var(--washi);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .8rem 1.3rem;
  display: flex;
  align-items: center;
  gap: .85rem;
  box-shadow: 0 10px 24px -18px rgba(46, 30, 68, .4);
}

.metric .kanji {
  font-family: var(--font-display);
  color: var(--peri-deep);
  font-size: 1.1rem;
}

.metric b {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  display: block;
  line-height: 1.1;
}

.metric span { font-size: .72rem; color: var(--plum-soft); letter-spacing: .06em; }

/* overview grid */
.grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 1.1rem;
  align-items: start;
}

.grid .col { display: flex; flex-direction: column; gap: 1.1rem; }

/* stat bars */
.stat-row { display: grid; grid-template-columns: 4.2rem 1fr 2rem; gap: .6rem; align-items: center; margin: .32rem 0; font-size: .82rem; }

.stat-row .label { color: var(--plum-soft); }

.stat-row .num { text-align: right; font-family: var(--font-display); }

.bar { height: 8px; border-radius: 999px; background: var(--snow); overflow: hidden; }

.bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--peri), var(--sakura));
}

/* crew rows */
.crew-row {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .9rem;
}

.crew-row:last-child { border-bottom: 0; }

.crew-row .dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }

.crew-row .kname { font-family: var(--font-display); font-size: 1rem; }

.crew-row .romaji { color: var(--plum-soft); font-size: .8rem; }

.crew-row .meta { margin-left: auto; text-align: right; font-size: .78rem; color: var(--plum-soft); }

.crew-row .meta b { font-family: var(--font-display); color: var(--plum); font-size: .95rem; }

/* turf grid */
.turf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }

.turf-node {
  background: var(--snow);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .7rem .8rem;
}

.turf-node .kanji { font-family: var(--font-display); font-size: 1.05rem; display: block; }

.turf-node .en { font-size: .72rem; color: var(--plum-soft); letter-spacing: .04em; }

.turf-node .holder {
  display: flex; align-items: center; gap: .4rem;
  margin-top: .45rem; font-size: .74rem; color: var(--plum-soft);
}

.turf-node .holder .dot { width: 8px; height: 8px; border-radius: 50%; }

/* THE dark dusk card: active war */
.war-card {
  background: linear-gradient(160deg, #3a2757, #2a1c40 70%);
  color: #f2ecf8;
  border: 0;
  border-radius: var(--radius-card);
  box-shadow: 0 22px 46px -20px rgba(46, 30, 68, .7);
  padding: 1.3rem 1.4rem;
}

.war-card .section-head h2 { color: var(--sakura-soft); }

.war-card .section-head .kanji { color: var(--sakura); }

.war-vs {
  display: flex; align-items: center; justify-content: space-between;
  gap: .8rem; margin: .5rem 0 .9rem;
}

.war-side { text-align: center; flex: 1; }

.war-side .kname { font-family: var(--font-display); font-size: 1.15rem; display: block; }

.war-side .score { font-family: var(--font-display); font-size: 1.9rem; color: var(--sakura-soft); }

.war-vs .tai { font-family: var(--font-display); color: var(--mauve); font-size: 1.2rem; }

.war-meter { height: 9px; border-radius: 999px; background: rgba(255, 255, 255, .12); overflow: hidden; }

.war-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--peri), var(--sakura)); }

.war-card .meta { margin-top: .7rem; font-size: .8rem; color: #cfc4e2; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .4rem; }

.war-card.idle { text-align: center; color: #cfc4e2; font-size: .9rem; }

/* ledger table */
.ledger { width: 100%; border-collapse: collapse; font-size: .84rem; }

.ledger td { padding: .45rem .2rem; border-bottom: 1px solid var(--line); vertical-align: top; }

.ledger tr:last-child td { border-bottom: 0; }

.ledger .who { font-weight: 600; }

.ledger .reason { color: var(--plum-soft); }

.ledger .delta { text-align: right; font-family: var(--font-display); white-space: nowrap; }

.delta.pos { color: #3d7d54; }

.delta.neg { color: var(--sakura-deep); }

.ledger .when { color: var(--mauve); font-size: .74rem; text-align: right; white-space: nowrap; }

/* featured character */
.featured { display: flex; gap: 1rem; }

.portrait {
  width: 74px; height: 74px; border-radius: 16px; flex-shrink: 0;
  background: linear-gradient(160deg, var(--peri), var(--sakura));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1.8rem; color: #fff;
  overflow: hidden;
}

.portrait img { width: 100%; height: 100%; object-fit: cover; }

.featured h3 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }

.featured .sub { font-size: .8rem; color: var(--plum-soft); margin-bottom: .4rem; }

/* buttons + forms */
.btn {
  display: inline-block;
  background: var(--sakura);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: .6rem 1.4rem;
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}

.btn:hover { background: var(--sakura-deep); text-decoration: none; transform: translateY(-1px); }

.btn.ghost { background: transparent; color: var(--sakura-deep); border: 1px solid var(--sakura-soft); }

.field { margin-bottom: 1rem; }

.field label { display: block; font-size: .78rem; letter-spacing: .06em; color: var(--plum-soft); margin-bottom: .3rem; }

.field input[type="text"], .field input[type="number"] {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .55rem .75rem;
  font-family: var(--font-body);
  font-size: .92rem;
  color: var(--plum);
}

.field input:focus-visible { outline: 2px solid var(--sakura); outline-offset: 1px; }

.field .hint { font-size: .72rem; color: var(--mauve); margin-top: .25rem; }

.toggles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }

.toggle {
  display: flex; align-items: center; gap: .55rem;
  background: var(--snow); border: 1px solid var(--line);
  border-radius: 10px; padding: .55rem .7rem; font-size: .86rem;
  cursor: pointer;
}

.toggle input { accent-color: var(--sakura-deep); width: 1rem; height: 1rem; }

.flash {
  background: var(--blush);
  border: 1px solid var(--sakura-soft);
  color: var(--sakura-deep);
  border-radius: 10px;
  padding: .6rem .9rem;
  font-size: .86rem;
  margin-bottom: 1rem;
}

/* login + guild picker */
.center-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}

.login-card { max-width: 420px; width: 100%; text-align: center; padding: 2.4rem 2rem; }

.login-card .mark { font-family: var(--font-display); font-size: 3rem; letter-spacing: .3em; }

.login-card .sub { color: var(--plum-soft); font-size: .9rem; margin: .6rem 0 1.6rem; }

.guild-list { display: grid; gap: .7rem; max-width: 560px; margin: 0 auto; }

.guild-item {
  display: flex; align-items: center; gap: .9rem;
  padding: .8rem 1rem;
}

.guild-item img, .guild-item .fallback {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(160deg, var(--peri), var(--sakura));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
}

.guild-item .gname { font-weight: 600; }

.guild-item .gstate { font-size: .76rem; color: var(--plum-soft); }

.guild-item .go { margin-left: auto; }

/* --------------------------------------------------------------------------
   Phase 2: tiers, lineage, brackets, tier-list bands
   -------------------------------------------------------------------------- */

.rank-no {
  font-family: var(--font-display);
  color: var(--mauve);
  width: 1.6rem;
  text-align: right;
  flex-shrink: 0;
}

.epithet { color: var(--sakura-deep); font-style: normal; }

.tier-chip {
  font-size: .68rem;
  letter-spacing: .05em;
  padding: .2rem .6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--snow);
  color: var(--plum-soft);
  white-space: nowrap;
}

.tier-chip.tier-feared { background: var(--blush); color: var(--sakura-deep);
  border-color: var(--sakura-soft); }

.tier-chip.tier-legend { background: linear-gradient(90deg, var(--peri), var(--sakura));
  color: #fff; border: 0; }

.holder-now { margin-bottom: .6rem; }

.lineage { list-style: none; margin-top: .3rem; }

.lineage li {
  display: flex; align-items: baseline; gap: .5rem;
  padding: .28rem 0; font-size: .84rem;
  border-bottom: 1px dashed var(--line);
}

.lineage li:last-child { border-bottom: 0; }

.lineage .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  align-self: center; }

.lineage .how { color: var(--plum-soft); font-size: .76rem; }

.lineage .when { margin-left: auto; color: var(--mauve); font-size: .72rem;
  white-space: nowrap; }

.bracket { display: flex; gap: .8rem; overflow-x: auto; padding-bottom: .4rem; }

.bracket-round { display: flex; flex-direction: column; justify-content: space-around;
  gap: .6rem; min-width: 9.5rem; }

.bracket-round-label { font-size: .68rem; letter-spacing: .14em; color: var(--mauve);
  text-transform: uppercase; }

.bracket-match {
  background: var(--snow); border: 1px solid var(--line); border-radius: 10px;
  padding: .45rem .6rem; font-size: .8rem; display: flex; flex-direction: column;
  gap: .15rem;
}

.bracket-match.is-done { border-color: var(--sakura-soft); }

.bracket-match .is-winner { font-weight: 700; color: var(--sakura-deep); }

.tier-band { display: flex; align-items: center; gap: .9rem; padding: .7rem 0;
  border-bottom: 1px solid var(--line); }

.tier-band:last-child { border-bottom: 0; }

.tier-letter {
  font-family: var(--font-display); font-size: 1.6rem; width: 2.4rem; height: 2.4rem;
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
}

.tier-band-S .tier-letter { background: linear-gradient(150deg, var(--sakura), var(--sakura-deep)); }
.tier-band-A .tier-letter { background: var(--peri-deep); }
.tier-band-B .tier-letter { background: var(--mauve); }

.tier-styles { display: flex; flex-wrap: wrap; gap: .4rem; }

.style-pill {
  background: var(--snow); border: 1px solid var(--line); border-radius: 999px;
  padding: .25rem .7rem; font-size: .8rem;
}

.decide { display: flex; gap: .4rem; }

.btn-small { padding: .35rem .8rem; font-size: .76rem; }

/* Top of the School (番) — the public hierarchy */

.crew-tag { font-family: var(--font-display); color: var(--peri-deep); }

.title-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }

.title-chip {
  font-size: .68rem;
  letter-spacing: .04em;
  padding: .18rem .55rem;
  border-radius: 999px;
  background: var(--blush);
  border: 1px solid var(--sakura-soft);
  color: var(--sakura-deep);
  white-space: nowrap;
}

.featured-aura {
  display: flex;
  align-items: baseline;
  gap: .8rem;
  margin: .9rem 0 .3rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--line);
}

.aura-big {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.1rem;
  line-height: 1;
  color: var(--plum);
}

.delta.flat { color: var(--mauve); }

.featured-aura .delta { font-size: .8rem; }

.top-rows { margin-top: .4rem; }

.top-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .88rem;
}

.top-row:last-child { border-bottom: 0; }

.portrait-small {
  width: 34px; height: 34px; border-radius: 10px; font-size: 1rem; flex-shrink: 0;
}

.top-row-name { min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }

.top-row-aura {
  margin-left: auto;
  font-family: var(--font-display);
  white-space: nowrap;
  display: flex; align-items: baseline; gap: .4rem;
}

.top-row-aura .delta { font-size: .72rem; font-family: var(--font-body); }

.unclaimed { text-align: center; padding: 1.2rem .8rem 1rem; }

.unclaimed-kanji {
  font-family: var(--font-display);
  font-size: 2.4rem;
  display: block;
  color: var(--sakura-soft);
  margin-bottom: .5rem;
}

.unclaimed-line { font-family: var(--font-display); font-size: 1.05rem;
  color: var(--plum); }

.unclaimed-hint { font-size: .8rem; color: var(--plum-soft); margin-top: .5rem;
  max-width: 30ch; margin-left: auto; margin-right: auto; }

/* --------------------------------------------------------------------------
   Phase 3: ambient layer, crests, show-off pages, gallery, medallions
   -------------------------------------------------------------------------- */

/* site-wide ambient: 3 barely-there petals on 60-90s loops (GPU-cheap) */
.ambient { position: fixed; inset: 0; pointer-events: none; z-index: 0;
  overflow: hidden; }

.ambient-petal {
  position: absolute; top: -20px; width: 10px; height: 10px;
  background: radial-gradient(circle at 30% 30%, #fff0f6, var(--sakura-soft));
  border-radius: 60% 0 60% 60%; opacity: .28;
  animation: petal-fall linear infinite;
}

.ambient-petal:nth-child(1) { left: 8%; animation-duration: 67s; }
.ambient-petal:nth-child(2) { left: 47%; animation-duration: 89s;
  animation-delay: 20s; width: 8px; height: 8px; }
.ambient-petal:nth-child(3) { left: 83%; animation-duration: 75s;
  animation-delay: 40s; }

.shell { position: relative; z-index: 1; }

/* gentle sky-hue shift on the hero (60s+, hue-rotate is compositor-cheap) */
.hero { animation: hero-drift 90s ease-in-out infinite; }

@keyframes hero-drift {
  0%, 100% { filter: hue-rotate(0deg); }
  50% { filter: hue-rotate(-8deg); }
}

/* entrance animation used across show-off pages */
.rise-in { animation: rise-in .5s cubic-bezier(.2, .7, .3, 1) both; }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* cup hero */
.cup-hero { display: flex; align-items: center; gap: 1.6rem; flex-wrap: wrap;
  border-top: 4px solid var(--accent, var(--sakura)); }

.cup-hero-id h1 { font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.1; margin: .2rem 0; }

.cup-jp { font-family: var(--font-display); font-size: 1.15rem;
  color: var(--peri-deep); }

.cup-venue { font-size: .82rem; color: var(--plum-soft); margin-top: .35rem; }

.cup-state { margin-left: auto; text-align: right; display: flex;
  flex-direction: column; gap: .5rem; align-items: flex-end; }

.state-banner { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  padding: .35rem .9rem; border-radius: 999px; background: var(--snow);
  color: var(--plum-soft); border: 1px solid var(--line); }

.state-banner.state-signup { background: var(--blush); color: var(--sakura-deep);
  border-color: var(--sakura-soft); }

.state-banner.state-active { background: linear-gradient(90deg, var(--peri), var(--sakura));
  color: #fff; border: 0; }

.state-banner.state-crowned { background: var(--plum); color: var(--sakura-soft);
  border: 0; }

.countdown { text-align: right; }

.countdown-value { font-family: var(--font-display); font-size: 1.3rem;
  display: block; }

.countdown-label { font-size: .7rem; color: var(--mauve); letter-spacing: .06em; }

/* entrant wall */
.entrant-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .7rem; }

.entrant-card { display: flex; align-items: center; gap: .6rem;
  background: var(--snow); border: 1px solid var(--line); border-radius: 12px;
  padding: .6rem .7rem; }

.entrant-id { min-width: 0; display: flex; flex-direction: column; }

.entrant-id strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: .88rem; }

.how-to-enter { border-top: 4px solid var(--accent, var(--sakura)); }

.enter-cmd { display: block; background: var(--plum); color: var(--sakura-soft);
  border-radius: 10px; padding: .6rem .8rem; font-size: .88rem; margin-top: .4rem;
  user-select: all; }

/* live bracket */
.bracket-live .bracket-match { transition: border-color .3s, box-shadow .3s; }

.bracket-match.is-current { border-color: var(--sakura); }

.round-current .bracket-round-label { color: var(--sakura-deep); }

.bracket-match.is-done .is-winner { text-shadow: 0 0 12px rgba(221, 111, 165, .55); }

.pred-tally { font-size: .66rem; color: var(--mauve); margin-left: .3rem; }

/* winner spotlight + petal burst */
.winner-spotlight { position: relative; overflow: hidden; margin-bottom: 1.1rem;
  border-top: 4px solid var(--accent, var(--sakura)); }

.spotlight-inner { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }

.spotlight-name { font-family: var(--font-display); font-size: 1.6rem;
  font-weight: 600; }

.transfer-callout { margin-top: .4rem; color: var(--plum-soft); font-size: .92rem; }

.petal-burst { position: absolute; inset: 0; pointer-events: none; }

.burst-petal { position: absolute; left: 50%; top: 55%; width: 10px; height: 10px;
  background: radial-gradient(circle at 30% 30%, #fff0f6, var(--sakura-soft));
  border-radius: 60% 0 60% 60%; opacity: 0; }

.burst-now .burst-petal { animation: burst 1.6s cubic-bezier(.2, .7, .4, 1) both; }

.burst-now .burst-petal:nth-child(odd) { background: radial-gradient(circle at 30% 30%, #fff, var(--peach)); }
.burst-now .burst-petal:nth-child(1) { --bx: -220px; --by: -120px; }
.burst-now .burst-petal:nth-child(2) { --bx: 180px; --by: -140px; animation-delay: .05s; }
.burst-now .burst-petal:nth-child(3) { --bx: -120px; --by: -180px; animation-delay: .1s; }
.burst-now .burst-petal:nth-child(4) { --bx: 240px; --by: -60px; animation-delay: .12s; }
.burst-now .burst-petal:nth-child(5) { --bx: -260px; --by: -30px; animation-delay: .16s; }
.burst-now .burst-petal:nth-child(6) { --bx: 90px; --by: -200px; animation-delay: .2s; }
.burst-now .burst-petal:nth-child(7) { --bx: -60px; --by: -160px; animation-delay: .22s; }
.burst-now .burst-petal:nth-child(8) { --bx: 300px; --by: -110px; animation-delay: .26s; }
.burst-now .burst-petal:nth-child(9) { --bx: -300px; --by: -90px; animation-delay: .3s; }
.burst-now .burst-petal:nth-child(10) { --bx: 140px; --by: -90px; animation-delay: .33s; }
.burst-now .burst-petal:nth-child(11) { --bx: -180px; --by: -60px; animation-delay: .36s; }
.burst-now .burst-petal:nth-child(12) { --bx: 60px; --by: -240px; animation-delay: .4s; }
.burst-now .burst-petal:nth-child(13) { --bx: -40px; --by: -220px; animation-delay: .44s; }
.burst-now .burst-petal:nth-child(14) { --bx: 220px; --by: -180px; animation-delay: .48s; }

@keyframes burst {
  0% { opacity: 0; transform: translate(0, 0) rotate(0); }
  12% { opacity: .95; }
  100% { opacity: 0; transform: translate(var(--bx), var(--by)) rotate(320deg); }
}

/* medallion wall (titles & badges) */
.medallion-grid { display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .9rem; }

.medallion-card { background: var(--washi); border: 1px solid var(--line);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card);
  padding: 1rem .8rem; text-align: center; }

.medallion-card summary { cursor: pointer; list-style: none; }

.medallion-card summary::-webkit-details-marker { display: none; }

.medallion-card.is-locked { background: var(--snow); box-shadow: none; }

.crest-locked { filter: grayscale(.85) opacity(.55); }

.medallion-name { font-family: var(--font-display); font-weight: 600;
  margin-top: .5rem; }

.medallion-kind { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--mauve); }

.medallion-holder { font-size: .8rem; color: var(--sakura-deep); margin-top: .3rem; }

.medallion-holder.locked-note { color: var(--mauve); font-style: italic; }

.medallion-detail { text-align: left; margin-top: .8rem; border-top: 1px solid var(--line);
  padding-top: .6rem; }

/* gallery board */
.gallery-toolbar { display: flex; align-items: flex-start; gap: 1rem;
  flex-wrap: wrap; margin-bottom: 1rem; }

.filter-chips { display: flex; flex-wrap: wrap; gap: .4rem; flex: 1; }

.filter-chip { font-size: .78rem; padding: .3rem .8rem; border-radius: 999px;
  background: var(--washi); border: 1px solid var(--line); color: var(--plum-soft); }

.filter-chip:hover { text-decoration: none; border-color: var(--sakura-soft); }

.filter-chip.is-active { background: var(--sakura); color: #fff; border-color: var(--sakura); }

.upload-box summary { list-style: none; }
.upload-box summary::-webkit-details-marker { display: none; }

.upload-form { background: var(--washi); border: 1px solid var(--line);
  border-radius: 14px; padding: 1rem; margin-top: .6rem; max-width: 380px; }

.gallery-grid { display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .9rem; }

.gallery-card { position: relative; background: var(--washi);
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 12px 28px -20px rgba(46, 30, 68, .5);
  transition: transform .18s ease; }

.gallery-card:hover { transform: translateY(-3px); }

.gallery-img-btn { display: block; width: 100%; border: 0; padding: 0;
  cursor: zoom-in; background: var(--snow); }

.gallery-img-btn img { width: 100%; height: 180px; object-fit: cover; display: block; }

.gallery-missing { height: 120px; display: flex; align-items: center;
  justify-content: center; color: var(--mauve); font-size: .8rem;
  background: var(--snow); }

.gallery-card figcaption { padding: .55rem .7rem; font-size: .8rem;
  display: flex; flex-wrap: wrap; gap: .35rem .6rem; align-items: baseline; }

.live-chip { font-size: .64rem; letter-spacing: .08em; text-transform: uppercase;
  background: var(--blush); color: var(--sakura-deep); border-radius: 999px;
  padding: .12rem .5rem; }

.win-ribbon { position: absolute; top: .55rem; left: -.4rem;
  background: linear-gradient(90deg, var(--sakura), var(--sakura-deep));
  color: #fff; font-size: .68rem; padding: .22rem .7rem; border-radius: 0 999px 999px 0;
  box-shadow: 0 4px 10px -4px rgba(46, 30, 68, .5); }

.mono { font-family: ui-monospace, monospace; font-size: .76rem; }

.lightbox { position: fixed; inset: 0; z-index: 50;
  background: rgba(46, 30, 68, .82); display: flex; align-items: center;
  justify-content: center; padding: 2rem; cursor: zoom-out; }

.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 12px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6); }

.lightbox-close { position: absolute; top: 1rem; right: 1.4rem; background: none;
  border: 0; color: #fff; font-size: 2rem; cursor: pointer; }

/* my standing (the ego mirror) */
.my-standing { position: relative; overflow: hidden; display: flex;
  align-items: center; justify-content: space-between; gap: 1.2rem;
  flex-wrap: wrap; margin-bottom: 1.2rem;
  border: 1px solid var(--sakura-soft);
  background: linear-gradient(135deg, var(--washi) 55%, var(--blush)); }

.my-standing-glow { position: absolute; right: -60px; top: -60px; width: 220px;
  height: 220px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(221, 111, 165, .18), transparent 70%); }

.my-left { display: flex; align-items: center; gap: 1rem; }

.my-name { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; }

.my-right { text-align: right; display: flex; flex-direction: column;
  gap: .45rem; align-items: flex-end; }

.tier-progress { display: flex; align-items: center; gap: .6rem; min-width: 220px; }

.tier-progress .bar { flex: 1; }

.tier-progress-label { font-size: .74rem; color: var(--plum-soft);
  white-space: nowrap; }

/* league chip (network) */
.league-chip { display: flex; align-items: center; gap: .8rem;
  background: var(--washi); border: 1px solid var(--line);
  border-left: 4px solid var(--accent, var(--peri));
  border-radius: 14px; padding: .6rem 1rem; margin: -0.4rem 0 1.2rem;
  color: var(--plum); font-size: .88rem; }

.league-chip:hover { text-decoration: none; border-color: var(--accent, var(--peri)); }

.league-chip-kanji { font-family: var(--font-display); font-size: 1.3rem;
  color: var(--accent, var(--peri)); }

.league-chip-go { margin-left: auto; color: var(--sakura-deep); font-size: .8rem; }

.row-mine { background: var(--blush); border-radius: 10px;
  padding-left: .5rem !important; padding-right: .5rem; }

.you-chip { font-size: .64rem; letter-spacing: .08em; text-transform: uppercase;
  background: var(--sakura); color: #fff; border-radius: 999px; padding: .1rem .5rem;
  margin-left: .4rem; }

.placements { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .6rem; }

@media (max-width: 760px) {
  .cup-hero { gap: .9rem; }
  .cup-state { margin-left: 0; align-items: flex-start; text-align: left; }
  .my-right { align-items: flex-start; text-align: left; }
}

/* --------------------------------------------------------------------------
   Responsive: sidebar collapses to an icon+kanji rail, grids stack
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --sidebar-w: 64px; }
  .sidebar { padding: 1rem .4rem; align-items: center; }
  .wordmark { font-size: 1.2rem; letter-spacing: 0; padding: 0; text-align: center; }
  .wordmark small, .nav-item .en, .sidebar-user .who { display: none; }
  .nav-item { justify-content: center; padding: .55rem; }
  .sidebar-user { border-top: 0; padding: .4rem; }
  .content { padding: 1rem .9rem 2.5rem; }
  .hero-inner { padding: 1.4rem 1.2rem 1.1rem; }
  .turf-grid { grid-template-columns: repeat(2, 1fr); }
  .toggles { grid-template-columns: 1fr 1fr; }
  .metrics { gap: .6rem; }
  .metric { padding: .65rem .9rem; }
}

@media (max-width: 460px) {
  .metrics { grid-template-columns: 1fr; }
  .turf-grid { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Reduced motion: no petals, no transitions
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .petal { display: none; }
  * { animation: none !important; transition: none !important; }
}
