:root {
  color-scheme: dark;
  --bg: #110c22;
  --bg-2: #1b1234;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.13);
  --text: #f8f4ff;
  --muted: rgba(248, 244, 255, 0.66);
  --line: rgba(255, 255, 255, 0.13);
  --brand: #8b5cf6;
  --brand-2: #28e2c4;
  --hot: #ff4fc4;
  --warn: #ffb84d;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(139, 92, 246, 0.34), transparent 34rem),
    radial-gradient(circle at 90% 18%, rgba(40, 226, 196, 0.18), transparent 28rem),
    linear-gradient(160deg, var(--bg), #090713 62%, #130d28);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app {
  width: min(1120px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom));
}

.shell {
  min-height: calc(100svh - 40px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 18px;
}

.hero,
.panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.05));
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero {
  min-height: 620px;
  display: grid;
  align-content: space-between;
  overflow: hidden;
  border-radius: 28px;
  padding: 28px;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto -10% 16% -10%;
  height: 230px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 79, 196, 0.26), transparent),
    repeating-linear-gradient(90deg, transparent 0 16px, rgba(255, 255, 255, 0.18) 16px 18px);
  transform: skewY(-7deg);
  opacity: 0.9;
}

.hero::after {
  content: "";
  position: absolute;
  right: -110px;
  bottom: -120px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(40, 226, 196, 0.2), transparent 70%);
}

.hero-content,
.hero-actions,
.result-card {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--brand-2);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 680px;
  margin-bottom: 14px;
  font-size: clamp(2.5rem, 8vw, 6.2rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.lead {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.token-form {
  max-width: 560px;
  margin: 20px 0 0;
}

.token-field {
  display: grid;
  gap: 7px;
}

.token-field span {
  color: var(--brand-2);
  font-size: 0.86rem;
  font-weight: 900;
}

.era-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.era-tag {
  padding: 8px 12px;
  border: 1px solid currentColor;
  border-radius: 10px;
  color: var(--warn);
  background: rgba(255, 184, 77, 0.08);
  font-weight: 900;
  transform: rotate(-4deg);
}

.era-tag:nth-child(2n) {
  color: #7aa7ff;
  transform: rotate(5deg);
}

.era-tag:nth-child(3n) {
  color: var(--brand-2);
  transform: rotate(-2deg);
}

.wave {
  width: 100%;
  height: 116px;
  margin: 26px 0;
}

.hero-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #6d37e2);
  font-weight: 900;
  text-decoration: none;
}

.button.secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line);
}

.button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.side {
  display: grid;
  gap: 18px;
  align-content: start;
}

.panel {
  border-radius: 24px;
  padding: 18px;
}

.panel h2 {
  margin-bottom: 8px;
  font-size: 1.26rem;
}

.panel p {
  color: var(--muted);
}

.form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.input,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.24);
  outline: none;
}

.input {
  min-height: 44px;
  padding: 10px 12px;
}

.textarea {
  min-height: 170px;
  padding: 12px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
}

.input:focus,
.textarea:focus {
  border-color: rgba(40, 226, 196, 0.68);
  box-shadow: 0 0 0 3px rgba(40, 226, 196, 0.13);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.notice,
.error {
  padding: 11px 12px;
  border-radius: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.notice {
  color: #c9fff4;
  background: rgba(40, 226, 196, 0.13);
  border: 1px solid rgba(40, 226, 196, 0.2);
}

.error {
  color: #ffe1e1;
  background: rgba(255, 79, 112, 0.14);
  border: 1px solid rgba(255, 79, 112, 0.24);
}

.result-card {
  border-radius: 22px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(139, 92, 246, 0.28), rgba(255, 255, 255, 0.07)),
    rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.result-card h2 {
  margin-bottom: 4px;
  font-size: clamp(2rem, 8vw, 3.8rem);
  line-height: 1;
}

.score {
  color: var(--muted);
  font-weight: 800;
}

.bars {
  display: grid;
  gap: 9px;
  margin: 18px 0;
}

.bar-row {
  display: grid;
  grid-template-columns: 70px 1fr 40px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--hot));
}

.fact {
  margin-top: 14px;
  padding: 13px;
  border-radius: 16px;
  color: #f4efff;
  background: rgba(255, 255, 255, 0.09);
}

.tracks {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.track {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
}

.track strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.hidden {
  display: none !important;
}

@media (max-width: 860px) {
  .app {
    padding: 12px;
  }

  .shell {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding: 22px;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 2.65rem;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }
}
