.lottery-page {
  --lottery-accent: var(--mainC, #c9152b);
  --lottery-accent-dark: color-mix(in srgb, var(--lottery-accent) 82%, #000);
  --lottery-border: #e5e7eb;
  --lottery-muted: #6b7280;
  --lottery-surface: #fff;
  --lottery-soft: #f7f7f8;
}

.lottery-page .h1-menu {
  margin-bottom: 2rem;
}

.lottery-list__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}

.lottery-card {
  min-width: 0;
  overflow: hidden;
  background: var(--lottery-surface);
  border: 1px solid var(--lottery-border);
  border-radius: 0.5rem;
  box-shadow: 0 0.3rem 1.1rem rgb(15 23 42 / 8%);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lottery-card:hover {
  transform: translateY(-0.25rem);
  box-shadow: 0 0.8rem 1.8rem rgb(15 23 42 / 14%);
}

.lottery-card__link,
.lottery-card__link:hover {
  display: block;
  color: inherit;
  text-decoration: none;
}

.lottery-card__image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #f0f0f0;
}

.lottery-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.lottery-card:hover .lottery-card__image img {
  transform: scale(1.025);
}

.lottery-card__badge,
.lottery-preview-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  color: #fff;
  background: #6b7280;
  border-radius: 999px;
  font-size: 0.78rem;
}

.lottery-card__badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

.lottery-card__body {
  padding: 1.2rem 1.25rem 1.4rem;
  text-align: center;
}

.lottery-card__brand,
.lottery-detail__brand {
  margin: 0 0 0.35rem;
  color: var(--lottery-muted);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

.lottery-card__title {
  margin: 0;
  color: #202124;
  font-size: 1.15rem;
  line-height: 1.55;
}

.lottery-card__period,
.lottery-detail__period {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  margin: 0.75rem 0 0;
  color: var(--lottery-accent);
  font-size: 0.95rem;
}

.lottery-empty {
  padding: 2rem;
  color: var(--lottery-muted);
  text-align: center;
  background: var(--lottery-soft);
  border: 1px solid var(--lottery-border);
  border-radius: 0.5rem;
}

.lottery-detail {
  padding-bottom: 2rem;
}

.lottery-detail__header {
  display: flex;
  gap: 1.5rem;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.lottery-detail__header h1 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.35;
}

.lottery-detail__header .lottery-detail__period {
  justify-content: flex-start;
}

.lottery-preview-badge {
  margin-top: 0.75rem;
}

.lottery-back-link {
  flex: 0 0 auto;
  padding-bottom: 0.25rem;
  color: var(--lottery-accent);
  text-decoration: none;
}

.lottery-back-link i {
  margin-right: 0.4rem;
}

.lottery-detail__hero {
  overflow: hidden;
  margin-bottom: 2rem;
  border-radius: 0.5rem;
}

.lottery-detail__hero img {
  display: block;
  width: 100%;
  max-height: 46rem;
  object-fit: contain;
}

.lottery-tabs {
  display: flex;
  overflow-x: auto;
  gap: 0;
  margin-bottom: 0;
  border-bottom: 2px solid var(--lottery-accent);
  scrollbar-width: thin;
}

.lottery-tabs__button {
  flex: 0 0 auto;
  min-width: 8rem;
  padding: 0.85rem 1.5rem;
  color: #374151;
  background: #f4f4f5;
  border: 0;
  border-right: 1px solid #fff;
  font-weight: 600;
  cursor: pointer;
}

.lottery-tabs__button:hover,
.lottery-tabs__button.is-active {
  color: #fff;
  background: var(--lottery-accent);
}

.lottery-tab-panels {
  padding: clamp(1.25rem, 3vw, 2.5rem);
  background: var(--lottery-surface);
  border: 1px solid var(--lottery-border);
  border-top: 0;
}

.lottery-tab-panel[hidden] {
  display: none;
}

.lottery-editor {
  overflow-wrap: anywhere;
  line-height: 1.8;
}

.lottery-editor img,
.lottery-editor iframe,
.lottery-editor video {
  max-width: 100%;
}

.lottery-editor table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.lottery-prizes {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--lottery-border);
}

.lottery-prizes h2,
.lottery-related h2 {
  margin: 0 0 1.25rem;
  font-size: 1.5rem;
}

.lottery-prizes__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.lottery-prize-card {
  overflow: hidden;
  border: 1px solid var(--lottery-border);
  border-radius: 0.5rem;
}

.lottery-prize-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--lottery-soft);
}

.lottery-prize-card > div {
  padding: 1rem;
}

.lottery-prize-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.lottery-prize-card p {
  margin-bottom: 0.65rem;
  color: var(--lottery-muted);
}

.lottery-prize-card span {
  color: var(--lottery-accent);
  font-weight: 600;
}

.lottery-registration {
  scroll-margin-top: 2rem;
}

.lottery-form-error {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  color: #9f1239;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 0.5rem;
  font-weight: 600;
  scroll-margin-top: 6rem;
}

.lottery-form-section {
  min-width: 0;
  margin: 0 0 2rem;
  padding: 0;
  border: 0;
}

.lottery-form-section legend {
  width: 100%;
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  color: #202124;
  border-bottom: 1px solid var(--lottery-border);
  font-size: 1.3rem;
  font-weight: 700;
}

.lottery-credential-rows {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.lottery-credential-row {
  display: grid;
  grid-template-columns: 2.2rem 1fr 1.2fr 1.55fr 1.2fr 2.2rem;
  gap: 0.75rem;
  align-items: end;
  padding: 1rem;
  background: var(--lottery-soft);
  border: 1px solid var(--lottery-border);
  border-radius: 0.5rem;
}

.lottery-credential-row__number {
  display: grid;
  align-self: center;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  color: #fff;
  background: var(--lottery-accent);
  border-radius: 50%;
  font-weight: 700;
}

.lottery-credential-remove {
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  color: #9f1239;
  background: #fff;
  border: 1px solid #fecdd3;
  border-radius: 50%;
}

.lottery-credential-row:only-child .lottery-credential-remove {
  visibility: hidden;
}

.lottery-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem 1.5rem;
}

.lottery-field {
  min-width: 0;
}

.lottery-field--wide {
  grid-column: 1 / -1;
}

.lottery-field > label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 600;
}

.lottery-field > label span {
  color: #dc2626;
}

.lottery-field > small {
  display: block;
  margin-top: 0.35rem;
  color: var(--lottery-muted);
}

.lottery-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  min-height: 2.75rem;
  align-items: center;
}

.lottery-choice-row .form-check {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  margin: 0;
}

.lottery-captcha {
  margin: 0 0 1.5rem;
}

.lottery-consent {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #fffaf0;
  border: 1px solid #f5d99b;
  border-radius: 0.5rem;
  line-height: 1.7;
}

.lottery-consent input {
  flex: 0 0 auto;
  margin-top: 0.35rem;
}

.lottery-form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.lottery-form-actions .btn {
  min-width: 8rem;
}

.lottery-winner-table th {
  white-space: nowrap;
}

.lottery-related {
  margin-top: 3rem;
}

.lottery-related__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.lottery-related__grid a {
  overflow: hidden;
  color: inherit;
  background: #fff;
  border: 1px solid var(--lottery-border);
  border-radius: 0.5rem;
  text-decoration: none;
}

.lottery-related__grid img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.lottery-related__grid span {
  display: block;
  padding: 0.9rem 1rem;
  font-weight: 600;
}

@media (max-width: 1199.98px) {
  .lottery-list__grid,
  .lottery-prizes__grid,
  .lottery-related__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lottery-credential-row {
    grid-template-columns: 2.2rem repeat(2, minmax(0, 1fr)) 2.2rem;
  }

  .lottery-credential-row__number {
    grid-row: span 2;
  }
}

@media (max-width: 767.98px) {
  .lottery-list__grid,
  .lottery-prizes__grid,
  .lottery-related__grid,
  .lottery-form-grid {
    grid-template-columns: 1fr;
  }

  .lottery-detail__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .lottery-tab-panels {
    padding: 1.1rem;
  }

  .lottery-tabs__button {
    min-width: auto;
    padding: 0.75rem 1rem;
  }

  .lottery-credential-row {
    grid-template-columns: 2.2rem minmax(0, 1fr) 2.2rem;
    align-items: start;
  }

  .lottery-credential-row__number {
    grid-row: auto;
  }

  .lottery-credential-row .lottery-field {
    grid-column: 2;
  }

  .lottery-credential-remove {
    grid-column: 3;
    grid-row: 1;
  }

  .lottery-field--wide {
    grid-column: auto;
  }
}

@media (max-width: 480px) {
  .lottery-list__grid {
    gap: 1.2rem;
  }

  .lottery-form-actions {
    flex-direction: column;
  }

  .lottery-form-actions .btn {
    width: 100%;
  }
}
