:root { --fg: #f5f5f7; --dim: #86868b; --line: rgba(255,255,255,.16); --accent: #f5f5f7; --ease: cubic-bezier(.2,.8,.2,1); }
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; overflow: hidden; background: #000; color: var(--fg); }
body { font: 400 17px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; letter-spacing: -.012em; }
button, input, select { font: inherit; letter-spacing: inherit; color: inherit; }
:focus-visible { outline: 2px solid #2997ff; outline-offset: 3px; }

#orb { position: fixed; inset: 0; width: 100vw; height: 100dvh; z-index: 0; pointer-events: none; }
main { position: relative; z-index: 1; height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr); padding: 0 clamp(18px, 4vw, 44px); }
header { height: 56px; display: flex; justify-content: space-between; align-items: center; }
footer { height: 44px; display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 12px; color: var(--dim); }
footer span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand { font-weight: 600; font-size: 16px; color: var(--fg); text-decoration: none; letter-spacing: -.02em; }

.primary, .ghost { border-radius: 980px; cursor: pointer; white-space: nowrap; font-weight: 500; font-size: 15px; height: 40px; padding: 0 20px; transition: transform .15s, background .2s, opacity .2s; }
.primary { background: var(--fg); color: #000; border: 0; }
.primary:hover { background: #fff; }
.primary:active, .ghost:active { transform: scale(.97); }
.primary:disabled { opacity: .5; cursor: default; }
.ghost { background: rgba(255,255,255,.08); border: 0; color: var(--fg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.ghost:hover { background: rgba(255,255,255,.16); }
header .ghost { height: 32px; padding: 0 14px; font-size: 13px; }
.link { background: none; border: 0; color: #2997ff; cursor: pointer; font-size: 15px; padding: 0 6px; }
.link:hover { text-decoration: underline; }
footer .link { font-size: 12px; white-space: nowrap; }

.stage { min-height: 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: clamp(8px, 1.9vh, 18px); }
.orb-space { width: 100%; height: min(30vh, 64vw); flex: none; transition: height .8s var(--ease); }
body.has-result .orb-space { height: min(24vh, 46vw); }

h1 { font-size: clamp(34px, min(6vw, 9.5vh), 72px); line-height: 1.05; font-weight: 600; letter-spacing: -.035em; }
.sub { color: var(--dim); font-size: clamp(16px, min(1.75vw, 2.9vh), 21px); line-height: 1.36; max-width: 30em; margin: clamp(8px, 1.5vh, 14px) auto 0; }

form { width: min(640px, 100%); display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 22px; border-radius: 980px; background: rgba(255,255,255,.08); backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .25s; margin-top: clamp(2px, 1vh, 10px); }
form:focus-within { box-shadow: inset 0 0 0 1px rgba(255,255,255,.5), 0 0 0 6px rgba(255,255,255,.06); }
input { flex: 1; min-width: 0; height: 44px; background: none; border: 0; outline: 0; font-size: 16px; }
input:not(:placeholder-shown) { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; letter-spacing: 0; }
input::placeholder { color: var(--dim); }
select { appearance: none; -webkit-appearance: none; background: rgba(255,255,255,.1); border: 0; border-radius: 980px; height: 36px; padding: 0 14px; font-size: 13px; cursor: pointer; display: none; }
select.on { display: block; }
form .primary { height: 44px; padding: 0 24px; font-size: 16px; flex: none; }
.status { min-height: 20px; font-size: 14px; color: var(--dim); }
.status.err { color: #ff9f0a; }
.status.busy { color: #2997ff; font-size: 16px; font-weight: 500; }
.status.busy::after { content: '...'; display: inline-block; overflow: hidden; vertical-align: bottom; width: 0; animation: dots 1.2s steps(4, end) infinite; }
@keyframes dots { to { width: 1.1em; } }
body[data-state="scan"] form { box-shadow: inset 0 0 0 1.5px #2997ff, 0 0 0 6px rgba(41,151,255,.16); }
body[data-state="scan"] .chips, body[data-state="scan"] .tease { opacity: .25; pointer-events: none; transition: opacity .3s; }

.tease { font-size: 14px; color: var(--dim); }
.chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; width: min(960px, 100%); }
.chips button { display: flex; align-items: center; gap: 11px; text-align: left; padding: 10px 14px 10px 10px; border: 0; border-radius: 18px; background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 1px var(--line); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); cursor: pointer; transition: transform .3s var(--ease), background .25s, box-shadow .25s; }
.chips button:hover { transform: translateY(-3px); background: rgba(255,255,255,.15); box-shadow: inset 0 0 0 1px rgba(255,255,255,.45), 0 16px 44px rgba(0,0,0,.55); }
.chips button:active { transform: scale(.98); }
.chips button::after { content: ''; flex: none; margin-left: auto; width: 7px; height: 7px; border-top: 1.5px solid var(--dim); border-right: 1.5px solid var(--dim); transform: rotate(45deg); transition: transform .3s var(--ease), border-color .25s; }
.chips button:hover::after { border-color: #fff; transform: translateX(3px) rotate(45deg); }
.chips i { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 600; font-size: 18px; background: #f7931a; color: #000; pointer-events: none; }
.chips button[data-a^="0x"] i { background: #627eea; color: #fff; }
.chips span { min-width: 0; display: flex; flex-direction: column; pointer-events: none; }
.chips b { font-size: 14px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips small { font-size: 12px; color: var(--dim); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.result { display: none; flex-direction: column; align-items: center; gap: clamp(8px, 1.7vh, 16px); width: 100%; }
body.has-result .result { display: flex; }
body.has-result .hero, body.has-result form, body.has-result .chips, body.has-result .tease, body.has-result .status { display: none; }
.who { font: 13px/1.3 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0; color: var(--dim); max-width: 100%; padding: 5px 14px; border-radius: 980px; background: rgba(0,0,0,.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who b { font: 500 13px/1.3 -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; color: var(--fg); margin-right: 10px; }
.verdict { font-size: clamp(38px, min(8vw, 12.5vh), 104px); line-height: 1; font-weight: 600; letter-spacing: -.045em; color: var(--accent); animation: land .9s var(--ease) both; }
@keyframes land { from { opacity: 0; transform: scale(1.12); filter: blur(14px); } }
.why { font-size: clamp(16px, min(1.7vw, 2.8vh), 21px); line-height: 1.36; max-width: 32em; color: #d2d2d7; }
.stats { display: grid; grid-template-columns: repeat(4, auto); justify-content: center; margin-top: clamp(2px, 1vh, 10px); }
.stats div { display: flex; flex-direction: column-reverse; padding: 0 clamp(14px, 2.8vw, 38px); border-left: 1px solid var(--line); min-width: 0; }
.stats div:first-child { border-left: 0; }
.stats dd { font-size: clamp(22px, min(3vw, 5vh), 40px); font-weight: 600; letter-spacing: -.035em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats dt { font-size: 13px; color: var(--dim); margin-top: 5px; white-space: nowrap; }
.next { font-size: 15px; color: var(--dim); max-width: 40em; line-height: 1.4; }
.next b { color: var(--fg); font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 12px; margin-top: clamp(0px, .6vh, 6px); }

dialog { border: 0; border-radius: 22px; background: rgba(29,29,31,.86); backdrop-filter: blur(50px) saturate(180%); -webkit-backdrop-filter: blur(50px) saturate(180%); color: var(--fg); width: min(640px, 92vw); max-height: 86dvh; padding: 0; margin: auto; box-shadow: 0 0 0 1px var(--line), 0 40px 120px rgba(0,0,0,.6); }
dialog[open] { animation: sheet .45s var(--ease); }
@keyframes sheet { from { opacity: 0; transform: translateY(18px) scale(.97); } }
dialog::backdrop { background: rgba(0,0,0,.6); }
.sheet { padding: clamp(22px, 4vw, 36px); display: flex; flex-direction: column; gap: 14px; max-height: 86dvh; }
.sheet h3 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.sheet p { color: #d2d2d7; font-size: 16px; line-height: 1.4; }
.sheet .fine { color: var(--dim); font-size: 13px; }
.sheet pre { margin: 0; padding: 16px; border-radius: 14px; background: rgba(0,0,0,.45); overflow: auto; min-height: 60px; font: 12.5px/1.6 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0; color: #e8e8ed; white-space: pre-wrap; word-break: break-all; }
.sheet .actions { justify-content: flex-start; }

@media (max-width: 1100px) { .chips button::after { display: none; } }
@media (max-width: 680px) {
  .stats { grid-template-columns: repeat(2, 1fr); gap: 14px 0; width: 100%; }
  .stats div:nth-child(3) { border-left: 0; }
  form { padding-left: 16px; }
  form .primary { padding: 0 18px; }
  footer span { font-size: 11px; }
  .chips { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .chips button { padding: 8px 10px 8px 8px; gap: 8px; border-radius: 14px; }
  .chips button::after { display: none; }
  .chips i { width: 30px; height: 30px; font-size: 15px; }
  .chips b { font-size: 13px; }
  .chips small { font-size: 11px; }
}
@media (max-height: 680px) { .next, .tease { display: none; } .orb-space { height: min(24vh, 56vw); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
