:root {
  --bg: #070b16;
  --bg2: #0d1430;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-border: rgba(255, 255, 255, 0.09);
  --text: #e9edf8;
  --muted: #8a93ac;
  --blue: #009efd;
  --purple: #5b35ff;
  --teal: #30d2be;
  --ok: #19d27c;
  --warn: #ffb454;
  --grad: linear-gradient(105deg, #5b35ff 0%, #009efd 55%, #30d2be 110%);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
.bg-glow {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(60% 50% at 15% 0%, rgba(91, 53, 255, 0.22), transparent 70%),
    radial-gradient(55% 45% at 95% 10%, rgba(0, 158, 253, 0.18), transparent 70%),
    radial-gradient(50% 60% at 50% 110%, rgba(48, 210, 190, 0.10), transparent 70%),
    var(--bg);
}
a { color: var(--blue); text-decoration: none; }
h1, h2 { line-height: 1.15; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.grad {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ---- Header / footer ---- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; max-width: 1100px; margin: 0 auto; width: 100%;
}
.brand { display: flex; align-items: center; }
/* Render the dark-coloured logo asset as solid white for the dark header. */
.brand img { display: block; filter: brightness(0) invert(1); }
.nav { display: flex; align-items: center; gap: 14px; }
.who { color: var(--muted); font-size: 0.9rem; }
.inline { display: inline; margin: 0; }
.site-main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 12px 28px 60px; }
.site-footer {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  max-width: 1100px; margin: 0 auto; width: 100%; padding: 22px 28px;
  border-top: 1px solid var(--panel-border); color: var(--muted); font-size: 0.85rem;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 9px; justify-content: center;
  font: inherit; font-weight: 600; cursor: pointer; border: 0;
  padding: 11px 18px; border-radius: 11px; color: #fff; transition: transform .08s ease, filter .15s ease, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: default; }
.btn-primary { background: var(--grad); box-shadow: 0 6px 24px rgba(43, 76, 255, 0.35); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: rgba(255,255,255,.06); border: 1px solid var(--panel-border); }
.btn-ghost:hover { background: rgba(255,255,255,.11); }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; border-radius: 13px; }

.pill {
  display: inline-block; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--teal); background: rgba(48, 210, 190, .1); border: 1px solid rgba(48,210,190,.25);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 18px; font-weight: 600;
}

/* ---- Landing ---- */
.hero { display: flex; justify-content: center; padding: 40px 0; }
.hero-card { max-width: 720px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin: 0 0 18px; }
.lede { font-size: 1.15rem; color: #c4cce0; max-width: 620px; }
.notice { margin: 18px 0; padding: 14px 16px; border-radius: 12px; background: rgba(255,180,84,.08); border: 1px solid rgba(255,180,84,.25); color: var(--warn); }
.features { list-style: none; padding: 0; margin: 34px 0 0; display: grid; gap: 14px; }
.features li { padding-left: 26px; position: relative; color: #c4cce0; }
.features li::before { content: "✓"; position: absolute; left: 0; color: var(--teal); font-weight: 700; }
.features b { color: var(--text); }

/* ---- Panels / dashboard ---- */
.dash { display: grid; gap: 22px; }
.panel {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius); padding: 26px; backdrop-filter: blur(6px);
}
.panel h2 { margin: 0 0 6px; font-size: 1.3rem; }
.field { display: block; margin: 16px 0; }
.field > span { display: block; font-size: .9rem; margin-bottom: 7px; color: #c4cce0; }
.field em { color: var(--muted); font-style: normal; }
.field-inline { max-width: 280px; }
input[type=text], textarea, select {
  width: 100%; font: inherit; color: var(--text);
  background: rgba(0,0,0,.28); border: 1px solid var(--panel-border);
  border-radius: 11px; padding: 11px 13px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input[type=text]:focus, textarea:focus, select:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,158,253,.18);
}
textarea { resize: vertical; font-family: var(--mono); font-size: .95rem; }
select { appearance: none; }

.result { margin-top: 20px; padding: 18px; border-radius: 13px; background: rgba(25,210,124,.06); border: 1px solid rgba(25,210,124,.28); }
.result-head { display: flex; align-items: center; gap: 9px; font-weight: 600; margin-bottom: 12px; }
.ok-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.copy-row { display: flex; gap: 10px; }
.copy-row input { font-family: var(--mono); font-size: .9rem; }
.warn { color: var(--warn); font-size: .85rem; margin: 12px 0 0; }
.warn code { background: rgba(255,255,255,.1); padding: 1px 5px; border-radius: 5px; }

/* ---- Links table ---- */
.table-wrap { overflow-x: auto; }
table.links { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.links th { text-align: left; color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; padding: 8px 12px; border-bottom: 1px solid var(--panel-border); }
table.links td { padding: 12px; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: top; }
.label-cell { font-weight: 600; max-width: 280px; }
.label-cell .id { font-weight: 400; font-size: .78rem; font-family: var(--mono); margin-top: 3px; }
.from .mono { font-size: .85rem; }
.from .asn { font-size: .8rem; }
.empty { color: var(--muted); padding: 14px 0; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; }
.badge-pending { background: rgba(0,158,253,.14); color: #6fc7ff; border: 1px solid rgba(0,158,253,.3); }
.badge-done { background: rgba(25,210,124,.14); color: #5be3a3; border: 1px solid rgba(25,210,124,.3); }
.badge-exp { background: rgba(255,255,255,.07); color: var(--muted); border: 1px solid var(--panel-border); }

/* ---- Centered state cards ---- */
.centered { display: flex; justify-content: center; padding: 50px 0; }
.state-card { text-align: center; max-width: 520px; padding: 40px; background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius); }
.state-icon { font-size: 2.6rem; margin-bottom: 8px; }
.state-card h1 { font-size: 1.7rem; margin: 0 0 12px; }
.state-card .btn { margin-top: 22px; }

/* ---- Reveal / peel sticker ---- */
.reveal { display: flex; justify-content: center; padding: 30px 0; }
.reveal-card { max-width: 560px; width: 100%; text-align: center; }
.reveal-card h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); margin: 0 0 12px; }
.reveal-intro .btn { margin-top: 22px; }
.error { margin-top: 18px; padding: 12px 14px; border-radius: 11px; background: rgba(255,90,90,.1); border: 1px solid rgba(255,90,90,.35); color: #ff9a9a; }

.sticker-stage { position: relative; margin: 24px auto 0; width: 100%; max-width: 460px; min-height: 260px; user-select: none; }
.key-under {
  position: relative; z-index: 1; padding: 34px 26px; border-radius: 18px;
  background: linear-gradient(160deg, rgba(91,53,255,.16), rgba(0,158,253,.1));
  border: 1px solid var(--panel-border);
  /* Fully hidden until the sticker is peeled — never reveal the key early. */
  opacity: var(--reveal, 0);
  transform: scale(calc(.97 + var(--reveal, 0) * .03));
  transition: opacity .2s ease;
}
.key-label { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); margin-bottom: 12px; }
.key-text {
  display: block; font-family: var(--mono); font-size: 1.15rem; word-break: break-all;
  background: rgba(0,0,0,.45); padding: 16px; border-radius: 12px; margin-bottom: 18px;
  border: 1px solid var(--panel-border); color: #fff;
}
.key-under .small { margin: 14px 0 0; }

.sticker {
  position: absolute; inset: 0; z-index: 2; border-radius: 18px; cursor: grab; overflow: hidden;
  background-color: #141a3e; /* opaque fallback so the key never shows through */
  background-image: linear-gradient(135deg, #2a3360 0%, #1a2150 45%, #141a3e 100%);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 14px 40px rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center; touch-action: none;
}
.sticker.dragging { cursor: grabbing; transition: none; }
.sticker:not(.dragging) { transition: transform .35s cubic-bezier(.2,.7,.2,1), opacity .35s ease; }
.sticker-shine {
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.16) 48%, transparent 62%);
  background-size: 250% 250%; animation: shine 4.5s ease-in-out infinite;
}
@keyframes shine { 0%{background-position:120% 0} 60%,100%{background-position:-40% 0} }
.sticker-text { position: relative; text-align: center; color: #c8d0ec; padding: 0 20px; }
.sticker-text span { display: block; font-weight: 700; font-size: 1.15rem; margin-top: 8px; color: #fff; }
.sticker-text small { display: block; color: var(--muted); margin-top: 6px; }
.sticker-curl {
  position: absolute; top: 0; right: 0; width: 56px; height: 56px;
  background: linear-gradient(225deg, rgba(255,255,255,.5), rgba(255,255,255,.05));
  border-bottom-left-radius: 14px;
  clip-path: polygon(100% 0, 0 0, 100% 100%);
  box-shadow: -3px 3px 8px rgba(0,0,0,.4);
}
.done-note { margin-top: 18px; color: var(--ok); font-weight: 600; }
