:root {
  --bg: #fffafc;
  --bg-accent: #fcd5f9;
  --text: #2a2540;
  --muted: #6b6585;
  --primary: #6a5acd; /* slate blue */
  --primary-2: #ff91da; /* pink fairy */
  --primary-3: #9be7f8;
  --glow: 0 0 30px rgba(255, 145, 218, 0.4), 0 0 60px rgba(106, 90, 205, 0.25);
}

/* Dark fairy theme */
.dark {
  --bg: #0f0c1b;
  --bg-accent: #1a142e;
  --text: #e7e2ff;
  --muted: #8f87b3;
  --primary: #7961c9;
  --primary-2: #67b1c2;
  --primary-3: #9be7f8;
  --glow: 0 0 30px rgba(155, 123, 255, 0.4), 0 0 60px rgba(139, 233, 255, 0.22);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Nunito', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
  color: var(--text);
  background: radial-gradient(1200px 800px at 50% -10%, var(--bg-accent), var(--bg));
}

.container {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  align-items: start;
  justify-items: center;
  gap: 20px;
  padding: 10px;
}

.header {
  text-align: center;
}

.title {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-weight: 800;
  letter-spacing: 0.5px;
  font-size: clamp(36px, 5vw, 54px);
  margin: 5px 0 2px 0;
  text-shadow: var(--glow);
}

.tagline {
  font-weight: 800;
  font-size: clamp(18px, 2.4vw, 20px);
  margin: 0 0 0 0;
}

.theme-toggle {
  border: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

.intro {
  max-width: 900px;
  text-align: center;
}

.description {
  font-size: clamp(12px, 1.6vw, 18px);
  line-height: 1.6;
  margin: 0;
  color: var(--muted);
}

.cta, .contact {
  width: min(1000px, 96vw);
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(0,0,0,0.06);
  backdrop-filter: blur(6px);
  padding: 10px 10px;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.06);
}

.dark .cta, .dark .contact {
  background: rgba(35, 29, 63, 0.55);
  border-color: rgba(255,255,255,0.06);
}

.cta h2, .contact h2 {
  margin: 0 0 6px 0;
  font-size: clamp(16px, 2vw, 20px);
}

.donate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  border: 2px solid rgba(21, 255, 0, 0.397);
  border-radius: 15px;
  padding-top: 5px;
  width: 500px;
  margin: 0 auto;
}

.donate .label {
  font-weight: 700;
}

.donate .address {
  padding: 8px 10px;
  background: rgba(0,0,0,0.05);
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.dark .donate .address {
  background: rgba(255,255,255,0.06);
}

.copy {
  border: 0;
  background: var(--bg-accent);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.tg {
  display: inline-block;
  text-decoration: none;
  color: white;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  padding: 10px 14px;
  border-radius: 12px;
}

.footer {
  margin-top: 6px;
}

.domain {
  color: var(--muted);
  text-decoration: none;
}

/* Canvas overlays the page for subtle dust */
#fairy-dust {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

.container, .header, .intro, .cta, .contact, .footer { z-index: 1; position: relative; }

/* Mobile adjustments */
@media (max-width: 640px) {
  body { overflow: auto; }
  .cta, .contact { padding: 16px; }
}

/* Visits section using Tabulator */
.visits {
  width: min(1000px, 96vw);
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(0,0,0,0.06);
  backdrop-filter: blur(6px);
  padding: 10px 10px 10px 10px;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.06);
}

.dark .visits {
  background: rgba(35, 29, 63, 0.55);
  border-color: rgba(255, 255, 255, 0.151);
}

.visits h2 { margin: 6px 6px 12px 6px; font-size: 18px; }

.table-wrap { width: 100%; }

/* Tabulator theme tweaks */
.tabulator {
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.7);
  font-family: Consolas, monospace;
}

.dark .tabulator {
  border-color: rgba(255,255,255,0.08);
  background: #1a142e; /* Darker color for better contrast */
}

.tabulator .tabulator-header {
  background: linear-gradient(135deg, var(--primary-2), var(--primary), var(--bg-accent));
  color: white;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.tabulator .tabulator-header .tabulator-col {
  background: linear-gradient(135deg, var(--primary-2), var(--primary), var(--bg-accent));
  color: white;
  border-right: none;
  text-align:center;
}

.tabulator .tabulator-row:hover {
  background: none;
}

.tabulator .tabulator-tableholder {
  background: transparent;
}

.tabulator .tabulator-row {
  background: transparent;
  color: var(--text);
}

.tabulator .tabulator-tableholder .tabulator-table {
  background-color: transparent;
}

.dark .tabulator .tabulator-row {
  color: var(--text);
  background: rgba(16, 13, 28, 0.6);
}

.tabulator .tabulator-row:nth-child(odd) {
  background: rgba(0,0,0,0.06);
}

.dark .tabulator .tabulator-row:nth-child(odd) {
  background: rgba(255,255,255,0.06);
}

.hash-link {
  color: var(--text);
  text-decoration: none;
}

.hash-link i { color: var(--muted); margin-left: 6px; }

.pager {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.page-btn {
  border: 0;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  color: white;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.page-info { color: var(--muted); }

#addressInput {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.06);
  background: var(--primary-3);
  color: black;
  margin-right: 10px;
  width: 370px;
}

#checkAddressBtn {
  border: 0;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  color: white;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}
