:root {
  --bg: #0a0a0b;
  --surface: #131316;
  --surface-2: #1b1b1f;
  --surface-3: #232329;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #ededf0;
  --text-muted: #8b8b95;
  --text-faint: #5a5a63;
  --accent: #6e56cf;
  --accent-hi: #9a86e8;
  --accent-soft: rgba(110, 86, 207, 0.16);
  --accent-line: rgba(110, 86, 207, 0.45);
  --ok: #3fb950;
  --err: #f85149;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --shadow-card:
    0 1px 0 rgba(255, 255, 255, 0.03) inset,
    0 14px 44px -18px rgba(0, 0, 0, 0.7);
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(115% 80% at 50% -8%, var(--accent-soft), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  padding: clamp(1.5rem, 5vw, 4rem) clamp(1rem, 4vw, 2rem) 4rem;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

.wrap {
  width: min(640px, 100%);
  margin: 0 auto;
}

/* ---- Header ---------------------------------------------------------- */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  animation: rise 0.5s var(--ease) both;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  border-radius: var(--r-sm);
}
.brand-mark {
  display: grid;
  place-items: center;
}
.brand-mark svg {
  width: 30px;
  height: 30px;
  display: block;
}
.brand-word {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.brand-word .dash {
  color: var(--accent-hi);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0.34rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  white-space: nowrap;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  transition:
    background 0.25s,
    box-shadow 0.25s;
}
.status[data-on="true"] .status-dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.15);
}

.lede {
  margin: 0.9rem 0 1.6rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  animation: rise 0.5s 0.04s var(--ease) both;
}

/* ---- Panel ----------------------------------------------------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(1rem, 3vw, 1.5rem);
  box-shadow: var(--shadow-card);
  animation: rise 0.5s 0.08s var(--ease) both;
}

/* Token field */
.field {
  margin-bottom: 1.1rem;
}
.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}
#token {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.62rem 0.75rem;
  outline: none;
  transition:
    border-color 0.18s,
    box-shadow 0.18s,
    background 0.18s;
}
#token::placeholder {
  color: var(--text-faint);
}
#token:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: #17171b;
}
.field-hint {
  margin: 0.45rem 0 0;
  font-size: 0.74rem;
  color: var(--text-faint);
}

/* Dropzone */
.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
  cursor: pointer;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  padding: clamp(1.7rem, 6vw, 2.8rem) 1rem;
  transition:
    border-color 0.18s,
    background 0.18s;
}
.drop:hover {
  border-color: var(--accent-line);
  background: #17171b;
}
.drop.drag {
  border-color: var(--accent);
  border-style: solid;
  background: var(--accent-soft);
}
/* Visually hidden but focusable, so the dropzone is keyboard-operable
   (Tab to it, Enter/Space opens the file picker). */
.drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.drop:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.drop-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-3);
  color: var(--accent-hi);
  border: 1px solid var(--border);
  transition: transform 0.18s var(--ease);
}
.drop:hover .drop-icon {
  transform: translateY(-2px);
}
.drop.drag .drop-icon {
  transform: translateY(-2px) scale(1.05);
}
.drop-icon svg {
  width: 22px;
  height: 22px;
}
.drop-title {
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--text);
}
.drop-hint {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--text-muted);
}
kbd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.08rem 0.42rem;
}

/* ---- Results --------------------------------------------------------- */
.results {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.1rem;
}
.results-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.4rem;
}
.results-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.shot {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.9rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0.75rem;
  animation: rise 0.35s var(--ease) both;
  transition:
    opacity 0.25s,
    border-color 0.2s;
}
.shot.pending .thumb {
  opacity: 0.55;
}
.thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  background:
    repeating-conic-gradient(
        rgba(255, 255, 255, 0.04) 0% 25%,
        transparent 0% 50%
      )
      50% / 14px 14px,
    var(--surface-2);
  border: 1px solid var(--border);
}
.shot-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}
.shot-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shot-stat {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  overflow: hidden;
  min-width: 0;
}
.shot-stat span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shot-stat.ok .ic {
  color: var(--ok);
}
.shot-stat.err {
  color: var(--err);
}
.shot-stat .ic {
  display: inline-flex;
  flex: none;
}
.shot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

/* ---- Buttons --------------------------------------------------------- */
.btn {
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.42rem 0.68rem;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s,
    transform 0.1s;
}
.btn:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
}
.btn:active {
  transform: translateY(1px);
}
.btn .ic {
  display: inline-flex;
  flex: none;
}
.btn .ic svg {
  width: 14px;
  height: 14px;
  display: block;
}
.btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}
.btn.primary:hover {
  background: #7c63db;
}
.btn.danger:hover {
  color: var(--err);
  border-color: rgba(248, 81, 73, 0.4);
  background: rgba(248, 81, 73, 0.08);
}
.btn[data-copied="1"] {
  color: var(--ok);
  border-color: rgba(63, 185, 80, 0.4);
  background: rgba(63, 185, 80, 0.08);
}
.btn.primary[data-copied="1"] {
  color: #fff;
  background: var(--ok);
}

/* ---- Footer ---------------------------------------------------------- */
.foot {
  margin-top: 1.6rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-faint);
  animation: rise 0.5s 0.12s var(--ease) both;
}
.foot a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
  transition:
    color 0.15s,
    border-color 0.15s;
}
.foot a:hover {
  color: var(--accent-hi);
  border-color: var(--accent-line);
}

/* ---- Focus / motion / responsive ------------------------------------ */
.btn:focus-visible,
.brand:focus-visible,
.drop:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
  border-color: var(--accent-line);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@media (max-width: 460px) {
  .hero {
    flex-wrap: wrap;
  }
  .shot {
    grid-template-columns: 56px 1fr;
    gap: 0.7rem;
  }
  .thumb {
    width: 56px;
    height: 56px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
