:root {
  --bg: #08090d;
  --bg-soft: #10131a;
  --panel: rgba(20, 24, 32, .88);
  --panel-strong: #171b23;
  --card: #202633;
  --line: rgba(255, 255, 255, .1);
  --line-strong: rgba(255, 255, 255, .18);
  --text: #f6f8fb;
  --muted: #9ca8b8;
  --accent: #ff8a3d;
  --accent-2: #4dd7b0;
  --accent-3: #8eb8ff;
  --gold: #f4cf75;
  --silver: #d7dde9;
  --bronze: #d79a65;
  --shadow: 0 24px 80px rgba(0, 0, 0, .38);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 52% -10%, rgba(255, 138, 61, .22), transparent 34%),
    radial-gradient(circle at 12% 22%, rgba(77, 215, 176, .13), transparent 22%),
    radial-gradient(circle at 86% 16%, rgba(142, 184, 255, .16), transparent 26%),
    linear-gradient(180deg, #11141b 0%, #07080b 74%);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 56px;
}

.site-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.kicker {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.site-header h1 {
  margin: 7px 0 0;
  font-size: clamp(38px, 5vw, 68px);
  letter-spacing: 0;
  line-height: .92;
}

.header-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #737b89;
  box-shadow: 0 0 0 4px rgba(115, 123, 137, .15);
}

.dot.live {
  background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(77, 215, 176, .16);
}

.stage {
  min-height: 460px;
  display: grid;
  place-items: end center;
  padding: 34px 0 46px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 138, 61, .16), transparent 38%),
    linear-gradient(180deg, rgba(23, 28, 39, .42), rgba(8, 9, 13, .34));
  overflow: hidden;
}

.podium {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: 1fr 1.16fr 1fr;
  gap: 22px;
  align-items: end;
  padding: 0 18px;
}

.podium-slot {
  appearance: none;
  border: 0;
  background: transparent;
  min-width: 0;
  padding: 0;
  text-align: center;
  cursor: pointer;
  display: grid;
  align-items: end;
}

.podium-person {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.avatar,
.empty-avatar {
  width: 92px;
  height: 92px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  background: linear-gradient(135deg, var(--card), #121722);
  color: var(--accent-3);
  font-size: 34px;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.rank-1 .avatar,
.rank-1 .empty-avatar {
  width: 124px;
  height: 124px;
  border-radius: 26px;
  color: var(--gold);
}

.rank-2 .avatar,
.rank-2 .empty-avatar {
  width: 100px;
  height: 100px;
  color: var(--silver);
}

.rank-3 .avatar,
.rank-3 .empty-avatar {
  width: 88px;
  height: 88px;
  color: var(--bronze);
}

.name-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
}

.user-name,
.podium-name,
.modal-name {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}

.podium-name {
  font-size: 24px;
}

.rank-1 .podium-name {
  font-size: 31px;
}

.podium-platform {
  position: relative;
  min-height: 178px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, #273040, #161b24 58%, #0d1118);
  box-shadow: inset 0 1px rgba(255, 255, 255, .07), 0 34px 84px rgba(0, 0, 0, .45);
  padding: 32px 24px 24px;
  transition: transform .18s ease, border-color .18s ease;
  overflow: hidden;
}

.rank-1 .podium-platform {
  min-height: 246px;
  border-color: rgba(244, 207, 117, .45);
  background: linear-gradient(180deg, rgba(107, 84, 30, .98), rgba(43, 36, 18, .98) 52%, #111015);
}

.rank-2 .podium-platform {
  min-height: 206px;
  border-color: rgba(215, 221, 233, .34);
  background: linear-gradient(180deg, rgba(72, 80, 94, .98), rgba(32, 38, 49, .98) 58%, #0d1118);
}

.rank-3 .podium-platform {
  min-height: 176px;
  border-color: rgba(215, 154, 101, .34);
  background: linear-gradient(180deg, rgba(97, 58, 32, .98), rgba(42, 25, 17, .98) 58%, #0d1118);
}

.podium-slot:hover .podium-platform {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, .24);
}

.trophy-badge {
  width: 42px;
  height: 42px;
  margin: -18px auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(244, 207, 117, .12);
  border: 1px solid rgba(244, 207, 117, .34);
  color: var(--gold);
  font-weight: 900;
}

.rank-2 .trophy-badge {
  color: var(--silver);
  border-color: rgba(215, 221, 233, .38);
  background: rgba(215, 221, 233, .12);
}

.rank-3 .trophy-badge {
  color: var(--bronze);
  border-color: rgba(215, 154, 101, .38);
  background: rgba(215, 154, 101, .12);
}

.podium-msgs {
  font-size: clamp(24px, 3vw, 42px);
  font-weight: 900;
}

.rank-1 .podium-msgs {
  font-size: clamp(38px, 4.2vw, 60px);
}

.podium-label {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.podium-prize {
  margin: 20px auto 0;
  width: min(220px, 100%);
  border: 1px solid rgba(244, 207, 117, .5);
  border-radius: 8px;
  background: rgba(244, 207, 117, .14);
  color: var(--gold);
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1;
  font-weight: 900;
  padding: 13px 10px 15px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .28);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.event-stats {
  grid-template-columns: repeat(4, 1fr);
}

.metric-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .045);
  padding: 18px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-card b {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr);
  gap: 18px;
  align-items: start;
}

.side-stack {
  display: grid;
  gap: 18px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 22px 64px rgba(0, 0, 0, .22);
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-size: 18px;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.search-wrap {
  width: min(220px, 46%);
  position: relative;
}

.search-wrap svg {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  fill: var(--muted);
  pointer-events: none;
}

.search {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #0e1219;
  color: var(--text);
  outline: none;
  padding: 10px 12px 10px 36px;
}

.list-button {
  width: calc(100% - 36px);
  margin: 14px 18px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, .045);
  color: var(--text);
  padding: 11px 14px;
  cursor: pointer;
  font-weight: 900;
}

.list-button:hover {
  background: rgba(255, 255, 255, .075);
  border-color: rgba(255, 255, 255, .26);
}

.table {
  display: grid;
}

.row {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 120px;
  gap: 12px;
  align-items: center;
  padding: 13px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  cursor: pointer;
}

.row:hover {
  background: rgba(255, 255, 255, .045);
}

.row.head {
  background: rgba(255, 255, 255, .025);
  cursor: default;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.serial,
.value {
  color: var(--muted);
  font-weight: 900;
}

.value {
  color: var(--text);
  text-align: right;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mini-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: #111722;
  border: 1px solid var(--line);
  color: var(--accent-3);
  font-size: 13px;
  font-weight: 900;
  object-fit: cover;
}

.badge-row {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.badge-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex: 0 0 auto;
}

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border-radius: 4px;
  padding: 0 4px;
  background: rgba(77, 215, 176, .13);
  color: var(--accent-2);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.emote-list {
  display: grid;
  padding: 0 14px;
}

.emote-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px 38px minmax(0, 1fr) 72px;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  padding: 11px 0;
}

.emote-item:last-child {
  border-bottom: 0;
}

.emote-item img {
  max-width: 32px;
  max-height: 32px;
  object-fit: contain;
  vertical-align: middle;
}

.user-emote-item {
  grid-template-columns: 38px minmax(0, 1fr) 72px;
}

.emote-rank {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.emote-copy {
  min-width: 0;
}

.emote-code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 900;
}

.emote-provider {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.emote-count {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

.activity-list {
  display: grid;
  padding: 0 14px;
}

.event-list {
  display: grid;
  padding: 0 14px;
}

.event-item {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.event-item:last-child {
  border-bottom: 0;
}

.event-type {
  border-radius: 999px;
  background: rgba(142, 184, 255, .12);
  color: var(--accent-3);
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.event-sub .event-type,
.event-resub .event-type {
  background: rgba(77, 215, 176, .12);
  color: var(--accent-2);
}

.event-gift_sub .event-type,
.event-gift_bomb .event-type {
  background: rgba(244, 207, 117, .12);
  color: var(--gold);
}

.event-bits .event-type {
  background: rgba(255, 138, 61, .13);
  color: var(--accent);
}

.event-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.event-copy b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.event-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.activity-line {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 72px;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.activity-line:last-child {
  border-bottom: 0;
}

.activity-line span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.activity-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.activity-line b {
  text-align: right;
  color: var(--accent-2);
}

.empty {
  padding: 20px;
  color: var(--muted);
}

.user-dialog {
  width: min(620px, calc(100% - 24px));
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  padding: 0;
  box-shadow: var(--shadow);
}

.full-list-dialog {
  width: min(820px, calc(100% - 24px));
}

.full-list-head {
  padding: 22px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.full-list-head h2 {
  margin: 0;
  font-size: 22px;
}

.full-list-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.full-list-table {
  max-height: min(70vh, 680px);
  overflow: auto;
}

.full-scroll-list {
  max-height: min(70vh, 680px);
  overflow: auto;
}

.full-list-table,
.full-scroll-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .28) rgba(255, 255, 255, .04);
}

.full-list-table::-webkit-scrollbar,
.full-scroll-list::-webkit-scrollbar {
  width: 10px;
}

.full-list-table::-webkit-scrollbar-track,
.full-scroll-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .035);
  border-radius: 999px;
}

.full-list-table::-webkit-scrollbar-thumb,
.full-scroll-list::-webkit-scrollbar-thumb {
  border: 2px solid rgba(16, 19, 26, .95);
  border-radius: 999px;
  background: rgba(255, 255, 255, .24);
}

.full-list-table::-webkit-scrollbar-thumb:hover,
.full-scroll-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, .36);
}

.user-dialog::backdrop {
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(3px);
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  cursor: pointer;
  font-weight: 900;
}

.user-card-head {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.user-card-body {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.modal-name {
  display: block;
  font-size: 28px;
}

.painted-name {
  color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mini-stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, .035);
}

.mini-stat span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.mini-stat b {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

.modal-section-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  padding: 2px 2px 0;
}

@media (max-width: 960px) {
  .content-grid,
  .stats-row,
  .event-stats {
    grid-template-columns: 1fr;
  }

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

  .rank-1 {
    order: -1;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1320px);
    padding-top: 18px;
  }

  .site-header,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-meta,
  .search-wrap {
    width: 100%;
  }

  .stage {
    min-height: 0;
    padding: 22px 0 34px;
  }

  .row {
    grid-template-columns: 48px minmax(0, 1fr) 86px;
    padding: 12px;
  }

  .emote-list,
  .mini-stats {
    grid-template-columns: 1fr;
  }
}
