/* Redeem codes — same card pattern as the community codes list. */

.codes-main {
  width: 100%;
  margin: 0 auto;
  padding-bottom: 48px;
}

.codes-main h1 {
  margin: 12px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 2.75rem);
  font-weight: 650;
  letter-spacing: -0.03em;
}

.codes-lede {
  margin: 12px 0 0;
  max-width: 40rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

body.codes-body {
  overflow-x: clip;
}

.codes-live {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.codes-live.is-live {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 28px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(14, 7, 24, 0.45);
  font-size: 0.88rem;
}

.codes-live.is-live b {
  color: var(--gold);
  font-weight: 800;
}

.codes-main,
.codes-stack,
.code-card {
  min-width: 0;
  max-width: 100%;
}

.codes-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
  align-items: stretch;
}

.code-card {
  display: flex;
  flex-direction: column;
  padding: 18px 18px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(42, 24, 72, 0.55);
}

.code-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.code-card-top > div {
  min-width: 0;
  flex: 1;
}

.code-name {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.15;
  color: var(--gold);
  word-break: break-word;
}

.code-status {
  margin: 4px 0 0;
  font-size: 0.92rem;
  font-weight: 650;
}

.is-working .code-status { color: #5ee08a; }
.is-expired .code-status { color: #ff6b3d; }
.is-checking .code-status { color: var(--gold); }

.code-copy,
.vote {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.code-copy {
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg-deep);
  padding: 8px 16px;
  font-size: 0.92rem;
  font-weight: 700;
}

.code-copy:hover { background: var(--gold); }

.code-rewards {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.code-rewards li {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.35;
}

.code-reward {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.code-foot {
  margin-top: auto;
  padding-top: 16px;
}

.meter {
  display: flex;
  margin-top: 0;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.meter-works,
.meter-expired {
  display: block;
  height: 100%;
}

.meter-works { background: #5ee08a; }
.meter-expired { background: #ff6b3d; }

.pct-line {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.vote-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.vote {
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(18, 8, 32, 0.45);
  color: var(--ink);
  padding: 8px 10px;
  font-size: 0.88rem;
  font-weight: 700;
}

.vote:hover { background: rgba(255, 255, 255, 0.12); }

.vote.is-selected[data-vote="works"],
.vote.is-selected[data-vote="works"]:hover {
  background: #5ee08a;
  border-color: transparent;
  color: #102016;
}

.vote.is-selected[data-vote="expired"],
.vote.is-selected[data-vote="expired"]:hover {
  background: #ff6b3d;
  border-color: transparent;
  color: #1a1020;
}

.vote:disabled,
.code-copy:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.codes-empty {
  margin: 28px 0;
  color: var(--muted);
}

@media (max-width: 760px) {
  .codes-stack {
    grid-template-columns: 1fr;
  }
}

.form-error {
  margin: 8px 0 0;
  color: var(--danger);
  font-weight: 700;
}

.form-error:empty { display: none; }
