:root {
  --bg: #0a080e;
  --bg-panel: #141019;
  --border: #2a2235;
  --fg: #e8e4f0;
  --muted: #8a8296;
  --pink: #ff006e;
  --cyan: #00e1e1;
  --green: #39ff8f;
  --radius: 10px;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(circle at 50% -10%, #1a0f22 0%, var(--bg) 55%);
  color: var(--fg);
  font-family: 'Courier New', ui-monospace, monospace;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  line-height: 1.5;
}

img { max-width: 100%; }
[hidden] { display: none !important; }

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.025) 0px,
    rgba(255, 255, 255, 0.025) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 1000;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 900px;
  margin: 24px auto 32px;
  flex-wrap: wrap;
}

.logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--pink);
  flex-shrink: 0;
}

.glitch {
  font-size: clamp(1.8rem, 6vw, 3rem);
  margin: 0;
  letter-spacing: 2px;
  color: var(--fg);
  text-shadow:
    2px 0 var(--pink),
    -2px 0 var(--cyan);
  position: relative;
}

.tagline {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

main {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.panel h2 {
  margin-top: 0;
  font-size: 1.1rem;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.blurb p {
  margin: 0;
  color: var(--muted);
}

.wallet-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #555;
  flex-shrink: 0;
}
.dot.connected { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.wrong-network { background: #ffb020; box-shadow: 0 0 8px #ffb020; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--cyan); color: var(--cyan); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { border-color: var(--pink); color: var(--pink); }
.btn-primary:hover { background: var(--pink); color: #0a080e; }

.btn-accent { border-color: var(--green); color: var(--green); }
.btn-accent:hover { background: var(--green); color: #0a080e; }

.balance-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 20px;
}

.balance-card {
  flex: 1 1 200px;
  background: #0d0a13;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.balance-card .label {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.balance-card .value {
  font-size: 1.6rem;
  color: var(--green);
}

.cooldown {
  font-size: 0.8rem;
  color: var(--muted);
}

.send-panel form {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
}

.send-panel label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
  flex: 1 1 220px;
}

input[type="text"],
input[type="number"] {
  background: #0d0a13;
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
}
input:focus { outline: none; border-color: var(--cyan); }

.status-msg {
  font-size: 0.85rem;
  color: var(--muted);
  flex-basis: 100%;
}

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 640px) {
  .columns { grid-template-columns: 1fr; }
}

.feed-list, .leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leaderboard-list { list-style: decimal inside; }

.feed-list li, .leaderboard-list li {
  font-size: 0.85rem;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 6px;
  word-break: break-all;
}

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

.howto ol {
  color: var(--fg);
  padding-left: 20px;
}
.howto li { margin-bottom: 8px; }
.howto a { color: var(--cyan); }

footer {
  max-width: 900px;
  margin: 32px auto 12px;
  text-align: center;
  font-size: 0.75rem;
}
