:root {
  --void: #0a0b0f;
  --void-2: #12141c;
  --panel: #171a24;
  --line: #262a38;
  --exotic: #ceae33;
  --exotic-bright: #ffe9a8;
  --exotic-dim: #7a6a2e;
  --text: #e8e9ee;
  --text-dim: #8b8fa3;
  --text-faint: #565a6b;
  --danger: #d9605a;
  --font-display: "Rajdhani", sans-serif;
  --font-body: "Inter", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
}

body {
  background:
    radial-gradient(ellipse 900px 500px at 50% -10%, rgba(206,174,51,0.08), transparent 60%),
    radial-gradient(ellipse 700px 500px at 90% 100%, rgba(90,70,140,0.10), transparent 60%),
    var(--void);
  position: relative;
  overflow-x: hidden;
}

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

.hidden { display: none !important; }

/* ---------- topbar ---------- */

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
  border-bottom: 1px solid var(--line);
}

.topbar__mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 15px;
  color: var(--text);
}

.topbar__glyph {
  color: var(--exotic);
  font-size: 18px;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-dim);
  transition: color 0.15s ease;
}

.topbar__brand:hover {
  color: var(--text);
}

.topbar__logo {
  width: 16px;
  height: 16px;
  display: block;
}

.topbar__sep {
  color: var(--line);
  font-weight: 400;
}

.topbar__tool {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- stage / screens ---------- */

.stage {
  position: relative;
  z-index: 2;
  min-height: calc(100vh - 73px);
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.screen {
  width: 100%;
  max-width: 860px;
  padding: 64px 28px 80px;
  margin: 0 auto;
}

.screen--center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
}

.eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.22em;
  color: var(--exotic);
  margin: 0 0 18px;
}

.reel-eyebrow {
  text-align: center;
}

.target-label {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin: -10px 0 18px;
}

.headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 46px;
  line-height: 1.08;
  letter-spacing: 0.005em;
  margin: 0 0 20px;
  max-width: 640px;
}

.headline--sm {
  font-size: 30px;
  max-width: 520px;
}

.sub {
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.6;
  max-width: 480px;
  margin: 0 0 34px;
}

/* ---------- buttons ---------- */

.btn {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.05em;
  font-size: 15px;
  padding: 15px 30px;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--exotic);
  color: #1a1506;
  box-shadow: 0 0 0 rgba(206,174,51,0);
}

.btn--primary:hover {
  background: var(--exotic-bright);
  box-shadow: 0 0 24px rgba(206,174,51,0.35);
}

.btn--primary:disabled {
  background: var(--exotic-dim);
  color: #2a2410;
  cursor: not-allowed;
  box-shadow: none;
}

.btn--wide {
  padding: 16px 56px;
}

.btn--ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--line);
}

.btn--ghost:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

.error {
  color: var(--danger);
  font-size: 14px;
  margin-top: 18px;
}

/* ---------- loading ---------- */

.engram-spinner {
  width: 64px;
  height: 64px;
  border: 2px solid var(--line);
  border-top-color: var(--exotic);
  border-radius: 50%;
  transform: rotate(45deg);
  animation: spin 1.1s linear infinite;
  margin-bottom: 28px;
}

@keyframes spin {
  to { transform: rotate(405deg); }
}

.loading-text {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-size: 15px;
}

/* ---------- reel ---------- */

#screen-reel {
  text-align: center;
}

.reel-frame {
  position: relative;
  margin: 8px 0 40px;
  padding: 0;
}

.reel-viewport {
  position: relative;
  height: 172px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--void-2), var(--panel) 50%, var(--void-2));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.reel-track {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  height: 100%;
  will-change: transform;
}

.reel-item {
  flex: 0 0 148px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-right: 1px solid var(--line);
}

.reel-item img {
  width: 84px;
  height: 84px;
  border: 1px solid var(--exotic-dim);
  background: #000;
}

.reel-item span {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--text-dim);
  text-align: center;
  padding: 0 8px;
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reel-pointer {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  z-index: 3;
}

.reel-pointer--top {
  top: -1px;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 11px solid var(--exotic);
}

.reel-pointer--bottom {
  bottom: -1px;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 11px solid var(--exotic);
}

.reel-edge {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 120px;
  z-index: 2;
  pointer-events: none;
}

.reel-edge--left {
  left: 0;
  background: linear-gradient(90deg, var(--void), transparent);
}

.reel-edge--right {
  right: 0;
  background: linear-gradient(270deg, var(--void), transparent);
}

/* ---------- result ---------- */

.result-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 48px;
  border: 1px solid var(--exotic-dim);
  background: radial-gradient(ellipse at 50% 0%, rgba(206,174,51,0.14), transparent 70%), var(--panel);
  margin-bottom: 30px;
  animation: reveal 0.5s ease;
}

@keyframes reveal {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.result-card img {
  width: 128px;
  height: 128px;
  border: 1px solid var(--exotic);
  background: #000;
  box-shadow: 0 0 40px rgba(206,174,51,0.25);
  margin-bottom: 20px;
}

.result-card__tier {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--exotic);
  margin-bottom: 6px;
}

.result-card__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  margin-bottom: 6px;
}

.result-card__type {
  color: var(--text-dim);
  font-size: 14px;
}

.result-actions {
  display: flex;
  gap: 14px;
}

.pull-status {
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-dim);
  min-height: 20px;
}

.pull-status--ok { color: var(--exotic); }
.pull-status--err { color: var(--danger); }

/* ---------- responsive ---------- */

@media (max-width: 560px) {
  .headline { font-size: 32px; }
  .topbar { padding: 16px 18px; }
  .screen { padding: 40px 16px 60px; }
  .reel-item { flex-basis: 116px; }
  .reel-item img { width: 68px; height: 68px; }
  .result-card { padding: 28px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .engram-spinner { animation: none; }
  .reel-track { transition: none !important; }
  .result-card { animation: none; }
}
