@font-face {
  font-family: "Kassen Serif";
  src: url("fonts/noto-serif-sc-display.woff2") format("woff2");
  font-weight: 600 800;
  font-display: swap;
}
@font-face {
  font-family: "Kassen Display";
  src: url("fonts/dela-gothic-title.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Kassen Han";
  src: url("fonts/noto-serif-sc-black-title.woff") format("woff");
  font-weight: 900;
  font-display: swap;
}
@font-face {
  font-family: "Kassen Sans";
  src: url("fonts/noto-sans-sc-ui.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Barlow SC";
  src: url("fonts/barlow-semi-condensed-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #fdf5f0;
  --paper: #fffbf7;
  --paper-2: #fff6ee;
  --ink: #2b1f38;
  --muted: #5d4d6b;
  --pink: #ff6e98;
  --pink-soft: #ffe5ee;
  --pink-deep: #d94875;
  --mint: #2ba593;
  --mint-soft: #dff7f2;
  --gold: #e6a832;
  --gold-soft: #fff4d9;
  --line-done: #f2a8be;
  --line-idle: #d6c2d2;
  --shadow: 0 10px 24px rgba(176, 122, 142, 0.14);
  --ribbon-bg: rgba(255, 251, 247, 0.94);
  --ribbon-bd: rgba(235, 168, 190, 0.62);
  --serif: "Kassen Serif", "Noto Serif SC", "Songti SC", serif;
  --display: "Kassen Display", "Kassen Serif", "Noto Serif SC", serif;
  --display-han: "Kassen Han", "Kassen Serif", "Noto Serif SC", serif;
  --sans: "Kassen Sans", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

body.theme-night {
  --bg: #151226;
  --paper: #221d3a;
  --paper-2: #292346;
  --ink: #f7f1ff;
  --muted: #cfc4e6;
  --pink: #ff7eb0;
  --pink-soft: rgba(255, 126, 176, 0.18);
  --pink-deep: #ffa6cb;
  --mint: #6be8d4;
  --mint-soft: rgba(107, 232, 212, 0.16);
  --gold: #ffd470;
  --gold-soft: rgba(255, 212, 112, 0.14);
  --line-done: #ff8fb8;
  --line-idle: rgba(208, 190, 235, 0.34);
  --shadow: 0 14px 32px rgba(6, 4, 18, 0.45);
  --ribbon-bg: rgba(36, 30, 62, 0.9);
  --ribbon-bd: rgba(255, 152, 194, 0.4);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  transition: background 0.45s ease, color 0.35s ease;
}
img { display: block; }
button { font-family: inherit; }

/* 全屏固定背景层（彻底消除“方块套方块”） */
.bg {
  position: fixed;
  inset: -24px;
  pointer-events: none;
  z-index: 0;
}
.bg-photo,
.bg-art-custom {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-repeat: no-repeat;
}
.bg-photo {
  background-image: url("img/kagu/room.jpg");
  background-position: center;
  filter: blur(10px) saturate(1.15);
  opacity: 0.17;
  transition: opacity 0.45s ease;
}
body.theme-night .bg-photo {
  background-image: url("img/kagu/moon-hall.webp");
  filter: blur(6px) saturate(1.22) brightness(0.70);
  opacity: 0.38;
}
body.has-custom-bg .bg-photo { opacity: 0; }
body.has-custom-bg .bg-art-custom {
  opacity: 0.32;
  filter: blur(4px) brightness(calc(var(--bg-bright, 60) / 60));
}

.bg-aura {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 190, 214, 0.34), transparent 42%),
    radial-gradient(circle at 82% 18%, rgba(162, 236, 224, 0.28), transparent 40%),
    radial-gradient(circle at 50% 62%, rgba(255, 224, 158, 0.28), transparent 46%);
  pointer-events: none;
  z-index: 1;
}
body.theme-night .bg-aura {
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 126, 176, 0.16), transparent 44%),
    radial-gradient(circle at 80% 18%, rgba(107, 232, 212, 0.14), transparent 44%),
    radial-gradient(circle at 50% 58%, rgba(155, 123, 255, 0.18), transparent 50%);
}

.bg-dots {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(rgba(232, 148, 178, 0.28) 1.8px, transparent 2px) 0 0 / 32px 32px;
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.45) 75%, transparent 100%);
  pointer-events: none;
  z-index: 2;
}
body.theme-night .bg-dots {
  background: radial-gradient(rgba(255, 224, 160, 0.22) 1.5px, transparent 2px) 0 0 / 38px 38px;
}

#fxCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 30;
}

/* 流式全屏内容容器 */
.board-shell {
  position: relative;
  z-index: 10;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: clamp(6px, 0.9vh, 14px) clamp(14px, 2vw, 38px) clamp(10px, 1.2vh, 16px);
}

/* 顶部标题区 + 第一排左右角落贴纸 */
.head {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: clamp(66px, 8.8vh, 102px);
  z-index: 15;
}
.head-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}
.corner-sticker.is-left {
  position: absolute;
  left: clamp(2px, 0.6vw, 18px);
  top: 0;
}
.corner-sticker.is-right {
  position: absolute;
  right: clamp(2px, 0.6vw, 18px);
  top: 0;
}
.corner-sticker img {
  height: clamp(64px, 9.6vh, 128px);
  width: auto;
}
.corner-sticker.is-left .say {
  left: calc(100% - 4px);
  top: clamp(8px, 1.4vh, 20px);
}
.corner-sticker.is-right .say {
  right: calc(100% - 4px);
  top: clamp(8px, 1.4vh, 20px);
}

.title-row {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1vw, 16px);
}
.title-row .logo {
  height: clamp(30px, 4vh, 46px);
  width: auto;
  filter: drop-shadow(0 2px 0 #fff) drop-shadow(0 6px 14px rgba(255, 110, 152, 0.24));
  transition: transform 0.28s cubic-bezier(0.22, 1.4, 0.36, 1);
}
.title-row .logo:hover { transform: scale(1.05) rotate(-1.5deg); }
body.theme-night .title-row .logo {
  filter: drop-shadow(0 0 12px rgba(255, 126, 176, 0.45));
}
.title-divider {
  width: 2px;
  height: clamp(26px, 3.6vh, 40px);
  border-radius: 2px;
  background: linear-gradient(180deg, var(--pink), var(--mint));
  opacity: 0.55;
  flex: 0 0 auto;
}
.title-row h1 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: clamp(8px, 0.8vw, 14px);
  font: 900 clamp(26px, 2.7vw, 42px)/1.1 var(--display-han);
  letter-spacing: 0.04em;
  color: var(--ink);
  white-space: nowrap;
}
.title-row h1 .title-kassen,
.title-row h1 .title-main {
  position: relative;
  display: inline-block;
  line-height: 1;
  color: #fff;
  transform: skewX(-6deg);
}
.title-row h1 .title-kassen {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(22px, 2.15vw, 34px);
  letter-spacing: 0.06em;
  -webkit-text-stroke: 6px #fff;
  text-shadow: 0 5px 12px rgba(232, 44, 106, 0.3);
}
.title-row h1 .title-main {
  font-family: var(--display-han);
  font-weight: 900;
  font-size: clamp(32px, 3.3vw, 54px);
  letter-spacing: 0.04em;
  -webkit-text-stroke: 6px #fff;
  text-shadow: 4px 5px 0 rgba(255, 110, 152, 0.55), 0 8px 18px rgba(130, 68, 106, 0.25);
}
.title-row h1 .title-kassen::after,
.title-row h1 .title-main::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  -webkit-text-stroke: 0;
  text-shadow: none;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.title-row h1 .title-kassen::after {
  background-image: linear-gradient(112deg, #e82c6a 0%, #ff5c8d 52%, #f59428 100%);
}
.title-row h1 .title-main::after {
  background-image: linear-gradient(180deg, #43285c 0%, #22142f 70%, #5a2448 100%);
}
body.theme-night .title-row h1 .title-kassen {
  -webkit-text-stroke: 5px rgba(24, 16, 44, 0.92);
  color: rgba(24, 16, 44, 0.92);
  text-shadow: 0 0 18px rgba(255, 110, 164, 0.55);
}
body.theme-night .title-row h1 .title-main {
  -webkit-text-stroke: 6px rgba(24, 16, 44, 0.92);
  color: rgba(24, 16, 44, 0.92);
  text-shadow: 4px 5px 0 rgba(255, 126, 176, 0.45), 0 0 22px rgba(107, 232, 212, 0.4);
}
body.theme-night .title-row h1 .title-kassen::after {
  background-image: linear-gradient(112deg, #ff6ea4 0%, #ffa8cb 52%, #ffd470 100%);
}
body.theme-night .title-row h1 .title-main::after {
  background-image: linear-gradient(180deg, #fffaf2 0%, #ffe3ee 65%, #ffc2d9 100%);
}
.title-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 1.5px;
  background: var(--pink);
  transform: rotate(45deg);
  box-shadow: 0 0 0 2px #fff;
}
body.theme-night .title-dot {
  box-shadow: 0 0 0 2px rgba(24, 16, 44, 0.92), 0 0 10px rgba(255, 126, 176, 0.6);
}
.spark {
  display: inline-block;
  color: var(--gold);
  font-size: clamp(14px, 1.4vw, 20px);
  animation: twinkle 2.8s ease-in-out infinite;
}
.spark.s2 { animation-delay: 1.3s; color: var(--pink); font-size: clamp(12px, 1.2vw, 16px); }

.ticket-ribbon {
  margin-top: clamp(6px, 0.9vh, 10px);
  display: inline-flex;
  align-items: center;
  gap: clamp(10px, 1vw, 18px);
  padding: clamp(5px, 0.55vh, 7px) clamp(14px, 1.4vw, 24px);
  border-radius: 999px;
  background: var(--ribbon-bg);
  border: 1.5px solid var(--ribbon-bd);
  box-shadow: 0 6px 20px rgba(186, 120, 146, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  font-size: clamp(13px, 0.98vw, 15px);
  font-weight: 800;
  color: var(--ink);
  backdrop-filter: blur(8px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ticket-ribbon:hover {
  border-color: var(--pink);
  box-shadow: 0 8px 24px rgba(255, 110, 152, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
body.theme-night .ticket-ribbon {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.ticket-ribbon::before,
.ticket-ribbon::after {
  content: "✦";
  color: var(--pink);
  font-size: 12px;
  opacity: 0.75;
}
.rib-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.rib-item[hidden],
.rib-sep[hidden] { display: none; }
.rib-ico {
  width: 15px;
  height: 15px;
  color: var(--pink-deep);
}
.rib-sep {
  width: 1px;
  height: 13px;
  background: var(--ribbon-bd);
}
.rib-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 2px 13px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff6392, #ff8ab0);
  color: #fff;
  font-weight: 800;
  font-size: clamp(12.5px, 0.92vw, 14px);
  letter-spacing: 0.05em;
  box-shadow: 0 3px 10px rgba(255, 99, 146, 0.36);
}
.rib-live[data-off="true"] {
  background: rgba(140, 122, 150, 0.22);
  color: var(--muted);
  box-shadow: none;
}
.rib-live[data-off="true"] .pulse-dot {
  animation: none;
  background: var(--muted);
  box-shadow: none;
}
.rib-live.is-champ {
  background: linear-gradient(135deg, #f3b233, #ffcf63);
  color: #4a2d00;
  box-shadow: 0 3px 12px rgba(243, 178, 51, 0.42);
}
.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.85);
  animation: pulseDot 1.6s ease-out infinite;
}
.rib-clock {
  font-family: "Barlow SC", sans-serif;
  font-weight: 700;
  font-size: clamp(15px, 1.1vw, 18px);
  font-variant-numeric: tabular-nums;
  color: var(--pink-deep);
  letter-spacing: 0.04em;
}

/* 5 列对称 BO1 赛程树（自适应铺满） */
.board {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding-top: clamp(18px, 2.2vh, 28px);
  z-index: 10;
}
.rounds {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(185px, 1fr) minmax(185px, 1fr) minmax(295px, 1.44fr) minmax(185px, 1fr) minmax(185px, 1fr);
  gap: clamp(12px, 1.4vw, 26px);
  align-items: stretch;
  z-index: 2;
}
.col {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  gap: clamp(10px, 1.5vh, 22px);
  position: relative;
  min-width: 0;
}
.col.is-sf {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(6px, 0.9vh, 14px);
}
.sf-pocket {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(4px, 0.8vw, 14px);
  min-height: 0;
  position: relative;
}
.sf-pocket.is-bot {
  align-items: flex-start;
  padding-top: clamp(18px, 2.4vh, 32px);
}
.sf-pocket .char-sticker {
  position: relative;
}
.sf-pocket .char-sticker img {
  height: clamp(54px, 9.2vh, 114px);
  width: auto;
}
.sf-pocket .say {
  left: 50%;
  top: -32px;
  transform: translateX(-50%);
}
.sf-pocket .say::after {
  left: 50%;
  right: auto;
  transform: translateX(-50%) rotate(45deg);
}
.sf-pocket .char-sticker:hover .say {
  transform: translateX(-50%) translateY(-4px);
}

.colh {
  position: absolute;
  top: clamp(-24px, -2.5vh, -28px);
  left: 0;
  right: 0;
  text-align: center;
  font-size: clamp(13.5px, 1.05vw, 16px);
  font-weight: 800;
  letter-spacing: 0.2em;
  color: #574568;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
}
body.theme-night .colh { color: #d6c8f0; }
.colh::before,
.colh::after {
  content: "";
  width: 16px;
  height: 1.5px;
  background: currentColor;
  opacity: 0.35;
}

/* 比赛卡片与丰富 Hover 反馈 */
.match {
  position: relative;
  background: var(--paper);
  border-radius: clamp(15px, 1.3vw, 20px);
  padding: clamp(7px, 0.85vh, 10px) clamp(9px, 0.8vw, 12px) clamp(8px, 0.95vh, 12px);
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 0 rgba(235, 212, 222, 0.9), var(--shadow);
  transition: transform 0.26s cubic-bezier(0.22, 1.4, 0.36, 1), box-shadow 0.26s ease, border-color 0.24s ease, background 0.35s ease;
}
body.theme-night .match {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 0 rgba(12, 8, 28, 0.9), var(--shadow);
}
.match:hover {
  transform: translateY(-4px) scale(1.015);
  border-color: rgba(255, 110, 152, 0.72);
  box-shadow: 0 8px 0 rgba(235, 202, 218, 0.95), 0 18px 34px rgba(255, 110, 152, 0.24);
  z-index: 6;
}
body.theme-night .match:hover {
  border-color: rgba(255, 126, 176, 0.68);
  box-shadow: 0 8px 0 rgba(12, 8, 28, 0.95), 0 18px 36px rgba(255, 126, 176, 0.24);
}

/* 纸胶带装饰 */
.match::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -9px;
  width: clamp(58px, 5.2vw, 78px);
  height: 16px;
  transform: translateX(-50%) rotate(-2.5deg);
  border-radius: 3px;
  background: repeating-linear-gradient(45deg, #ffd1e0, #ffd1e0 7px, #ffe6ef 7px, #ffe6ef 14px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
  opacity: 0.95;
  transition: transform 0.26s cubic-bezier(0.22, 1.4, 0.36, 1);
}
.match.alt::before {
  transform: translateX(-50%) rotate(2.5deg);
  background: repeating-linear-gradient(45deg, #bcefe6, #bcefe6 7px, #dcf8f3 7px, #dcf8f3 14px);
}
.match:hover::before {
  transform: translateX(-50%) rotate(0deg) scale(1.06);
}
body.theme-night .match::before { opacity: 0.72; }

.match header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1px 2px clamp(4px, 0.6vh, 8px);
  font-size: clamp(12px, 0.88vw, 13.5px);
  font-weight: 800;
  color: var(--muted);
  gap: 5px;
}
.mname {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(155, 123, 255, 0.12);
  color: #7c5ca8;
  font-weight: 800;
  white-space: nowrap;
}
body.theme-night .mname {
  background: rgba(175, 152, 255, 0.2);
  color: #d6c8ff;
}
.mnote {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: auto;
}
.mstate {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.mstate.is-done { color: var(--mint); }
.mstate.is-live {
  background: linear-gradient(135deg, #ff5e8e, #ff86ac);
  color: #fff;
  padding: 2px 9px;
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(255, 94, 142, 0.35);
}

.slots {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 0.55vh, 6px);
}
.slot {
  display: grid;
  grid-template-columns: clamp(32px, 3vw, 42px) 1fr auto;
  align-items: center;
  gap: clamp(7px, 0.65vw, 10px);
  padding: clamp(4px, 0.52vh, 6px) clamp(6px, 0.55vw, 8px);
  border-radius: 12px;
  background: rgba(246, 237, 242, 0.45);
  transition: transform 0.2s cubic-bezier(0.22, 1.4, 0.36, 1), background 0.2s ease, box-shadow 0.2s ease;
}
body.theme-night .slot { background: rgba(255, 255, 255, 0.05); }
.slot:not(.is-empty):hover {
  background: rgba(255, 224, 236, 0.62);
  transform: translateX(3px);
  box-shadow: inset 0 0 0 1px rgba(255, 110, 152, 0.28);
}
body.theme-night .slot:not(.is-empty):hover {
  background: rgba(255, 126, 176, 0.14);
}

.av-wrap { position: relative; width: clamp(32px, 3vw, 42px); height: clamp(32px, 3vw, 42px); }
.av {
  width: clamp(32px, 3vw, 42px);
  height: clamp(32px, 3vw, 42px);
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, var(--g1, #ff8eb5), var(--g2, #7fd8cd));
  transition: transform 0.22s cubic-bezier(0.22, 1.5, 0.36, 1), box-shadow 0.22s ease;
}
.slot:not(.is-empty):hover .av {
  transform: scale(1.1) rotate(-4deg);
  box-shadow: 0 0 0 3px rgba(255, 110, 152, 0.26);
}
body.theme-night .av { border-color: rgba(255, 255, 255, 0.25); }
.av img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.av-empty {
  width: clamp(32px, 3vw, 42px);
  height: clamp(32px, 3vw, 42px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(235, 222, 232, 0.55);
  border: 2px dashed #ccb8cb;
  color: var(--muted);
  font-weight: 900;
}
body.theme-night .av-empty {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.22);
}

.who { min-width: 0; }
.who b {
  display: block;
  font-size: clamp(14.5px, 1.1vw, 18px);
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.who small {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.slot-sub {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.tag {
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 900;
  flex-shrink: 0;
}
.tag.new { background: var(--mint-soft); color: #167a6b; }
.tag.old { background: var(--gold-soft); color: #8c5d06; }
body.theme-night .tag.new { color: #7ef0d2; }
body.theme-night .tag.old { color: #ffd470; }

.wpill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px 1px 5px;
  border-radius: 999px;
  background: var(--wbg);
  color: var(--wfg);
  border: 1px solid var(--wbd);
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}
body.theme-night .wpill {
  background: var(--wnbg);
  color: var(--wnfg);
  border-color: var(--wnbd);
}
.w-ico { width: 11px; height: 11px; flex-shrink: 0; }

/* BO1 胜负印章 */
.hanko {
  width: clamp(26px, 2.1vw, 32px);
  height: clamp(26px, 2.1vw, 32px);
  border-radius: 9px;
  border: 2px solid #eb547d;
  color: #eb547d;
  background: rgba(255, 240, 245, 0.9);
  font: 900 clamp(13px, 1.1vw, 16px)/1 var(--serif);
  display: grid;
  place-items: center;
  transform: rotate(-8deg);
  box-shadow: 0 2px 8px rgba(235, 84, 125, 0.22);
  transition: transform 0.22s cubic-bezier(0.22, 1.5, 0.36, 1);
}
.slot:hover .hanko { transform: rotate(-14deg) scale(1.14); }
body.theme-night .hanko {
  background: rgba(235, 84, 125, 0.22);
  color: #ff9abb;
  border-color: #ff86ae;
}
.hanko.slam { animation: hankoSlam 0.48s cubic-bezier(0.22, 1.4, 0.36, 1) forwards; }

.lose-pill {
  font-size: 11.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(110, 92, 124, 0.16);
  color: var(--muted);
}

.slot.is-win {
  background: linear-gradient(90deg, var(--pink-soft), rgba(255, 255, 255, 0.65));
  box-shadow: inset 0 0 0 1.5px rgba(255, 110, 152, 0.32);
}
body.theme-night .slot.is-win {
  background: linear-gradient(90deg, rgba(255, 126, 176, 0.22), rgba(255, 255, 255, 0.04));
}
.slot.is-win .av {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255, 110, 152, 0.22);
}
.slot.is-lose { opacity: 0.72; filter: saturate(0.75); }
.slot.is-empty .who b { color: var(--muted); font-weight: 800; font-size: clamp(13.5px, 1vw, 15.5px); }

/* 激战中卡片 */
.match[data-state="live"] {
  border-color: var(--pink);
  box-shadow: 0 5px 0 #ffc0d4, 0 0 0 5px rgba(255, 110, 152, 0.16), 0 18px 34px rgba(255, 110, 152, 0.26);
  transform: rotate(-0.8deg);
  overflow: visible;
}
.match[data-state="live"]:hover {
  transform: rotate(0deg) translateY(-5px) scale(1.02);
  box-shadow: 0 8px 0 #ffb3cc, 0 0 0 7px rgba(255, 110, 152, 0.22), 0 22px 42px rgba(255, 110, 152, 0.36);
}
body.theme-night .match[data-state="live"] {
  box-shadow: 0 5px 0 rgba(255, 126, 176, 0.45), 0 0 0 5px rgba(255, 126, 176, 0.18), 0 18px 36px rgba(255, 110, 152, 0.28);
}
.match[data-state="live"]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  background-size: 220% 100%;
  animation: cardShimmer 3.6s ease-in-out infinite;
  pointer-events: none;
}
body.theme-night .match[data-state="live"]::after {
  background: linear-gradient(115deg, transparent 30%, rgba(255, 180, 210, 0.16) 50%, transparent 70%);
  background-size: 220% 100%;
}
.match[data-state="live"] .slot { padding-right: clamp(38px, 3vw, 50px); }

.vs-pill {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(28px, 2.3vw, 36px);
  height: clamp(28px, 2.3vw, 36px);
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6392, #ff99b8);
  color: #fff;
  font: 800 clamp(11px, 0.85vw, 13px)/1 "Barlow SC", sans-serif;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 4px var(--paper), 0 4px 12px rgba(255, 99, 146, 0.45);
  z-index: 3;
  animation: vsBeat 1.8s ease-in-out infinite;
}

/* 中央列 */
.col.center {
  justify-content: space-evenly;
  align-items: center;
  gap: clamp(6px, 1vh, 16px);
  padding: 2px 0;
}

.theater {
  position: relative;
  z-index: 4;
  overflow: visible;
  width: 100%;
  border-radius: clamp(18px, 1.6vw, 24px);
  background: linear-gradient(145deg, var(--paper), var(--paper-2));
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 5px 0 rgba(235, 212, 222, 0.9), var(--shadow);
  padding: clamp(8px, 1.05vh, 13px) clamp(10px, 1.1vw, 16px);
  display: grid;
  grid-template-columns: clamp(62px, 5.4vw, 96px) minmax(0, 1fr);
  gap: clamp(8px, 0.85vw, 14px);
  align-items: center;
  transition: transform 0.25s cubic-bezier(0.22, 1.4, 0.36, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}
.theater:hover {
  z-index: 20;
  transform: translateY(-3px);
  border-color: rgba(255, 110, 152, 0.55);
  box-shadow: 0 8px 0 rgba(235, 202, 218, 0.95), 0 18px 34px rgba(255, 110, 152, 0.2);
}
body.theme-night .theater {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 5px 0 rgba(12, 8, 28, 0.9), var(--shadow);
}
.theater-sticker {
  width: clamp(62px, 5.4vw, 96px);
  height: clamp(66px, 9.2vh, 102px);
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.theater-sticker img {
  height: clamp(64px, 8.8vh, 104px);
  width: auto;
  filter: drop-shadow(0 6px 10px rgba(150, 90, 120, 0.22));
  animation: bob 3.4s ease-in-out infinite;
  transition: transform 0.22s ease;
}
.theater-sticker:hover img { transform: scale(1.09) rotate(-3deg); }
.theater-sticker.pop img { animation: popBounce 0.5s cubic-bezier(0.22, 1.6, 0.36, 1); }
.theater-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--pink-deep);
  background: var(--pink-soft);
  padding: 2px 9px;
  border-radius: 999px;
  margin-bottom: 4px;
}
.theater-quote {
  margin: 0;
  font-size: clamp(13.5px, 1.08vw, 15.5px);
  font-weight: 800;
  line-height: 1.48;
  color: var(--ink);
}
.theater-quote.is-swap { animation: sayPop 0.36s ease; }
.theater-sub {
  margin-top: clamp(6px, 0.8vh, 10px);
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}
.cheer-lbl {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(155, 123, 255, 0.14);
  color: #473558;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}
body.theme-night .cheer-lbl {
  background: rgba(186, 164, 255, 0.22);
  color: #efe7ff;
}
.theater-emojis {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: clamp(4px, 0.45vw, 7px);
  min-width: 0;
}
.cheer-item {
  position: relative;
  flex-shrink: 0;
  width: clamp(28px, 2.05vw, 36px);
  height: clamp(28px, 2.05vw, 36px);
  padding: 2px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #fff7fa;
  box-shadow: 0 3px 10px rgba(176, 118, 146, 0.22);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.22s cubic-bezier(0.22, 1.5, 0.36, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}
body.theme-night .cheer-item {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.32);
}
.cheer-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}
.cheer-item:hover,
.cheer-item:focus-visible {
  transform: scale(1.18) translateY(-4px);
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255, 110, 152, 0.24), 0 8px 16px rgba(255, 110, 152, 0.3);
  z-index: 10;
  outline: 0;
}
.cheer-name {
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-50%) translateY(-4px) scale(0.92);
  opacity: 0;
  pointer-events: none;
  padding: 3px 9px;
  border-radius: 999px;
  background: #2b1f38;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(43, 31, 56, 0.26);
  transition: opacity 0.18s ease, transform 0.2s cubic-bezier(0.22, 1.4, 0.36, 1);
}
body.theme-night .cheer-name {
  background: #ff7eb0;
  color: #1b1228;
}
.cheer-item:hover .cheer-name,
.cheer-item:focus .cheer-name,
.cheer-item:focus-visible .cheer-name {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* 冠军加冕台 */
.champ-stage {
  width: 100%;
  border-radius: 24px;
  background: linear-gradient(160deg, #fffdf5, #fff2cf);
  border: 2px solid #ffe08d;
  box-shadow: 0 6px 0 #ebd082, 0 18px 36px rgba(230, 168, 50, 0.26);
  padding: clamp(10px, 1.2vh, 14px) clamp(12px, 1.2vw, 16px);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.26s ease, box-shadow 0.26s ease;
}
.champ-stage:hover {
  transform: translateY(-3px);
  box-shadow: 0 9px 0 #e6c367, 0 22px 44px rgba(230, 168, 50, 0.34);
}
body.theme-night .champ-stage {
  background: linear-gradient(160deg, #3b2d18, #271f39);
  border-color: rgba(255, 212, 112, 0.55);
  box-shadow: 0 6px 0 rgba(20, 12, 4, 0.8), 0 0 38px rgba(255, 212, 112, 0.24);
}
.champ-rays {
  position: absolute;
  left: -60px;
  top: -80px;
  width: 260px;
  height: 260px;
  background: repeating-conic-gradient(rgba(255, 206, 92, 0.24) 0 10deg, transparent 10deg 22deg);
  border-radius: 50%;
  animation: spinSlow 24s linear infinite;
  pointer-events: none;
}
.champ-av-box { position: relative; flex-shrink: 0; }
.champ-av {
  width: clamp(56px, 5.2vw, 72px);
  height: clamp(56px, 5.2vw, 72px);
  border-radius: 50%;
  border: 4px solid #ffcf56;
  box-shadow: 0 0 22px rgba(255, 198, 66, 0.65);
  overflow: hidden;
  display: grid;
  place-items: center;
  font: 900 26px/1 var(--serif);
  color: #fff;
  background: linear-gradient(135deg, #ff8eb5, #f3b233);
}
.champ-av img { width: 100%; height: 100%; object-fit: cover; }
.champ-crown {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 22px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 2px 4px rgba(130, 82, 0, 0.35));
}
.champ-crown svg { width: 26px; height: 22px; }
.champ-info { position: relative; z-index: 2; min-width: 0; }
.champ-kicker {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: #b5790c;
  white-space: nowrap;
}
body.theme-night .champ-kicker { color: #ffd470; }
.champ-name {
  margin: 2px 0 5px;
  font: 900 clamp(20px, 1.8vw, 26px)/1.1 var(--serif);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.champ-path {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.champ-path > span:not(.wpill) {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: #8c5a08;
}
body.theme-night .champ-path > span:not(.wpill) {
  background: rgba(255, 212, 112, 0.16);
  color: #ffe39c;
}
.champ-cheer {
  margin-left: auto;
  display: flex;
  flex-shrink: 0;
  gap: 2px;
  position: relative;
  z-index: 2;
}
.champ-cheer img { animation: bob 2.6s ease-in-out infinite; }
.champ-cheer img:nth-child(2) { animation-delay: 0.6s; }

/* 决赛英雄卡 */
.final-block { width: 100%; position: relative; }
.final-heading { text-align: center; margin-bottom: clamp(5px, 0.8vh, 10px); }
.final-heading .ftitle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 900 clamp(18px, 1.7vw, 25px)/1 var(--serif);
  letter-spacing: 0.1em;
  color: var(--ink);
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.85);
}
body.theme-night .final-heading .ftitle {
  color: #ffe29a;
  text-shadow: 0 0 16px rgba(255, 212, 112, 0.45);
}
.final-heading .fsub { font-size: clamp(12.5px, 0.92vw, 14px); font-weight: 800; color: #8c5c12; margin-top: 3px; }
body.theme-night .final-heading .fsub { color: #ffe09a; }

.final-block .match {
  padding: clamp(9px, 1.2vh, 14px) clamp(11px, 1.1vw, 16px) clamp(10px, 1.3vh, 16px);
  border-radius: 22px;
  background: linear-gradient(180deg, #fffef8, #fff5dc);
  border-color: #ffe39c;
  box-shadow: 0 6px 0 #edd287, 0 16px 32px rgba(230, 174, 58, 0.22);
}
.final-block .match:hover {
  border-color: #f4b732;
  box-shadow: 0 9px 0 #e5bf64, 0 22px 42px rgba(230, 168, 50, 0.34);
}
body.theme-night .final-block .match {
  background: linear-gradient(180deg, #332a47, #27203b);
  border-color: rgba(255, 212, 112, 0.45);
  box-shadow: 0 6px 0 rgba(16, 10, 28, 0.9), 0 0 32px rgba(255, 212, 112, 0.16);
}
.final-block .match::before {
  width: clamp(76px, 7vw, 110px);
  background: repeating-linear-gradient(45deg, #ffe08c, #ffe08c 7px, #fff2c6 7px, #fff2c6 14px);
}
.final-block .av,
.final-block .av-empty,
.final-block .av-wrap { width: clamp(36px, 3.4vw, 48px); height: clamp(36px, 3.4vw, 48px); }
.final-block .slot { grid-template-columns: clamp(36px, 3.4vw, 48px) 1fr auto; padding: clamp(5px, 0.7vh, 8px) clamp(7px, 0.7vw, 10px); }
.final-block .who b { font-size: clamp(16px, 1.32vw, 20px); }

.third-block { width: min(88%, 400px); }

.garland {
  display: inline-flex;
  align-items: center;
  gap: clamp(5px, 0.55vw, 8px);
  padding: clamp(5px, 0.6vh, 7px) clamp(11px, 1vw, 16px);
  border-radius: 999px;
  background: var(--ribbon-bg);
  border: 1.5px solid var(--ribbon-bd);
  box-shadow: 0 4px 14px rgba(176, 122, 142, 0.12);
  font-size: clamp(12.5px, 0.9vw, 14px);
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}
.garland i {
  width: clamp(22px, 1.7vw, 25px);
  height: clamp(22px, 1.7vw, 25px);
  border-radius: 50%;
  font-style: normal;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  background: rgba(200, 180, 200, 0.18);
  color: var(--muted);
  cursor: default;
  transition: transform 0.2s cubic-bezier(0.22, 1.5, 0.36, 1), box-shadow 0.2s ease;
}
.garland i:hover {
  transform: scale(1.24);
  box-shadow: 0 3px 10px rgba(255, 110, 152, 0.32);
}
.garland i.d {
  background: var(--mint);
  color: #fff;
  box-shadow: 0 2px 0 rgba(42, 148, 132, 0.55);
}
.garland i.l {
  background: var(--pink);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(255, 110, 152, 0.25);
  animation: vsBeatPlain 1.5s ease-in-out infinite;
}

/* 角色贴纸 */
.char-sticker {
  z-index: 16;
  cursor: pointer;
  user-select: none;
  transition: transform 0.26s cubic-bezier(0.22, 1.4, 0.36, 1);
}
.char-sticker:hover {
  transform: scale(1.1) translateY(-6px);
  z-index: 22;
}
.char-sticker img {
  filter: drop-shadow(0 8px 14px rgba(130, 86, 112, 0.22));
  animation: bob 4.2s ease-in-out infinite;
  transition: filter 0.25s ease;
}
.char-sticker:hover img {
  filter: drop-shadow(0 12px 20px rgba(255, 110, 152, 0.32));
}
.char-sticker.delay1 img { animation-delay: 0.7s; }
.char-sticker.delay2 img { animation-delay: 1.4s; }
.char-sticker.delay3 img { animation-delay: 2.1s; }
.char-sticker.pop img { animation: popBounce 0.5s cubic-bezier(0.22, 1.6, 0.36, 1); }

.diecut {
  filter:
    drop-shadow(0 2px 0 #fff)
    drop-shadow(0 -2px 0 #fff)
    drop-shadow(2px 0 0 #fff)
    drop-shadow(-2px 0 0 #fff)
    drop-shadow(0 8px 14px rgba(130, 86, 112, 0.24));
}

.say {
  position: absolute;
  padding: 6px 13px;
  border-radius: 15px;
  background: var(--paper);
  border: 1.5px solid var(--ribbon-bd);
  color: var(--ink);
  font-size: clamp(12.5px, 0.94vw, 14.5px);
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(160, 100, 130, 0.16);
  pointer-events: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.say.is-swap { animation: sayPop 0.36s ease; }
.say::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 18px;
  width: 9px;
  height: 9px;
  background: var(--paper);
  border-right: 1.5px solid var(--ribbon-bd);
  border-bottom: 1.5px solid var(--ribbon-bd);
  transform: rotate(45deg);
  transition: border-color 0.2s ease;
}
.say.right-tail::after { left: auto; right: 18px; }
.char-sticker:hover .say {
  border-color: var(--pink);
}
.char-sticker:hover .say::after {
  border-color: var(--pink);
}
.say.temp-say {
  left: 50%;
  top: -34px;
  transform: translateX(-50%);
  z-index: 20;
}
.say.temp-say::after {
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
}

/* SVG 晋级连线（含悬停高亮） */
.links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 1;
}
.links path {
  transition: stroke 0.2s ease, stroke-width 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}
.links path.is-hi {
  stroke: var(--pink) !important;
  stroke-width: 4 !important;
  opacity: 1 !important;
  filter: drop-shadow(0 0 6px rgba(255, 110, 152, 0.55));
}
.link-hot { stroke-dasharray: 4 10; animation: dashFlow 1.2s linear infinite; }

/* 底部 3 栏功能坞 */
.bottom-dock {
  flex: 0 0 auto;
  margin-top: clamp(6px, 0.9vh, 12px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  z-index: 40;
}
.dock-left { justify-self: start; }
.top-actions {
  justify-self: end;
  display: flex;
  gap: 8px;
}

.board-back,
.pill-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--ribbon-bg);
  border: 1.5px solid var(--ribbon-bd);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s cubic-bezier(0.22, 1.4, 0.36, 1), box-shadow 0.2s ease;
}
.board-back:hover,
.pill-action:hover {
  color: var(--pink-deep);
  border-color: var(--pink);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(255, 110, 152, 0.2);
}
.board-back:active,
.pill-action:active { transform: translateY(1px); }
.pill-action.is-on {
  background: var(--pink-soft);
  color: var(--pink-deep);
  border-color: var(--pink);
}

/* 参赛名单浮层 */
.roster-card {
  position: fixed;
  right: clamp(14px, 2vw, 38px);
  bottom: 58px;
  width: 350px;
  border-radius: 20px;
  background: var(--paper);
  border: 2px solid #fff;
  box-shadow: 0 18px 40px rgba(80, 40, 60, 0.22);
  padding: 14px 16px;
  z-index: 45;
  display: none;
}
body.theme-night .roster-card { border-color: rgba(255, 255, 255, 0.16); }
.roster-card.is-open { display: block; }
.roster-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.roster-head h2 { margin: 0; font-size: 14px; font-weight: 900; }
.roster-count { font-size: 12px; font-weight: 800; color: var(--muted); }
.roster-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.roster-row {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 7px;
  align-items: center;
  padding: 5px 7px;
  border-radius: 10px;
  background: rgba(246, 237, 242, 0.55);
  font-size: 12px;
  font-weight: 800;
  transition: transform 0.18s ease, background 0.18s ease;
}
.roster-row:hover {
  background: var(--pink-soft);
  transform: translateX(2px);
}
body.theme-night .roster-row { background: rgba(255, 255, 255, 0.06); }
.roster-av {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--g1, #ff8eb5), var(--g2, #7fd8cd));
}
.roster-av img { width: 100%; height: 100%; object-fit: cover; }
.roster-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 弹幕轨道与底部免登录发送条 */
.danmaku-stage {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 25;
  transition: opacity 0.25s ease;
}
.danmaku-stage.is-off { opacity: 0; }
.dm-pill {
  position: absolute;
  pointer-events: auto;
  cursor: default;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px 5px 7px;
  border-radius: 999px;
  background: rgba(255, 251, 247, 0.9);
  border: 1.5px solid rgba(235, 168, 190, 0.58);
  box-shadow: 0 5px 16px rgba(176, 122, 142, 0.16);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  backdrop-filter: blur(6px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.dm-pill:hover {
  animation-play-state: paused;
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255, 110, 152, 0.22), 0 8px 22px rgba(255, 110, 152, 0.28);
  z-index: 35;
}
.dm-pill.mine {
  border-color: var(--pink);
  background: linear-gradient(135deg, rgba(255, 232, 240, 0.96), rgba(255, 251, 247, 0.96));
  box-shadow: 0 0 0 3px rgba(255, 110, 152, 0.2), 0 6px 18px rgba(255, 110, 152, 0.25);
}
body.theme-night .dm-pill {
  background: rgba(34, 28, 60, 0.9);
  border-color: rgba(255, 152, 194, 0.42);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.38);
}
body.theme-night .dm-pill.mine {
  background: rgba(74, 34, 62, 0.94);
  border-color: var(--pink);
}
.dm-pill img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: contain;
  background: #fff8fb;
  border: 1.5px solid rgba(255, 110, 152, 0.36);
  padding: 1px;
}
.dm-pill.fly { left: 100vw; animation: dmFly 12.5s linear forwards; }

.danmaku-bar {
  position: relative;
  height: 46px;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--ribbon-bg);
  border: 1.5px solid var(--ribbon-bd);
  box-shadow: 0 8px 24px rgba(176, 122, 142, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  backdrop-filter: blur(10px);
}
body.theme-night .danmaku-bar {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.danmaku-bar.is-muted .dm-input,
.danmaku-bar.is-muted .dm-quick,
.danmaku-bar.is-muted .dm-send,
.danmaku-bar.is-muted .dm-emo-btn { opacity: 0.48; pointer-events: none; }

.dm-emo-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.dm-emo-btn {
  height: 36px;
  padding: 2px 9px 2px 3px;
  border-radius: 999px;
  border: 1.5px solid var(--ribbon-bd);
  background: #fff;
  box-shadow: 0 2px 8px rgba(176, 122, 142, 0.14);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.dm-emo-btn:hover,
.dm-emo-wrap.is-open .dm-emo-btn {
  transform: translateY(-1px);
  border-color: var(--pink);
  box-shadow: 0 4px 12px rgba(255, 110, 152, 0.24);
}
body.theme-night .dm-emo-btn { background: rgba(255, 255, 255, 0.14); }
.dm-emo-btn img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff8fb;
}
.dm-caret {
  display: inline-block;
  font-size: 11px;
  transition: transform 0.2s ease;
}
.dm-emo-wrap.is-open .dm-caret { transform: rotate(180deg); }

.dm-emo-pop[hidden] { display: none !important; }
.dm-emo-pop {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  width: 300px;
  padding: 10px;
  border-radius: 20px;
  background: var(--paper);
  border: 2px solid #fff;
  box-shadow: 0 18px 42px rgba(72, 36, 62, 0.26), 0 0 0 1.5px var(--ribbon-bd);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  z-index: 65;
  animation: popUpMenu 0.18s cubic-bezier(0.22, 1.4, 0.36, 1);
}
body.theme-night .dm-emo-pop {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6), 0 0 0 1.5px var(--ribbon-bd);
}
.dm-emo-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  border-radius: 14px;
  border: 1.5px solid transparent;
  background: rgba(246, 237, 242, 0.55);
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.22, 1.4, 0.36, 1), border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
body.theme-night .dm-emo-opt { background: rgba(255, 255, 255, 0.06); }
.dm-emo-opt:hover {
  transform: translateY(-2px);
  border-color: var(--pink);
  background: var(--pink-soft);
}
.dm-emo-opt.is-active {
  border-color: var(--pink);
  background: var(--pink-soft);
  box-shadow: 0 0 0 2px rgba(255, 110, 152, 0.22);
}
.dm-opt-av {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(235, 168, 190, 0.45);
  padding: 2px;
  display: grid;
  place-items: center;
}
body.theme-night .dm-opt-av { background: rgba(255, 255, 255, 0.12); }
.dm-opt-av img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}
.dm-opt-name {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}
.dm-input {
  width: clamp(170px, 17vw, 260px);
  height: 30px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: 700 14px var(--sans);
}
.dm-input::placeholder { color: var(--muted); opacity: 0.9; }
.dm-quick {
  border: 1px solid var(--ribbon-bd);
  background: rgba(255, 232, 240, 0.55);
  color: var(--pink-deep);
  border-radius: 999px;
  padding: 4px 10px;
  font: 800 13px var(--sans);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.dm-quick:hover {
  transform: translateY(-2px);
  border-color: var(--pink);
  background: var(--pink-soft);
}
body.theme-night .dm-quick { background: rgba(255, 126, 176, 0.16); }
.dm-send {
  height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff6392, #ff8ab0);
  color: #fff;
  font: 800 13.5px var(--sans);
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(255, 99, 146, 0.34);
  white-space: nowrap;
  transition: transform 0.2s cubic-bezier(0.22, 1.4, 0.36, 1), box-shadow 0.2s ease;
}
.dm-send:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 16px rgba(255, 99, 146, 0.46);
}
.dm-send:active { transform: translateY(1px); }
.dm-toggle {
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--ribbon-bd);
  background: transparent;
  color: var(--ink);
  font: 800 13px var(--sans);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.dm-toggle:hover { transform: translateY(-1px); border-color: var(--pink); color: var(--ink); }
.dm-toggle.on { color: var(--mint); border-color: rgba(63, 184, 166, 0.45); }

.m-tabs { display: none; }

/* 窄桌面端：防止角标气泡或底部栏拥挤 */
@media (max-width: 1420px) {
  .corner-sticker .say:not(.temp-say) { display: none; }
}
@media (max-width: 1220px) {
  .dm-quick { display: none; }
}

/* 预览 iframe 精简模式 (?preview=1) */
body.is-preview .bottom-dock,
body.is-preview .roster-card { display: none !important; }

/* 动画 */
@keyframes dmFly {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-100vw - 520px)); }
}
@keyframes pulseDot {
  0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.85); }
  70%  { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
@keyframes twinkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.75; }
  50% { transform: scale(1.28) rotate(20deg); opacity: 1; }
}
@keyframes cardShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -100% 0; }
}
@keyframes vsBeat {
  0%, 100% { transform: translateY(-50%) scale(1); }
  50% { transform: translateY(-50%) scale(1.1); }
}
@keyframes vsBeatPlain {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-6px) rotate(1.2deg); }
}
@keyframes popBounce {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.18) rotate(-5deg); }
  70%  { transform: scale(0.95) rotate(3deg); }
  100% { transform: scale(1); }
}
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes dashFlow {
  from { stroke-dashoffset: 28; }
  to   { stroke-dashoffset: 0; }
}
@keyframes hankoSlam {
  0%   { transform: scale(2.4) rotate(-25deg); opacity: 0; }
  65%  { transform: scale(0.88) rotate(-6deg); opacity: 1; }
  100% { transform: scale(1) rotate(-8deg); opacity: 1; }
}
@keyframes sayPop {
  0%   { opacity: 0.2; filter: blur(1px); }
  100% { opacity: 1; filter: blur(0); }
}
@keyframes popUpMenu {
  0%   { opacity: 0; transform: translateY(8px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* 矮屏笔记本（如 1280×720）：收紧纵向间距保证底栏完整落屏 */
@media (min-width: 1081px) and (max-height: 800px) {
  .board-shell { padding-top: 4px; padding-bottom: 8px; }
  .head { min-height: 58px; }
  .title-row .logo { height: 30px; }
  .title-divider { height: 24px; }
  .title-row h1 .title-kassen { font-size: 22px; }
  .title-row h1 .title-main { font-size: 34px; }
  .ticket-ribbon { margin-top: 4px; padding: 4px 16px; }
  .board { padding-top: 16px; }
  .colh { top: -19px; }
  .col.center { gap: 4px; }
  .theater { padding: 7px 12px; }
  .theater-sticker { height: 58px; }
  .theater-sticker img { height: 58px; }
  .theater-sub { margin-top: 3px; }
  .final-heading { margin-bottom: 3px; }
  .final-block .match { padding: 7px 11px 8px; }
  .match { padding: 6px 9px 7px; }
  .match header { padding-bottom: 3px; }
  .slot { padding: 3px 7px; }
  .garland { padding: 3px 11px; }
  .bottom-dock { margin-top: 4px; }
  .danmaku-bar { height: 38px; }
}

/* 手机 / 窄屏响应式（<= 1080px 切换为竖排流式手账布局） */
@media (max-width: 1080px) {
  .board-shell {
    padding: 50px 14px calc(82px + env(safe-area-inset-bottom, 0px));
  }
  #fxCanvas,
  .corner-sticker,
  .sf-pocket,
  .links { display: none; }

  .bottom-dock {
    display: contents;
  }
  .dock-left {
    position: absolute;
    top: 10px;
    left: 12px;
    z-index: 42;
  }
  .top-actions {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 42;
  }
  #rosterToggle { display: none; }

  .head {
    min-height: 0;
    margin-bottom: 14px;
  }
  .title-row { flex-wrap: wrap; justify-content: center; gap: 4px 8px; }
  .title-row .spark, .title-divider { display: none; }
  .title-row .logo { height: 26px; flex: 0 0 100%; object-fit: contain; }
  .title-row h1 { gap: 8px; }
  .title-row h1 .title-kassen { font-size: 24px; -webkit-text-stroke: 5px #fff; }
  .title-row h1 .title-main { font-size: 36px; -webkit-text-stroke: 5px #fff; text-shadow: 3px 4px 0 rgba(255, 110, 152, 0.55); }
  body.theme-night .title-row h1 .title-kassen,
  body.theme-night .title-row h1 .title-main { -webkit-text-stroke: 5px rgba(24, 16, 44, 0.92); }
  .ticket-ribbon {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 12px;
    padding: 8px 14px;
    border-radius: 18px;
    font-size: 12px;
    max-width: 100%;
  }
  .ticket-ribbon::before,
  .ticket-ribbon::after,
  .rib-sep { display: none; }

  .m-tabs {
    position: sticky;
    top: 8px;
    z-index: 38;
    display: flex;
    gap: 6px;
    padding: 4px;
    margin: 0 0 14px;
    border-radius: 14px;
    background: var(--ribbon-bg);
    border: 1px solid var(--ribbon-bd);
    backdrop-filter: blur(12px);
    box-shadow: 0 6px 18px rgba(176, 122, 142, 0.14);
  }
  body.theme-night .m-tabs {
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.42);
  }
  .m-tabs button {
    flex: 1;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    padding: 8px 0;
    border-radius: 10px;
    cursor: pointer;
  }
  .m-tabs button.on {
    background: var(--pink);
    color: #fff;
  }

  .board { padding-top: 0; }
  .rounds {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  .col,
  .col.is-sf {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .col.center { order: -1; gap: 14px; padding: 0; }
  .col.is-sf-right .colh { display: none; }
  .colh {
    position: static;
    margin-bottom: 2px;
    font-size: 13px;
  }

  /* 移动端取消卡片斜倾与悬停位移，触屏滑动更整洁 */
  .match[data-state="live"] { transform: none; }
  .match:hover,
  .match[data-state="live"]:hover,
  .theater:hover,
  .champ-stage:hover,
  .slot:not(.is-empty):hover {
    transform: none;
  }
  .slot:not(.is-empty):hover .av { transform: none; }

  .theater {
    grid-template-columns: 74px minmax(0, 1fr);
    padding: 12px;
    gap: 10px;
  }
  .theater-sticker { width: 74px; height: 74px; }
  .theater-sticker img { height: 74px; }
  .theater-sub { flex-wrap: wrap; }
  .champ-stage { flex-wrap: wrap; }
  .champ-info { flex: 1; min-width: 0; }
  .champ-path { flex-wrap: wrap; white-space: normal; gap: 5px; }
  .champ-cheer { display: none; }
  .third-block { width: 100%; }
  .garland { width: 100%; justify-content: center; flex-wrap: wrap; }

  .board[data-filter="QF"] .col:not(.is-qf),
  .board[data-filter="SF"] .col:not(.is-sf),
  .board[data-filter="F"] .col:not(.center) { display: none; }

  .roster-card {
    position: relative;
    right: auto;
    bottom: auto;
    width: 100%;
    margin-top: 18px;
    display: block;
    box-shadow: var(--shadow);
  }
  .roster-card[hidden] { display: none; }
  .roster-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .roster-row { min-width: 0; }

  .danmaku-bar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    width: auto;
    height: 44px;
    padding: 4px 6px;
    gap: 6px;
    z-index: 44;
    box-shadow: 0 8px 24px rgba(43, 31, 56, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  }
  body.theme-night .danmaku-bar {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
  .dm-emo-btn { height: 34px; padding: 1px 7px 1px 2px; }
  .dm-emo-btn img { width: 28px; height: 28px; }
  .dm-emo-pop { left: 0; width: min(296px, calc(100vw - 24px)); }
  .dm-input { width: 100%; min-width: 0; flex: 1; height: 34px; font-size: 16px; }
  .dm-quick { display: none; }
  .dm-toggle { height: 34px; padding: 0 10px; font-size: 12px; }
  .dm-send { height: 34px; padding: 0 12px; font-size: 12px; }
}

@media (max-width: 540px) {
  .board-shell {
    padding: 48px 12px calc(76px + env(safe-area-inset-bottom, 0px));
  }
  .board-back,
  .pill-action {
    height: 30px;
    padding: 0 11px;
    font-size: 12px;
  }
  .head { margin-bottom: 12px; }
  .title-row .logo { height: 22px; }
  .title-row h1 .title-kassen { font-size: 21px; -webkit-text-stroke: 4px #fff; }
  .title-row h1 .title-main { font-size: 32px; -webkit-text-stroke: 4px #fff; }
  body.theme-night .title-row h1 .title-kassen,
  body.theme-night .title-row h1 .title-main { -webkit-text-stroke: 4px rgba(24, 16, 44, 0.92); }
  .ticket-ribbon {
    gap: 5px 10px;
    padding: 7px 12px;
    font-size: 11.5px;
  }
  .rib-live { font-size: 11.5px; padding: 2px 10px; }
  .rib-clock { font-size: 13.5px; }

  .m-tabs { margin-bottom: 12px; gap: 4px; }
  .m-tabs button { font-size: 12.5px; padding: 7px 0; }

  .rounds { gap: 14px; }
  .col, .col.is-sf, .col.center { gap: 12px; }
  .theater {
    grid-template-columns: 58px minmax(0, 1fr);
    padding: 11px;
    gap: 10px;
    align-items: start;
    border-radius: 18px;
  }
  .theater-sticker { width: 58px; height: 62px; }
  .theater-sticker img { height: 58px; }
  .theater-quote { font-size: 13px; line-height: 1.45; }
  .theater-sub {
    flex-wrap: nowrap;
    justify-content: space-between;
    margin-top: 8px;
  }
  .theater-emojis { margin-left: 0; gap: 6px; }
  .cheer-item { width: 30px; height: 30px; }
  .cheer-name { display: none; }

  .final-heading .ftitle { font-size: 17px; }
  .final-heading .fsub { font-size: 12px; }
  .garland {
    gap: 4px;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 14px;
  }
  .garland i { width: 20px; height: 20px; font-size: 11px; }

  .match {
    padding: 8px 10px 9px;
    border-radius: 16px;
  }
  .match::before { width: 52px; height: 12px; top: -6px; }
  .match header { font-size: 12px; }
  .slot {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 6px 8px;
  }
  .av-wrap, .av, .av-empty { width: 36px; height: 36px; }
  .final-block .slot {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    padding: 7px 9px;
  }
  .final-block .av, .final-block .av-empty, .final-block .av-wrap { width: 40px; height: 40px; }
  .who b { font-size: 15px; }
  .final-block .who b { font-size: 16.5px; }
  .hanko { width: 28px; height: 28px; font-size: 14px; }
  .roster-card { padding: 12px; border-radius: 18px; margin-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
