.contests-page {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0 70px;
  min-height: 50vh;
}

.contests-loading,
.contests-empty {
  padding: 60px 20px;
  text-align: center;
  color: #888;
  font-size: 15px;
}

.contests-list-title {
  font-size: 24px;
  margin: 10px 0 24px;
}

.contests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.contest-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.contest-card:hover {
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.contest-card-image {
  height: 150px;
  background: linear-gradient(135deg, #fff4d6, #ffe1b3);
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
  font-size: 40px;
}

.contest-card-body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contest-card-body h3 {
  margin: 0;
  font-size: 17px;
}

.contest-card-body p {
  margin: 0;
  color: #777;
  font-size: 13px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.contest-card-prize {
  font-size: 13px;
  color: #444;
}

.contest-card-prize-label {
  color: #999;
  margin-left: 4px;
}

.contest-card-cta {
  margin-top: 6px;
  font-weight: 700;
  font-size: 13px;
  color: #111;
}

/* ===== Contest detail / quiz ===== */

.contest-detail {
  max-width: 720px;
  margin: 0 auto;
}

.contest-back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: #666;
  text-decoration: none;
  font-size: 13px;
}

.contest-back-link:hover {
  color: #111;
}

.contest-detail-banner {
  height: 220px;
  border-radius: 16px;
  background: linear-gradient(135deg, #fff4d6, #ffe1b3);
  background-size: cover;
  background-position: center;
  margin-bottom: 20px;
}

.contest-detail h1 {
  margin: 0 0 10px;
  font-size: 26px;
}

.contest-detail-desc {
  color: #666;
  line-height: 1.9;
  margin: 0 0 16px;
}

.contest-detail-prize {
  background: #fff8e8;
  border: 1px solid #ffe4a8;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 18px;
}

.contest-quiz-intro {
  color: #555;
  font-size: 13px;
  margin-bottom: 20px;
}

.contest-question {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 16px 18px;
  margin: 0 0 14px;
}

.contest-question legend {
  padding: 0 4px;
  font-weight: 700;
  font-size: 14.5px;
}

.contest-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  cursor: pointer;
  font-size: 14px;
}

.contest-option input {
  accent-color: #111;
}

.contest-quiz-message {
  color: #b00020;
  font-size: 13px;
  min-height: 18px;
  margin: 6px 0 14px;
}

.contest-submit-btn {
  display: inline-block;
  border: none;
  background: #111;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 13px 26px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
}

.contest-submit-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.contest-empty-state {
  text-align: center;
  padding: 50px 20px;
}

.contest-empty-state h1 {
  font-size: 22px;
  margin-bottom: 8px;
}

.contest-empty-state h2 {
  font-size: 17px;
  margin: 10px 0;
}

.contest-empty-state p {
  color: #777;
  margin: 0 0 20px;
  line-height: 1.8;
}

.contest-result {
  text-align: center;
  padding: 40px 20px;
  border-radius: 16px;
  border: 1px solid #eee;
}

.contest-result h1 {
  font-size: 20px;
  color: #888;
}

.contest-result h2 {
  font-size: 22px;
  margin: 10px 0;
}

.contest-result p {
  color: #666;
  line-height: 1.8;
}

.contest-result-score {
  font-weight: 700;
  color: #111;
}

.contest-result.is-winner {
  background: #fff8e8;
  border-color: #ffe4a8;
}

.contest-result.is-correct-late {
  background: #f3f6ff;
  border-color: #dbe3ff;
}

.contest-result.is-incorrect {
  background: #faf7f5;
}

/* ===== Live contest — status badges + winner on cards ===== */

.contest-card-image {
  position: relative;
}

.contest-card-status {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #444;
}

.contest-card-status.is-live {
  color: #c1121f;
}

.contest-card-status.is-scheduled {
  color: #1a73e8;
}

.contest-card-winner {
  margin-top: 4px;
  font-weight: 700;
  font-size: 13px;
  color: #b8860b;
}

/* ===== Live contest — detail page (waiting room / question / reveal / ended) ===== */

.contest-live-state {
  border: 1px solid #eee;
  border-radius: 16px;
  padding: 22px 20px;
  text-align: center;
}

.contest-live-state h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.contest-live-state p {
  color: #666;
  line-height: 1.8;
  margin: 0 0 16px;
}

.contest-live-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.contest-live-badge.is-spectator {
  background: #f1f1f1;
  color: #666;
}

.contest-live-badge.is-eliminated {
  background: #fdeaea;
  color: #b00020;
}

.contest-live-joined {
  color: #16833b;
  font-weight: 700;
}

.contest-live-note {
  color: #999;
  font-size: 13px;
  margin: 14px 0 0;
}

.contest-question-live {
  text-align: start;
}

.contest-question-live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.contest-countdown {
  font-weight: 700;
  font-size: 18px;
  color: #c1121f;
  background: #fff2f2;
  padding: 5px 12px;
  border-radius: 999px;
}

.contest-question-live-text {
  font-weight: 700;
  font-size: 17px;
  margin: 0 0 16px;
}

.contest-options-live {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.contest-option-live {
  display: block;
  width: 100%;
  text-align: start;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 14.5px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.contest-option-live:hover:not(:disabled) {
  border-color: #111;
}

.contest-option-live:disabled {
  cursor: default;
  opacity: 0.7;
}

.contest-option-live.is-selected {
  border-color: #111;
  background: #f5f5f5;
  font-weight: 700;
}

.contest-option-live.is-reveal {
  cursor: default;
}

.contest-option-live.is-reveal.is-correct {
  border-color: #16833b;
  background: #f2fbf5;
  color: #16833b;
  font-weight: 700;
}

.contest-live-self-notice {
  font-weight: 700;
  text-align: center;
  padding: 12px;
  border-radius: 10px;
  background: #f8f8f8;
  margin: 10px 0 18px;
}

.contest-reveal-title {
  font-size: 14px;
  margin: 10px 0 10px;
  color: #777;
}

.contest-reveal-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
}

.contest-reveal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13.5px;
}

.contest-reveal-row.is-correct {
  background: #f2fbf5;
}

.contest-reveal-row.is-wrong {
  background: #fdf5f5;
  color: #999;
}

@media (max-width: 640px) {
  .contests-grid {
    grid-template-columns: 1fr;
  }

  .contest-detail-banner {
    height: 160px;
  }

  .contest-question-live-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
