:root {
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #f8fafc 0%, #eef3ff 100%);
  color: #0f172a;
}

.page-shell {
  width: 100%;
  flex: 1;
  padding: clamp(16px, 4vw, 32px) 0 40px;
}

.prize-layout {
  width: min(1080px, 100% - clamp(24px, 8vw, 120px));
  margin: 14px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 420px);
  gap: clamp(20px, 4vw, 40px);
  align-items: start;
}

.prize-intro {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.06);
  padding: clamp(22px, 4vw, 34px);
  backdrop-filter: blur(10px);
}

.prize-eyebrow {
  margin: 0 0 12px;
  color: #2563eb;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prize-title {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.1;
}

.prize-text {
  margin: 0;
  color: #475569;
  font-size: 1rem;
  line-height: 1.7;
  max-width: 60ch;
}

.page-content {
  width: min(1075px, 100% - clamp(24px, 8vw, 120px));
  margin: 60px auto 0;
}

.prize-widget-wrap {
  min-width: 0;
}

[hidden] {
  display: none !important;
}

#raffle-widget {
  --bg: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --stroke: rgba(148, 163, 184, 0.35);
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.15);
  --radius: 20px;
  color: var(--text);
  font-family: inherit;
}

.widget-shell {
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
  padding: clamp(16px, 3vw, 28px);
  margin: 0 auto;
}

.card {
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--stroke);
  padding: clamp(16px, 2.5vw, 24px);
  margin-bottom: clamp(16px, 2vw, 24px);
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.85), rgba(255, 255, 255, 0.95));
  backdrop-filter: blur(5px);
}

.card:last-of-type {
  margin-bottom: 0;
}

#winnerDetails .medium-text {
  font-size: 1rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.label {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.value {
  margin: 4px 0 0;
  color: var(--text);
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  font-weight: 600;
}

.subtle {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.95rem;
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
}

.progress {
  position: relative;
  height: 16px;
  margin-bottom: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
}

.progress-fill {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 0;
  height: 100%;
  padding-right: 8px;
  border-radius: inherit;
  background: linear-gradient(90deg, #818cf8, #2563eb);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  transition: width 0.6s ease;
}

.progress-fill span {
  mix-blend-mode: screen;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stat {
  padding: 12px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.08);
}

.last-winner .winner-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.widget-loader,
.widget-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 220px;
  text-align: center;
}

.widget-error button {
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.widget-error button:focus-visible,
.widget-error button:hover {
  opacity: 0.9;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(37, 99, 235, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .progress-fill,
  .spinner {
    transition: none;
    animation: none;
  }
}

@media (max-width: 900px) {
  .prize-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .prize-layout {
    width: min(1080px, 100% - 24px);
  }

  .widget-shell {
    border-radius: 16px;
    padding: 16px;
  }

  .card {
    padding: 16px;
    border-radius: 14px;
  }
}
