* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Lilita One', cursive;
  background: #1e0340;
  color: #fff;
  overflow-x: hidden;
  min-height: 100vh;
}

header { will-change: transform; }

body.no-select {
  user-select: none;
  -webkit-user-select: none;
}

.sunburst-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 45%, #7c3aed 0%, #5b21b6 30%, #4c1d95 50%, #3b0764 70%, #1e0340 100%);
}
.sunburst-bg::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 250vmax; height: 250vmax;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 0deg, rgba(255,255,255,0.045) 0deg 5deg, transparent 5deg 10deg);
  animation: sunburst-spin 240s linear infinite;
}
.sunburst-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 45%, transparent 30%, rgba(30,3,64,0.5) 80%);
  pointer-events: none;
}
@keyframes sunburst-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.particles-layer {
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.particle {
  position: absolute;
  width: 4px; height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  animation: float-particle linear infinite;
}
@keyframes float-particle {
  from { transform: translateY(100vh) scale(0); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  to   { transform: translateY(-10vh) scale(1); opacity: 0; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(40px) scale(0.92); }
  to   { opacity: 1; transform: none; }
}

.weekly-page {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 220px 20px 80px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.weekly-page-title {
  text-align: center;
  font-family: 'Lilita One', cursive;
  font-size: 3rem;
  color: #fff;
  text-shadow: 0 4px 24px rgba(124,58,237,0.6), 0 0 60px rgba(124,58,237,0.3);
  margin-bottom: 4px;
  letter-spacing: 0.05em;
  opacity: 0;
  animation: fadeUp 0.7s 0.2s ease-out forwards;
}

.weekly-subtitle {
  text-align: center;
  font-size: 1rem;
  color: rgba(255,255,255,0.55);
  font-family: system-ui, sans-serif;
  font-weight: 400;
  max-width: 650px;
  margin: 0 auto 12px;
  line-height: 1.55;
  opacity: 0;
  animation: fadeUp 0.6s 0.35s ease-out forwards;
}

.back-link {
  position: fixed;
  top: 100px;
  left: 150px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #fff;
  text-decoration: none;
  border-radius: 14px;
  font-family: 'Lilita One', cursive;
  font-size: 1.15rem;
  transition: transform 0.25s, box-shadow 0.25s;
  box-shadow: 0 4px 18px rgba(124,58,237,0.4);
  border: none;
  cursor: url('/static/cursor/select.cur'), pointer;
  letter-spacing: 0.05em;
}

.back-link:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 6px 28px rgba(124,58,237,0.55);
}

.back-link *,
.back-link span,
.back-link svg {
  pointer-events: none;
}

.back-link svg {
  width: 20px;
  height: 20px;
}

.hero-card {
  position: relative;
  display: flex;
  gap: 0;
  align-items: stretch;
  background: rgba(15,5,40,0.7);
  border: 2px solid rgba(124,58,237,0.25);
  border-radius: 22px;
  backdrop-filter: blur(12px);
  overflow: hidden;
  min-height: 380px;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), box-shadow 0.35s, border-color 0.35s;
  opacity: 0;
  animation: cardIn 0.6s 0.4s ease-out forwards;
}

.hero-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 48px rgba(124,58,237,0.4), 0 0 32px rgba(124,58,237,0.15);
  border-color: rgba(124,58,237,0.5);
}

.hero-image {
  width: 50%;
  min-height: 380px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.hero-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, transparent 60%, rgba(15,5,40,0.6) 100%);
}

.hero-badge {
  position: absolute;
  top: 18px;
  left: 18px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.05em;
  box-shadow: 0 6px 20px rgba(34,197,94,0.5);
  z-index: 10;
  font-size: 0.95rem;
  animation: pulseLive 2s ease-in-out infinite;
}

@keyframes pulseLive {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.hero-content {
  flex: 1;
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  z-index: 1;
}

.actions {
  position: relative;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  z-index: 5;
}

.play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 36px;
  border-radius: 16px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.05em;
  font-size: 1.25rem;
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #fff;
  box-shadow: 0 4px 18px rgba(124,58,237,0.4);
  transition: transform 0.25s, box-shadow 0.25s;
  border: none;
  cursor: url('/static/cursor/select.cur'), pointer;
  min-width: 280px;
  min-height: 68px;
  font-family: 'Lilita One', cursive;
}

.play-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 28px rgba(124,58,237,0.55);
}

.play-btn *,
.play-btn span,
.play-btn svg {
  pointer-events: none;
}

.play-btn svg {
  width: 22px;
  height: 22px;
}

.play-btn.login-btn {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1f2937;
  box-shadow: 0 4px 18px rgba(251,191,36,0.4);
}

.play-btn.login-btn:hover {
  box-shadow: 0 6px 28px rgba(251,191,36,0.55);
}

.rules-popover {
  display: none;
  position: absolute;
  top: 100%;
  margin-top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15,5,40,0.94);
  border: 1.5px solid rgba(124,58,237,0.3);
  border-radius: 18px;
  padding: 20px 22px;
  min-width: 400px;
  max-width: 520px;
  box-shadow: 0 18px 38px rgba(0,0,0,0.6), 0 0 24px rgba(124,58,237,0.2);
  backdrop-filter: blur(14px);
  z-index: 2000;
}

.rules-popover .rules {
  margin: 0;
  gap: 10px;
  font-size: 1rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  font-family: system-ui, sans-serif;
  font-weight: 400;
  color: rgba(255,255,255,0.7);
}

.rules-popover .rules div {
  padding: 8px 0;
  border-bottom: 1px solid rgba(124,58,237,0.15);
}

.rules-popover .rules div:last-child {
  border-bottom: none;
}

.actions:hover .rules-popover {
  display: flex;
  flex-direction: column;
}

.panel {
  background: rgba(15,5,40,0.7);
  border: 2px solid rgba(124,58,237,0.25);
  border-radius: 22px;
  backdrop-filter: blur(12px);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), box-shadow 0.35s, border-color 0.35s;
  opacity: 0;
  animation: cardIn 0.6s 0.55s ease-out forwards;
}

.panel:hover {
  border-color: rgba(124,58,237,0.45);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.panel-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.panel-title {
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  margin: 0;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
  font-family: 'Lilita One', cursive;
}

.week-timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(124,58,237,0.2);
  border: 1.5px solid rgba(124,58,237,0.35);
  color: #a78bfa;
  padding: 8px 16px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
  font-family: system-ui, sans-serif;
}

.reward-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(124,58,237,0.12);
  border: 1.5px solid rgba(124,58,237,0.25);
  padding: 10px 16px;
  border-radius: 14px;
  flex-shrink: 0;
}

.reward-badge img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(124,58,237,0.3);
  flex-shrink: 0;
}

.reward-badge-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reward-badge-title {
  color: #a78bfa;
  font-weight: 800;
  font-size: 0.85rem;
}

.reward-badge-sub {
  color: rgba(255,255,255,0.55);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: system-ui, sans-serif;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
  background: rgba(124,58,237,0.1);
  border: 1.5px solid rgba(124,58,237,0.25);
  border-radius: 16px;
  backdrop-filter: blur(8px);
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  color: rgba(255,255,255,0.5);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: system-ui, sans-serif;
}

.stat-value {
  color: #fbbf24;
  font-size: 1.4rem;
  font-weight: 900;
  text-shadow: 0 0 10px rgba(251,191,36,0.4);
}

.vip-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: rgba(124,58,237,0.08);
  border: 1.5px solid rgba(167,139,250,0.25);
  border-radius: 16px;
  margin-bottom: 16px;
}

.vip-progress-label {
  color: #a78bfa;
  font-weight: 700;
  font-size: 0.95rem;
}

.vip-progress-bar {
  height: 12px;
  background: rgba(0,0,0,0.35);
  border-radius: 6px;
  overflow: hidden;
  border: 1.5px solid rgba(167,139,250,0.3);
}

.vip-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #fbbf24);
  transition: width 0.4s ease;
  box-shadow: 0 0 12px rgba(124,58,237,0.5);
}

.vip-progress-text {
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-family: system-ui, sans-serif;
}

.leader-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  align-items: center;
  gap: 12px;
  background: rgba(15,5,40,0.5);
  border: 1.5px solid rgba(124,58,237,0.15);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  transition: transform 0.25s, border-color 0.25s, background 0.25s;
  position: relative;
  min-height: 50px;
}

.leader-item * {
  cursor: pointer;
}

.leader-item:hover {
  transform: translateX(6px);
  border-color: rgba(124,58,237,0.35);
  background: rgba(124,58,237,0.08);
}

.leader-item.first-place {
  background: linear-gradient(135deg, rgba(251,191,36,0.12), rgba(124,58,237,0.1));
  border: 2px solid rgba(251,191,36,0.45);
  box-shadow: 0 0 24px rgba(251,191,36,0.2);
  animation: pulse-glow 2.5s ease-in-out infinite;
}

.leader-item.first-place:hover {
  transform: translateX(6px) scale(1.01);
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 24px rgba(251,191,36,0.2); }
  50% { box-shadow: 0 0 36px rgba(251,191,36,0.35), 0 0 60px rgba(124,58,237,0.15); }
}

.leader-rank {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  background: rgba(124,58,237,0.15);
  border-radius: 12px;
  border: 1.5px solid rgba(124,58,237,0.3);
}

.leader-item.first-place .leader-rank {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border-color: #fbbf24;
  box-shadow: 0 0 16px rgba(251,191,36,0.5);
  font-size: 1.6rem;
}

.vip-winner-badge {
  position: absolute;
  top: -11px;
  right: 16px;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: #fff;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 14px rgba(124,58,237,0.5);
  border: 1.5px solid rgba(255,255,255,0.2);
  white-space: nowrap;
  z-index: 10;
}

.leader-body {
  display: contents;
}

.leader-name {
  color: #e0d4ff;
  font-weight: 800;
  letter-spacing: 0.03em;
  font-size: 1.05rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.leader-info {
  display: contents;
}

.leader-score {
  color: #fbbf24;
  font-weight: 900;
  font-size: 1.2rem;
  text-shadow: 0 0 8px rgba(251,191,36,0.4);
  white-space: nowrap;
}

.leader-attempts {
  color: #a78bfa;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.view-profile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  border: none;
  cursor: url('/static/cursor/select.cur'), pointer !important;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 3px 10px rgba(124,58,237,0.3);
  min-width: 110px;
  font-family: 'Lilita One', cursive;
}

.view-profile-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 5px 16px rgba(124,58,237,0.5);
}

.muted {
  color: rgba(255,255,255,0.45);
  font-size: 1rem;
  text-align: center;
  padding: 2rem;
  font-family: system-ui, sans-serif;
  font-weight: 400;
}

.profile-modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.85);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(12px);
}

.profile-modal.show {
  display: flex;
}

.profile-modal-content {
  position: relative;
  width: 90%;
  max-width: 700px;
}

.profile-modal iframe {
  width: 700px;
  height: 480px;
  border: none;
  border-radius: 22px;
  background: rgba(15,5,40,0.95);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 30px rgba(124,58,237,0.2);
  display: block;
}

.profile-modal-close {
  position: absolute;
  top: -15px;
  right: -15px;
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  cursor: url('/static/cursor/select.cur'), pointer !important;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.profile-modal-close:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(239,68,68,0.6);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media (max-width: 1100px) {
  .back-link {
    left: 10px;
  }
}

@media (max-width: 900px) {
  .back-link {
    top: 100px;
    left: 10px;
    padding: 10px 18px;
    font-size: 1.05rem;
  }

  .weekly-page-title {
    font-size: 2.4rem;
  }

  .hero-card {
    flex-direction: column;
    min-height: auto;
  }

  .hero-image {
    width: 100%;
    min-height: 220px;
    border-radius: 0;
  }

  .hero-image::after {
    background: linear-gradient(to bottom, transparent 50%, rgba(15,5,40,0.7) 100%);
  }

  .hero-content {
    padding: 1.5rem;
    gap: 1rem;
  }

  .play-btn {
    min-width: auto;
    width: 100%;
    padding: 14px 24px;
    font-size: 1.1rem;
    min-height: 58px;
  }

  .rules-popover {
    min-width: calc(100vw - 2rem);
    max-width: calc(100vw - 2rem);
    left: 1rem;
    transform: none;
    padding: 16px;
  }
}

@media (max-width: 768px) {
  .weekly-page {
    padding: 180px 12px 60px;
    gap: 20px;
  }

  .weekly-page-title {
    font-size: 2rem;
  }

  .weekly-subtitle {
    font-size: 0.9rem;
    padding: 0 12px;
  }

  .panel {
    padding: 18px;
  }

  .panel-title {
    font-size: 1.2rem;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .panel-header-left {
    width: 100%;
    justify-content: space-between;
  }

  .reward-badge {
    width: 100%;
    padding: 10px 14px;
  }

  .reward-badge img {
    width: 36px;
    height: 36px;
  }

  .week-timer {
    padding: 6px 12px;
    font-size: 0.82rem;
  }

  .player-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .stat-label {
    font-size: 0.72rem;
  }

  .stat-value {
    font-size: 1.15rem;
  }

  .vip-progress {
    padding: 12px;
  }

  .vip-progress-label {
    font-size: 0.85rem;
  }

  .vip-progress-bar {
    height: 10px;
  }

  .vip-progress-text {
    font-size: 0.78rem;
  }

  .leader-item {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    padding: 10px;
  }

  .leader-rank {
    width: 40px;
    height: 40px;
    font-size: 1.15rem;
  }

  .leader-item.first-place .leader-rank {
    font-size: 1.3rem;
  }

  .leader-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
  }

  .leader-name {
    font-size: 0.92rem;
  }

  .leader-info {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
  }

  .leader-score {
    font-size: 1rem;
  }

  .leader-attempts {
    font-size: 0.78rem;
  }

  .view-profile-btn {
    padding: 5px 10px;
    font-size: 0.68rem;
    min-width: auto;
  }

  .vip-winner-badge {
    top: -10px;
    right: 10px;
    padding: 4px 10px;
    font-size: 0.65rem;
  }

  .profile-modal-content {
    width: 95%;
    max-width: calc(100vw - 20px);
  }

  .profile-modal iframe {
    width: 100%;
    max-width: calc(100vw - 40px);
    height: 480px;
  }

  .profile-modal-close {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    top: -12px;
    right: -12px;
  }
}

@media (max-width: 480px) {
  .weekly-page {
    padding: 160px 8px 60px;
  }

  .back-link {
    top: 60px;
    left: 8px;
    padding: 8px 14px;
    font-size: 0.95rem;
    gap: 6px;
  }

  .back-link svg {
    width: 16px;
    height: 16px;
  }

  .weekly-page-title {
    font-size: 1.6rem;
  }

  .hero-image {
    min-height: 180px;
  }

  .hero-content {
    padding: 1rem 0.75rem;
  }

  .play-btn {
    padding: 12px 20px;
    font-size: 1rem;
    min-height: 52px;
  }

  .panel {
    padding: 14px;
    border-radius: 16px;
  }

  .panel-title {
    font-size: 1.05rem;
  }

  .player-stats {
    gap: 8px;
    padding: 10px;
  }

  .stat-label {
    font-size: 0.68rem;
  }

  .stat-value {
    font-size: 1.05rem;
  }

  .leader-item {
    gap: 8px;
    padding: 8px;
  }

  .leader-rank {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .leader-name {
    font-size: 0.82rem;
  }

  .leader-score {
    font-size: 0.9rem;
  }

  .leader-attempts {
    font-size: 0.72rem;
  }

  .view-profile-btn {
    padding: 4px 8px;
    font-size: 0.62rem;
  }

  .week-timer {
    padding: 5px 10px;
    font-size: 0.75rem;
  }

  .vip-winner-badge {
    font-size: 0.58rem;
    padding: 3px 8px;
  }

  .profile-modal iframe {
    height: 320px;
  }
}

@media (max-width: 360px) {
  .weekly-page-title {
    font-size: 1.4rem;
  }

  .play-btn {
    font-size: 0.95rem;
    padding: 10px 16px;
  }

  .leader-item {
    grid-template-columns: auto 1fr;
    gap: 6px;
  }

  .leader-info {
    flex-direction: column;
    align-items: flex-start;
  }

  .view-profile-btn {
    width: 100%;
    justify-content: center;
  }
}
