:root {
  --rg-bg: #090d18;
  --rg-panel: rgba(18, 25, 42, 0.88);
  --rg-panel-strong: #121a2c;
  --rg-border: rgba(255, 255, 255, 0.1);
  --rg-muted: rgba(255, 255, 255, 0.62);
  --rg-red: #ff2d3d;
}

* {
  letter-spacing: 0;
}

body {
  min-height: 100vh;
  color: #fff;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 45, 61, 0.2), transparent 26%),
    linear-gradient(135deg, #070a12 0%, #11182a 48%, #080b14 100%);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  text-decoration: none;
}

.rg-navbar {
  background: rgba(8, 12, 22, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rg-border);
}

.rg-shell {
  max-width: 1440px;
}

.panel-card,
.metric-card,
.mini-card,
.login-card,
.result-hero {
  background: var(--rg-panel);
  border: 1px solid var(--rg-border);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  border-radius: 8px;
}

.panel-card {
  padding: 24px;
}

.panel-card.narrow {
  max-width: 860px;
  margin: 0 auto;
}

.metric-card {
  min-height: 118px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

.metric-card i {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--rg-red);
  background: rgba(255, 45, 61, 0.12);
  border-radius: 8px;
  font-size: 1.35rem;
}

.metric-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}

.metric-label,
.text-white-75 {
  color: var(--rg-muted);
}

.mini-card {
  height: 100%;
  padding: 16px;
  overflow-wrap: anywhere;
}

.table-dark {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
  --bs-table-hover-bg: rgba(255, 255, 255, 0.06);
  border-color: var(--rg-border);
}

.form-control,
.form-select {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--rg-border);
}

.form-control:focus,
.form-select:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 45, 61, 0.65);
  box-shadow: 0 0 0 0.25rem rgba(255, 45, 61, 0.16);
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.btn {
  border-radius: 8px;
  font-weight: 650;
}

.btn-danger {
  --bs-btn-bg: var(--rg-red);
  --bs-btn-border-color: var(--rg-red);
  --bs-btn-hover-bg: #e82030;
  --bs-btn-hover-border-color: #e82030;
}

.badge {
  border-radius: 8px;
}

.comment-cell {
  max-width: 520px;
  white-space: normal;
}

.comment-author {
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.comment-author img {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.comment-author span {
  overflow-wrap: anywhere;
}

.login-body {
  display: grid;
  place-items: center;
}

.login-wrap {
  width: min(440px, calc(100% - 28px));
}

.login-card {
  padding: 32px;
}

.brand-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--rg-red);
  border-radius: 8px;
  font-size: 2.3rem;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  background: rgba(3, 6, 12, 0.72);
  backdrop-filter: blur(8px);
}

.loading-card {
  width: min(420px, calc(100% - 32px));
  padding: 28px;
  background: var(--rg-panel-strong);
  border: 1px solid var(--rg-border);
  border-radius: 8px;
}

.toast-area {
  position: fixed;
  top: 82px;
  right: 18px;
  z-index: 2100;
  width: min(420px, calc(100% - 36px));
}

.result-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 26px;
}

.result-showcase {
  display: grid;
  grid-template-columns: minmax(280px, 0.88fr) minmax(0, 1.12fr);
  gap: 24px;
  align-items: stretch;
  padding: 18px;
  background: linear-gradient(135deg, rgba(255, 45, 61, 0.16), rgba(18, 25, 42, 0.9) 42%, rgba(255, 255, 255, 0.055));
  border: 1px solid var(--rg-border);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

.result-media {
  position: relative;
  min-height: 270px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.result-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.result-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(5, 8, 16, 0.72));
}

.result-media-badge {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 2;
  padding: 8px 12px;
  color: #fff;
  background: rgba(255, 45, 61, 0.92);
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 700;
}

.result-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 18px 10px 18px 0;
}

.result-kicker {
  color: var(--rg-red);
  font-weight: 800;
  margin-bottom: 8px;
}

.result-copy h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 3rem);
  font-weight: 850;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.result-stats div {
  padding: 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--rg-border);
  border-radius: 8px;
}

.result-stats strong {
  display: block;
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
}

.result-stats span {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.82rem;
}

.result-section {
  padding: 22px;
  background: rgba(18, 25, 42, 0.7);
  border: 1px solid var(--rg-border);
  border-radius: 8px;
}

.result-section-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 16px;
}

.result-section-title h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.result-section-title span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.9rem;
}

.result-winner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.result-backup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.result-winner-card,
.result-backup-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--rg-border);
  border-radius: 8px;
}

.result-winner-card {
  padding: 18px;
  background: linear-gradient(145deg, rgba(255, 45, 61, 0.16), rgba(255, 255, 255, 0.06));
}

.result-backup-card {
  padding: 15px;
  background: rgba(255, 255, 255, 0.045);
}

.result-winner-rank {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  color: #fff;
  background: rgba(255, 45, 61, 0.9);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 14px;
}

.result-backup-card .result-winner-rank {
  background: rgba(255, 255, 255, 0.12);
}

.result-winner-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.result-winner-head img {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.result-backup-card .result-winner-head img {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
}

.result-winner-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.result-winner-head div div {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.82rem;
}

.result-winner-card p,
.result-backup-card p {
  display: -webkit-box;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.45;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.result-winner-card p {
  -webkit-line-clamp: 4;
}

.result-backup-card p {
  font-size: 0.88rem;
  -webkit-line-clamp: 3;
}

.winner-card {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--rg-border);
  border-radius: 8px;
}

.winner-card img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.14);
}

.rg-modal {
  color: #fff;
  background: rgba(14, 20, 34, 0.98);
  border: 1px solid var(--rg-border);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.draw-modal {
  overflow: hidden;
}

.draw-stage {
  position: relative;
  height: 152px;
  overflow: hidden;
  display: flex;
  align-items: center;
  border: 1px solid var(--rg-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.draw-pointer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 3;
  width: 2px;
  background: var(--rg-red);
  box-shadow: 0 0 22px rgba(255, 45, 61, 0.9);
}

.draw-pointer::before,
.draw-pointer::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
}

.draw-pointer::before {
  top: 0;
  border-top: 14px solid var(--rg-red);
}

.draw-pointer::after {
  bottom: 0;
  border-bottom: 14px solid var(--rg-red);
}

.draw-reel {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-inline: 22px;
  transform: translateX(0);
  will-change: transform;
}

.draw-reel.is-spinning {
  animation: drawSpin 5s cubic-bezier(.12, .74, .12, 1) forwards;
}

.draw-avatar {
  flex: 0 0 108px;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 12px 8px;
  border: 1px solid var(--rg-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.draw-avatar img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
}

.draw-avatar span {
  width: 100%;
  min-height: 34px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  line-height: 1.15;
  text-align: center;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.draw-winner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(255, 45, 61, 0.32);
  border-radius: 8px;
  background: rgba(255, 45, 61, 0.1);
}

.draw-winner img {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
}

.draw-progress {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.draw-board {
  max-height: 260px;
  overflow: auto;
}

.draw-board-list {
  display: grid;
  gap: 10px;
}

.draw-board-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--rg-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.draw-board-item img {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.draw-board-item strong {
  display: block;
  overflow-wrap: anywhere;
}

.draw-board-item span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.78rem;
  white-space: nowrap;
}

.draw-board-item p {
  display: -webkit-box;
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.82rem;
  line-height: 1.25;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

@keyframes drawSpin {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-2170px);
  }
}

@media (max-width: 767.98px) {
  .panel-card,
  .result-hero {
    padding: 18px;
  }

  .result-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-showcase {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .result-media {
    min-height: 190px;
  }

  .result-copy {
    padding: 2px;
  }

  .result-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-section {
    padding: 16px;
  }

  .metric-card {
    min-height: 102px;
    padding: 16px;
  }

  .metric-card i {
    display: none;
  }

  .winner-card {
    flex-direction: column;
  }

  .draw-stage {
    height: 136px;
  }

  .draw-avatar {
    flex-basis: 92px;
  }

  .draw-avatar img {
    width: 48px;
    height: 48px;
  }

  .draw-winner {
    align-items: flex-start;
    flex-direction: column;
  }
}
