:root {
  --bg: #0c0d0b;
  --panel: rgba(24, 25, 21, 0.88);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(216, 255, 107, 0.48);
  --text: #f7f7f1;
  --muted: #aaa99f;
  --green: #d9ff62;
  --ok: #71e1a2;
  --danger: #ff6b6b;
  --shadow: 0 24px 100px rgba(0, 0, 0, 0.46);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-family: Inter, "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 12% 16%, rgba(216, 255, 98, 0.09), transparent 28%),
    radial-gradient(circle at 82% 20%, rgba(119, 201, 160, 0.08), transparent 30%),
    var(--bg);
  background-size: 24px 24px, 24px 24px, auto, auto, auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
textarea {
  font: inherit;
}

.public-shell {
  min-height: 100vh;
  padding: 28px 72px 64px;
  display: flex;
  flex-direction: column;
}

.public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0;
}

.text-brand {
  text-transform: uppercase;
}

.online-pill,
.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 999px;
  color: #d9d9cf;
}

.online-pill {
  padding: 8px 14px;
  font-size: 14px;
}

.online-pill span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #54d38b;
  box-shadow: 0 0 16px #54d38b;
}

.extract-panel {
  position: relative;
  width: min(1040px, calc(100vw - 48px));
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-block {
  position: relative;
  padding: 66px 70px 26px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 6px;
}

.eyebrow span {
  width: 24px;
  height: 1px;
  background: var(--green);
}

.hero-block h1 {
  position: relative;
  margin: 12px 0 18px;
  font-size: clamp(44px, 6vw, 72px);
  line-height: 1.08;
  letter-spacing: 0;
  z-index: 1;
}

.hero-block h1 strong {
  color: var(--green);
  font-style: normal;
}

.hero-block p {
  position: relative;
  max-width: 760px;
  margin: 0;
  color: #c2c0b7;
  font-size: 18px;
  line-height: 1.7;
  z-index: 1;
}

.hero-meta {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
  z-index: 1;
}

.hero-meta span {
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 700;
}

.ghost-word {
  position: absolute;
  top: 34px;
  right: 22px;
  color: rgba(255, 255, 255, 0.035);
  font-size: clamp(80px, 12vw, 150px);
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.inventory-showcase {
  position: absolute;
  right: 38px;
  top: 30px;
  z-index: 1;
  width: 204px;
  min-height: 112px;
  padding: 20px 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid rgba(216, 255, 98, 0.42);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(216, 255, 98, 0.2), rgba(255, 255, 255, 0.035) 54%, rgba(113, 225, 162, 0.12)),
    rgba(8, 9, 7, 0.7);
  box-shadow: 0 0 0 1px rgba(216, 255, 98, 0.08), 0 24px 80px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.inventory-showcase span {
  color: #ebe8d7;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 2px;
}

.inventory-showcase strong {
  display: block;
  margin-top: 10px;
  color: var(--green);
  font-size: 54px;
  line-height: 1;
  font-weight: 950;
  text-shadow: 0 0 28px rgba(216, 255, 98, 0.32);
}

.redeem-form {
  padding: 44px 70px 48px;
}

label {
  display: block;
  margin-bottom: 10px;
  color: #dcd9cc;
  font-weight: 800;
}

textarea {
  width: 100%;
  min-height: 160px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(3, 4, 3, 0.68);
  padding: 16px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 18px;
  line-height: 1.7;
  outline: none;
  resize: vertical;
}

textarea:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(216, 255, 98, 0.1);
}

.hint-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
  color: #dcd9cc;
  font-weight: 800;
}

.hint-row small {
  color: var(--muted);
  font-weight: 500;
}

.primary-action {
  display: block;
  min-width: 150px;
  height: 60px;
  margin: 28px auto 0;
  border: 0;
  border-radius: 16px;
  color: #11120e;
  background: #f2f0ea;
  cursor: pointer;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 1px;
}

.primary-action:hover {
  background: var(--green);
}

.primary-action:disabled {
  opacity: 0.7;
  cursor: wait;
}

.primary-action.is-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.primary-action.is-loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(17, 18, 14, 0.28);
  border-top-color: #11120e;
  border-radius: 50%;
  animation: button-spin 700ms linear infinite;
}

@keyframes button-spin {
  to {
    transform: rotate(360deg);
  }
}

.toast {
  position: fixed;
  top: 34px;
  left: 50%;
  z-index: 80;
  min-width: 260px;
  max-width: 420px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: #f6f3e9;
  background: rgba(18, 19, 16, 0.94);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.36);
  opacity: 0;
  transform: translate(-50%, -10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  border-color: rgba(255, 107, 107, 0.46);
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.18), rgba(18, 19, 16, 0.94));
}

.toast.success {
  border-color: rgba(113, 225, 162, 0.46);
  background: linear-gradient(135deg, rgba(113, 225, 162, 0.14), rgba(18, 19, 16, 0.94));
}

.route-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  height: 3px;
  pointer-events: none;
}

.route-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--green), var(--ok), #f7f7f1);
}

@media (max-width: 860px) {
  .public-shell {
    padding: 20px 16px 36px;
  }

  .public-header {
    margin-bottom: 24px;
  }

  .brand {
    font-size: 21px;
  }

  .extract-panel {
    width: 100%;
    margin: 0;
    border-radius: 18px;
  }

  .hero-block {
    padding: 34px 24px 24px;
  }

  .hero-block h1 {
    font-size: 42px;
  }

  .hero-desc {
    font-size: 16px;
  }

  .inventory-showcase {
    position: relative;
    right: auto;
    top: auto;
    width: 100%;
    min-height: 90px;
    margin-top: 22px;
  }

  .ghost-word {
    top: 18px;
    right: 10px;
  }

  .redeem-form {
    padding: 26px 20px 30px;
  }

  .hint-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}
