*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --bg: #f7f8fc;
  --panel: #ffffff;
  --panel-soft: rgba(9, 14, 32, 0.04);
  --text: #111827;
  --text-muted: #4b5563;
  --accent: #4f46e5;
  --accent-strong: #4338ca;
  --border: rgba(79, 70, 229, 0.18);
}

body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top, rgba(79, 70, 229, 0.12), transparent 55%),
    var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  font-family: "Inter", "Open Sans", Helvetica, sans-serif;
  color: var(--text);
  font-size: 18px;
  line-height: 1.6;
  min-height: 100vh;
}

.frontpage-header {
  width: min(1100px, 92vw);
  margin-top: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.frontpage-header img {
  max-width: 100%;
  width: min(420px, 100%);
  max-height: 22vh;
  height: auto;
  object-fit: contain;
  display: block;
}

.home-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
}

.home-link:hover {
  color: var(--text);
}

.giveaway-content {
  width: min(1100px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-bottom: 48px;
}

.listing-hero {
  display: grid;
  gap: 12px;
  padding: 8px 12px;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  padding: 24px;
  background: var(--panel-soft);
  border-radius: 24px;
  border: 1px solid var(--border);
}

.listing-section {
  display: grid;
  gap: 16px;
}

.section-header {
  padding: 0 12px;
}

.section-header h2 {
  margin: 0 0 6px;
  font-size: 1.4rem;
}

.section-header p {
  margin: 0;
  color: var(--text-muted);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 20px 12px;
  color: var(--text-muted);
  text-align: center;
}

.listing-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.listing-image {
  background: var(--panel-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  height: 200px;
  border-bottom: 1px solid var(--border);
}

.listing-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.listing-body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  flex: 1;
}

.listing-body h2 {
  margin: 0;
  font-size: 1.25rem;
}

.listing-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.1);
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 600;
}

.listing-body p {
  margin: 0;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.listing-actions {
  display: grid;
  grid-template-columns: minmax(140px, auto) 1fr;
  align-items: center;
  gap: 12px;
  margin-top: auto;
}

.secondary-link {
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 600;
}

.secondary-link:hover {
  color: var(--text);
}

.secondary-link.disabled {
  color: var(--text-muted);
  cursor: not-allowed;
  display: inline-flex;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge.active {
  background: rgba(79, 70, 229, 0.12);
  color: var(--accent-strong);
}

.badge.expired {
  background: rgba(244, 63, 94, 0.12);
  color: #be123c;
}

.giveaway-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

.giveaway-copy h1 {
  margin: 8px 0 12px;
  font-size: clamp(2rem, 3vw, 2.8rem);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--accent-strong);
  font-weight: 600;
  margin: 0;
}

.description {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 10px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.3);
}

.primary-button.disabled {
  background: #c7c9d9;
  border-color: #c7c9d9;
  color: #6b7280;
  box-shadow: none;
  cursor: not-allowed;
}

.redirect-note {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.giveaway-media {
  background: var(--panel-soft);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
}

.giveaway-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--text-muted);
}

.page-link {
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 600;
}

.page-link:hover {
  color: var(--text);
}

.info-panel {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 24px;
}

.info-panel h2 {
  margin: 0 0 8px;
}

.info-panel a {
  color: var(--accent-strong);
  word-break: break-word;
}

@media (max-width: 768px) {
  .frontpage-header {
    flex-direction: column;
    text-align: center;
  }

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

  .listing-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .primary-button {
    width: 100%;
    text-align: center;
  }
}