/* ══════════════════════════════════════════════════════════
   JustinGambles — Challenges Page
══════════════════════════════════════════════════════════ */

.ch-page{ min-height: 80vh; }

/* ── Hero ── */
.ch-hero{
  position: relative;
  padding: 52px 28px 40px;
  overflow: hidden;
  border-bottom: 1px solid rgba(196,135,71,.10);
  margin-bottom: 8px;
}
.ch-hero__glow{
  position: absolute;
  top: -60px; left: 50%;
  transform: translateX(-50%);
  width: 700px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(196,135,71,.13) 0%, transparent 70%);
  pointer-events: none;
}
.ch-hero__inner{
  position: relative;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ch-hero__eyebrow{
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: rgba(196,135,71,.65);
}
.ch-hero__title{
  font-size: 44px;
  font-weight: 950;
  letter-spacing: .3px;
  margin: 0;
  line-height: 1.05;
  color: rgba(233,238,247,.97);
}
.ch-hero__gold{
  background: linear-gradient(135deg,#ffd77a,#c9912a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ch-hero__sub{
  font-size: 14px;
  color: rgba(170,180,197,.80);
  line-height: 1.6;
  margin: 0;
  max-width: 480px;
}
.ch-hero__cta{
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 22px;
  border-radius: 14px;
  background: linear-gradient(135deg,#ffd77a,#c9912a);
  color: #1b1206;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  margin-top: 4px;
  width: fit-content;
  transition: filter .15s;
}
.ch-hero__cta:hover{ filter: brightness(1.07); }

/* ── Shell ── */
.ch-shell{
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

/* ── How it works ── */
.ch-how{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.ch-how__item{
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 160px;
  padding: 12px 16px;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
}
.ch-how__icon{ font-size: 20px; flex-shrink: 0; }
.ch-how__text{ font-size: 13px; color: rgba(170,180,197,.85); line-height: 1.4; }

/* ── Grid ── */
.ch-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* ── Challenge Card ── */
.ch-card{
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(255,255,255,.07);
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.ch-card:hover{
  transform: translateY(-4px);
  border-color: rgba(196,135,71,.30);
  box-shadow: 0 12px 40px rgba(0,0,0,.5), 0 0 20px rgba(196,135,71,.06);
}

/* Image area */
.ch-card__img{
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: rgba(0,0,0,.4);
  flex-shrink: 0;
}
.ch-card__img img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}
.ch-card:hover .ch-card__img img{ transform: scale(1.04); }
.ch-card__imgPlaceholder{
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  background: rgba(196,135,71,.06);
  border-bottom: 1px solid rgba(196,135,71,.10);
}

/* Prize badge over image */
.ch-card__prizeBadge{
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg,#ffd77a,#c9912a);
  color: #1a0e00;
  font-size: 14px;
  font-weight: 950;
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
  letter-spacing: .3px;
}

/* Card body */
.ch-card__body{
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  flex: 1;
  background: linear-gradient(180deg, rgba(18,14,8,.92), rgba(10,8,4,.96));
}
.ch-card__game{
  font-size: 16px;
  font-weight: 950;
  color: rgba(233,238,247,.97);
  line-height: 1.2;
}
.ch-card__provider{
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: rgba(196,135,71,.60);
  margin-top: -4px;
}
.ch-card__title{
  font-size: 12px;
  color: rgba(170,180,197,.65);
  line-height: 1.4;
}

/* Requirements */
.ch-card__reqs{
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.ch-card__req{
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px;
  padding: 8px 10px;
}
.ch-card__reqIcon{ font-size: 14px; flex-shrink: 0; }
.ch-card__reqLabel{
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .7px;
  text-transform: uppercase;
  color: rgba(170,180,197,.45);
  line-height: 1;
}
.ch-card__reqVal{
  font-size: 14px;
  font-weight: 950;
  color: rgba(233,238,247,.95);
  line-height: 1.2;
}

/* Prize row */
.ch-card__prize{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(196,135,71,.07);
  border: 1px solid rgba(196,135,71,.18);
  border-radius: 12px;
  margin-top: 4px;
}
.ch-card__prizeLabel{
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: rgba(196,135,71,.65);
}
.ch-card__prizeVal{
  font-size: 20px;
  font-weight: 950;
  background: linear-gradient(135deg,#ffd77a,#c9912a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: .3px;
}

/* Claim button */
.ch-card__claim{
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg,#ffd77a,#c9912a);
  color: #1b1206;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  margin-top: auto;
  cursor: pointer;
  border: none;
  width: 100%;
  font-family: inherit;
  transition: filter .15s;
}
.ch-card__claim:hover{ filter: brightness(1.08); }
.ch-card__claim--locked{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  color: rgba(170,180,197,.70);
}
.ch-card__claim--locked:hover{ filter: none; border-color: rgba(196,135,71,.25); }

/* Empty */
.ch-empty{
  text-align: center;
  padding: 60px 20px;
  color: rgba(170,180,197,.55);
  font-size: 15px;
}

/* ── Modal shared field/upload/button styles ── */
.rwm-field{ display: flex; flex-direction: column; gap: 6px; }
.rwm-field label{
  font-size: 11px; font-weight: 950; letter-spacing: .7px;
  text-transform: uppercase; color: rgba(196,135,71,.80);
}
.rwm-field input,
.rwm-field textarea{
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 10px;
  padding: 10px 13px;
  color: rgba(233,238,247,.92);
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}
.rwm-field input:focus,
.rwm-field textarea:focus{ border-color: rgba(196,135,71,.45); }
.rwm-field textarea{ resize: vertical; min-height: 72px; }
.rw-hint{ font-size: 11px; color: rgba(170,180,197,.55); margin-top: 2px; }
.req{ color: rgba(255,100,100,.85); }

/* Upload zone */
.rwm-upload{
  border: 1.5px dashed rgba(255,255,255,.14);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  overflow: hidden;
}
.rwm-upload:hover,
.rwm-upload.is-drag{
  border-color: rgba(196,135,71,.40);
  background: rgba(196,135,71,.05);
}
.rwm-upload input[type=file]{ display: none; }
.rwm-upload__inner{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 16px;
}
.rwm-upload__icon{ font-size: 24px; }
.rwm-upload__text{ font-size: 14px; color: rgba(233,238,247,.80); font-weight: 600; }
.rwm-upload__hint{ font-size: 12px; color: rgba(170,180,197,.50); }

/* Preview — thumbnail, NOT full screen */
.rwm-upload__preview{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  flex-wrap: wrap;
}
.rwm-upload__preview img{
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.10);
  flex-shrink: 0;
  display: block;
}
#chUploadFilename{
  font-size: 12px;
  color: rgba(170,180,197,.75);
  flex: 1;
  word-break: break-all;
}
.rwm-upload__remove{
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255,80,80,.10);
  border: 1px solid rgba(255,80,80,.20);
  color: rgba(255,190,190,.85);
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Error */
.rwm-error{
  padding: 10px 14px;
  background: rgba(255,80,80,.10);
  border: 1px solid rgba(255,80,80,.25);
  border-radius: 10px;
  color: rgba(255,190,190,.95);
  font-size: 13px;
}

/* Action buttons */
.rwm-actions{ display: flex; gap: 10px; }
.rwm-submit{
  flex: 1; height: 44px; border-radius: 12px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  border: 1px solid rgba(255,210,120,.35);
  background: linear-gradient(135deg,#ffd77a 0%,#c9912a 100%);
  color: #1b1206; transition: filter .15s; font-family: inherit;
}
.rwm-submit:hover{ filter: brightness(1.07); }
.rwm-submit:disabled{ opacity: .55; cursor: not-allowed; filter: none; }
.rwm-cancel{
  height: 44px; padding: 0 20px; border-radius: 12px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(232,224,199,.18);
  color: rgba(255,245,230,.88); transition: border-color .15s; font-family: inherit;
}
.rwm-cancel:hover{ border-color: rgba(255,210,120,.30); }

/* Success state */
.rwm-success{
  display: flex; flex-direction: column;
  align-items: center; gap: 14px;
  padding: 20px 0; text-align: center;
}
.rwm-success__icon{
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(60,200,100,.15);
  border: 1px solid rgba(60,200,100,.30);
  color: rgba(120,240,160,.95); font-size: 26px;
  display: flex; align-items: center; justify-content: center;
}
.rwm-success__title{ font-size: 20px; font-weight: 950; color: rgba(233,238,247,.97); }
.rwm-success__sub{ font-size: 14px; color: rgba(170,180,197,.80); max-width: 320px; line-height: 1.6; }

/* ── Modal ── */
.ch-modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ch-modal{
  background: #14120e;
  border: 1px solid rgba(196,135,71,.22);
  border-radius: 22px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 32px 80px rgba(0,0,0,.65);
}
.ch-modal__head{ display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ch-modal__title{ font-size: 20px; font-weight: 950; color: rgba(233,238,247,.97); }
.ch-modal__sub{ font-size: 13px; color: rgba(196,135,71,.70); margin-top: 3px; font-weight: 700; }
.ch-modal__close{
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.10);
  color: rgba(233,238,247,.70); font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s; flex-shrink: 0;
}
.ch-modal__close:hover{ background: rgba(255,80,80,.15); color: rgba(255,190,190,.9); }
.ch-modal__form{ display: flex; flex-direction: column; gap: 14px; }

@media(max-width:767px){
  .ch-hero__title{ font-size: 32px; }
  .ch-grid{ grid-template-columns: 1fr !important; gap: 14px; }
}

/* ── Claimed challenge state ── */
.ch-card--claimed{
  position: relative;
  pointer-events: none;
}
/* Fade the card content behind overlay */
.ch-card--claimed .ch-card__img,
.ch-card--claimed .ch-card__body{
  opacity: 0.28;
  filter: saturate(0.25);
}
/* Full-card overlay */
.ch-card__claimedOverlay{
  position: absolute;
  inset: 0;
  z-index: 10;
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8,6,3,.55);
  backdrop-filter: blur(2px);
}
.ch-card__claimedInner{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 16px;
}
/* Avatar circle */
.ch-card__claimedAvatar{
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid rgba(196,135,71,.70);
  box-shadow: 0 0 20px rgba(196,135,71,.30);
}

.ch-card__claimedLabel{
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: rgba(120,240,160,.85);
}
.ch-card__claimedName{
  font-size: 16px;
  font-weight: 950;
  color: rgba(255,245,230,.95);
  margin-top: 2px;
}
