* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0a0a0a;
  color: #fff;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.modal-open {
  overflow: hidden;
}

.container {
  max-width: 400px;
  width: 100%;
  padding: 2rem;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: #888;
  margin-bottom: 1rem;
}

.faucet-balance {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem;
  background: #111;
  border: 1px solid #252525;
  border-radius: 6px;
}

.faucet-balance-label {
  font-size: 0.75rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.faucet-balance-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: #4ade80;
  font-variant-numeric: tabular-nums;
}

.faucet-address {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 2rem;
  padding: 0.75rem;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
}

.faucet-address-label {
  font-size: 0.75rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.faucet-address-value {
  font-size: 0.8rem;
  color: #aaa;
  word-break: break-all;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

label {
  font-size: 0.875rem;
  color: #888;
}

input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #333;
  border-radius: 6px;
  background: #1a1a1a;
  color: #fff;
  font-size: 1rem;
  font-family: monospace;
}

input:focus {
  outline: none;
  border-color: #3b82f6;
}

button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  background: #3b82f6;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover {
  background: #2563eb;
}

button:disabled {
  background: #333;
  cursor: not-allowed;
}

.secondary-button {
  border: 1px solid #333;
  background: #111827;
  color: #e5e7eb;
}

.secondary-button:hover {
  background: #1f2937;
}

.secondary-button:disabled {
  border-color: #333;
  background: #1f2937;
  color: #6b7280;
}

.donate-button {
  width: 100%;
  margin-bottom: 1.5rem;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid #1e293b;
  color: #64748b;
  transition: color 0.2s, border-color 0.2s;
}

.donate-button:hover {
  color: #94a3b8;
  border-color: #334155;
  background: transparent;
}

.result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
}

.result.success {
  background: #052e16;
  border: 1px solid #16a34a;
}

.result.error {
  background: #450a0a;
  border: 1px solid #dc2626;
}

.result a {
  color: #3b82f6;
  word-break: break-all;
}

.cf-turnstile {
  margin: 0.5rem 0;
}

/* --- Donate modal --- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: background 0.25s ease, opacity 0.25s ease, visibility 0s linear 0.25s;
}

.modal.is-open {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  transition: background 0.25s ease, opacity 0.25s ease, visibility 0s linear 0s;
}

.modal-panel {
  width: min(100%, 400px);
  padding: 1.75rem;
  border: 1px solid #1e293b;
  border-radius: 10px;
  background: #0d1117;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03),
    0 20px 50px rgba(0, 0, 0, 0.6);
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s ease;
}

.modal.is-open .modal-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #1e293b;
}

.modal-header h2 {
  font-size: 0.85rem;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 0.02em;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #475569;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.modal-close:hover {
  color: #cbd5e1;
  border-color: #334155;
  background: #1e293b;
}

.modal-body-text {
  margin-bottom: 1.25rem;
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.55;
}

.donation-address {
  padding: 0.75rem;
  border-radius: 8px;
  background: #0a0e14;
  border: 1px solid #1e293b;
}

.donation-address-label {
  display: block;
  margin-bottom: 0.35rem;
  color: #475569;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}

.donation-address-value {
  color: #e2e8f0;
  font-size: 0.78rem;
  word-break: break-all;
  line-height: 1.5;
}

.modal-actions {
  margin-top: 1rem;
}

.modal-actions .secondary-button {
  width: 100%;
  font-size: 0.8rem;
  padding: 0.6rem 1rem;
}

.modal-status {
  min-height: 1rem;
  margin-top: 0.6rem;
  font-size: 0.75rem;
  text-align: center;
}

.modal-status.success {
  color: #4ade80;
}

.modal-status.error {
  color: #f87171;
}
