*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #ffffff;
  --bg-subtle: #f8f9fb;
  --text: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --border-focus: #ffb8cc;
  --accent: #ff8fab;
  --accent-strong: #f06b8f;
  --accent-soft: #fff0f4;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 8px 24px rgba(17, 24, 39, 0.06);
  --font: "DM Sans", system-ui, -apple-system, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.05rem;
}

.site-nav {
  display: flex;
  gap: 1.75rem;
  font-size: 0.925rem;
  color: var(--text-muted);
}

.site-nav a:hover {
  color: var(--text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.social-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.social-x:hover {
  background: var(--bg-subtle);
  border-color: #d1d5db;
}

.social-x svg {
  width: 16px;
  height: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-primary {
  padding: 0.75rem 1.5rem;
  background: var(--text);
  color: #fff;
}

.btn-primary:hover {
  background: #1f2937;
}

.btn-ghost {
  padding: 0.75rem 1.25rem;
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--bg-subtle);
}

.btn-create {
  min-width: 140px;
  padding: 0.85rem 2rem;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1rem;
}

.btn-create:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn-create:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

main {
  max-width: 920px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.hero {
  text-align: center;
  padding: 2rem 0 3.5rem;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 999px;
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero-heart-wrap {
  position: relative;
  width: min(100%, 380px);
  height: clamp(220px, 42vw, 300px);
  margin: 0.25rem auto 0.5rem;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.hero-heart-wrap:active {
  cursor: grabbing;
}

#hero-heart-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-heart-hint {
  margin: -0.25rem 0 0;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c4c9d1;
}

.hero-lead {
  max-width: 34rem;
  margin: 0.75rem auto 1.75rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.token-form {
  padding: 2rem 2rem 2.25rem;
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
}

.form-header h2 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.form-subtitle {
  margin: 0;
  font-size: 0.925rem;
  color: var(--text-muted);
  max-width: 28rem;
}

.form-watermark {
  opacity: 0.35;
  flex-shrink: 0;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.field-row-3 {
  grid-template-columns: repeat(3, 1fr);
}

.field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.field-row .field {
  margin-bottom: 0;
}

label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.req {
  color: var(--accent-strong);
  margin-left: 0.15rem;
}

.optional {
  font-weight: 400;
  color: var(--text-muted);
}

input[type="text"],
input[type="url"],
textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input::placeholder,
textarea::placeholder {
  color: #9ca3af;
}

input:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(255, 143, 171, 0.2);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

.char-count {
  position: absolute;
  right: 0;
  top: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.upload-row {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 1.25rem;
}

.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 1.5rem;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.upload-zone:hover,
.upload-zone:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.upload-zone.dragover {
  border-color: var(--accent-strong);
  background: var(--accent-soft);
}

.upload-icon {
  width: 28px;
  height: 28px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.upload-text {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

.link-btn {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  color: #2563eb;
  cursor: pointer;
}

.upload-hint {
  margin: 0;
  font-size: 0.8rem;
  color: #9ca3af;
}

.preview-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.preview-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d1d5db;
}

.preview-box {
  flex: 1;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.preview-empty {
  font-size: 0.8rem;
  color: #d1d5db;
}

.preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.charity-fieldset {
  margin: 0 0 1.5rem;
  padding: 0;
  border: none;
}

.charity-fieldset legend {
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0;
  margin-bottom: 0.35rem;
}

.fieldset-hint {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.charity-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.charity-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.charity-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.charity-card {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.charity-option input:checked + .charity-card {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent);
}

.charity-option input:focus-visible + .charity-card {
  box-shadow: 0 0 0 3px rgba(255, 143, 171, 0.25);
}

.charity-emoji {
  font-size: 1.35rem;
  line-height: 1;
}

.charity-info strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

.charity-info span {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.form-error {
  margin: 0 0 1rem;
  padding: 0.65rem 0.9rem;
  font-size: 0.875rem;
  color: #b91c1c;
  background: #fef2f2;
  border-radius: 8px;
}

.form-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 0.5rem;
  gap: 0.65rem;
}

.create-wallet-hint {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}

.launch-section {
  scroll-margin-top: 5rem;
}

.launch-section[hidden] {
  display: none !important;
}

.how-section {
  margin-top: 4rem;
}

.how-section h2 {
  margin: 0 0 1.5rem;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1.25rem;
}

.steps li {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  counter-increment: step;
}

.steps li strong {
  font-size: 1rem;
}

.steps li span {
  font-size: 0.9rem;
  color: var(--text-muted);
}


.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.success-dialog {
  position: relative;
  width: min(440px, calc(100% - 2rem));
  padding: 2rem 1.75rem 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px rgba(17, 24, 39, 0.12);
  border: none;
}

.success-dialog::backdrop {
  background: rgba(17, 24, 39, 0.35);
}

.dialog-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-subtle);
  border-radius: 8px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
}

.success-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.success-dialog h2 {
  margin: 0 0 0.35rem;
  text-align: center;
  font-size: 1.35rem;
}

.success-lead {
  margin: 0 0 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.925rem;
}

.success-meta {
  margin: 0 0 1.25rem;
  padding: 1rem;
  background: var(--bg-subtle);
  border-radius: var(--radius);
  font-size: 0.85rem;
}

.success-meta div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
}

.success-meta dt {
  color: var(--text-muted);
  font-weight: 500;
}

.success-meta dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}

.success-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.success-note {
  margin: 1rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(420px, calc(100% - 2rem));
  padding: 0.65rem 1.25rem;
  background: var(--text);
  color: #fff;
  font-size: 0.875rem;
  text-align: center;
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 100;
}

.wallet-picker {
  position: relative;
  width: min(380px, calc(100% - 2rem));
  padding: 1.5rem;
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px rgba(17, 24, 39, 0.12);
}

.wallet-picker::backdrop {
  background: rgba(17, 24, 39, 0.35);
}

.wallet-picker h3 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.wallet-picker-hint {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.wallet-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.wallet-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: left;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.wallet-option:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.wallet-option img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: contain;
}

.wallet-option-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.field.invalid input,
.field.invalid textarea {
  border-color: #fca5a5;
}

@media (max-width: 768px) {
  .site-nav {
    display: none;
  }

  .field-row,
  .field-row-3,
  .upload-row,
  .charity-grid {
    grid-template-columns: 1fr;
  }

  .token-form {
    padding: 1.5rem 1.25rem;
  }
}
