:root {
  --bg: #07111f;
  --panel: rgba(7, 17, 31, 0.78);
  --panel-strong: #0f1f34;
  --line: rgba(147, 197, 253, 0.18);
  --text: #f5f7fb;
  --muted: #9fb3cf;
  --accent: #41e0c7;
  --accent-2: #7aa2ff;
  --accent-3: #f7b267;
  --danger: #ff6b7a;
  --shadow: 0 24px 60px rgba(1, 10, 21, 0.45);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(65, 224, 199, 0.16), transparent 28%),
    radial-gradient(circle at 85% 10%, rgba(122, 162, 255, 0.2), transparent 26%),
    linear-gradient(145deg, #02060d 0%, #07111f 40%, #0d1d31 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 90%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: calc(100% - 160px);
  max-width: none;
  margin: 0 auto;
  padding: 28px 0 36px;
}

@media (max-width: 1200px) {
  .page-shell {
    width: calc(100% - 80px);
  }
}

.site-header,
.site-footer,
.header-actions,
.nav-links,
.hero-actions,
.panel-header,
.preview-meta,
.gift-preview-top {
  display: flex;
  align-items: center;
}

.site-header,
.site-footer,
.panel-header {
  justify-content: space-between;
}

.site-header {
  gap: 16px;
  margin-bottom: 56px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #041019;
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #7cf8d0);
  box-shadow: 0 12px 30px rgba(65, 224, 199, 0.35);
}

.brand strong,
.section-heading h1,
.hero-copy h1,
.gift-preview strong {
  display: block;
}

.brand span,
.hero-text,
.site-footer span,
.nav-links a,
.role-card p,
.section-heading p,
.detail-item span,
.wallet-meta {
  color: var(--muted);
}

.header-actions,
.nav-links {
  gap: 12px;
}

.nav-links a {
  padding: 10px 14px;
  border-radius: 999px;
  transition: 0.25s ease;
}

.nav-links a.active,
.nav-links a:hover {
  color: var(--text);
  background: rgba(122, 162, 255, 0.14);
}

.card {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
}

.glow-card::after,
.preview-panel::after,
.records-panel::after {
  content: "";
  position: absolute;
  inset: auto -10% -35% auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(122, 162, 255, 0.28), transparent 68%);
}

.hero-layout,
.two-column {
  display: grid;
  gap: 24px;
}

.hero-layout,
.content-layout {
  width: min(100%, 1200px);
  margin: 0 auto;
}

.hero-layout {
  grid-template-columns: 1.15fr 0.85fr;
  align-items: stretch;
}

.content-layout {
  display: grid;
  gap: 26px;
}

.hero-copy,
.hero-panel,
.form-panel,
.preview-panel,
.empty-records-panel,
.records-panel,
.redeem-form-card,
#redeem-result {
  padding: 30px;
}

.empty-records-panel h2 {
  margin: 0 0 10px;
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 14px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(65, 224, 199, 0.12);
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.76rem;
}

.hero-copy h1,
.section-heading h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  line-height: 0.98;
}

.hero-text,
.section-heading p {
  max-width: 62ch;
  font-size: 1.02rem;
  line-height: 1.7;
}

.hero-actions {
  gap: 14px;
  margin: 30px 0;
}

.btn {
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  transform: none;
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary,
.btn-secondary,
.wallet-button,
.wallet-connected {
  padding: 13px 18px;
}

.btn-primary {
  color: #041019;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #a4ffe5);
  box-shadow: 0 14px 32px rgba(65, 224, 199, 0.28);
}

.btn-secondary {
  color: var(--text);
  background: rgba(122, 162, 255, 0.12);
  border: 1px solid rgba(122, 162, 255, 0.18);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.role-grid,
.stat-grid,
.detail-grid {
  display: grid;
  gap: 14px;
}

.role-grid,
.stat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.role-card,
.detail-item {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.role-tag {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-3);
  font-weight: 700;
}

.hero-visual {
  position: relative;
  min-height: 320px;
  margin-bottom: 24px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 25% 20%, rgba(65, 224, 199, 0.3), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  overflow: hidden;
}

.chain-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(6px);
}

.orb-one {
  width: 180px;
  height: 180px;
  left: -24px;
  top: 24px;
  background: radial-gradient(circle, rgba(65, 224, 199, 0.55), transparent 70%);
}

.orb-two {
  width: 220px;
  height: 220px;
  right: -36px;
  bottom: -28px;
  background: radial-gradient(circle, rgba(122, 162, 255, 0.55), transparent 70%);
}

.flow-card {
  position: absolute;
  inset: auto 24px 24px 24px;
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: 22px;
  background: rgba(3, 10, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.flow-card span,
.stat-grid span,
.detail-item strong {
  display: block;
}

.stat-grid strong {
  font-size: 1.6rem;
}

.section-heading h1 {
  max-width: none;
}

.two-column {
  grid-template-columns: minmax(0, 0.9fr) minmax(300px, 0.7fr);
  align-items: start;
}

.form-panel,
.redeem-form-card {
  display: grid;
  gap: 18px;
}

label span {
  display: block;
  margin-bottom: 10px;
  font-weight: 500;
}

input,
select {
  width: 100%;
  padding: 15px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(65, 224, 199, 0.7);
  box-shadow: 0 0 0 4px rgba(65, 224, 199, 0.12);
}

.gift-preview-stack {
  position: relative;
  min-height: 320px;
  margin-top: -14px;
  padding-top: 36px;
  padding-inline: 28px;
}

.gift-preview {
  position: relative;
  z-index: 3;
  padding: 24px;
  border-radius: 24px;
  min-height: 280px;
  background:
    linear-gradient(155deg, rgba(65, 224, 199, 0.18), rgba(122, 162, 255, 0.1)),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.32s ease, box-shadow 0.32s ease;
  transform-origin: center bottom;
}

.preview-card {
  opacity: 1;
  background:
    linear-gradient(155deg, rgba(65, 224, 199, 0.24), rgba(122, 162, 255, 0.16)),
    rgba(15, 31, 52, 0.96);
  border-color: rgba(255, 255, 255, 0.12);
}

.ghost-layer {
  position: absolute;
  inset: 36px 28px 0;
  min-height: 280px;
  pointer-events: none;
  opacity: 0;
  transform: translateX(0) translateY(10px) rotate(0deg) scale(0.98);
  background:
    linear-gradient(155deg, rgba(65, 224, 199, 0.12), rgba(122, 162, 255, 0.08)),
    rgba(255, 255, 255, 0.03);
  box-shadow: 0 18px 40px rgba(1, 10, 21, 0.18);
  transition: opacity 0.38s ease, transform 0.38s ease, box-shadow 0.38s ease;
  transform-origin: center bottom;
}

.ghost-layer-left-inner,
.ghost-layer-right-inner {
  z-index: 2;
}

.ghost-layer-left-outer,
.ghost-layer-right-outer {
  z-index: 1;
}

.gift-preview-stack[data-stack="2"] .ghost-layer-left-inner,
.gift-preview-stack[data-stack="3"] .ghost-layer-left-inner,
.gift-preview-stack[data-stack="4"] .ghost-layer-left-inner,
.gift-preview-stack[data-stack="5"] .ghost-layer-left-inner {
  opacity: 0.68;
  transform: translateX(-34px) translateY(8px) rotate(-2deg) scale(0.985);
}

.gift-preview-stack[data-stack="3"] .ghost-layer-right-inner,
.gift-preview-stack[data-stack="4"] .ghost-layer-right-inner,
.gift-preview-stack[data-stack="5"] .ghost-layer-right-inner {
  opacity: 0.5;
  transform: translateX(34px) translateY(8px) rotate(2deg) scale(0.985);
}

.gift-preview-stack[data-stack="4"] .ghost-layer-left-outer,
.gift-preview-stack[data-stack="5"] .ghost-layer-left-outer {
  opacity: 0.4;
  transform: translateX(-62px) translateY(14px) rotate(-3deg) scale(0.97);
}

.gift-preview-stack[data-stack="5"] .ghost-layer-right-outer {
  opacity: 0.32;
  transform: translateX(62px) translateY(14px) rotate(3deg) scale(0.97);
}

.gift-preview-stack[data-stack="2"] .gift-preview,
.gift-preview-stack[data-stack="3"] .gift-preview,
.gift-preview-stack[data-stack="4"] .gift-preview,
.gift-preview-stack[data-stack="5"] .gift-preview {
  box-shadow: 0 24px 54px rgba(1, 10, 21, 0.28);
}

.gift-preview strong {
  margin: 28px 0 10px;
  font-size: 3rem;
}

.preview-meta {
  justify-content: space-between;
  gap: 10px;
  margin-top: 26px;
  font-size: 0.94rem;
}

.records-table-wrap {
  overflow-x: auto;
}

.records-table {
  width: 100%;
  border-collapse: collapse;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.pagination-info {
  color: var(--muted);
  font-size: 0.92rem;
}

.pagination-btn {
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.records-table th,
.records-table td {
  padding: 14px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.records-table th {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}

.status-pill {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.84rem;
}

.status-unused {
  color: #88f5dd;
  background: rgba(65, 224, 199, 0.12);
}

.status-claimed {
  color: #a9bcff;
  background: rgba(122, 162, 255, 0.12);
}

.status-expired {
  color: #ffc0c8;
  background: rgba(255, 107, 122, 0.12);
}

.table-copy {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.redeem-stack {
  display: grid;
  gap: 22px;
}

.detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 22px;
}

.detail-item strong {
  margin-bottom: 6px;
  font-size: 1.06rem;
}

.wallet-button,
.wallet-connected {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.wallet-button {
  cursor: pointer;
}

.wallet-menu {
  position: relative;
}

.wallet-menu::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 0;
  width: 100%;
  height: 14px;
}

.wallet-connected {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.wallet-caret {
  display: inline-block;
  transition: transform 0.22s ease;
}

.wallet-menu:hover .wallet-caret,
.wallet-menu.is-open .wallet-caret {
  transform: rotate(180deg);
}

.wallet-avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #041019;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-3), #ffe0ab);
}

.wallet-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  padding: 18px;
  border-radius: 20px;
  background: #091423;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  z-index: 30;
}

.wallet-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.wallet-address {
  padding: 12px;
  border-radius: 14px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.04);
  word-break: break-all;
}

.wallet-actions {
  display: grid;
  gap: 10px;
}

.wallet-modal-backdrop,
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(1, 6, 12, 0.56);
  backdrop-filter: blur(6px);
  z-index: 40;
}

.wallet-modal,
.success-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(92vw, 420px);
  padding: 28px;
  border-radius: 24px;
  transform: translate(-50%, -50%);
  background: #091423;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  z-index: 41;
}

.wallet-provider-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 20px;
}

.wallet-provider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.wallet-provider-name,
.wallet-provider-indicator {
  color: rgba(245, 247, 251, 0.94);
}

.wallet-provider-name {
  font-weight: 500;
}

.wallet-provider-indicator {
  font-size: 1rem;
}

.wallet-provider.active {
  border-color: rgba(65, 224, 199, 0.8);
  background: rgba(65, 224, 199, 0.12);
}

.language-switcher {
  position: relative;
}

.lang-menu {
  position: relative;
}

.lang-trigger {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.lang-globe {
  width: 22px;
  height: 22px;
  display: block;
}

.lang-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 156px;
  padding: 10px;
  border-radius: 18px;
  background: #091423;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  z-index: 35;
}

.lang-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  color: rgba(245, 247, 251, 0.94);
  background: transparent;
  cursor: pointer;
}

.lang-option:hover,
.lang-option.active {
  background: rgba(122, 162, 255, 0.14);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #0b1828;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  z-index: 60;
}

.success-modal h3,
.wallet-modal h3 {
  margin-top: 0;
}

.modal-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.success-hash {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  word-break: break-all;
}

.site-footer {
  margin-top: 30px;
  padding-top: 18px;
  width: min(100%, 1200px);
  margin-left: auto;
  margin-right: auto;
}

.hidden {
  display: none !important;
}

@media (max-width: 920px) {
  .hero-layout,
  .two-column {
    grid-template-columns: 1fr;
  }

  .hero-copy h1,
  .section-heading h1 {
    max-width: none;
    font-size: clamp(2.3rem, 9vw, 4rem);
  }
}

@media (max-width: 680px) {
  .page-shell {
    width: calc(100% - 20px);
    padding-top: 18px;
  }

  .site-header,
  .header-actions,
  .site-footer,
  .hero-actions,
  .panel-header,
  .preview-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-links,
  .hero-actions,
  .role-grid,
  .stat-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .gift-preview strong {
    font-size: 2.4rem;
  }
}
