
html {
  
  --bg: #0e100f;
  --bg-2: #151816;
  --card: #151816;
  --card-2: #1a1e1b;
  --line: #333a34;
  --line-soft: #1d211e;
  --line-strong: #414a42;
  --fg: #edefea;
  
  --dim: #e4e8e0;
  --faint: #ccd3c8;
  --accent: #4fb56a;
  --accent-2: #6cc884;    
  --accent-on: #0e1a10;   
  --gold: #d9a63f;
  --win: #4fb56a;
  
  --draw: #7e877f;
  --loss: #e08a4e;
  
  --pitch: #21462e;
  --pitch-2: #285339;
  --pitch-edge: #4c9061;
  --pitch-line: #ffffff40;
  
  --slot-bg: #0e100fcc;
  --slot-bg-on: #0e100fee;
  --slot-ink: #ffffff;
  --slot-line: #ffffff44;
  --slot-sub: #ffffffdd;
  --slot-shadow: 0 1px 3px #000, 0 0 6px #000;
  
  --feature: #1d3a26;
  --feature-line: #35563d;
  --toast-bg: #1a1e1bee;
  
  --crest-outline: #f2f5ef;
  --chem: #7fe6a0;
  
  --verdict-bg: #25422e;
  --verdict-ink: #f4f8f2;
  
  --tier-gold-ink: #ffd75e;
  --tier-plat-ink: #fffaea;
  --r: 16px;
  --r-lg: 22px;
}

html.bg-warm {
  --bg: #f5f2eb;
  --bg-2: #ffffff;
  --card: #ffffff;
  --card-2: #faf7f0;
  --line: #e0dace;
  --line-soft: #efebe2;
  --line-strong: #a79d8a;
  --fg: #22201b;
  --dim: #2a271f;
  --faint: #3b362b;
  --accent: #4e7f49;
  --accent-2: #3d6839;
  --accent-on: #ffffff;
  
  --gold: #8a6624;
  --win: #4e7f49;
  --draw: #6a6354;
  --loss: #b4541f;
  --pitch: #dcefc7;
  --pitch-2: #d3e8bc;
  --pitch-edge: #a9c795;
  --pitch-line: #ffffffdd;
  --slot-bg: #fffffff2;
  --slot-bg-on: #ffffff;
  --slot-ink: #22201b;
  --slot-line: #00000030;
  --slot-sub: #000000cc;
  --slot-shadow: 0 1px 2px #ffffffdd, 0 0 4px #ffffffdd;
  --feature: #e6eddd;
  --feature-line: #b9caa8;
  --toast-bg: #ffffffee;
  --crest-outline: #22201b;
  --chem: #1f5f2b;
  --verdict-bg: #dfe9d4;
  --verdict-ink: #1c2a18;
  --tier-gold-ink: #8a6624;
  --tier-plat-ink: #6d5a2e;
}

html.bg-grass {
  --bg: #edf2e6;
  --bg-2: #ffffff;
  --card: #ffffff;
  --card-2: #f6faf1;
  --line: #d5dfc8;
  --line-soft: #e6ecdd;
  --line-strong: #94a585;
  --fg: #1e2419;
  --dim: #262e20;
  --faint: #36402f;
  --accent: #3f7a46;
  --accent-2: #316237;
  --accent-on: #ffffff;
  --gold: #7d6020;
  --win: #3f7a46;
  --draw: #5d6b52;
  --loss: #a94f1c;
  --pitch: #d8ecc4;
  --pitch-2: #cfe5b9;
  --pitch-edge: #9dba8b;
  --pitch-line: #ffffffdd;
  --slot-bg: #fffffff2;
  --slot-bg-on: #ffffff;
  --slot-ink: #1e2419;
  --slot-line: #00000030;
  --slot-sub: #000000cc;
  --slot-shadow: 0 1px 2px #ffffffdd, 0 0 4px #ffffffdd;
  --feature: #e2eed9;
  --feature-line: #aac59a;
  --toast-bg: #ffffffee;
  --crest-outline: #1e2419;
  --chem: #1b5726;
  --verdict-bg: #d7e7c8;
  --verdict-ink: #16220f;
  --tier-gold-ink: #7d6020;
  --tier-plat-ink: #63552b;
}

* { box-sizing: border-box; }


[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-text-size-adjust: 100%;
}






#topbar {
  position: relative;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  width: 100%; max-width: 560px; margin: 0 auto;
  padding: 22px 16px 14px;
  border-bottom: 1px solid var(--line);
}

body[data-screen="home"] #topbar {
  border-bottom: 0;
  padding-bottom: 0;
  justify-content: flex-end;
}
body[data-screen="home"] .tb-left { display: none; }

#topbar h1 {
  margin: 0;
  font-size: 30px; font-weight: 700;
  letter-spacing: .16em;          
}
#topbar .sub {
  margin: 5px 0 0;
  font-size: 15px; font-weight: 600; letter-spacing: .1em;
  
  color: var(--dim);
}

.tb-right { display: flex; gap: 8px; }


.swatch {
  width: 30px; height: 22px; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 4px;
  background: transparent; cursor: pointer;
}
.swatch span { display: block; width: 100%; height: 100%; border-radius: 3px; }

.swatch[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}


.tb-back {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; padding: 0;
  font-size: 22px; line-height: 1; color: var(--fg);
  border: 1px solid var(--line-strong); border-radius: 50%;
  background: var(--card); cursor: pointer;
}
.tb-back:active { transform: translateY(-50%) scale(.92); }

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px calc(28px + env(safe-area-inset-bottom));
}

.screen { animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }



.hero { text-align: center; padding: 26px 0 20px; }


.hero-name {
  margin: 0;
  font-size: 46px; font-weight: 700; letter-spacing: .18em;
  
  text-indent: .18em;
  line-height: 1.1;
}
.hero-sub {
  margin: 8px 0 0;
  font-size: 17px; font-weight: 600; letter-spacing: .12em;
  text-indent: .12em;
  color: var(--dim);
}

.tagline { color: var(--dim); margin: 12px 0 0; font-size: 14px; }
.tagline.strong { color: var(--fg); font-weight: 600; margin-top: 10px; }



.menu { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }

.menu-item {
  appearance: none; cursor: pointer; width: 100%; text-align: left;
  display: flex; align-items: center; gap: 13px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px 18px;
  color: var(--fg); font-family: inherit; transition: .15s;
}
.menu-item:hover { border-color: var(--accent); background: var(--card-2); }
.menu-item .txt { flex: 1; min-width: 0; }

.menu-item .t { display: block; font-size: 16px; font-weight: 700; }
.menu-item .d { display: block; font-size: 13px; color: var(--faint); margin-top: 3px; }
.menu-item .go { color: var(--faint); font-size: 18px; }

.menu-item.feature {
  background: linear-gradient(150deg, var(--feature), var(--card));
  border-color: var(--feature-line);
}
.menu-item.feature .t { color: var(--accent-2); }
.menu-item.done { opacity: .55; }
.menu-item:disabled { cursor: default; opacity: .4; }

.stats-strip {
  display: flex; gap: 8px; margin: 4px 0 18px;
}
.stats-strip div {
  flex: 1; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 10px 6px; text-align: center;
}
.stats-strip b { display: block; font-size: 19px; }
.stats-strip small { color: var(--faint); font-size: 12px; }

.field { margin: 18px 0; }
.field-label {
  display: block; font-size: 13px; color: var(--faint);
  letter-spacing: 1px; margin-bottom: 8px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  appearance: none; cursor: pointer;
  background: var(--card); color: var(--dim);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px; font-size: 14px; font-family: inherit;
  transition: .15s;
}
.chip:hover { border-color: var(--faint); }
.chip[aria-pressed="true"] {
  background: var(--accent); color: var(--accent-on); border-color: var(--accent);
  font-weight: 700;
}
.chip small { opacity: .7; margin-left: 5px; font-size: 12px; }

.hint { color: var(--faint); font-size: 13px; margin: 8px 0 0; min-height: 1em; }



.btn {
  appearance: none; cursor: pointer; width: 100%;
  background: var(--bg-2); color: var(--fg);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 13px; font-size: 15px; font-family: inherit;
  margin-top: 10px; transition: .15s;
}
.btn:hover:not(:disabled) { border-color: var(--faint); }
.btn:disabled { opacity: .45; cursor: default; }

.btn.primary {
  background: var(--accent); border-color: transparent;
  color: var(--accent-on); font-weight: 800; border-radius: var(--r-lg);
}
.btn.primary:hover:not(:disabled) { background: var(--accent-2); }
.btn.primary::before { content: "→ "; }
.btn.big { padding: 17px; font-size: 17px; }
.btn.ghost { background: none; color: var(--dim); border-color: transparent; }
.btn.tiny { width: auto; padding: 6px 12px; font-size: 14px; margin: 0; }



.draft-top { margin-bottom: 12px; }

.progress { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.progress span { font-size: 13px; color: var(--faint); white-space: nowrap; }
.bar { flex: 1; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }


.wheel-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px;
  display: flex; align-items: center; gap: 14px;
}
.wheel-text { min-width: 0; }
.wheel-card.spinning .wheel-club { opacity: .45; filter: blur(1px); }
.wheel-season { font-size: 13px; color: var(--gold); letter-spacing: 1px; }
.wheel-club {
  font-size: 22px; font-weight: 700; margin-top: 3px;
  transition: opacity .12s, filter .12s;
}




.crest-cell {
  flex: none; width: 22px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
}
.crest-cell.big { width: 52px; height: 52px; }

.crest {
  display: block; width: auto; height: 100%;
  max-width: 100%; object-fit: contain;
}


.crest.outlined, .kob-crest.outlined {
  filter:
    drop-shadow(1px 0 0 var(--crest-outline)) drop-shadow(-1px 0 0 var(--crest-outline))
    drop-shadow(0 1px 0 var(--crest-outline)) drop-shadow(0 -1px 0 var(--crest-outline));
}


.crest-mark {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--faint);
  font-size: 14px; font-weight: 700; letter-spacing: .06em;
}


.champion-crest { height: 64px; max-width: 96px; margin: 0 auto 10px; }



.pitch-wrap { margin: 14px 0; }


.setup-pitch { max-width: 310px; margin: 12px auto 0; }

.setup-pitch .slots { inset: 22px 4px 22px; }


.swap-tip {
  margin: 10px 0 0; padding: 9px 12px;
  background: var(--card); border: 1px solid var(--line-strong);
  border-radius: var(--r); text-align: center;
  font-size: 14px; color: var(--fg);
}
.swap-tip b { color: var(--accent-2); }

.swap-tip .nw { white-space: nowrap; }

.pitch {
  position: relative;
  aspect-ratio: 3 / 4;
  background:
    repeating-linear-gradient(0deg, var(--pitch) 0 8%, var(--pitch-2) 8% 16%);
  border: 1px solid var(--pitch-edge); border-radius: var(--r);
  overflow: hidden;
}


.pitch::before, .pitch::after {
  content: ""; position: absolute; border: 1px solid var(--pitch-line);
}
.pitch::before {
  width: 26%; aspect-ratio: 1; border-radius: 50%;
  left: 37%; top: 50%; transform: translateY(-50%);
}
.pitch::after { left: 22%; width: 56%; height: 13%; bottom: -1px; border-bottom: 0; }



.slots { position: absolute; inset: 18px 4px 58px; }


.slot { position: absolute; width: 0; height: 0; cursor: default; }
.slot-body {
  position: absolute; left: 0; top: -21px;   
  width: 88px; margin-left: -44px;
  text-align: center;
}
.badge-wrap { position: relative; width: 42px; margin: 0 auto; }
.slot .badge {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 17px; font-weight: 800;
  
  background: var(--slot-bg); border: 1.5px solid var(--slot-line); color: var(--slot-sub);
}

.slot:not(.filled) .badge { font-size: 13px; font-weight: 700; letter-spacing: .02em; }

.slot-crest {
  position: absolute; right: -12px; top: -6px;
  height: 21px; max-width: 28px; width: auto;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .55));
}
.slot-crest.outlined {
  filter:
    drop-shadow(1px 0 0 var(--crest-outline)) drop-shadow(-1px 0 0 var(--crest-outline))
    drop-shadow(0 1px 0 var(--crest-outline)) drop-shadow(0 -1px 0 var(--crest-outline));
}
.slot.filled .badge {
  border-style: solid; border-color: var(--slot-ink); background: var(--slot-bg-on);
  color: var(--slot-ink);
}
.slot.filled.hi .badge { border-color: var(--gold); color: var(--gold); }

.slot .nm {
  font-size: 13px; font-weight: 700; margin-top: 3px; line-height: 1.15;
  text-shadow: var(--slot-shadow);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}
.slot .ps { font-size: 12px; color: var(--slot-sub); text-shadow: var(--slot-shadow); }

.natflag {
  display: inline-block; width: 15px; height: 10px; margin-right: 4px;
  vertical-align: -1px; border-radius: 1px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .45);
}
.natflag svg { display: block; width: 100%; height: 100%; }


.slot .ps.off { color: var(--faint); }
.slot .ps.off em { font-style: normal; opacity: .85; }

.slot.movable { touch-action: none; }
.slot.movable.filled .badge { cursor: grab; }
.slot.dragging .slot-body { opacity: .55; transform: scale(1.06); }

.slot.picked .badge, .slot.drop .badge {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent);
}
.slot.drop .badge { transform: scale(1.1); }

.slot.target .badge { border-color: var(--accent-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent); }




.t-bronze { --tier-a: #c98a45; --tier-b: #8f5a22; --tier-ink: #2a1a08; }
.t-silver { --tier-a: #cfd8de; --tier-b: #8d9aa6; --tier-ink: #1c2429; }
.t-gold   { --tier-a: #ffd75e; --tier-b: #d99b1c; --tier-ink: #2b1f02; }
.t-plat   { --tier-a: #fffaea; --tier-b: #e8ac3c; --tier-ink: #16110a; }

.cand .ov.t-bronze, .cand .ov.t-silver, .cand .ov.t-gold, .cand .ov.t-plat {
  background: linear-gradient(155deg, var(--tier-a), var(--tier-b));
  border-color: transparent; color: var(--tier-ink);
}
.cand .ov.t-plat { box-shadow: 0 0 0 1px rgba(255,255,255,.6), 0 0 10px rgba(255,213,120,.35); }


.slot.t-bronze .badge, .slot.t-silver .badge,
.slot.t-gold .badge, .slot.t-plat .badge {
  background: linear-gradient(155deg, var(--tier-a), var(--tier-b));
  border-color: rgba(0, 0, 0, .35); color: var(--tier-ink);
}

.slot.t-plat .badge {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .75), 0 0 12px rgba(255, 213, 120, .55);
}




.chem-layer {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1;
}

.chem-link { stroke: var(--chem); vector-effect: non-scaling-stroke; stroke-linecap: round; }
.chem-link.s1 { stroke-width: 2; opacity: .45; }
.chem-link.s2 { stroke-width: 3; opacity: .7; }
.chem-link.s3 { stroke-width: 4.5; opacity: .95; }

.slot { z-index: 2; }


.power {
  display: flex; align-items: stretch; gap: 12px; margin-top: 10px;
  background: var(--card-2); border: 1px solid var(--line-strong);
  border-radius: var(--r); padding: 12px 14px;
}
.pw-total {
  flex: none; width: 82px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  border-right: 1px solid var(--line-strong); padding-right: 12px;
}
.pw-total b {
  font-size: 46px; font-weight: 900; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--fg);
}
.pw-total small { font-size: 13px; font-weight: 700; color: var(--fg); letter-spacing: .06em; }
.pw-total.t-gold b { color: var(--tier-gold-ink); }
.pw-total.t-plat b { color: var(--tier-plat-ink); text-shadow: 0 0 12px rgba(255,213,120,.5); }

.pw-bars { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px;
  justify-content: center; }
.pw-row { display: flex; align-items: center; gap: 8px; }
.pw-k { flex: none; width: 38px; font-size: 13px; font-weight: 700; color: var(--fg); }
.pw-bar {
  flex: 1; height: 9px; border-radius: 999px; overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--line);
}
.pw-bar i { display: block; height: 100%; border-radius: 999px;
  background: var(--accent); transition: width .25s; }

.pw-bar i.t-bronze, .pw-bar i.t-silver, .pw-bar i.t-gold, .pw-bar i.t-plat {
  background: linear-gradient(90deg, var(--tier-b), var(--tier-a));
}
.pw-v { flex: none; width: 30px; text-align: right; font-size: 17px; font-weight: 900;
  font-variant-numeric: tabular-nums; }




.scorers { width: 100%; font-size: 12px; color: var(--dim); }


.cand-head {
  position: sticky; top: 0; z-index: 2; background: var(--bg);
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; row-gap: 2px; column-gap: 8px;
  margin: 4px 0 0; padding: 4px 0 8px; font-size: 13px; color: var(--faint);
}

.ct-season {
  font-style: normal; font-weight: 700; color: var(--gold);
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}

.cand-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 46vh; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

.cand {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 11px;
  cursor: pointer; font-family: inherit; color: var(--fg); text-align: left;
}

.cand.claimed { opacity: .45; }
.cand.claimed .nm { text-decoration: line-through; }
.cand:hover { border-color: var(--accent); background: var(--card-2); }
.cand .ov {
  min-width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  background: var(--bg); border: 1px solid var(--line);
}



.cand-wrap { display: flex; flex-direction: column; }
.cand.futcard { border-radius: 12px; padding: 8px 10px; gap: 11px; }
.fc-badge {
  flex: none; width: 44px; padding: 3px 0; border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; line-height: 1.05;
  background: var(--bg-2); border: 1px solid var(--line-strong); color: var(--fg);
}
.fc-badge b { font-size: 19px; font-weight: 900; font-variant-numeric: tabular-nums; }
.fc-badge span { font-size: 10px; letter-spacing: .06em; opacity: .9; }

.cand.t-bronze .fc-badge, .cand.t-silver .fc-badge,
.cand.t-gold .fc-badge, .cand.t-plat .fc-badge {
  background: linear-gradient(155deg, var(--tier-a), var(--tier-b));
  border-color: transparent; color: var(--tier-ink);
}
.cand.t-plat .fc-badge { box-shadow: 0 0 0 1px rgba(255,255,255,.6), 0 0 10px rgba(255,213,120,.35); }



.cand-wrap:has(.pos-pick:not([hidden])) .cand.futcard {
  border-radius: 12px 12px 0 0;
  
  border-bottom-color: transparent;
  border-color: var(--accent);
  background: var(--card-2);
}
.pos-pick {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 4px 10px 10px; margin: 0 0 2px;
  background: var(--card-2); border: 1px solid var(--accent);
  border-top: 0; border-radius: 0 0 12px 12px;
}
.pchip {
  display: flex; align-items: baseline; gap: 5px;
  background: var(--bg-2); color: var(--fg);
  border: 1px solid var(--accent); border-radius: 999px;
  padding: 7px 13px; font-size: 14px; font-family: inherit; cursor: pointer;
}
.pchip b { font-weight: 800; }
.pchip i { font-style: normal; color: var(--accent-2); font-weight: 700;
  font-variant-numeric: tabular-nums; }
.pchip:hover { background: var(--accent); color: var(--accent-on); }
.pchip:hover i { color: var(--accent-on); }
.cand .ov.hi { color: var(--gold); border-color: var(--line-strong); }
.cand .info { flex: 1; min-width: 0; }
.cand .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cand .sub { font-size: 12px; color: var(--faint); }
.cand .to { text-align: right; font-size: 12px; color: var(--dim); white-space: nowrap; }
.cand .to b { display: block; font-size: 15px; color: var(--accent-2); }

.draft-actions { margin-top: 14px; }



.season-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; gap: 10px;
}
.season-record { font-size: 14px; }
.season-record b { font-size: 20px; }

.fixtures { display: flex; flex-direction: column; gap: 5px; }

.fx {
  
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: var(--card-2); border: 1px solid var(--line-strong);
  border-left-width: 4px; border-radius: 8px; padding: 9px 10px;
  font-size: 14px;
}
.fx.pending { opacity: .38; }
.fx.W { border-left-color: var(--win); }
.fx.D { border-left-color: var(--draw); }
.fx.L { border-left-color: var(--loss); }
.fx .rd { font-size: 12px; color: var(--dim); min-width: 56px; }
.fx .opp { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx .opp em { font-style: normal; color: var(--gold); font-size: 12px; opacity: .75; }
.fx .ha { font-size: 12px; color: var(--dim); }
.fx .sc { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 40px; text-align: right; }
.fx .note { font-size: 11px; color: var(--gold); }
.fixtures.compact .fx { padding: 6px 9px; font-size: 13px; }



.match-stage {
  background: var(--card); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); padding: 18px 14px 16px; margin-bottom: 14px;
  text-align: center;
}
.ms-round { font-size: 14px; color: var(--dim); letter-spacing: .04em; }
.ms-round .ms-ha { color: var(--faint); }

.ms-body {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 10px; margin: 14px 0 10px;
}
.ms-side { min-width: 0; }
.ms-crest {
  display: flex; align-items: center; justify-content: center;
  height: 54px; max-width: 100%; margin: 0 auto 6px; object-fit: contain;
}

.ms-crest.me, .ms-crest.none {
  width: 54px; border-radius: 50%; font-size: 20px; font-weight: 800;
  background: var(--card-2); border: 1px solid var(--line-strong); color: var(--fg);
}
.ms-nm {
  font-size: 14px; font-weight: 700; line-height: 1.25;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.ms-yr { font-size: 12px; color: var(--gold); opacity: .8; }


.ms-score {
  display: flex; align-items: baseline; gap: 6px;
  font-variant-numeric: tabular-nums; font-weight: 900;
}
.ms-score b { font-size: 42px; line-height: 1; min-width: 32px; }
.ms-score i { font-style: normal; font-size: 24px; color: var(--faint); }

.ms-tag {
  display: inline-block; padding: 3px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 700; border: 1px solid var(--line-strong);
}
.ms-tag.W { color: var(--accent-on); background: var(--win); border-color: transparent; }
.ms-tag.D { color: var(--fg); background: var(--card-2); }
.ms-tag.L { color: var(--fg); background: var(--card-2); border-color: var(--loss); }
.ms-tag.pending { color: var(--faint); }

.ms-agg { margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--dim); }

.ms-goals { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.gl {
  display: flex; gap: 8px; align-items: baseline; text-align: left;
  font-size: 13px; padding: 7px 10px; border-radius: 8px; background: var(--bg-2);
}
.gl .who { flex: none; max-width: 40%; color: var(--faint); font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl .nm { flex: 1; min-width: 0; }

.gl.mine .nm { color: var(--accent-2); font-weight: 700; }
.gl.theirs .nm { color: var(--gold); }
.gl.mine::before, .gl.theirs::before { content: "⚽"; font-size: 13px; }

.new-result { animation: pop .35s ease; }
@keyframes pop { from { transform: scale(.94); opacity: .4; } }



.screen-title { font-size: 18px; margin: 6px 0 0; }
.sub { font-size: 14px; color: var(--dim); margin: 22px 0 8px; }


.odds { margin: 14px 0; }
.odds-head {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 14px 12px; border-radius: var(--r) var(--r) 0 0;
  border: 2px solid var(--line-strong); border-bottom: 0;
  background: var(--card-2);
}
.odds-k { font-size: 13px; font-weight: 700; letter-spacing: .18em; color: var(--fg); }
.odds-grade { font-size: 34px; font-weight: 900; letter-spacing: .04em; line-height: 1.1; }

.odds-head.hot { background: var(--feature); border-color: var(--gold); }
.odds-head.hot .odds-grade { color: var(--gold); }
.odds-head.good { background: var(--feature); border-color: var(--accent); }
.odds-head.good .odds-grade { color: var(--accent-2); }
.odds-head.mid .odds-grade { color: var(--fg); }
.odds-head.flat .odds-grade { color: var(--dim); }
.odds-head.cold { border-color: var(--loss); }
.odds-head.cold .odds-grade { color: var(--loss); }

.odds-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line-strong);
  border: 2px solid var(--line-strong); border-top: 0;
  border-radius: 0 0 var(--r) var(--r); overflow: hidden;
}
.odds-cell { background: var(--card); padding: 10px 4px; text-align: center; }
.odds-cell b { display: block; font-size: 20px; font-weight: 900;
  font-variant-numeric: tabular-nums; }
.odds-cell small { font-size: 12px; font-weight: 600; color: var(--fg); }



.verdict-card {
  background: var(--verdict-bg);
  border: 2px solid var(--line-strong); border-radius: var(--r);
  padding: 24px 16px; text-align: center; margin-bottom: 14px;
}
.verdict-card.perfect {
  border-color: var(--gold);
  box-shadow: 0 0 30px color-mix(in srgb, var(--gold) 16%, transparent);
}
.verdict-card h2 {
  margin: 0 0 8px;
  font-size: 34px; font-weight: 800; letter-spacing: -.5px;
  color: var(--verdict-ink);
}
.verdict-card.perfect h2 { color: var(--gold); }
.verdict-card p { margin: 0; color: var(--verdict-ink); opacity: .9; font-size: 15px; }

.badges { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.badge-pill {
  background: var(--feature); border: 1px solid var(--feature-line);
  border-radius: 999px; padding: 5px 12px; font-size: 13px;
}
.badge-pill b { color: var(--gold); }

.result-table {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
.result-table div {
  background: var(--card-2); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 9px 4px; text-align: center;
}
.result-table b { display: block; font-size: 18px; }
.result-table small { color: var(--dim); font-size: 12px; }

.awards { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.award {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--card-2); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 9px 12px; font-size: 14px;
}
.award .t { color: var(--dim); font-size: 13px; }
.award .v { font-weight: 600; }
.award .v small { color: var(--dim); font-weight: 400; margin-left: 6px; }

.player-stats { display: flex; flex-direction: column; gap: 4px; }
.pstat {
  display: flex; align-items: center; gap: 9px;
  background: var(--card-2); border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 7px 10px; font-size: 14px;
}
.pstat .pos { font-size: 12px; color: var(--dim); min-width: 30px; font-weight: 700; }
.pstat .crest-cell { width: 20px; height: 18px; }
.pstat .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pstat .yr { font-style: normal; color: var(--gold); font-size: 13px; }
.pstat .ga { font-variant-numeric: tabular-nums; color: var(--dim); font-size: 13px; }
.pstat .ga b { color: var(--fg); }


.share-row { display: flex; gap: 8px; margin-top: 16px; }
.share-row .btn { margin-top: 0; }
.share-row .btn.primary::before { content: none; }





.rank-list { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; }

.rank-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; font-size: 14px;
}
.rank-row.me { border-color: var(--accent); background: var(--card-2); }

.rank-row.me .no { color: var(--gold); }
.rank-row.perfect { border-color: var(--gold); }
.rank-row .no {
  min-width: 34px; font-variant-numeric: tabular-nums;
  color: var(--faint); font-weight: 700;
}
.rank-row .who { flex: 1; min-width: 0; }

.rank-row .who .nm { display: block; font-size: 16px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .who .sub { display: block; font-size: 12px; color: var(--faint); }
.rank-row .res { font-weight: 700; white-space: nowrap; }
.rank-row .res.gold { color: var(--gold); }


.verdict-card .room-rank { color: var(--gold); }

.rank-me { margin-top: 14px; }
.rank-me-label { font-size: 13px; color: var(--faint); margin-bottom: 5px; }

.name-row { display: flex; gap: 8px; align-items: center; }

.text-input {
  flex: 1; background: var(--card); color: var(--fg);
  border: 1.5px solid var(--accent); border-radius: var(--r);
  padding: 11px 13px; font-size: 15px; font-family: inherit;
}
.text-input::placeholder { color: var(--faint); }
.text-input:focus { outline: none; border-color: var(--accent-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }

.submit-row { margin-top: 16px; }
.submit-done {
  text-align: center; color: var(--dim); font-size: 14px;
  padding: 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r);
}
.linkish {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--accent-2); font: inherit; text-decoration: underline;
}

.help-item {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px 16px; margin-bottom: 10px;
}
.help-item h4 { margin: 0 0 6px; font-size: 14px; color: var(--accent-2); }
.help-item p {
  margin: 0; font-size: 14px; color: var(--dim); line-height: 1.7;
  white-space: pre-line;               
}

.history { margin-top: 20px; }
.history summary { cursor: pointer; color: var(--dim); font-size: 14px; }
.history-row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  width: 100%; padding: 9px 0; border: 0; border-bottom: 1px solid var(--line);
  background: none; color: var(--fg); font: inherit; font-size: 13px;
  text-align: left;
}
.history-row b { color: var(--gold); }

.history-row.openable { cursor: pointer; }
.history-row.openable:hover { color: var(--accent-2); }
.history-row .hr-right { display: flex; align-items: center; gap: 2px; }
.history-row .hr-go { color: var(--accent-2); font-size: 16px; margin-left: 6px; }



.share-card {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, .62);
  overflow-y: auto;
}
.share-box {
  width: 100%; max-width: 420px;
  background: var(--bg-2); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); padding: 14px;
}

#share-canvas, #share-img {
  display: block; width: 100%; height: auto;
  border-radius: 10px;
}
#share-actions .btn { margin-top: 8px; }
#share-actions .hint { margin-top: 10px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--toast-bg); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 9px 18px; font-size: 14px;
  
  z-index: 40; animation: fade .2s;
}


#credit {
  margin: 34px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--fg);
  font-size: 13px; letter-spacing: .08em; line-height: 1.9;
}
#credit a {
  display: inline-block; margin-top: 3px;
  color: var(--fg); text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  word-break: break-all;         
}
#credit a:hover { border-bottom-color: var(--fg); }


.foot-row {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 12px 28px;
}

.afd-row {
  display: inline-flex; align-items: center; flex-wrap: wrap;
  justify-content: center; gap: 10px;
}
.credit-one { display: block; }

#credit .afd-url { margin-top: 0; }
#credit .afd-pill {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 0;
  padding: 6px 13px; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-on);
  font-weight: 700; letter-spacing: .08em; white-space: nowrap;
}
#credit .afd-pill:hover { filter: brightness(1.08); }

.afd-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-on); opacity: .85;
  animation: afd-pulse 1.9s ease-in-out infinite;
}
@keyframes afd-pulse {
  0%, 100% { opacity: .25; transform: scale(.8); }
  50%      { opacity: 1;   transform: scale(1.15); }
}
@media (prefers-reduced-motion: reduce) { .afd-dot { animation: none; opacity: .85; } }


.legal {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft);
  color: var(--faint); font-size: 11px; line-height: 1.6; text-align: center;
}

.loading { text-align: center; color: var(--faint); padding: 30px 0; font-size: 14px; }





.mode-row { display: flex; gap: 10px; margin: 8px 0 18px; }
.mode-row .btn { flex: 1; margin: 0; }


.room-bar {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 14px;
  background: linear-gradient(150deg, var(--feature), var(--card));
  border: 1px solid var(--feature-line); border-radius: var(--r-lg);
}
.room-bar .code {
  font-weight: 900; letter-spacing: .14em; color: var(--fg);
  font-variant-numeric: tabular-nums; font-size: 28px; line-height: 1.1;
}
.room-bar .meta {
  color: var(--dim); font-size: 12px;
  
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}


.room-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin: 8px 0 12px;
}
.room-actions .btn { margin-top: 0; }


.turn-pop {
  position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%) scale(.92);
  z-index: 60; pointer-events: none;
  padding: 14px 26px; border-radius: var(--r-lg);
  background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .45);
  text-align: center; opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
}
.turn-pop.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.turn-pop .tp-who { font-size: 22px; font-weight: 900; line-height: 1.2; }
.turn-pop .tp-sub { margin-top: 4px; font-size: 12px; color: var(--dim); }

.turn-pop.mine { border-color: var(--accent); background: var(--card-2); }
.turn-pop.mine .tp-who { color: var(--accent); }

.seats { display: flex; flex-direction: column; gap: 5px; }

.seat {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; font-size: 14px;
}
.seat.me { border-color: var(--accent); background: var(--card-2); }
.seat.empty { border-style: dashed; opacity: .5; }
.seat .no {
  min-width: 22px; color: var(--faint); font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.seat .nm { flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; }
.seat .st { font-size: 12px; color: var(--faint); white-space: nowrap; }
.seat .st.ready { color: var(--accent-2); }




.room-power { display: flex; flex-direction: column; gap: 5px; }
.rp-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; font-size: 14px;
}
.rp-row.me { border-color: var(--accent); background: var(--card-2); }
.rp-row .no {
  min-width: 22px; color: var(--faint); font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rp-row .nm { flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 700; }
.rp-row .fm { font-size: 12px; color: var(--faint); white-space: nowrap; }

.rp-row .ov {
  min-width: 42px; text-align: center; font-weight: 900; font-size: 17px;
  font-variant-numeric: tabular-nums;
  border-radius: 8px; padding: 2px 6px;
}


.draw-verdict {
  background: var(--verdict-bg);
  border: 2px solid var(--line-strong); border-radius: var(--r);
  padding: 14px 16px; margin-bottom: 14px;
}
.dv-kicker { font-size: 12px; color: var(--dim); }
.dv-main { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 6px; }
.dv-main b { font-size: 26px; font-weight: 900; color: var(--accent-2); }
.dv-main span { font-size: 13px; color: var(--dim); }
.dv-note { font-size: 12px; color: var(--faint); line-height: 1.6; }


.pots {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.pot {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px;
}
.pot-name {
  font-size: 12px; font-weight: 700; color: var(--dim);
  padding-bottom: 6px; margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.pot-row {
  display: flex; align-items: center; gap: 7px;
  padding: 3px 0; font-size: 13px; color: var(--dim);
}
.pot-row .crest-cell { width: 18px; height: 16px; }
.pot-row .nm { flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }

.pot-row.human { color: var(--fg); font-weight: 700; }
.pot-row.me { color: var(--accent-2); }



.league-box { margin-top: 16px; }
.league-box summary {
  cursor: pointer; color: var(--dim); font-size: 14px; padding: 4px 0;
}
.league-box summary::marker { color: var(--faint); }

.ltable { margin-top: 8px; }

.ltable.folded .lfold, .ltable:not(.folded) .lgap { display: none; }
.lgap { text-align: center; color: var(--faint); font-size: 13px; line-height: 1; padding: 2px 0 6px; }
.btn.tiny.lt-more { display: block; margin: 6px auto 0; }

.lrow {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; font-size: 13px;
  border: 1px solid transparent; border-radius: 8px;
}
.lrow:nth-child(odd) { background: var(--card); }

.lrow.cut { border-bottom-color: var(--line-strong); border-radius: 8px 8px 0 0; }
.lrow.human { color: var(--fg); }
.lrow.human .nm { font-weight: 700; }
.lrow.me { border-color: var(--accent); background: var(--card-2); }
.lrow .no {
  min-width: 22px; text-align: right; color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.lrow .crest-cell { width: 18px; height: 16px; }
.lrow .nm { flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; color: var(--dim); }
.lrow.human .nm, .lrow.me .nm { color: var(--fg); }
.lrow .wd, .lrow .gd {
  color: var(--faint); font-variant-numeric: tabular-nums;
  min-width: 40px; text-align: right;
}
.lrow .pt {
  font-weight: 700; min-width: 24px; text-align: right;
  font-variant-numeric: tabular-nums;
}




.live-clock {
  margin: 12px 0 10px; padding: 10px 14px; border-radius: var(--r);
  background: var(--card); border: 1px solid var(--line);
  text-align: center; font-size: 14px; color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.live-clock:empty { display: none; }
.live-clock.mine {
  background: linear-gradient(150deg, var(--feature), var(--card));
  border-color: var(--accent); color: var(--fg); font-weight: 700;
}

.live-clock.urgent { color: var(--loss); animation: clockpulse 1s ease-in-out infinite; }
@keyframes clockpulse { 50% { opacity: .5; } }


.seat.onclock {
  border-color: var(--accent);
  background: linear-gradient(150deg, var(--feature), var(--card));
}
.seat .picking {
  margin-left: auto; font-size: 12px; font-weight: 700; color: var(--fg);
  background: var(--accent); border-radius: 6px; padding: 2px 8px;
}

.seat .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4caf7d; flex: none;
}
.seat .dot.off { background: var(--faint); }


.board-title { font-size: 13px; color: var(--faint); margin: 12px 0 6px; }
.board {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 5px;
}
.board-cell {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 7px; font-size: 12px;
  border-left-width: 3px; border-left-color: var(--line);
}
.board-cell.on { border-left-color: var(--accent); }
.board-cell .pos { display: block; color: var(--faint); font-size: 11px; }
.board-cell .who {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.board-cell.on .who { color: var(--fg); font-weight: 600; }



.bracket { display: flex; flex-direction: column; gap: 14px; }
.bracket-round > .rd-name {
  font-size: 13px; color: var(--faint); letter-spacing: 1px; margin-bottom: 6px;
}
.bracket-round.final > .rd-name { color: var(--gold); }

.tie {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 11px; margin-bottom: 6px;
}

.tie .side {
  display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 14px;
}
.tie .crest-cell { width: 20px; height: 18px; }

.tie .side.out { color: var(--faint); }
.tie .side.won .nm { font-weight: 700; }
.tie .side .nm { flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.tie .side.human .nm::before {
  content: "●"; color: var(--accent); font-size: 10px; margin-right: 5px;
  vertical-align: middle;
}
.tie .side.me .nm { color: var(--accent-2); }
.tie .side .sc { font-variant-numeric: tabular-nums; font-weight: 700; }
.tie .note { font-size: 11px; color: var(--gold); margin-top: 3px; }



@media (min-width: 900px) {
  #topbar, #app { max-width: 1180px; }

  
  .screen { max-width: 900px; margin: 0 auto; }

  
  .player-stats, .fixtures.compact, .awards, .seats {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px;
  }
  
  .result-table { grid-template-columns: repeat(8, 1fr); }

  
  .fixtures:not(.compact) .fx, .rank-row, .lrow, .history-row {
    padding-left: 140px; padding-right: 140px;
  }
  
  .tie { padding-left: 70px; padding-right: 70px; }

  
  .fx .rd { width: 86px; flex: none; }

  #screen-draft {
    max-width: none;
    display: grid;
    grid-template-columns: 480px minmax(0, 1fr);
    gap: 0 26px;
    align-items: start;
    grid-template-areas: "pitch top" "pitch cands" "pitch acts";
    grid-template-rows: auto auto 1fr;
  }
  #screen-draft .draft-top { grid-area: top; }
  
  #screen-draft .pitch-wrap {
    grid-area: pitch; margin-top: 0;
    position: sticky; top: 12px;
  }
  #screen-draft .candidates { grid-area: cands; }
  #screen-draft .draft-actions { grid-area: acts; align-self: end; }
  
  #screen-draft .cand-list { max-height: none; }

  
  #screen-liveroom {
    max-width: none;
    display: grid;
    grid-template-columns: 480px minmax(0, 1fr);
    gap: 0 26px;
    align-items: start;
    grid-template-areas: "pitch head" "pitch cands" "pitch acts";
    grid-template-rows: auto auto 1fr;
  }
  #screen-liveroom .live-head { grid-area: head; }
  #screen-liveroom .pitch-wrap {
    grid-area: pitch; margin-top: 0;
    position: sticky; top: 12px;
  }
  #screen-liveroom .candidates { grid-area: cands; }
  
  #screen-liveroom #live-actions { grid-area: acts; align-self: end; }
  #screen-liveroom[data-phase="lobby"] #live-actions { align-self: start; }
  #screen-liveroom .cand-list { max-height: none; }

  
  #screen-preview { max-width: 640px; }

  
  #screen-preview .badge-wrap, #screen-preview .slot .badge { width: 56px; }
  #screen-preview .slot .badge { height: 56px; font-size: 21px; border-width: 2px; }
  #screen-preview .slot-body { width: 130px; margin-left: -65px; top: -28px; }
  #screen-preview .slot .nm { font-size: 16px; line-height: 1.2; }
  #screen-preview .slot .ps { font-size: 14px; }
  #screen-preview .natflag { width: 18px; height: 12px; }
  #screen-preview .slot-crest { right: -13px; top: -6px; height: 24px; max-width: 32px; }
  
  #screen-preview .slots { inset: 26px 8px 56px; }

  
  .slot-body { width: 104px; margin-left: -52px; }
  .slot .nm { font-size: 14px; }
  .slot .ps { font-size: 13px; }

  
  #credit, .legal { max-width: 620px; margin-left: auto; margin-right: auto; }
  .hero .tagline { max-width: 620px; margin-left: auto; margin-right: auto; }

  
  .turn-pop { padding: 20px 40px; }
  .turn-pop .tp-who { font-size: 28px; }
  .turn-pop .tp-sub { font-size: 14px; }
}

@media (max-width: 380px) {
  .code-card .code { font-size: 42px; }
  .slot-body { width: 50px; margin-left: -25px; top: -15px; }
  .badge-wrap, .slot .badge { width: 30px; }
  .slot .badge { height: 30px; font-size: 13px; }
  
  .slot:not(.filled) .badge { font-size: 11px; }
  .slot-crest { right: -8px; top: -4px; height: 15px; max-width: 20px; }
  
  .crest-cell.big { width: 42px; height: 42px; }
  .wheel-club { font-size: 19px; }
  
  .lrow { gap: 6px; }
  .lrow .crest-cell { width: 16px; height: 14px; }
}



.interlude { margin: 4px 0 8px; }

.il-head { text-align: center; margin-bottom: 14px; }
.il-kicker {
  font-size: 13px; font-weight: 700; letter-spacing: .18em; color: var(--fg);
}
.il-verdict {
  margin-top: 6px; font-size: 26px; font-weight: 900; line-height: 1.2;
}
.il-verdict.ok { color: var(--accent-2); }
.il-verdict.out { color: var(--loss); }

.il-verdict.wait { color: var(--dim); font-size: 20px; }


.cw-list {
  display: flex; flex-direction: column; gap: 6px;
  margin: 4px auto 0; max-width: 340px;
}
.cw-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; font-size: 14px;
}
.cw-row.me { border-color: var(--accent); background: var(--card-2); }
.cw-nm { flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.cw-st { font-size: 12px; color: var(--faint); white-space: nowrap; }
.cw-st.done { color: var(--accent-2); font-weight: 700; }

.il-tablehead, .il-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; font-size: 14px;
}
.il-tablehead {
  font-size: 12px; font-weight: 700; color: var(--fg);
  border-bottom: 1px solid var(--line-strong); padding-bottom: 6px;
}

.il-tablehead .c-nm { margin-left: 30px; }

.il-table { display: flex; flex-direction: column; }
.il-row {
  background: var(--card-2); border: 1px solid var(--line-strong);
  border-radius: 8px; margin-top: 5px;
}

.il-row.me {
  background: var(--feature); border-color: var(--accent);
  font-weight: 800;
}
.il-row .c-rk { flex: none; width: 18px; text-align: right;
  font-variant-numeric: tabular-nums; color: var(--dim); }
.il-row.me .c-rk { color: var(--accent-2); }
.il-row .c-nm, .il-tablehead .c-nm {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.il-row .c-nm em { font-style: normal; font-size: 12px; color: var(--dim); }
.il-row .c-wd, .il-tablehead .c-wd { flex: none; width: 52px; text-align: center;
  font-variant-numeric: tabular-nums; }
.il-row .c-gd, .il-tablehead .c-gd { flex: none; width: 30px; text-align: right;
  font-variant-numeric: tabular-nums; color: var(--dim); }
.il-row.me .c-gd { color: var(--fg); }
.il-row .c-pt, .il-tablehead .c-pt { flex: none; width: 26px; text-align: right;
  font-weight: 900; font-variant-numeric: tabular-nums; }
.crest-cell.mine {
  font-size: 11px; font-weight: 800; color: var(--accent-2);
  border: 1px solid var(--accent); border-radius: 50%;
  width: 20px; height: 20px;
}


.il-cut {
  margin: 8px 0 3px; font-size: 12px; font-weight: 700; color: var(--gold);
  text-align: center; position: relative;
}
.il-cut::before, .il-cut::after {
  content: ""; position: absolute; top: 50%; width: calc(50% - 52px);
  border-top: 1px dashed var(--gold);
}
.il-cut::before { left: 0; }
.il-cut::after { right: 0; }

.il-road { margin-top: 18px; }
.il-road.out {
  text-align: center; font-size: 15px; font-weight: 700; color: var(--loss);
  background: var(--card-2); border: 1px solid var(--loss);
  border-radius: var(--r); padding: 14px;
}
.il-ko {
  display: flex; align-items: center; gap: 8px; margin-top: 6px;
  background: var(--card-2); border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 9px 10px; font-size: 14px;
}
.il-ko .k-rd { flex: none; width: 60px; font-size: 12px; font-weight: 700; color: var(--fg); }
.il-ko .k-nm { flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.il-ko .k-nm em { font-style: normal; font-size: 12px; color: var(--dim); }
.il-ko .k-legs { flex: none; font-size: 12px; color: var(--dim); }
.il-kicker.mt { margin-top: 16px; }
.il-note {
  margin: 6px 0 2px; font-size: 12px; line-height: 1.5; color: var(--faint);
  text-align: center;
}




.kob { display: block; width: 100%; height: auto; margin: 10px 0 2px; }
.kob-ln { fill: none; stroke: var(--line-strong); stroke-width: 1; }

.kob-ln.on { stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; }

.kob-me .ring { fill: var(--feature); stroke: var(--accent); stroke-width: 1.6; }
.kob-me .tx { fill: var(--accent-2); font-size: 11px; font-weight: 800; }
.kob-me .ring-top { fill: none; stroke: var(--accent); stroke-width: 1.6; }

.kob-mono { fill: var(--faint); font-size: 9px; font-weight: 700; }

.kob-yr { fill: var(--gold); font-size: 7.5px; font-weight: 700; }
.kob-rd { fill: var(--faint); font-size: 9px; letter-spacing: .04em; }

html.bg-warm .kob-cup, html.bg-grass .kob-cup {
  filter:
    drop-shadow(1px 0 0 var(--crest-outline)) drop-shadow(-1px 0 0 var(--crest-outline))
    drop-shadow(0 1px 0 var(--crest-outline)) drop-shadow(0 -1px 0 var(--crest-outline));
}




.cb-code, .kp-display { -webkit-user-select: text; user-select: text; }



.hero-name span { display: block; }
.hero-name { font-size: 44px; letter-spacing: .14em; text-indent: .14em; }
@media (max-width: 360px) { .hero-name { font-size: 38px; } }

#topbar .tb-brand {
  margin: 0; font-size: 18px; font-weight: 800; letter-spacing: .06em; white-space: nowrap;
}

body:not([data-screen="home"]) .tb-left { padding-left: 46px; }
#topbar { align-items: center; }
.tb-left { min-width: 0; }



.avatar {
  display: inline-block; flex: none; border-radius: 50%;
  object-fit: cover; background: var(--card-2);
}
.avatar.initial {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-on); font-weight: 800;
}


.user-chip { display: flex; align-items: center; gap: 9px; min-width: 0; }
.tb-avatar { width: 32px; height: 32px; font-size: 15px; }
.tb-nick {
  font-size: 16px; font-weight: 700; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body.has-user[data-screen="home"] .tb-left { display: block; }
body.has-user[data-screen="home"] #topbar { justify-content: space-between; }


.avatar.ms-crest.me { width: 54px; height: 54px; padding: 0; font-size: 22px; }
img.avatar.ms-crest.me { border: 1px solid var(--line-strong); }


.avatar.crest-cell.mine { width: 20px; height: 20px; font-size: 11px; }
img.avatar.crest-cell.mine { border: 1px solid var(--accent); }



.ad-row { margin-top: 10px; }

.btn.ad { margin-top: 0; }

.btn.big.ad { font-size: 16px; letter-spacing: .02em; padding: 19px 10px; }
.ad-note { text-align: center; margin-top: 6px; }
#redraft-row { margin-top: 14px; }



.challenge-tag {
  margin: 8px 0 0; font-size: 13px; font-weight: 700; color: var(--gold); text-align: center;
}
.run-note {
  margin: -6px 0 12px; font-size: 13px; color: var(--dim); text-align: center;
}
.challenge-box {
  margin-top: 16px; padding: 12px 14px 10px;
  border: 1px dashed var(--line-strong); border-radius: var(--r);
  text-align: center;
}
.cb-label { font-size: 12px; font-weight: 700; color: var(--dim); letter-spacing: .1em; }
.cb-code {
  margin-top: 4px; font-size: 28px; font-weight: 900; letter-spacing: .1em;
  font-variant-numeric: tabular-nums; color: var(--fg);
}
.challenge-box .hint { margin-top: 4px; }



.modal {
  position: fixed; inset: 0; z-index: 35;
  display: flex; align-items: center; justify-content: center;
  padding: 18px; background: rgba(0, 0, 0, .58);
}
.modal-box {
  width: 100%; max-width: 360px;
  background: var(--bg-2); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); padding: 18px 16px 16px;
  animation: fade .18s ease;
}
.modal-title { margin: 0 0 6px; font-size: 18px; }
.modal-text { margin: 4px 0 0; font-size: 14px; line-height: 1.6; color: var(--dim); }
.modal-actions { display: flex; gap: 8px; margin-top: 14px; }
.modal-actions .btn { margin-top: 0; }
.modal-actions .btn.primary::before { content: none; }


.kp-display {
  margin-top: 12px; padding: 12px 8px;
  border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--card);
  font-size: 26px; font-weight: 800; letter-spacing: .08em; text-align: center;
  font-variant-numeric: tabular-nums;
}
.kp-display.empty { font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--faint); }
.kp-msg { min-height: 1.3em; margin: 6px 0; font-size: 13px; color: var(--loss); text-align: center; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kp-key {
  appearance: none; cursor: pointer; font: inherit;
  padding: 12px 0; font-size: 22px; font-weight: 700;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--card); color: var(--fg);
}
.kp-key:active { transform: scale(.96); }
.kp-key.del { font-size: 18px; color: var(--dim); }
.kp-key.ok { background: var(--accent); border-color: transparent; color: var(--accent-on); font-size: 17px; }



.share-card { z-index: 30; }
#share-actions .loading { padding: 18px 0; }


.share-card { align-items: flex-start; }
.share-box { margin: auto 0; }
.share-fig { margin: 0 0 12px; }
.share-cap { margin: 0 0 6px; font-size: 12px; font-weight: 700; color: var(--dim); }
.share-page { display: block; width: 100%; height: auto; border-radius: 10px; }
#share-actions {
  position: sticky; bottom: -14px; z-index: 1;
  margin: 0 -14px -14px; padding: 4px 14px 14px;
  background: var(--bg-2); border-top: 1px solid var(--line);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}


.ad-duo { display: flex; gap: 8px; }
.ad-duo > .ad-row { flex: 1 1 0; min-width: 0; }
.ad-duo .btn.ad { width: 100%; padding-left: 6px; padding-right: 6px; font-size: 14px; white-space: nowrap; }
#arrange-row { margin: 12px 0 4px; }


.cand-wrap.hinted > .cand { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 14px rgba(232, 189, 82, .28); }
.hint-tag {
  align-self: flex-start; margin: 0 0 4px; padding: 2px 10px;
  font-size: 12px; font-weight: 800; color: #2b1f02;
  background: var(--gold); border-radius: 999px;
}
.pos-pick .pchip.rec { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }


.share-page { cursor: zoom-in; }
.share-cap { display: flex; justify-content: space-between; }
.share-zoom { font-weight: 600; opacity: .8; }
.zoom-view {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column;
  background: rgba(0, 0, 0, .92);
}
.zoom-stage { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 12px; }
.zoom-img { display: block; width: 100%; height: auto; margin: 0 auto; border-radius: 8px; cursor: zoom-in; }
.zoom-view.zoomed .zoom-img { width: 250%; max-width: none; cursor: zoom-out; }
.zoom-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, .6);
}
.zoom-tip { flex: 1; margin: 0; font-size: 13px; color: rgba(255, 255, 255, .8); }
.zoom-bar .btn { width: auto; margin: 0; padding: 8px 18px; color: #fff; border-color: rgba(255, 255, 255, .4); }


.my-record {
  margin: 22px 0 6px; padding: 16px 14px 10px;
  border: 1px solid var(--line-strong); border-radius: 22px;
  background: var(--card);
}
.my-record #home-stats { margin: 0 0 8px; }

.my-record .history-row { padding: 10px 2px; font-size: 14px; border-bottom-color: var(--line-soft); }
.my-record .history-row:last-child { border-bottom: 0; }
.history-row .hr-left { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr-tag {
  display: inline-block; padding: 1px 7px; margin-right: 2px;
  font-size: 11px; font-weight: 800; color: #2b1f02; background: var(--gold); border-radius: 999px;
}
.record-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; }
.record-actions .btn { width: auto; margin: 0; }
#btn-clear-history { margin-left: auto; }



html.bg-ucl {
  --bg: #060d24;
  --bg-2: #0d1838;
  --card: #0f1c40;
  --card-2: #15264f;
  --line: #243564;
  --line-soft: #15224a;
  --line-strong: #3a5190;
  --fg: #f1f4ff;
  --dim: #dfe5f7;
  --faint: #c3cbe6;
  --accent: #4db2ff;
  --accent-2: #7fc8ff;
  --accent-on: #031233;
  --gold: #e8bd52;
  --win: #4fc27a;
  --draw: #8a94b4;
  --loss: #ff8f63;
  --pitch: #1b4a31;
  --pitch-2: #205638;
  --pitch-edge: #3f8f5f;
  --pitch-line: #ffffff45;
  --slot-bg: #06102acc;
  --slot-bg-on: #06102aee;
  --slot-ink: #ffffff;
  --slot-line: #ffffff44;
  --slot-sub: #ffffffdd;
  --slot-shadow: 0 1px 3px #000, 0 0 6px #000;
  --feature: #13306b;
  --feature-line: #2f5cb0;
  --toast-bg: #0f1c40f2;
  --crest-outline: #f2f5ff;
  --chem: #7fe6a0;
  --verdict-bg: #102a66;
  --verdict-ink: #f4f7ff;
  --tier-gold-ink: #ffd75e;
  --tier-plat-ink: #fffaea;
}

html.bg-ucl body {
  background-color: #060d24;
  background-image:
    radial-gradient(900px 420px at 50% -160px, rgba(77, 140, 255, .38), transparent 70%),
    radial-gradient(520px 360px at 100% 0, rgba(150, 90, 255, .16), transparent 70%),
    radial-gradient(1px 1px at 22px 34px, rgba(255, 255, 255, .7), transparent 60%),
    radial-gradient(1px 1px at 96px 120px, rgba(255, 255, 255, .5), transparent 60%),
    radial-gradient(1.5px 1.5px at 170px 60px, rgba(255, 255, 255, .8), transparent 60%),
    radial-gradient(1px 1px at 140px 190px, rgba(255, 255, 255, .45), transparent 60%),
    radial-gradient(1px 1px at 60px 210px, rgba(255, 255, 255, .6), transparent 60%),
    linear-gradient(180deg, #0a1640 0%, #060d24 38%, #050a1d 100%);
  background-size: 100% 100%, 100% 100%, 220px 240px, 220px 240px, 220px 240px,
    220px 240px, 220px 240px, 100% 100%;
  background-repeat: no-repeat, no-repeat, repeat, repeat, repeat, repeat, repeat, no-repeat;
  min-height: 100vh;
}
html.bg-ucl #topbar { border-bottom-color: rgba(255, 255, 255, .08); }
html.bg-ucl .btn.primary {
  background: linear-gradient(180deg, #7cc6ff, #3d9dff);
  box-shadow: 0 8px 24px rgba(61, 157, 255, .28), inset 0 1px 0 rgba(255, 255, 255, .45);
}
html.bg-ucl .btn.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #9ad4ff, #56abff);
}
html.bg-ucl .wheel-card {
  background: linear-gradient(135deg, #172a62, #0f1c40);
  border-color: var(--line-strong);
}
html.bg-ucl .verdict-card {
  background:
    radial-gradient(420px 160px at 50% 0, rgba(77, 178, 255, .25), transparent 70%),
    linear-gradient(180deg, #13306b, #0d1f4d);
}

.screen-title { font-size: 24px; font-weight: 800; letter-spacing: .06em; margin: 10px 0 4px; }
.sub { font-size: 15px; font-weight: 700; letter-spacing: .08em; color: var(--fg); margin: 28px 0 10px; }
.btn.big { padding: 18px; font-size: 18px; letter-spacing: .06em; }
.btn.primary::before { content: none; }
.verdict-card { padding: 28px 18px; border-radius: var(--r-lg); }
.verdict-card h2 { font-size: 40px; }
.verdict-card.champion { border-color: var(--gold); }
.verdict-card .vc-kicker {
  font-size: 12px; font-weight: 700; letter-spacing: .24em; text-indent: .24em;
  color: var(--verdict-ink); opacity: .75; margin-bottom: 6px;
}
.wheel-club { font-size: 24px; }
.crest-cell.big { width: 60px; height: 60px; }

.hero { position: relative; padding: 4px 0 18px; text-align: center; }

html:not(.bg-ucl) .hero {
  margin: 0 -4px; padding: 6px 12px 22px; border-radius: 26px; color: #f1f4ff;
  background:
    radial-gradient(520px 240px at 50% -60px, rgba(77, 140, 255, .45), transparent 70%),
    linear-gradient(180deg, #0c1a48, #060d24);
}
html:not(.bg-ucl) .hero .tagline { color: #dfe5f7; }
.hero-stage {
  position: relative; height: 200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.hero-stage .beam {
  position: absolute; top: -30px; width: 110px; height: 300px;
  background: linear-gradient(180deg, rgba(170, 205, 255, .42), rgba(170, 205, 255, 0));
  filter: blur(8px); transform-origin: top center; pointer-events: none;
}
.hero-stage .beam.l { left: 6%; transform: rotate(-26deg); }
.hero-stage .beam.r { right: 6%; transform: rotate(26deg); }

.cup-glow {
  position: absolute; left: 50%; top: 50%; width: 230px; height: 230px;
  transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(200, 220, 255, .42), rgba(120, 160, 255, .16) 55%, transparent);
}
.hero-cup {
  position: relative; height: 188px; width: auto;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .45));
}
.hero-kicker {
  margin: 4px 0 0; font-size: 13px; font-weight: 800; letter-spacing: .32em; text-indent: .32em;
  color: #e8bd52;
}
.hero-name {
  margin: 6px 0 0; font-size: 46px; font-weight: 900; letter-spacing: .12em; text-indent: .12em;
  line-height: 1.12; color: #ffffff;
  background: linear-gradient(180deg, #ffffff 30%, #b8c6ec);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-name span { display: block; }

.hero .hero-name { font-size: 40px; }
@media (max-width: 360px) {
  .hero .hero-name { font-size: 36px; }
  .hero-stage { height: 178px; }
  .hero-cup { height: 168px; }
}
.hero .tagline { margin-top: 10px; font-size: 15px; }

.crest-wall {
  margin: 6px -16px 22px; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.cw-row { overflow: hidden; padding: 6px 0; }
.cw-track {
  display: flex; gap: 22px; width: max-content;
  animation: cw-move 46s linear infinite;
}
.cw-row.rev .cw-track { animation-direction: reverse; animation-duration: 52s; }
.cw-crest { height: 38px; width: auto; flex: none; opacity: .92; }
@keyframes cw-move { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .cw-track { animation: none; }
}

.btn.cta { margin-top: 4px; font-size: 20px; padding: 20px; border-radius: 999px; }
.cta-note { margin: 8px 0 0; text-align: center; font-size: 13px; color: var(--faint); }
.menu { gap: 12px; margin: 22px 0 8px; }
.menu-item { padding: 18px; gap: 14px; border-radius: 20px; }
.menu-item .t { font-size: 17px; }
.menu-item .mi-icon {
  flex: none; width: 44px; height: 44px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 900; color: var(--accent-2);
  background: var(--bg-2); border: 1px solid var(--line-strong);
}
.menu-item.feature .mi-icon { color: var(--gold); border-color: var(--gold); }
.menu-item.resume .mi-icon { color: var(--win); }
#home-stats { margin-top: 18px; }
.stats-strip div { padding: 12px 6px; border-radius: 14px; }
.stats-strip b { font-size: 22px; }

.champ-board {
  margin: 22px 0 6px; padding: 16px 14px 12px;
  border: 1px solid var(--line-strong); border-radius: 22px;
  background:
    radial-gradient(360px 120px at 50% 0, rgba(232, 189, 82, .16), transparent 70%),
    var(--card);
}
.board-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.board-head h3 {
  margin: 0; font-size: 20px; font-weight: 900; letter-spacing: .1em; color: var(--gold);
}
.board-head span { font-size: 13px; color: var(--faint); }
.lb-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 6px; border-bottom: 1px solid var(--line-soft);
}
.lb-row:last-child { border-bottom: 0; }
.lb-no {
  flex: none; width: 24px; text-align: center; font-weight: 900;
  font-variant-numeric: tabular-nums; color: var(--faint);
}
.lb-row.top1 .lb-no { color: #f6cf62; font-size: 18px; }
.lb-row.top2 .lb-no { color: #c9d3e2; font-size: 17px; }
.lb-row.top3 .lb-no { color: #e0a36c; font-size: 16px; }
.lb-av { width: 32px; height: 32px; font-size: 14px; }
.lb-row.top .lb-av { width: 36px; height: 36px; }
.lb-nm {
  flex: 1; min-width: 0; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lb-n { flex: none; font-variant-numeric: tabular-nums; }
.lb-n b { font-size: 20px; color: var(--gold); }
.lb-n small { color: var(--dim); }
.lb-n em { font-style: normal; font-size: 12px; color: var(--faint); }
.lb-empty { text-align: center; color: var(--faint); font-size: 14px; margin: 14px 0; }
.lb-row.me {
  border-radius: 12px; border-bottom-color: transparent;
  background: rgba(232, 189, 82, .14); box-shadow: inset 0 0 0 1px rgba(232, 189, 82, .45);
}
.lb-me {
  margin-bottom: 8px; padding: 10px 12px; border-radius: 14px;
  background: var(--bg-2); border: 1px solid var(--line); text-align: center; font-size: 14px;
}
.lb-me b { color: var(--gold); font-size: 18px; margin: 0 2px; }
.lb-me-tip { color: var(--dim); }
.lb-more { display: block; margin: 8px auto 0; }
.lb-more[hidden] { display: none; }
.lb-rule { margin: 10px 2px 0; font-size: 12px; color: var(--faint); line-height: 1.5; }

.lb-past { margin-top: 22px; }
.lb-past[hidden], .lb-sub[hidden] { display: none; }
.lb-past:not([hidden]) + .champ-board { margin-top: 10px; }
.lb-past-item {
  border: 1px solid var(--line-strong); border-radius: 18px; background: var(--card); overflow: hidden;
}
.lb-past-item + .lb-past-item { margin-top: 8px; }
.lb-fold {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 14px 16px; border: 0; background: none;
  color: var(--gold); font: inherit; font-size: 16px; font-weight: 900; letter-spacing: .06em; cursor: pointer;
}
.lb-fold small { margin-left: auto; font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--faint); }
.lb-fold::after { content: "▾"; margin-left: 8px; color: var(--faint); transition: transform .2s; }
.lb-fold[aria-expanded="true"]::after { transform: rotate(180deg); }
.lb-sub { padding: 0 14px 12px; }

.title-receipt { margin: -4px 0 12px; text-align: center; font-size: 14px; color: var(--dim); }
.title-receipt b { color: var(--gold); }

.live-card {
  margin: 16px 0 6px; padding: 4px 14px 16px;
  border: 1px solid var(--line-strong); border-radius: 22px; background: var(--card);
}
.live-who { text-align: center; }
.live-who b { color: var(--fg); }
.room-bar .code { letter-spacing: .18em; font-variant-numeric: tabular-nums; }
.seat .seat-av { width: 26px; height: 26px; font-size: 12px; margin-right: 2px; }

.crest-cell.human-mark, .ms-crest.human-mark { color: var(--gold); border-color: var(--gold); }

#btn-live-invite[hidden] + #btn-live-leave { grid-column: 1 / -1; flex: 1 1 100%; }

#btn-start {
  position: sticky; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 5;
}

#btn-start.stuck {
  box-shadow: 0 -34px 26px 6px var(--bg), 0 8px 24px rgba(61, 157, 255, .28);
}

@media (max-width: 899px) {
  
  #screen-draft .ad-row { margin-top: 8px; }
  #screen-draft .ad-note { margin-top: 3px; font-size: 12px; }
  
  #screen-draft .cand-list { max-height: 52vh; }
  
  #screen-draft .candidates { min-height: calc(52vh + 34px); }
  #screen-draft .pitch-wrap { margin-top: 18px; }
  #screen-draft .swap-tip { padding: 7px 10px; font-size: 13px; }

  
  #screen-draft .power { padding: 8px 12px; gap: 10px; }
  #screen-draft .pw-total { width: 62px; padding-right: 10px; }
  #screen-draft .pw-total b { font-size: 32px; }
  #screen-draft .pw-total small { font-size: 12px; }
  #screen-draft .pw-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
  #screen-draft .pw-k { width: auto; font-size: 12px; }
  #screen-draft .pw-bar { height: 7px; }
  #screen-draft .pw-v { width: 22px; font-size: 14px; }
}

.fold-box {
  margin-top: 12px; border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--card);
}
.fold-box > summary {
  cursor: pointer; padding: 13px 14px; font-size: 15px; font-weight: 700; letter-spacing: .06em;
  color: var(--fg); list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.fold-box > summary::-webkit-details-marker { display: none; }
.fold-box > summary::after { content: "展开 ▾"; font-size: 13px; font-weight: 600; color: var(--faint); }
.fold-box[open] > summary::after { content: "收起 ▴"; }
.fold-box > :not(summary) { margin: 0 10px 10px; }
#screen-result .share-row { flex-direction: column; gap: 10px; }
#screen-result .share-row .btn { width: 100%; }
#btn-home { margin-top: 14px; }




body.has-login[data-screen="home"] .tb-left { display: flex; align-items: center; }
body.has-login[data-screen="home"] .tb-brand { display: none; }
.tb-left:has(.tb-login) { display: flex; align-items: center; gap: 10px; }
.tb-login {
  flex: none; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--card-2); color: var(--fg);
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.tb-login:disabled { opacity: .55; cursor: default; }


:root { --sup: #fb7299; --sup-soft: rgba(251, 114, 153, .16); --sup-line: rgba(251, 114, 153, .45); }


#topbar .corner-support {
  position: relative; margin-left: auto; flex: none; align-self: center;
  width: 34px; height: 34px; padding: 0;
  display: grid; place-items: center;
  border: 1px solid var(--sup-line); border-radius: 999px;
  background: var(--card-2); cursor: pointer;
}
body[data-screen="home"] #topbar .corner-support { align-self: flex-start; }
.sup-heart {
  font-size: 16px; line-height: 1; color: var(--sup);
  font-family: -apple-system, "Segoe UI", sans-serif;   
}
.sup-red {
  position: absolute; top: 3px; right: 3px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--sup); box-shadow: 0 0 0 2px var(--bg);
  opacity: 0; transition: opacity .2s;
}
.corner-support.has-dot .sup-red { opacity: 1; animation: supPulse 2.4s ease-in-out infinite; }
.corner-support.all-done { border-color: rgba(251, 114, 153, .25); }
@keyframes supPulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px rgba(251, 114, 153, .45); }
  50%      { box-shadow: 0 0 0 2px var(--bg), 0 0 0 7px rgba(251, 114, 153, 0); }
}


.sup-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(2, 6, 20, .68); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
}
.sup-overlay[hidden] { display: none; }
.sup-panel {
  position: relative; width: 100%; max-width: 560px; max-height: 86vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line-strong);
  border-top: 2px solid var(--sup-line);
  border-radius: var(--r-lg, 16px) var(--r-lg, 16px) 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  animation: supRise .26s ease both;
}
@keyframes supRise { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
.sup-close {
  position: absolute; top: 14px; right: 14px; width: 28px; height: 28px; line-height: 1;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: transparent; color: var(--faint); cursor: pointer; font-size: 12px;
}
.sup-title { margin: 0 0 6px; font-size: 18px; font-weight: 800; color: var(--fg); }
.sup-title::before { content: "❤"; color: var(--sup); margin-right: 6px; font-family: -apple-system, "Segoe UI", sans-serif; }
.sup-lead { margin: 0 0 14px; font-size: 13px; line-height: 1.6; color: var(--dim); }

.sup-progress { height: 5px; border-radius: 999px; background: var(--card-2); overflow: hidden; }
.sup-progress > i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--sup), var(--gold));
  transition: width .45s cubic-bezier(.3, 1.2, .5, 1);
}
.sup-count { margin: 6px 0 14px; font-size: 12px; color: var(--faint); text-align: right; }

.sup-task {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: var(--r, 12px);
  background: var(--card-2);
}
.sup-task.ok { border-color: var(--sup-line); }
.sup-ico {
  width: 42px; height: 42px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--sup-soft); color: var(--sup); font-size: 17px; font-weight: 700;
}
.sup-ico.sup-pic { position: relative; overflow: hidden; }
.sup-ico.sup-pic > img { width: 100%; height: 100%; object-fit: cover; display: block; }

.sup-ico.sup-avatar { border-radius: 50%; background: transparent; }
.sup-ico.sup-cover { border-radius: 8px; border: 1px solid var(--line); background: var(--card); }
.sup-ico.sup-pic.ok::after {
  content: "✓"; position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(251, 114, 153, .62); color: #fff; font-size: 17px; font-weight: 700;
}
.sup-task-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.sup-task-meta > b {
  font-size: 14px; font-weight: 700; color: var(--fg);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sup-task-meta > span { font-size: 12px; color: var(--faint); }
.sup-dots { display: flex; gap: 6px; flex-wrap: wrap; }
.sup-dot {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 11px; font-style: normal; color: var(--faint);
  filter: grayscale(1); opacity: .75;
}
.sup-dot > em { font-style: normal; font-size: 12px; line-height: 1; }
.sup-dot.on { filter: none; opacity: 1; color: var(--gold); border-color: var(--gold); }
.sup-go {
  flex-shrink: 0; padding: 6px 12px; border: 0; border-radius: 999px;
  background: var(--sup); color: #fff;
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(251, 114, 153, .28);
}
.sup-go.done { background: transparent; color: var(--faint); border: 1px solid var(--line); box-shadow: none; cursor: default; }

.sup-soon .sup-go, .sup-go:disabled { background: transparent; color: var(--faint); border: 1px dashed var(--line); box-shadow: none; cursor: default; }
.sup-soon .sup-cover { display: grid; place-items: center; color: var(--faint); border-style: dashed; }
.sup-note { margin: 10px 0 0; font-size: 12px; color: var(--faint); }
.sup-note[hidden] { display: none; }


.sup-inline {
  margin: 16px 0 4px; padding: 12px 12px 10px;
  border: 1px solid var(--sup-line); border-radius: var(--r-lg, 16px);
  background: linear-gradient(100deg, rgba(251, 114, 153, .1), rgba(232, 189, 82, .06));
}
.sup-inline-lead {
  display: flex; align-items: center; gap: 6px; margin: 0 0 10px;
  font-size: 14px; font-weight: 700; color: var(--fg);
}
.sup-inline-lead > span { color: var(--sup); font-family: -apple-system, "Segoe UI", sans-serif; }
.sup-inline .sup-task { background: var(--card); }
.sup-inline .sup-task:last-of-type { margin-bottom: 0; }
