:root {
  --bg: #0a0a0f;
  --bg2: #151520;
  --bg3: #1a1a2e;
  --line: #2a2a40;
  --purple: #8b5cf6;
  --purple2: #a78bfa;
  --pink: #ec4899;
  --text: #f8fafc;
  --text2: #cbd5e1;
  --muted: #94a3b8;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--purple2); }

[hidden] { display: none !important; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg2);
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
}
.brand span {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.account { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text2); min-width: 0; }
#account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pill {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text2);
  white-space: nowrap;
}
.pill.member { border-color: var(--purple); color: var(--purple2); }

main {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card.center { align-items: center; text-align: center; padding: 36px 20px; }

h1 { margin: 0; font-size: 22px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.center-text { text-align: center; margin: 0; }
p { margin: 0; }

.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg3);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn.primary { background: linear-gradient(135deg, var(--purple), var(--pink)); border: 0; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 180px;
  padding: 16px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  text-align: center;
  cursor: pointer;
}
.drop:hover, .drop.dragging { border-color: var(--purple); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop img { max-width: 100%; max-height: 320px; border-radius: 8px; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.tab[aria-selected="true"] { border-color: var(--purple); color: var(--text); background: var(--bg3); }

select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.notice {
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1px solid var(--warn);
  background: rgba(251, 191, 36, .08);
  color: var(--text);
}
.notice.bad { border-color: var(--bad); background: rgba(248, 113, 113, .08); }
.notice a { font-weight: 600; }

.result { display: grid; gap: 12px; }
.result img { width: 100%; border-radius: 10px; display: block; }
.result .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.error-text { color: var(--bad); }
.ok-text { color: var(--ok); }

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex: none;
}
.spinner.small-spin { width: 20px; height: 20px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

footer { text-align: center; padding: 18px 16px 24px; }
footer a { color: var(--muted); }
