:root {
  --ink: #1a211c;
  --muted: #5c6b62;
  --paper: #f3efe6;
  --panel: rgba(255, 252, 246, 0.88);
  --line: rgba(26, 33, 28, 0.12);
  --win: #1f6b45;
  --win-bg: #d9f0e3;
  --lose: #8a3b2b;
  --lose-bg: #f5e2dc;
  --accent: #0f5c5c;
  --accent-ink: #f7fffe;
  --shadow: 0 18px 50px rgba(26, 33, 28, 0.08);
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(15, 92, 92, 0.14), transparent 60%),
    radial-gradient(700px 380px at 100% 0%, rgba(143, 92, 42, 0.12), transparent 55%),
    linear-gradient(180deg, #efe8da 0%, var(--paper) 40%, #e7efe9 100%);
}

.shell {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}

.shell.dimmed {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}

.hidden {
  display: none !important;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(26, 33, 28, 0.28);
  backdrop-filter: blur(6px);
}

.auth-card {
  width: min(420px, calc(100% - 2rem));
  padding: 1.75rem 1.6rem 1.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: 2rem;
}

.user-bar {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
}

#google-btn {
  margin-top: 1rem;
  min-height: 44px;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: end;
  margin-bottom: 1.75rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.lede {
  margin: 0.6rem 0 0;
  max-width: 36rem;
  color: var(--muted);
  line-height: 1.5;
}

.meta {
  text-align: right;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.vendor-bar {
  margin-bottom: 1.25rem;
  padding: 1rem 1.15rem 1.05rem;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.vendor-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.vendor-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
}

.vendor-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.vendor-switch button {
  margin: 0;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.vendor-switch button[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.capability-strip {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.capability-strip span {
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.6);
}

.capability-strip .ok {
  color: var(--win);
  border-color: rgba(31, 107, 69, 0.28);
}

.capability-strip .warn {
  color: var(--lose);
  border-color: rgba(138, 59, 43, 0.28);
}

.fund {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

.fund h2,
.panel h2 {
  margin: 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

.fund-balance {
  margin: 0.35rem 0 0;
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -0.03em;
}

.grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 1.25rem 1.35rem 1.4rem;
  box-shadow: var(--shadow);
}

.cards {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0;
}

.kyc-form {
  margin: 1rem 0 0.75rem;
  padding: 0;
  border-top: none;
}

.kyc-form h3 {
  margin: 0 0 0.35rem;
  font-family: "Fraunces", serif;
  font-size: 1.15rem;
  font-weight: 600;
}

.issue-card-section {
  margin-top: 0.35rem;
}

.issue-pitch {
  margin: 0 0 1rem;
  font-family: "Fraunces", serif;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.issue-steps {
  margin: 0 0 0.85rem;
  padding-left: 1.25rem;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.55;
}

.issue-steps li {
  margin: 0.25rem 0;
}

.issue-free {
  margin: 0 0 1rem;
}

.issue-card-section #issue-card,
.issue-card-section #issue-submit {
  width: 100%;
}

.issue-verify-section {
  margin-top: 0.15rem;
}

.issue-step-label {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.issue-verify-title {
  margin: 0 0 0.35rem;
  font-family: "Fraunces", serif;
  font-size: 1.35rem;
  font-weight: 600;
}

.issue-verify-actions {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.1rem;
}

.kyc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 0.75rem;
  margin: 0.75rem 0;
}

.kyc-grid label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.kyc-grid input {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  font: inherit;
}

.kyc-terms {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

@media (max-width: 640px) {
  .kyc-grid {
    grid-template-columns: 1fr;
  }
}

.card-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.card-row strong {
  font-family: "Fraunces", serif;
  font-size: 1.15rem;
}

.card-row .sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

form {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

input,
select,
button {
  font: inherit;
}

input,
select {
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--ink);
  padding: 0.7rem 0.8rem;
}

button {
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  filter: brightness(1.05);
}

button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.hint {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.log-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.logs {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.log {
  border: 1px solid var(--line);
  padding: 0.95rem 1rem;
  background: rgba(255, 255, 255, 0.5);
}

.log.win {
  border-color: rgba(31, 107, 69, 0.35);
  background: var(--win-bg);
}

.log.lose {
  border-color: rgba(138, 59, 43, 0.28);
  background: var(--lose-bg);
}

.log-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.badge {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.log.win .badge {
  color: var(--win);
}

.log.lose .badge {
  color: var(--lose);
}

.log pre {
  margin: 0.7rem 0 0;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #243028;
}

.log-summary {
  margin: 0.55rem 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

.purchase-history-panel {
  margin-top: 1.25rem;
}

.empty {
  color: var(--muted);
  font-size: 0.95rem;
}

.giveaway-banner {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.giveaway-terms h2,
.giveaway-fund h2 {
  margin: 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

.stripe-fund-block {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.fund-balance-secondary {
  margin: 0.35rem 0 0;
  font-family: "Fraunces", serif;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  letter-spacing: -0.02em;
  color: var(--accent);
}

.rules-summary {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.user-grid {
  grid-template-columns: 1fr 1fr;
}

.card-details {
  margin: 1rem 0 0;
  padding: 0;
  border: none;
  background: transparent;
}

.card-wallet {
  display: grid;
  gap: 1rem;
}

.card-wallet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.card-wallet-head h3 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: 1.2rem;
}

.virtual-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 1.35rem 1.4rem 1.25rem;
  color: #f7f9fc;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(255, 255, 255, 0.18), transparent 55%),
    linear-gradient(135deg, #1a2744 0%, #0f5c5c 52%, #12352f 100%);
  box-shadow: 0 22px 44px rgba(15, 92, 92, 0.28);
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.virtual-card-shine {
  position: absolute;
  inset: -40% auto auto -20%;
  width: 70%;
  height: 140%;
  background: linear-gradient(
    115deg,
    rgba(255, 255, 255, 0) 35%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 255, 255, 0) 65%
  );
  transform: rotate(12deg);
  pointer-events: none;
}

.virtual-card-top,
.virtual-card-bottom,
.virtual-card-chip-row {
  position: relative;
  z-index: 1;
}

.virtual-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.92;
}

.virtual-card-label {
  font-weight: 700;
}

.virtual-card-network {
  font-weight: 600;
}

.virtual-card-chip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.8rem 0 0.35rem;
}

.virtual-card-chip {
  width: 42px;
  height: 32px;
  border-radius: 7px;
  background: linear-gradient(145deg, #f0d27a, #b8892f);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.virtual-card-contactless {
  opacity: 0.85;
}

.virtual-card-number {
  position: relative;
  z-index: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(1.15rem, 3.5vw, 1.45rem);
  letter-spacing: 0.12em;
  margin: 0.35rem 0 0.85rem;
}

.virtual-card-bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.92rem;
}

.virtual-card-field-label {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.72;
  margin-bottom: 0.15rem;
}

.virtual-card-name {
  display: block;
  max-width: 12rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-wallet-balance {
  display: grid;
  gap: 0.15rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.card-wallet-balance-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.card-wallet-balance strong {
  font-family: "Fraunces", serif;
  font-size: 1.6rem;
}

.card-wallet-actions-top {
  display: flex;
  justify-content: flex-end;
}

.reveal-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.card-field-list {
  display: grid;
  gap: 0.55rem;
}

.card-field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.card-field-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.card-field-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95rem;
}

.card-field-btns {
  display: flex;
  gap: 0.35rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  cursor: pointer;
}

.icon-btn:hover {
  background: #fff;
}

.wallet-provision {
  display: grid;
  gap: 0.75rem;
  padding-top: 0.25rem;
}

.wallet-provision-hint {
  margin: 0;
}

.wallet-provision-btns {
  display: grid;
  gap: 0.65rem;
}

.wallet-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.wallet-btn.apple-wallet {
  border: none;
  background: #111;
  color: #fff;
}

.wallet-btn.google-wallet {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.copy-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) translateY(12px);
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: rgba(26, 33, 28, 0.92);
  color: #fff;
  font-size: 0.88rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 30;
}

.copy-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.attempt-result {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
}

.attempt-result.win {
  background: var(--win-bg);
  border-color: rgba(31, 107, 69, 0.35);
}

.attempt-result.lose {
  background: var(--lose-bg);
  border-color: rgba(138, 59, 43, 0.28);
}

.attempt-result p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.rules-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.inline-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.rules-form textarea {
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--ink);
  padding: 0.7rem 0.8rem;
  font: inherit;
  resize: vertical;
}

.admin-rules-grid {
  margin-bottom: 1.25rem;
}

.terms-page .terms-body {
  margin-top: 1.5rem;
  line-height: 1.55;
}

.terms-page .terms-body h2 {
  font-family: "Fraunces", serif;
  font-size: 1.25rem;
  margin: 1.25rem 0 0.35rem;
}

@media (max-width: 840px) {
  .top,
  .fund,
  .grid,
  .giveaway-banner,
  .user-grid,
  .admin-rules-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .meta {
    text-align: left;
  }
}
