/* tier ranking clip styles */
:root {
  --tier-s: #ff5d5d;
  --tier-a: #ff9a3d;
  --tier-b: #ffd23d;
  --tier-c: #5fd66b;
  --tier-d: #43c5e0;
  --ink: #f4f7ff;
  --ink-dim: #9fb0cd;
  --panel: rgba(12, 20, 38, 0.62);
  --panel-line: rgba(120, 150, 200, 0.22);
  --card-bg: rgba(18, 28, 50, 0.92);
  --card-line: rgba(150, 175, 220, 0.28);
  --font: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; background: #04060d; overflow: hidden; }
.stage {
  position: relative;
  width: 1080px;
  height: 1920px;
  margin: 0 auto;
  overflow: hidden;
  font-family: var(--font);
  color: var(--ink);
  transform-origin: top left;
}
.bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.bg-photo { opacity: 0.35; filter: brightness(0.6); }
.bg-main.show { opacity: 1; }
.bg-divider { mix-blend-mode: screen; }
.bg-divider.show { opacity: 0.55; }
.cover {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.cover.show { opacity: 1; }
.cover.hide { opacity: 0; pointer-events: none; }
.cover-art {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.06);
  transition: transform 2.2s ease;
}
.cover.show .cover-art { transform: scale(1); }
.cover-text { position: relative; padding: 0 90px 260px; }
.cover-kicker {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 14px;
  color: var(--tier-b);
  margin-bottom: 26px;
}
.cover-title {
  font-size: 118px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 2px;
  text-shadow: 0 8px 40px rgba(0, 0, 0, 0.55);
}
.cover-sub {
  margin-top: 30px;
  font-size: 40px;
  font-weight: 600;
  color: var(--ink-dim);
  letter-spacing: 1px;
}
.boards {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding: 40px 56px 48px;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.boards.show { opacity: 1; }
.board-head { flex: 0 0 auto; text-align: center; margin-bottom: 18px; }
.board-title { font-size: 54px; font-weight: 900; letter-spacing: 1px; }
.race {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 28px;
  padding: 18px 24px 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.race-year { flex: 1 1 auto; margin-bottom: 22px; }
.bar-bill-label {
  position: absolute;
  left: 60px;
  right: 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.bar-bill-label.show { opacity: 1; }
.race-term { flex: 0 0 auto; height: 470px; }
.race-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 12px;
  padding: 0 4px;
}
.race-unit { font-size: 24px; font-weight: 600; color: var(--ink-dim); }
.race-track {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}
.race-track.live .bar-row,
.race-track.live .bar-fill {
  transition: none !important;
}
.year-watermark {
  position: absolute;
  right: 10px;
  bottom: 4px;
  font-size: 190px;
  font-weight: 900;
  color: rgba(255, 210, 61, 0.12);
  letter-spacing: 2px;
  pointer-events: none;
  z-index: 0;
  text-shadow: 0 0 60px rgba(255, 210, 61, 0.25), 0 0 120px rgba(255, 180, 50, 0.12);
}
.bar-row {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 30px;
  transform: translateY(0);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
  will-change: transform, opacity;
  z-index: 1;
}
.bar-row.show { opacity: 1; }
.bar-row.enter { animation: barPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes barPop {
  0% { transform: translateY(var(--y)) scale(0.7); }
  60% { transform: translateY(var(--y)) scale(1.06); }
  100% { transform: translateY(var(--y)) scale(1); }
}
.bar-row.current {
  z-index: 5;
}
.bar-row.swap-up { z-index: 6; }
.bar-row.swap-up .bar-fill {
  filter: brightness(1.22) saturate(1.18);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.18), 0 0 26px rgba(255,255,255,0.22), inset 0 -2px 6px rgba(0, 0, 0, 0.18);
  transform: scaleX(1.035);
}
.bar-row.swap-up .bar-rank,
.bar-row.swap-up .bar-value {
  color: #fff4c2;
  text-shadow: 0 0 14px rgba(255, 210, 61, 0.85);
}
.bar-row.swap-up .bar-track {
  transform: translateX(10px);
}
.bar-row.swap-down .bar-fill {
  filter: brightness(0.92) saturate(0.9);
  transform: scaleX(0.985);
}
.bar-row.swap-down .bar-track {
  transform: translateX(-6px);
}
.bar-row.take-lead { z-index: 8; }
.bar-row.take-lead .bar-fill {
  filter: brightness(1.28) saturate(1.22);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.2), 0 0 34px rgba(255, 210, 61, 0.38), inset 0 -2px 6px rgba(0,0,0,0.16);
  transform: scaleX(1.05);
}
.bar-row.take-lead .bar-rank,
.bar-row.take-lead .bar-value {
  color: #fff7d6;
  text-shadow: 0 0 18px rgba(255, 210, 61, 0.95);
}
.bar-row.take-lead .bar-track {
  transform: translateX(16px);
}
.bar-row.swap-up .bar-rank::after,
.bar-row.take-lead .bar-rank::after {
  content: "▲";
  margin-left: 6px;
  font-size: 13px;
  color: #fff1a6;
  vertical-align: middle;
}
.bar-row.swap-down .bar-rank::after {
  content: "▼";
  margin-left: 6px;
  font-size: 13px;
  color: #ff8a8a;
  vertical-align: middle;
}
.bar-rank {
  flex: 0 0 46px;
  text-align: right;
  font-size: 26px;
  font-weight: 800;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}
.bar-track {
  position: relative;
  flex: 1 1 auto;
  height: 100%;
  transition: transform 0.22s ease-out;
}
.bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  min-width: 13%;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.22s ease-out, filter 0.22s ease-out, box-shadow 0.22s ease-out;
  box-shadow: inset 0 -2px 6px rgba(0, 0, 0, 0.25);
  transform-origin: left center;
}
.bar-label {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 21px;
  font-weight: 800;
  color: #0b0f18;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.28);
  z-index: 2;
  pointer-events: none;
}
.bar-value {
  flex: 0 0 52px;
  text-align: left;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: color 0.2s ease-out, text-shadow 0.2s ease-out;
}
.race-term .bar-row { height: 52px; }
.race-term .bar-rank { flex-basis: 54px; font-size: 32px; }
.race-term .bar-label { font-size: 28px; }
.race-term .bar-value { font-size: 28px; }
.race-term .bar-fill { min-width: 28px; }
.board-foot {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 26px;
  font-weight: 600;
  color: var(--ink-dim);
}
