/* ==========================================
   GIVEAWAY PAGE (css/giveaway.css)
   Pink and purple palette, matching the homepage.
========================================== */

:root {
  --gw-bg: #0c0517;
  --gw-panel: #160a26;
  --gw-card: #200d36;
  --gw-line: rgba(192, 132, 252, .22);
  --gw-text: #faf5ff;
  --gw-muted: #c4b5d4;
  --gw-purple: #c084fc;
  --gw-pink: #f472b6;
  --gw-grad: linear-gradient(135deg, #e879f9 0%, #a855f7 50%, #f472b6 100%);
  --gw-ok: #4ade80;
  --gw-bad: #fb7185;
}

body {
  background: var(--gw-bg);
  color: var(--gw-text);
}

.giveaway-page {
  width: min(1080px, 100% - 32px);
  margin: 0 auto;
  padding: 40px 0 72px;
  box-sizing: border-box;
}

/* ---------- hero ---------- */

.giveaway-hero {
  text-align: center;
  padding: 24px 0 36px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--gw-line);
  background: rgba(192, 132, 252, .08);
  color: var(--gw-purple);
  font-size: .85rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.giveaway-hero h1 {
  margin: 14px 0 10px;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  background: var(--gw-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.giveaway-hero p {
  margin: 0 auto;
  max-width: 560px;
  color: var(--gw-muted);
  line-height: 1.6;
}

.hero-badge .ic,
.premium-tag .ic,
.card-meta .ic,
.winner .ic,
.entered-note .ic,
.signin-note .ic,
.owner-panel h2 .ic {
  width: 1em;
  height: 1em;
}

/* ---------- owner panel ---------- */

.owner-panel {
  background: var(--gw-panel);
  border: 1px solid var(--gw-line);
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 28px;
}

.owner-panel h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 1.1rem;
}

.create-form {
  display: grid;
  gap: 16px 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
}

.create-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--gw-muted);
  font-size: .9rem;
  min-width: 0;
}

/* Checkbox sits on one line with its text, aligned to the input row. */
.create-form label.check-row {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  height: 44px;
  white-space: nowrap;
  color: var(--gw-text);
}

.create-form label.check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--gw-pink);
}

/* Every text field has the same height and inner spacing. */
.create-form input:not([type="checkbox"]),
.create-form textarea {
  height: 44px;
  background: var(--gw-bg);
  color: var(--gw-text);
  border: 1px solid var(--gw-line);
  border-radius: 10px;
  padding: 0 12px;
  font: inherit;
  width: 100%;
  box-sizing: border-box;
}

.create-form textarea {
  padding: 10px 12px;
  line-height: 1.4;
  resize: vertical;
  min-height: 44px;
}

.create-form .primary-button {
  grid-column: 1 / -1;
  justify-self: start;
}

/* ---------- status line ---------- */

.status-line {
  min-height: 1.4em;
  margin: 0 0 18px;
  text-align: center;
  color: var(--gw-muted);
}

.status-line[data-tone="success"] { color: var(--gw-ok); }
.status-line[data-tone="error"] { color: var(--gw-bad); }

/* ---------- list ---------- */

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

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

.giveaway-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--gw-card);
  border: 1px solid var(--gw-line);
  border-radius: 20px;
  padding: 22px;
  overflow: hidden;
}

.giveaway-card.is-premium {
  border-color: transparent;
  background:
    linear-gradient(var(--gw-card), var(--gw-card)) padding-box,
    var(--gw-grad) border-box;
  border: 1.5px solid transparent;
  box-shadow: 0 0 32px rgba(232, 121, 249, .18);
}

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.card-prize-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(192, 132, 252, .14);
  color: var(--gw-purple);
  flex-shrink: 0;
}

.card-prize-icon .ic {
  width: 22px;
  height: 22px;
}

.card-title {
  flex: 1;
  min-width: 0;
}

.card-title h2 {
  margin: 0;
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}

.premium-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--gw-grad);
  color: #1a0624;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.status-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  border: 1px solid var(--gw-line);
  color: var(--gw-muted);
  white-space: nowrap;
}

.status-pill[data-state="open"] {
  color: var(--gw-ok);
  border-color: rgba(74, 222, 128, .35);
}

.status-pill[data-state="drawn"] {
  color: var(--gw-pink);
  border-color: rgba(244, 114, 182, .4);
}

.card-prize {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gw-pink);
  overflow-wrap: anywhere;
}

.card-desc {
  margin: 0;
  color: var(--gw-muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--gw-muted);
  font-size: .9rem;
}

.card-meta li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.card-foot {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.winner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(244, 114, 182, .1);
  color: var(--gw-pink);
  font-weight: 700;
}

.enter-button,
.owner-actions .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.owner-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.entered-note,
.signin-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--gw-muted);
  font-size: .95rem;
}

.entered-note {
  color: var(--gw-ok);
  font-weight: 700;
}

.signin-note a {
  color: var(--gw-purple);
  font-weight: 700;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
}

.primary-button {
  background: var(--gw-grad);
  color: #1a0624;
}

.ghost-button {
  background: transparent;
  color: var(--gw-purple);
  border-color: var(--gw-line);
}

.primary-button:disabled,
.ghost-button:disabled {
  opacity: .55;
  cursor: wait;
}

.primary-button .ic,
.ghost-button .ic {
  width: 1em;
  height: 1em;
}

.giveaway-page [hidden] {
  display: none !important;
}

/* ---------- light theme ---------- */

:root[data-theme="light"] .giveaway-page {
  --gw-bg: #faf5ff;
  --gw-panel: #ffffff;
  --gw-card: #ffffff;
  --gw-line: rgba(168, 85, 247, .25);
  --gw-text: #2e1065;
  --gw-muted: #6b5a86;
}

:root[data-theme="light"] body {
  background: #faf5ff;
  color: #2e1065;
}

@media (max-width: 520px) {
  .giveaway-page {
    width: calc(100% - 32px);
    padding-top: 28px;
  }

  .giveaway-list {
    grid-template-columns: 1fr;
  }
}
