.ristourne-header {
  background: linear-gradient(152deg, #1A1A1A 0%, #0A0A0A 50%, #000000 100%);
  padding: 52px 20px 20px;
  position: relative;
  overflow: hidden;
  border-radius: 0 0 28px 28px;
  flex-shrink: 0;
}

.ristourne-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.ristourne-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}

.ristourne-medal-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.11);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  outline: none;
  -webkit-appearance: none;
}

.ristourne-medal-btn svg {
  width: 20px;
  height: 20px;
  color: #FCD34D;
}

.ristourne-tabs {
  display: flex;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 4px;
}

.ristourne-tab {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--radius-full);
  background: none;
  border: none;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  transition: all 150ms ease;
}

.ristourne-tab.active {
  background: var(--primary);
  color: #fff;
}

.ristourne-topbar {
  display: none;
}

.ristourne-open-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.ristourne-open-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.ristourne-open-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--orange-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ristourne-open-card-icon svg {
  width: 18px;
  height: 18px;
  color: var(--orange);
}

.ristourne-open-card-info {
  flex: 1;
  min-width: 0;
}

.ristourne-open-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ristourne-open-card-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.ristourne-open-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ristourne-open-card-amount {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.ristourne-join-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  padding: 8px 18px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  outline: none;
  -webkit-appearance: none;
}

.ristourne-join-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.ristourne-empty-msg {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.leaderboard-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  opacity: 0;
  pointer-events: none;
  transition: background 220ms ease, opacity 220ms ease;
  z-index: 999;
}

.leaderboard-overlay.visible {
  background: rgba(0,0,0,0.5);
  opacity: 1;
  pointer-events: auto;
}

.leaderboard-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 78vh;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 280ms var(--ease-out);
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 32px rgba(0,0,0,0.22);
}

.leaderboard-sheet.open {
  transform: translateY(0);
}

.leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.leaderboard-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.leaderboard-title svg {
  width: 18px;
  height: 18px;
  color: #F59E0B;
}

.leaderboard-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  outline: none;
  -webkit-appearance: none;
}

.leaderboard-close-btn svg {
  width: 16px;
  height: 16px;
}

.leaderboard-list {
  overflow-y: auto;
  padding: 14px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
}

.leaderboard-rank {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.leaderboard-rank.top1 { background: #FCD34D; color: #78350F; }
.leaderboard-rank.top2 { background: #E5E7EB; color: #374151; }
.leaderboard-rank.top3 { background: #FDBA74; color: #7C2D12; }

.leaderboard-info {
  flex: 1;
  min-width: 0;
}

.leaderboard-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-meta {
  font-size: 11.5px;
  color: var(--text-muted);
}

.leaderboard-reserve-btn {
  flex-shrink: 0;
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  border-radius: var(--radius-full);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  outline: none;
  -webkit-appearance: none;
}

.leaderboard-reserve-btn.reserved {
  background: var(--accent-light);
  color: var(--accent-dark);
  cursor: default;
}

@media (min-width: 768px) {
  .ristourne-header {
    display: none;
  }

  .ristourne-topbar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 24px;
    background: var(--secondary);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
  }

  .ristourne-topbar .ristourne-title {
    font-size: 15px;
    flex-shrink: 0;
  }

  .ristourne-topbar .ristourne-tabs {
    flex: 1;
    max-width: 360px;
    background: rgba(255,255,255,0.07);
  }

  .ristourne-topbar .ristourne-medal-btn {
    background: rgba(255,255,255,0.07);
  }

  .leaderboard-sheet {
    left: auto;
    right: 24px;
    bottom: 24px;
    width: 380px;
    max-height: 70vh;
    border-radius: 20px;
    transform: translateY(24px) scale(0.96);
    opacity: 0;
    transition: transform 220ms var(--ease-out), opacity 220ms ease;
  }

  .leaderboard-sheet.open {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.r-creator-wrap {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.r-creator-wrap.large {
  width: 54px;
  height: 54px;
}

.r-creator-img,
.r-detail-member-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.r-creator-initial,
.r-detail-member-initial {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
}

.r-owner-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  vertical-align: middle;
  margin-left: 4px;
}

.ristourne-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 12px;
  background: var(--surface);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.r-detail-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.r-detail-creator {
  display: flex;
  align-items: center;
  gap: 14px;
}

.r-detail-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
}

.r-detail-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.r-detail-stats {
  display: flex;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.r-detail-stat {
  flex: 1;
  padding: 12px;
  text-align: center;
  border-right: 1px solid var(--border);
}

.r-detail-stat:last-child {
  border-right: none;
}

.r-detail-stat-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.3px;
}

.r-detail-stat-lbl {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.r-detail-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.r-status-badge {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
}

.r-status-active { background: rgba(34,197,94,0.1); color: #22c55e; }
.r-status-open   { background: rgba(236,72,153,0.1); color: var(--primary); }

.r-detail-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 12px;
  padding-top: 4px;
}

.r-detail-member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.r-detail-member-row:last-child { border-bottom: none; }

.r-detail-member-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.r-detail-member-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.r-detail-member-initial {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
}

.r-detail-member-info { flex: 1; min-width: 0; }
.r-detail-member-name { font-size: 14px; font-weight: 600; color: var(--text); }
.r-detail-member-meta { font-size: 12px; color: var(--text-muted); }

.r-detail-member-status {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.r-status-paid    { background: rgba(34,197,94,0.1); color: #22c55e; }
.r-status-pending { background: rgba(245,158,11,0.1); color: #f59e0b; }

.ristourne-open-card { cursor: pointer; }
.ristourne-open-card:active { opacity: 0.85; }
.ristourne-card { cursor: pointer; }
.ristourne-card:active { opacity: 0.85; }
