:root {
  --bg-deep: #12081f;
  --bg-card: rgba(28, 16, 48, 0.72);
  --stroke: rgba(244, 114, 182, 0.22);
  --stroke-soft: rgba(255, 255, 255, 0.08);
  --text: #f8f4ff;
  --text-muted: rgba(248, 244, 255, 0.72);
  --accent: #f472b6;
  --accent-dim: rgba(244, 114, 182, 0.35);
  --violet: #8b5cf6;
  --violet-deep: #5b21b6;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 40px rgba(244, 114, 182, 0.18);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  --shell-pad-x: clamp(16px, 4vw, 48px);
  --shell-pad-y: clamp(16px, 3vw, 32px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-deep);
  background-image: linear-gradient(
    165deg,
    #1a0a2e 0%,
    #12081f 38%,
    #0f0618 100%
  );
  line-height: 1.5;
}

body.is-wallet-connected {
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}

.orb-a {
  width: min(520px, 95vw);
  height: min(520px, 95vw);
  background: #7c3aed;
  top: -18%;
  right: -12%;
}

.orb-b {
  width: min(440px, 90vw);
  height: min(440px, 90vw);
  background: #db2777;
  bottom: -20%;
  left: -15%;
  opacity: 0.35;
}

.orb-c {
  width: min(320px, 60vw);
  height: min(320px, 60vw);
  background: #a78bfa;
  top: 35%;
  left: 25%;
  opacity: 0.22;
}

.orb-d {
  width: min(280px, 50vw);
  height: min(280px, 50vw);
  background: #c026d3;
  bottom: 30%;
  right: 8%;
  opacity: 0.18;
}

/* ——— Shell ——— */
.shell {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100dvh;
  min-height: 100vh;
}

/* ——— Connect gate (full viewport) ——— */
.gate-screen {
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--shell-pad-y) var(--shell-pad-x);
}

.gate-screen--hidden {
  display: none;
}

.gate-inner {
  width: 100%;
  max-width: 440px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.gate-logo-wrap {
  border-radius: 28px;
  overflow: hidden;
  border: 3px solid var(--accent-dim);
  box-shadow: var(--shadow-soft), var(--shadow-glow);
  background: #6d28d9;
  line-height: 0;
  margin-bottom: 8px;
}

.gate-logo {
  display: block;
  width: min(160px, 42vw);
  height: min(160px, 42vw);
  object-fit: cover;
}

.gate-title {
  margin: 0;
  font-size: clamp(1.75rem, 5vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.gate-tagline {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 34ch;
}

.gate-hint {
  margin: 12px 0 8px;
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 32ch;
}

.gate-inner .eyebrow {
  margin: 0;
}

.btn-connect-large {
  margin-top: 16px;
  padding: 16px 36px;
  font-size: 1.05rem;
  border-radius: 14px;
}

.gate-message {
  margin: 20px 0 0;
  width: 100%;
  max-width: 100%;
  text-align: left;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.5;
  color: rgba(248, 244, 255, 0.9);
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(244, 114, 182, 0.3);
  border-radius: var(--radius-md);
}

.gate-message:empty {
  display: none;
}

/* ——— Dashboard (full page after connect) ——— */
.dashboard {
  min-height: 100dvh;
  min-height: 100vh;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--shell-pad-y) var(--shell-pad-x) calc(var(--shell-pad-y) + 12px);
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2vw, 28px);
}

.dashboard--hidden {
  display: none;
}

.dashboard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 20px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.dashboard-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.dashboard-logo-wrap {
  flex-shrink: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--accent-dim);
  line-height: 0;
  background: #6d28d9;
}

.dashboard-logo {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: cover;
}

.dashboard-eyebrow {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dashboard-sub {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.page-layout {
  flex: 1;
  display: grid;
  gap: clamp(16px, 2vw, 28px);
  grid-template-columns: minmax(300px, 1.2fr) minmax(280px, 0.85fr);
  align-items: stretch;
  min-height: 0;
}

.panel-details {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  min-height: 0;
}

.panel-details .section-title {
  margin-top: 0;
}

.section-actions {
  margin-bottom: 0;
}

.section-title {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section-hint {
  margin: 0 0 16px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.card-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.card-grid--details {
  flex: 1;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  align-content: start;
}

.stat-card-span {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .page-layout {
    grid-template-columns: 1fr;
  }

  .panel-side {
    min-height: auto;
  }
}

.stat-card {
  padding: 16px 18px;
  min-height: 76px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radius-md);
}

.stat-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-value {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  word-break: break-all;
}

.stat-value.mono {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 500;
}

.wallet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease,
    opacity 0.15s ease;
}

.btn-primary {
  color: #1a0520;
  background: linear-gradient(135deg, #f9a8d4 0%, #f472b6 40%, #e879f9 100%);
  box-shadow: 0 4px 20px rgba(244, 114, 182, 0.35);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(244, 114, 182, 0.45);
}

.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke-soft);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.claim-panel {
  padding: 22px 22px;
  flex: 1;
  min-height: 0;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.claim-form {
  display: grid;
  gap: 16px;
}

.claim-form--row {
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

.field {
  display: grid;
  gap: 8px;
}

.field-grow {
  min-width: 0;
}

.btn-claim {
  white-space: nowrap;
  padding: 14px 20px;
}

.signing-note {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.signing-note-title {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.signing-note-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 3px;
  font-size: 0.84rem;
  color: rgba(248, 244, 255, 0.9);
}

.claim-history {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.claim-history-title {
  margin: 0 0 10px;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.claim-history-list {
  display: grid;
  gap: 8px;
}

.claim-history-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.claim-history-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.78rem;
}

.claim-history-amount {
  font-weight: 700;
}

.claim-history-time {
  color: var(--text-muted);
}

.claim-history-link {
  display: inline-flex;
  width: fit-content;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #f9a8d4;
  text-decoration: none;
}

.claim-history-link:hover {
  text-decoration: underline;
}

.claim-history-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.claim-history-pagination {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.claim-history-btn {
  padding: 7px 12px;
  font-size: 0.75rem;
}

.claim-history-page {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.support-links {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 8px;
}

.support-link {
  display: inline-flex;
  width: fit-content;
  font-size: 0.82rem;
  color: #f9a8d4;
  text-decoration: none;
}

.support-link:hover {
  text-decoration: underline;
}

@media (max-width: 540px) {
  .claim-form--row {
    grid-template-columns: 1fr;
  }

  .btn-claim {
    width: 100%;
  }
}

.field-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--stroke-soft);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]::placeholder {
  color: rgba(248, 244, 255, 0.35);
}

input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.result-panel {
  flex-shrink: 0;
  margin: 0;
  min-height: 3.5rem;
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.55;
  color: rgba(248, 244, 255, 0.88);
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-md);
}

.result-panel:empty {
  display: none;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0;
  font-size: clamp(1.55rem, 4.5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.section {
  margin-bottom: 24px;
}

/* ——— Claim success modal ——— */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 20px;
  transition:
    opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.4s;
}

.modal-root--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-root:not(.modal-root--hidden) .modal-scrim {
  animation: modalScrimIn 0.45s ease forwards;
}

.modal-root:not(.modal-root--hidden) .modal-dialog {
  animation: modalPop 0.65s cubic-bezier(0.34, 1.45, 0.64, 1) forwards;
}

.modal-root:not(.modal-root--hidden) .modal-badge {
  animation: modalBadgeIn 0.55s cubic-bezier(0.34, 1.45, 0.64, 1) 0.08s both;
}

@keyframes modalScrimIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(16px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

@keyframes modalBadgeIn {
  from {
    opacity: 0;
    transform: scale(0.5) rotate(-12deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

.modal-scrim {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: radial-gradient(
      ellipse 120% 80% at 50% 0%,
      rgba(124, 58, 237, 0.25),
      transparent 55%
    ),
    rgba(6, 2, 14, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
}

.modal-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 428px;
}

.modal-particles {
  position: absolute;
  inset: -30% -20%;
  background:
    radial-gradient(circle at 15% 25%, rgba(244, 114, 182, 0.2) 0%, transparent 42%),
    radial-gradient(circle at 85% 75%, rgba(167, 139, 250, 0.18) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(192, 38, 211, 0.08) 0%, transparent 50%);
  animation: modalParticles 10s ease-in-out infinite alternate;
  pointer-events: none;
  filter: blur(2px);
}

@keyframes modalParticles {
  from {
    transform: translate(-3%, 1%) scale(1);
    opacity: 0.85;
  }
  to {
    transform: translate(3%, -2%) scale(1.05);
    opacity: 1;
  }
}

.modal-dialog {
  position: relative;
  padding: 36px 28px 28px;
  border-radius: 24px;
  background: linear-gradient(
    155deg,
    rgba(45, 22, 78, 0.94) 0%,
    rgba(20, 10, 38, 0.97) 48%,
    rgba(14, 8, 28, 0.98) 100%
  );
  border: 1px solid rgba(244, 114, 182, 0.38);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.07) inset,
    0 28px 90px rgba(0, 0, 0, 0.55),
    0 0 100px rgba(168, 85, 247, 0.22),
    0 0 60px rgba(244, 114, 182, 0.12);
  overflow: hidden;
}

.modal-dialog::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    #f472b6,
    #e879f9,
    #a78bfa,
    #f472b6,
    transparent
  );
  background-size: 200% 100%;
  animation: modalShimmer 3.5s linear infinite;
  opacity: 0.95;
}

@keyframes modalShimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 12px;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition:
    color 0.15s,
    background 0.15s,
    transform 0.15s;
}

.modal-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.05);
}

.modal-badge {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 30%,
    rgba(249, 168, 212, 0.35),
    rgba(124, 58, 237, 0.25)
  );
  border: 1px solid rgba(244, 114, 182, 0.45);
  color: #fda4d0;
  box-shadow: 0 0 32px rgba(244, 114, 182, 0.35);
}

.modal-check {
  display: block;
}

.modal-check-ring {
  opacity: 0;
  transform-origin: center;
  animation: modalRingIn 0.45s ease 0.15s forwards;
}

.modal-check-mark {
  stroke-dasharray: 42;
  stroke-dashoffset: 42;
  animation: modalDrawCheck 0.55s ease 0.4s forwards;
}

@keyframes modalRingIn {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 0.85;
    transform: scale(1);
  }
}

@keyframes modalDrawCheck {
  to {
    stroke-dashoffset: 0;
  }
}

.modal-title {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-align: center;
  background: linear-gradient(120deg, #fce7f3, #f472b6, #e9d5ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.modal-lead {
  margin: 0 0 22px;
  font-size: 0.95rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.45;
}

.modal-sig-box {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--stroke-soft);
}

.modal-sig-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.modal-sig {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.45;
  word-break: break-all;
  color: rgba(248, 244, 255, 0.92);
}

.btn-copy {
  justify-self: start;
  padding: 8px 14px;
  font-size: 0.8rem;
  margin-top: 4px;
}

.modal-solscan {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 20px;
  font-size: 1rem;
  text-decoration: none;
  border-radius: 14px;
}

.modal-solscan:hover:not(:disabled) {
  transform: translateY(-2px);
}

.modal-external {
  flex-shrink: 0;
  opacity: 0.9;
}

@media (prefers-reduced-motion: reduce) {
  .modal-root:not(.modal-root--hidden) .modal-scrim,
  .modal-root:not(.modal-root--hidden) .modal-dialog,
  .modal-root:not(.modal-root--hidden) .modal-badge,
  .modal-dialog::before,
  .modal-particles,
  .modal-check-ring,
  .modal-check-mark {
    animation: none !important;
  }

  .modal-check-ring {
    opacity: 0.85;
  }

  .modal-check-mark {
    stroke-dashoffset: 0;
  }

  .modal-root:not(.modal-root--hidden) .modal-dialog {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
