:root {
  --bg-main: #09131e;
  --bg-panel: rgba(12, 24, 38, 0.86);
  --text-main: #f2f5ff;
  --text-soft: #b7c7e6;
  --border: rgba(255, 255, 255, 0.14);
  --hot: #ff5b2e;
  --hot-2: #ffb22d;
  --win: #35db8b;
  --loss: #ff4c75;
  --gold: #ffd35f;
  --silver: #c9d9ff;
  --bronze: #f1ad82;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-main);
  font-family: 'Noto Sans SC', sans-serif;
  background:
    radial-gradient(1200px 650px at 85% -10%, rgba(255, 91, 46, 0.22), transparent 60%),
    radial-gradient(1000px 500px at 0% 0%, rgba(255, 178, 45, 0.15), transparent 58%),
    linear-gradient(160deg, #070d17 0%, #101a2a 52%, #08101c 100%);
}

.arena-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(100deg, rgba(255, 91, 46, 0.09), transparent 40%),
    linear-gradient(280deg, rgba(53, 219, 139, 0.07), transparent 35%);
  animation: pulse 4.6s ease-in-out infinite;
}

.page {
  width: min(1260px, 94vw);
  margin: 1.4rem auto 2.8rem;
  position: relative;
  z-index: 1;
}

.panel {
  border: 1px solid var(--border);
  background: var(--bg-panel);
  border-radius: 18px;
  backdrop-filter: blur(5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.hidden {
  display: none !important;
}

.badge {
  margin: 0;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.1em;
  color: var(--hot-2);
  font-size: 1rem;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.login-shell {
  min-height: calc(100vh - 4rem);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(460px, 100%);
  padding: 1.4rem;
}

.login-card h1 {
  margin-top: 0.2rem;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.06em;
  font-size: clamp(2rem, 5vw, 2.8rem);
}

.login-hint {
  margin-top: 0.2rem;
  color: var(--text-soft);
}

.login-form {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
}

label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.92rem;
  color: var(--text-soft);
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  padding: 0.58rem 0.72rem;
}

textarea {
  resize: vertical;
}

.btn-primary {
  border: none;
  border-radius: 12px;
  padding: 0.65rem 1rem;
  background: linear-gradient(95deg, var(--hot), var(--hot-2));
  color: #2b1308;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 0.45rem 0.8rem;
  background: rgba(255, 255, 255, 0.06);
  color: #eff4ff;
  cursor: pointer;
}

.account-tip {
  margin-top: 0.9rem;
  color: #d7e1fa;
  font-size: 0.9rem;
}

.account-tip code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  padding: 0.05rem 0.35rem;
}

.dashboard {
  display: grid;
  gap: 1rem;
}

.hero {
  padding: 1.2rem 1.3rem;
  display: grid;
  gap: 0.85rem;
}

.hero h1 {
  margin-top: 0.2rem;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.05em;
  font-size: clamp(2rem, 4vw, 3.1rem);
}

.subtitle {
  color: var(--text-soft);
}

.hero-side {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: #dfe9ff;
}

.status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.95rem;
}

.status-line span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
}

.controls {
  padding: 0.9rem 1rem;
  display: grid;
  grid-template-columns: 220px 1fr auto auto;
  gap: 0.9rem;
  align-items: end;
  background:
    linear-gradient(170deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03)),
    rgba(12, 24, 38, 0.86);
}

.switch-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.switch {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  padding: 0.53rem 0.95rem;
  cursor: pointer;
}

.switch.active {
  border-color: transparent;
  color: #2d1105;
  font-weight: 800;
  background: linear-gradient(90deg, var(--hot), var(--hot-2));
}

.display-area {
  --area-left-col: 2.25fr;
  --area-right-col: 1fr;
  --board-left-col: 1fr;
  --board-right-col: 1fr;
  display: grid;
  grid-template-columns: minmax(0, var(--area-left-col)) 10px minmax(320px, var(--area-right-col));
  gap: 0.65rem;
  align-items: stretch;
  min-height: 0;
}

.boards {
  display: grid;
  grid-template-columns: minmax(0, var(--board-left-col)) 10px minmax(0, var(--board-right-col));
  gap: 0.65rem;
  min-width: 0;
  min-height: 0;
}

.splitter {
  align-self: stretch;
  position: relative;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: col-resize;
  transition: background 0.16s ease;
}

.splitter::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 3px;
  height: 38px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
}

.splitter:hover,
.splitter.dragging {
  background: rgba(255, 178, 45, 0.18);
}

.trend-panel {
  padding: 1rem;
  min-width: 0;
}

.trend-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 0.8rem;
}

.trend-head p {
  color: var(--text-soft);
}

.trend-stats {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.trend-stats span {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #e9f0ff;
  font-size: 0.86rem;
}

.trend-canvas-wrap {
  margin-top: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    rgba(8, 16, 26, 0.7);
  padding: 0.35rem;
}

#trendCanvas {
  display: block;
  width: 100%;
  height: 280px;
}

.role-board {
  position: relative;
  overflow: hidden;
  padding: 1rem;
  background: linear-gradient(170deg, rgba(17, 33, 52, 0.96), rgba(9, 19, 31, 0.94));
}

.role-board::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 4px;
}

.role-board[data-board-index='0']::before {
  background: linear-gradient(90deg, rgba(127, 179, 255, 0.95), rgba(66, 218, 168, 0.86));
}

.role-board[data-board-index='1']::before {
  background: linear-gradient(90deg, rgba(255, 168, 96, 0.95), rgba(255, 95, 122, 0.84));
}

.role-board::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(450px 180px at 78% -10%, rgba(255, 255, 255, 0.11), transparent 65%),
    radial-gradient(340px 150px at -5% 0%, rgba(255, 255, 255, 0.06), transparent 65%);
}

.board-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.role-title {
  font-size: 1.36rem;
  font-weight: 900;
}

.board-meta {
  color: var(--text-soft);
  font-size: 0.9rem;
}

.podium-stage {
  min-height: 304px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: end;
  padding-top: 0.2rem;
  margin-bottom: 1rem;
}

.podium-slot {
  position: relative;
  isolation: isolate;
  --slot-height: 232px;
  --podium-border: rgba(255, 255, 255, 0.28);
  --podium-bg-top: rgba(255, 255, 255, 0.18);
  --podium-bg-bottom: rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  height: 100%;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--podium-border);
  border-radius: 14px 14px 10px 10px;
  background: linear-gradient(180deg, var(--podium-bg-top), var(--podium-bg-bottom));
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.26);
  height: var(--slot-height);
}

.podium-card {
  width: 100%;
  flex: 1;
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.86rem 0.45rem 0.72rem;
  text-align: center;
  z-index: 1;
}

.podium-card::after {
  content: '';
  position: absolute;
  inset: -140% -22% auto;
  height: 185%;
  background: linear-gradient(
    120deg,
    transparent 35%,
    rgba(255, 255, 255, 0.36) 50%,
    transparent 65%
  );
  transform: rotate(8deg) translateX(-110%);
}

.podium-card .rank {
  display: block;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.08em;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
}

.podium-card .name {
  display: block;
  margin-top: 0.22rem;
  font-size: 1rem;
  font-weight: 900;
}

.podium-card .score {
  display: block;
  margin-top: 0.18rem;
  color: #f0f5ff;
  font-size: 0.86rem;
}

.podium-stand {
  width: 100%;
  border: none;
  background: transparent;
  box-shadow: none;
  margin-top: 0;
}

.podium-slot.rank-1 {
  --slot-height: 264px;
  --podium-border: rgba(255, 214, 110, 0.95);
  --podium-bg-top: rgba(255, 214, 110, 0.42);
  --podium-bg-bottom: rgba(255, 203, 84, 0.14);
  transform: scale(1.05);
  transform-origin: bottom center;
  z-index: 2;
  box-shadow:
    0 0 0 1px rgba(255, 220, 140, 0.35),
    0 18px 34px rgba(0, 0, 0, 0.4),
    0 0 26px rgba(255, 205, 92, 0.28);
  animation: champion-glow 2.8s ease-in-out infinite;
}

.podium-slot.rank-1::after {
  content: '';
  position: absolute;
  top: -8%;
  bottom: -8%;
  left: -72%;
  width: 62%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255, 255, 255, 0.03) 18%,
    rgba(255, 255, 255, 0.5) 50%,
    rgba(255, 255, 255, 0.08) 82%,
    transparent 100%
  );
  transform: skewX(-18deg);
  pointer-events: none;
  z-index: 3;
  animation: shine-sweep-full 3s ease-in-out infinite;
}

.rank-1 .podium-card {
  padding-top: 1rem;
}

.rank-1 .podium-card::after {
  display: none;
}

.rank-1 .podium-card .name {
  font-size: 1.14rem;
  color: #fff9e9;
}

.rank-1 .podium-card .score {
  color: #fff4d5;
}

.podium-slot.rank-2 {
  --slot-height: 200px;
  --podium-border: rgba(208, 224, 255, 0.82);
  --podium-bg-top: rgba(210, 226, 255, 0.34);
  --podium-bg-bottom: rgba(164, 183, 217, 0.12);
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(220, 232, 255, 0.18);
}

.podium-slot.rank-3 {
  --slot-height: 160px;
  --podium-border: rgba(240, 174, 132, 0.8);
  --podium-bg-top: rgba(242, 179, 139, 0.34);
  --podium-bg-bottom: rgba(184, 122, 88, 0.12);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.26),
    0 0 0 1px rgba(250, 194, 160, 0.18);
}

.rank-1 .podium-stand {
  height: 114px;
}

.rank-2 .podium-stand {
  height: 64px;
}

.rank-3 .podium-stand {
  height: 36px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
}

.role-board table {
  min-width: 100%;
}

th,
td {
  padding: 0.58rem 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}

th {
  font-size: 0.9rem;
  color: #e8efff;
}

.role-board th {
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: #d3e1ff;
}

.role-board .role-body tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.025);
}

.role-board .role-body tr:hover td {
  background: rgba(255, 255, 255, 0.08);
}

.rank-pill {
  display: inline-flex;
  min-width: 2.1rem;
  justify-content: center;
  align-items: center;
  padding: 0.1rem 0.34rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem;
}

.trend-up {
  color: var(--win);
  font-weight: 700;
}

.trend-down {
  color: var(--loss);
  font-weight: 700;
}

.trend-flat {
  color: #d4def8;
}

.admin-panel {
  padding: 1rem;
}

.admin-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 0.8rem;
}

.admin-title p {
  color: var(--text-soft);
}

.admin-grid {
  margin-top: 0.8rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.form-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.85rem;
  display: grid;
  gap: 0.6rem;
}

.mini-tip {
  margin: 0;
  color: #c7d7f6;
  font-size: 0.85rem;
}

.import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.visibility-card {
  align-content: start;
}

.visibility-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.75rem;
}

.visibility-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.visibility-list {
  max-height: 236px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 0.45rem;
  padding: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.person-toggle {
  min-width: 0;
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 0.42rem;
  padding: 0.42rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: #edf3ff;
  cursor: pointer;
}

.person-toggle input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: #ffb22d;
  cursor: pointer;
}

.person-toggle span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: #e9f0ff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.58rem 0.78rem;
  font-size: 0.88rem;
}

.btn-link:hover {
  background: rgba(255, 255, 255, 0.12);
}

.recent-wrap {
  margin-top: 0.9rem;
}

.recent-toolbar {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.date-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.recent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.compact table {
  min-width: 560px;
}

#selectAllRows,
.row-select {
  width: 16px;
  height: 16px;
  accent-color: #ffb22d;
  cursor: pointer;
}

.compact th:first-child,
.compact td:first-child {
  width: 40px;
  text-align: center;
}

.table-input {
  width: 100%;
  min-width: 90px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  padding: 0.4rem 0.45rem;
  font-size: 0.86rem;
}

tr.row-changed td {
  background: rgba(255, 178, 45, 0.12) !important;
}

.btn-danger {
  border: 1px solid rgba(255, 76, 117, 0.55);
  border-radius: 8px;
  background: rgba(255, 76, 117, 0.16);
  color: #ffb2c5;
  padding: 0.35rem 0.62rem;
  cursor: pointer;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 4;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.25s ease;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(10, 20, 34, 0.94);
  color: #e9f0ff;
  padding: 0.8rem 0.95rem;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.58;
  }
  50% {
    opacity: 1;
  }
}

@keyframes champion-glow {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(255, 220, 140, 0.35),
      0 18px 34px rgba(0, 0, 0, 0.4),
      0 0 24px rgba(255, 205, 92, 0.24);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255, 233, 169, 0.48),
      0 20px 38px rgba(0, 0, 0, 0.44),
      0 0 36px rgba(255, 214, 95, 0.4);
  }
}

@keyframes shine-sweep-full {
  0% {
    left: -72%;
    opacity: 0;
  }
  16% {
    opacity: 0.92;
  }
  52% {
    left: 124%;
    opacity: 0;
  }
  100% {
    left: 124%;
    opacity: 0;
  }
}

@media (max-width: 1080px) {
  .display-area {
    grid-template-columns: 1fr;
  }

  .boards {
    grid-template-columns: 1fr;
  }

  .controls {
    grid-template-columns: 1fr 1fr;
  }

  .controls button {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .splitter {
    display: none;
  }

  .hero-side,
  .status-line,
  .admin-title,
  .trend-head {
    flex-direction: column;
    align-items: start;
  }

  .controls,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .date-range {
    grid-template-columns: 1fr;
  }

  .podium-stage {
    min-height: 246px;
  }

  .podium-slot.rank-1 {
    --slot-height: 220px;
    transform: scale(1.03);
  }

  .podium-slot.rank-2 {
    --slot-height: 180px;
  }

  .podium-slot.rank-3 {
    --slot-height: 150px;
  }

  .rank-1 .podium-stand {
    height: 96px;
  }

  .rank-2 .podium-stand {
    height: 58px;
  }

  .rank-3 .podium-stand {
    height: 34px;
  }
}

@media (min-width: 1366px) and (min-aspect-ratio: 16/9) {
  body.viewer-mode {
    overflow: hidden;
  }

  body.viewer-mode .page {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0.65vw;
  }

  body.viewer-mode .dashboard {
    height: 100%;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas:
      'hero'
      'controls'
      'display';
    gap: 0.6vw;
  }

  body.viewer-mode .hero {
    grid-area: hero;
    padding: 0.6rem 0.85rem;
    gap: 0.4rem;
  }

  body.viewer-mode .hero h1 {
    font-size: clamp(1.35rem, 1.8vw, 2.05rem);
    line-height: 1.05;
  }

  body.viewer-mode .subtitle {
    font-size: 0.83rem;
  }

  body.viewer-mode .status-line {
    gap: 0.5rem;
    font-size: 0.8rem;
  }

  body.viewer-mode .status-line span {
    padding: 0.2rem 0.5rem;
  }

  body.viewer-mode .controls {
    grid-area: controls;
    padding: 0.55rem 0.75rem;
    gap: 0.5rem;
    grid-template-columns: minmax(420px, 1fr) 180px 120px 120px;
  }

  body.viewer-mode .switch {
    padding: 0.4rem 0.72rem;
    font-size: 0.8rem;
  }

  body.viewer-mode .controls label,
  body.viewer-mode .controls select,
  body.viewer-mode .controls button {
    font-size: 0.82rem;
  }

  body.viewer-mode .display-area {
    grid-area: display;
    height: 100%;
    min-height: 0;
    grid-template-columns: minmax(0, var(--area-left-col)) 8px minmax(260px, var(--area-right-col));
    gap: 0.45rem;
  }

  body.viewer-mode .splitter {
    display: block;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
  }

  body.viewer-mode .splitter::before {
    height: 26px;
  }

  body.viewer-mode .boards {
    min-height: 0;
    height: 100%;
    gap: 0.45rem;
    grid-template-columns: minmax(0, var(--board-left-col)) 8px minmax(0, var(--board-right-col));
  }

  body.viewer-mode .role-board {
    padding: 0.62rem;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    min-height: 0;
  }

  body.viewer-mode .board-head {
    margin-bottom: 0.45rem;
    padding-bottom: 0.42rem;
  }

  body.viewer-mode .role-title {
    font-size: 1rem;
  }

  body.viewer-mode .board-meta {
    font-size: 0.72rem;
  }

  body.viewer-mode .podium-stage {
    min-height: 170px;
    padding-top: 0.15rem;
    margin-bottom: 0.42rem;
  }

  body.viewer-mode .podium-slot.rank-1 {
    --slot-height: 168px;
    transform: scale(1.01);
  }

  body.viewer-mode .podium-slot.rank-2 {
    --slot-height: 136px;
  }

  body.viewer-mode .podium-slot.rank-3 {
    --slot-height: 112px;
  }

  body.viewer-mode .rank-1 .podium-stand {
    height: 66px;
  }

  body.viewer-mode .rank-2 .podium-stand {
    height: 40px;
  }

  body.viewer-mode .rank-3 .podium-stand {
    height: 24px;
  }

  body.viewer-mode .podium-card {
    padding: 0.58rem 0.35rem 0.5rem;
  }

  body.viewer-mode .podium-card .rank {
    font-size: 0.8rem;
  }

  body.viewer-mode .podium-card .name {
    font-size: 0.86rem;
    margin-top: 0.12rem;
  }

  body.viewer-mode .rank-1 .podium-card .name {
    font-size: 0.93rem;
  }

  body.viewer-mode .podium-card .score {
    font-size: 0.72rem;
    margin-top: 0.08rem;
  }

  body.viewer-mode .role-board .table-wrap {
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  body.viewer-mode .role-board table {
    height: 100%;
    table-layout: fixed;
  }

  body.viewer-mode .role-board th {
    font-size: 0.68rem;
    padding: 0.2rem 0.22rem;
  }

  body.viewer-mode .role-board td {
    font-size: 0.73rem;
    padding: 0.18rem 0.22rem;
  }

  body.viewer-mode .rank-pill {
    min-width: 1.4rem;
    font-size: 0.82rem;
    padding: 0 0.2rem;
  }

  body.viewer-mode .trend-panel {
    padding: 0.65rem;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    min-height: 0;
  }

  body.viewer-mode .trend-head h2 {
    font-size: 0.98rem;
  }

  body.viewer-mode .trend-head p {
    font-size: 0.72rem;
  }

  body.viewer-mode .trend-stats {
    margin-top: 0.36rem;
    gap: 0.35rem;
  }

  body.viewer-mode .trend-stats span {
    font-size: 0.7rem;
    padding: 0.18rem 0.45rem;
  }

  body.viewer-mode .trend-canvas-wrap {
    margin-top: 0.45rem;
    min-height: 0;
  }

  body.viewer-mode #trendCanvas {
    height: 100%;
    min-height: 180px;
  }
}
