:root {
  --green: #ccff00;
  --green-soft: #9fc900;
  --ink: #070907;
  --panel: #111410;
  --panel-2: #181c17;
  --line: rgba(204, 255, 0, 0.18);
  --muted: #929b8f;
  --white: #f5f7f2;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--ink);
  color: var(--white);
  font-family: Inter, system-ui, sans-serif;
}
button, input, textarea { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.topbar {
  height: 76px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 34px;
  border-bottom: 1px solid rgba(255,255,255,.09);
  background: rgba(7,9,7,.9);
  backdrop-filter: blur(18px);
  position: relative;
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; font-size: 14px; letter-spacing: .12em; }
.brand b { color: var(--green); }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; overflow: hidden; border-radius: 50%; background: #050705; border: 1px solid rgba(204,255,0,.4); }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.product-pill { border: 1px solid var(--line); background: rgba(204,255,0,.05); color: #cbd2c7; border-radius: 99px; padding: 10px 16px; font: 500 11px DM Mono, monospace; letter-spacing: .14em; text-decoration: none; }
.product-pill:hover { color: var(--green); border-color: rgba(204,255,0,.55); }
.pulse { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }
.wallet-button { justify-self: end; display: flex; align-items: center; gap: 9px; border: 1px solid rgba(255,255,255,.14); background: #151815; border-radius: 10px; padding: 11px 14px; font-size: 12px; cursor: pointer; }
.wallet-button:hover { border-color: var(--green); }
.wallet-dot { width: 8px; height: 8px; border-radius: 50%; background: #555; }
.wallet-button.connected .wallet-dot { background: var(--green); box-shadow: 0 0 8px var(--green); }

.experience { min-height: calc(100vh - 112px); display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(460px, .88fr); }
.figure-stage { position: relative; min-height: 770px; overflow: hidden; border-right: 1px solid rgba(255,255,255,.08); background: radial-gradient(circle at 58% 46%, rgba(204,255,0,.2), transparent 33%), linear-gradient(145deg, #0d110c, #070907 55%); }
.figure-stage::after { content: ""; position: absolute; inset: 0; opacity: .13; background-image: linear-gradient(rgba(204,255,0,.14) 1px, transparent 1px), linear-gradient(90deg, rgba(204,255,0,.14) 1px, transparent 1px); background-size: 70px 70px; mask-image: linear-gradient(to bottom, transparent, black 28%, black 75%, transparent); }
.stage-copy { position: absolute; z-index: 3; top: 55px; left: 6%; max-width: 470px; }
.eyebrow, .console-kicker { font: 500 10px DM Mono, monospace; color: var(--green); letter-spacing: .18em; }
.stage-copy h1 { margin: 18px 0 12px; font-size: clamp(44px, 5vw, 76px); line-height: .92; letter-spacing: -.07em; }
.stage-copy h1 em { color: var(--green); font-style: normal; }
.stage-copy p { width: 350px; color: #9ba198; font-size: 14px; line-height: 1.6; }

.figure-orbit { position: absolute; z-index: 2; inset: 138px 0 78px; display: grid; place-items: center; }
.figure-orbit img { position: relative; z-index: 2; width: min(68%, 610px); max-height: 640px; object-fit: contain; filter: drop-shadow(0 28px 38px rgba(0,0,0,.65)); transition: opacity .25s ease, transform .35s cubic-bezier(.2,.8,.2,1); }
.figure-orbit.switching img { opacity: 0; transform: translateY(8px) scale(.97); }
.orbit-ring { position: absolute; border: 1px solid rgba(204,255,0,.18); border-radius: 50%; }
.ring-one { width: 570px; height: 570px; animation: spin 24s linear infinite; }
.ring-one::before, .ring-one::after { content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 14px var(--green); }
.ring-one::before { top: 38px; left: 120px; }
.ring-one::after { bottom: 55px; right: 92px; }
.ring-two { width: 430px; height: 430px; border-style: dashed; opacity: .4; animation: spin 18s linear reverse infinite; }
.scan-line { position: absolute; z-index: 3; width: 62%; height: 1px; top: 20%; background: linear-gradient(90deg, transparent, var(--green), transparent); box-shadow: 0 0 14px var(--green); animation: scan 5s ease-in-out infinite; opacity: .55; }
.figure-shadow { position: absolute; bottom: 7%; width: 46%; height: 9%; border-radius: 50%; background: rgba(0,0,0,.72); filter: blur(19px); }
.figure-id { position: absolute; right: 6%; bottom: 4%; padding: 13px 15px; border-left: 2px solid var(--green); background: rgba(8,10,8,.68); backdrop-filter: blur(10px); }
.figure-id span, .figure-id small { display: block; font-family: DM Mono, monospace; }
.figure-id span { font-size: 11px; letter-spacing: .12em; }
.figure-id small { color: var(--green); font-size: 9px; margin-top: 4px; }

.figure-picker { position: absolute; z-index: 4; left: 5%; bottom: 28px; display: flex; gap: 9px; }
.figure-thumb { width: 58px; height: 58px; overflow: hidden; padding: 0; border-radius: 10px; border: 1px solid rgba(255,255,255,.15); background: #111; cursor: pointer; opacity: .55; transition: .2s ease; }
.figure-thumb img { width: 100%; height: 100%; object-fit: cover; }
.figure-thumb:hover, .figure-thumb.active { opacity: 1; transform: translateY(-4px); border-color: var(--green); box-shadow: 0 0 0 2px rgba(204,255,0,.12); }
.figure-thumb.rare { position: relative; }
.figure-thumb.rare::after { content: "RARE"; position: absolute; right: 2px; bottom: 2px; font: 7px DM Mono; color: #050505; background: var(--green); padding: 2px 3px; }

.console { position: relative; padding: 42px clamp(28px, 4vw, 64px); background: linear-gradient(180deg, #121511, #0a0c09); }
.console::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(135deg, rgba(204,255,0,.045), transparent 35%); }
.console-head { position: relative; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.09); padding-bottom: 24px; }
.console-head h2 { margin: 7px 0 0; font-size: 28px; letter-spacing: -.035em; }
.power-cell { text-align: right; }
.power-cell span { display: block; color: #70776e; font: 9px DM Mono; letter-spacing: .16em; }
.power-cell b { display: block; color: var(--green); font: 500 20px DM Mono; margin-top: 5px; }

.gate-view { position: relative; max-width: 450px; margin: 84px auto 0; text-align: center; }
.gate-symbol { width: 78px; height: 78px; display: grid; place-items: center; overflow: hidden; margin: auto; border: 1px solid var(--line); border-radius: 22px; background: #050705; box-shadow: inset 0 0 35px rgba(204,255,0,.06), 0 0 55px rgba(204,255,0,.07); }
.gate-symbol img { width: 100%; height: 100%; object-fit: cover; }
.gate-view h3 { font-size: 25px; margin: 25px 0 8px; }
.gate-view > p { color: var(--muted); line-height: 1.65; font-size: 14px; margin: 0 auto 26px; }
.primary-button { width: 100%; border: 0; border-radius: 10px; padding: 17px 20px; display: flex; justify-content: space-between; background: var(--green); color: #070907; font-weight: 800; cursor: pointer; box-shadow: 0 14px 34px rgba(204,255,0,.13); }
.primary-button:hover { background: #d8ff3d; transform: translateY(-1px); }
.micro-row { display: flex; justify-content: center; gap: 13px; margin-top: 20px; color: #626961; font: 9px DM Mono; }

.builder-view { position: relative; padding-top: 30px; }
.step-label { margin: 21px 0 10px; font: 500 10px DM Mono; letter-spacing: .14em; color: #91988e; }
.step-label span { color: var(--green); margin-right: 9px; }
.field { display: block; position: relative; }
.field > span { display: block; margin-bottom: 8px; font-size: 12px; color: #d8ddd5; }
.field i { color: #687067; font-style: normal; }
.field input, .field textarea { width: 100%; outline: none; color: white; background: #0b0d0b; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; padding: 14px 15px; resize: none; }
.field input:focus, .field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(204,255,0,.07); }
.field > small { position: absolute; bottom: 10px; right: 12px; color: #626961; font: 9px DM Mono; }
.archetypes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.archetype { min-height: 66px; padding: 12px; text-align: left; border-radius: 9px; border: 1px solid rgba(255,255,255,.1); background: #0d0f0d; cursor: pointer; }
.archetype b, .archetype small { display: block; }
.archetype b { font-size: 12px; }
.archetype small { margin-top: 5px; color: #747c72; font-size: 10px; }
.archetype:hover, .archetype.active { border-color: var(--green); background: rgba(204,255,0,.06); }
.archetype.active b { color: var(--green); }
.archetype.legendary { grid-column: 1 / -1; background: linear-gradient(90deg, rgba(204,255,0,.08), rgba(180,210,255,.05)); }
.activate { margin-top: 23px; }

.chat-view { position: relative; padding-top: 22px; }
.chat-identity { display: flex; align-items: center; gap: 12px; padding: 11px; border: 1px solid rgba(255,255,255,.09); border-radius: 12px; background: #0b0d0b; }
.chat-identity img { width: 52px; height: 52px; border-radius: 9px; object-fit: cover; }
.chat-identity div { flex: 1; }
.chat-identity strong, .chat-identity span { display: block; }
.chat-identity strong { font-size: 14px; }
.chat-identity span { margin-top: 5px; color: var(--green); font: 8px DM Mono; letter-spacing: .12em; }
.chat-identity span i { display: inline-block; width: 6px; height: 6px; background: var(--green); border-radius: 50%; margin-right: 6px; box-shadow: 0 0 8px var(--green); }
.chat-identity button { border: 0; color: #7d857a; background: transparent; font-size: 11px; cursor: pointer; }
.messages { height: 365px; overflow-y: auto; padding: 21px 4px 8px; scrollbar-width: thin; scrollbar-color: #343a32 transparent; }
.message { max-width: 88%; margin-bottom: 16px; }
.message p { margin: 5px 0 0; padding: 13px 15px; border-radius: 6px 14px 14px 14px; background: #171a16; color: #d6dbd3; font-size: 13px; line-height: 1.58; white-space: pre-wrap; }
.message .speaker { color: var(--green); font: 8px DM Mono; letter-spacing: .14em; }
.user-message { margin-left: auto; }
.user-message .speaker { color: #777f75; display: block; text-align: right; }
.user-message p { border-radius: 14px 6px 14px 14px; background: rgba(204,255,0,.1); color: #ecf1e8; }
.prompt-chips { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 10px; }
.prompt-chips button { white-space: nowrap; border: 1px solid rgba(255,255,255,.1); border-radius: 99px; background: transparent; color: #8e968b; padding: 8px 10px; font-size: 9px; cursor: pointer; }
.prompt-chips button:hover { border-color: var(--green); color: var(--green); }
.composer { display: flex; align-items: flex-end; gap: 10px; padding: 10px; border-radius: 12px; border: 1px solid rgba(255,255,255,.14); background: #090b09; }
.composer:focus-within { border-color: var(--green); }
.composer textarea { flex: 1; max-height: 130px; resize: none; border: 0; outline: 0; background: transparent; color: white; padding: 8px 5px; font-size: 13px; }
.composer button { width: 38px; height: 38px; flex: 0 0 38px; border: 0; border-radius: 9px; background: var(--green); color: #060806; font-size: 22px; cursor: pointer; }
.composer button:disabled { opacity: .4; cursor: wait; }
.chat-foot { display: flex; justify-content: space-between; color: #5f665d; font: 8px DM Mono; margin-top: 9px; }
.status-toast { position: absolute; z-index: 10; left: 50%; bottom: 28px; transform: translateX(-50%); width: max-content; max-width: 85%; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; background: #1a1d19; box-shadow: 0 20px 50px rgba(0,0,0,.5); padding: 12px 16px; color: #d8ddd5; font-size: 12px; }

footer { height: 36px; display: flex; justify-content: space-between; align-items: center; padding: 0 34px; border-top: 1px solid rgba(255,255,255,.08); color: #4f554d; background: #070907; font: 8px DM Mono; letter-spacing: .12em; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes scan { 0%, 100% { top: 18%; opacity: 0; } 15% { opacity: .55; } 75% { opacity: .35; } 85% { top: 82%; opacity: 0; } }

@media (max-width: 1050px) {
  .experience { grid-template-columns: 1fr; }
  .figure-stage { min-height: 710px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.08); }
  .console { min-height: 720px; }
}
@media (max-width: 680px) {
  .topbar { height: 68px; grid-template-columns: 1fr auto; padding: 0 16px; }
  .product-pill { display: none; }
  .brand { font-size: 11px; }
  .wallet-button { padding: 10px; }
  .experience { min-height: 0; }
  .figure-stage { min-height: 610px; }
  .stage-copy { top: 35px; left: 20px; }
  .stage-copy h1 { font-size: 45px; }
  .stage-copy p { width: min(320px, 88vw); font-size: 12px; }
  .figure-orbit { inset: 152px 0 72px; }
  .figure-orbit img { width: min(88%, 480px); }
  .ring-one { width: 390px; height: 390px; }
  .ring-two { width: 300px; height: 300px; }
  .figure-picker { left: 16px; right: 16px; overflow-x: auto; }
  .figure-thumb { min-width: 50px; width: 50px; height: 50px; }
  .figure-id { right: 16px; bottom: 88px; }
  .console { padding: 30px 18px 45px; }
  .gate-view { margin-top: 60px; }
  .micro-row { flex-wrap: wrap; }
  .archetypes { grid-template-columns: 1fr; }
  .archetype.legendary { grid-column: auto; }
  .messages { height: 340px; }
  footer { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
