/*
 * Compact Result Card – 4D King Results
 * Desktop: 360×460 (fixed), responsive on mobile.
 * Beautiful hover glow, subtle border stroke,
 * and perfect spacing for buttons and jackpot cards.
 */

/* ── 3‑column grid for archive pages ── */
.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 30px;
}

/* Wrapper keeps card + its own “View Full Draw” button together */
.result-card-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;           /* space before download button or jackpot */
}

.result-card-wrapper .crc-card {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

/* ── “View Full Draw” button (the one directly under the card) ── */
.view-full-draw-btn {
  display: block;
  width: 150px;
  height: 35px;
  line-height: 35px;
  text-align: center;
  margin: 13px auto 0;           /* auto margins → horizontal centre */
  background: var(--primary-red);
  color: var(--white);
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.view-full-draw-btn:hover {
  background: var(--primary-hover, #a00000);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ── Main card ── */
.crc-card {
  width: 100%;
  max-width: 360px;
  height: 460px;
  background: var(--white);
  border: 1px solid var(--primary-red);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 3px 12px rgba(6, 0, 0, 0.285);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 0.8rem;
  line-height: 1.25;
  box-sizing: border-box;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* Hover glow & stroke */
.crc-card::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 16px;
  background: transparent;
  border: 2px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  pointer-events: none;
}

.crc-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(204, 0, 0, 0.571), 0 0 0 1px rgba(96, 2, 2, 0.539);
}

.crc-card:hover::after {
  border-color: var(--primary-red);
}

/* Header */
.crc-logo-wrapper {
  text-align: center;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.lottery-logo {
  max-height: 26px;
  width: auto;
  object-fit: contain;
  outline: var(--primary-red) 2px solid;
  border-radius: 100%;
  margin-bottom: 2px;
}

.lottery-logo-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  color: var(--grey);
}

.lottery-name {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  color: var(--dark);
  line-height: 1.2;
}

/* Meta row */
.crc-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 27px;
  padding: 0 2px;
  font-size: 0.72rem;
  color: var(--grey);
  border-bottom: 1px dashed var(--dark);
}

.result-number {
  font-weight: 700;
  color: var(--primary-red);
}

/* Prize rows */
.prizes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--grey);
}

.prize-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 27px;
  padding: 0 2px;
  border: 1px solid var(--dark);
  border-radius: 3px;
  transition: background 0.2s, border-color 0.2s;
}

.prize-row:hover {
  background: #fff5f5;
  border-color: var(--primary-red);
}

.prize-label {
  font-weight: 600;
  margin-left: 4px;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--dark);
}

.prize-value {
  font-weight: 700;
  margin-right: 4px;
  color: var(--primary-red);
  font-size: 0.85rem;
}

/* Section titles (Special / Consolation) */
.special-numbers h4,
.consolation-numbers h4 {
  text-align: center;
  width: 100%;
  font-size: 0.75rem;
  font-weight: 700;
  margin: 4px 0 2px;
  color: var(--dark);
  height: 27px;
  line-height: 27px;
  border: 1px solid var(--dark);
  border-radius: 3px;
  transition: background 0.2s, border-color 0.2s;
}

.special-numbers h4:hover,
.consolation-numbers h4:hover {
  background: #fff5f5;
  border-color: var(--primary-red);
}

/* Number grids */
.number-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(5, 1fr);
  grid-gap: 2px;
  margin-bottom: 4px;
}

.number-cell {
  text-align: center;
  padding: 0;
  border: 1px solid var(--dark);
  border-radius: 3px;
  font-weight: 700;
  font-size: 0.68rem;
  color: var(--dark);
  background: var(--white);
  height: 23px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}

.number-cell:hover {
  background: #fff5f5;
  border-color: var(--primary-red);
}

/* Disclaimer */
.disclaimer {
  height: 15px;
  margin-top: 0;
  margin-bottom: 2px;
  padding: 0 2px;
  border-top: 1px dashed var(--light-grey);
  display: flex;
  width: 100%;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  font-size: 9px !important;
  color: var(--grey);
}

.disclaimer small {
  font-size: inherit !important;
  white-space: nowrap;
}

.legal-links {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.legal-links a {
  font-size: inherit !important;
  color: var(--primary-red);
  text-decoration: underline;
  font-weight: 500;
}

/* Placeholder card */
.crc-card.placeholder {
  background: var(--light-grey);
  border: 2px dashed var(--grey);
  text-align: center;
  justify-content: center;
  height: auto;
  min-height: 200px;
}

.crc-card.placeholder .lottery-name {
  color: var(--grey);
}

.coming-soon {
  font-style: italic;
  color: var(--grey);
  margin-top: 4px;
}

/* ================== JACKPOT CARD (outside wrapper) ================== */
.jackpot-card {
  width: 100%;
  max-width: 360px;            /* match result card width */
  margin: 30px auto 20px;      /* auto → horizontally centered */
  padding: 16px;
  border: 2px solid var(--primary-red);
  border-radius: 8px;
  background: var(--white);
  box-sizing: border-box;
}

/* When two jackpot cards are consecutive */
.jackpot-card + .jackpot-card {
  margin-top: 15px;            /* tighter gap between them */
}

.jackpot-card h3 {
  color: var(--primary-red);
  margin-bottom: 12px;
}

/* The “View Full Draw” button inside a jackpot card stays exactly as defined above */

/* ================== DOWNLOAD BUTTON (uses global .download-btn + .center-btn) ================== */
/* No special overrides needed – the .center-btn class from buttons.css will centre it.
   The template already adds both classes to the download button. */

/* ================== RESPONSIVE ================== */
@media (max-width: 1024px) {
  .results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .crc-card {
    width: 100%;
    height: auto;               /* allow card to expand */
    min-height: 460px;
  }

  .jackpot-card {
    max-width: 100%;
    margin-left: 10px;
    margin-right: 10px;
  }

  .view-full-draw-btn {
    width: 100%;                /* full width on small screens */
    height: 44px;                /* comfortable tap target on mobile */
    line-height: 44px;
  }

  /* Let the disclaimer wrap instead of silently clipping legal text
     once the card is narrow enough that the text + links no longer
     fit on a single line. */
  .disclaimer {
    height: auto;
    flex-wrap: wrap;
    row-gap: 3px;
    padding: 4px 2px 2px;
  }

  .disclaimer small,
  .legal-links a {
    white-space: normal;
  }
}

/* Extra safety margin on very narrow phones — no layout change,
   just a touch more breathing room around the disclaimer text. */
@media (max-width: 380px) {
  .disclaimer {
    font-size: 8.5px !important;
  }
}