:root {
  --bg: #0b0816; --panel: #15102a; --panel2: #1c1638; --line: #2c2450;
  --text: #f4f1ff; --muted: #a49bc7; --green: #22e07a; --green2: #16a34a;
  --pink: #ff4fd8; --violet: #8b5cf6; --gold: #ffcc33; --red: #ff6b6b;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; overflow-x: hidden; }
a { color: var(--green); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.glow { position: fixed; inset: -20% -10% auto; height: 70vh; z-index: -1; pointer-events: none;
  background: radial-gradient(40% 50% at 25% 30%, #8b5cf633, transparent 70%), radial-gradient(35% 45% at 75% 20%, #ff4fd822, transparent 70%), radial-gradient(30% 40% at 50% 60%, #22e07a18, transparent 70%); }

.top { display: flex; justify-content: space-between; align-items: center; max-width: 1080px; margin: 0 auto; padding: 20px 16px; }
.logo { font-weight: 900; font-size: 20px; color: var(--text); text-decoration: none; letter-spacing: -.02em; }
.counter { color: var(--muted); font-size: 13px; }

main { max-width: 1080px; margin: 0 auto; padding: 0 16px 60px; }
.hero { text-align: center; padding: 40px 0 20px; }
h1 { font-size: clamp(38px, 7vw, 76px); line-height: 1.02; letter-spacing: -.045em; margin: 0 0 16px; font-weight: 900; }
.grad { background: linear-gradient(90deg, var(--green), #7cf5c0 40%, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { color: var(--muted); font-size: clamp(16px, 2vw, 19px); max-width: 620px; margin: 0 auto 28px; line-height: 1.5; }

.modes { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin-bottom: 16px; }
.mode { background: none; border: 0; color: var(--muted); font: 600 14px Inter; padding: 8px 16px; border-radius: 999px; cursor: pointer; }
.mode.active { background: var(--panel2); color: var(--text); box-shadow: 0 0 0 1px var(--line); }

.search { display: flex; gap: 8px; max-width: 680px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 8px; box-shadow: 0 20px 60px #0008; align-items: center; }
.search:focus-within { border-color: var(--violet); }
.search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text); font: 600 18px Inter; padding: 12px 12px; }
.search input::placeholder { color: #6e6593; }
.vs { font-weight: 900; color: var(--pink); font-size: 14px; }
.search button { background: linear-gradient(135deg, var(--green), #10b981); color: #04160c; border: 0; font: 800 17px Inter; padding: 14px 22px; border-radius: 12px; cursor: pointer; white-space: nowrap; transition: transform .1s; }
.search button:hover { transform: translateY(-1px); }
.search button:disabled { opacity: .6; cursor: wait; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.chip { background: var(--panel); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 6px 12px; font: 500 13px Inter; cursor: pointer; }
.chip:hover { color: var(--text); border-color: var(--violet); }

.loading { text-align: center; padding: 40px 0; color: var(--muted); }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--green); animation: spin .8s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.error { max-width: 680px; margin: 20px auto; background: #ff6b6b18; border: 1px solid #ff6b6b55; color: #ffb3b3; padding: 14px 18px; border-radius: 12px; text-align: center; }

#results { margin-top: 20px; }
.battle { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.verdict-bar { grid-column: 1 / -1; text-align: center; font-size: clamp(20px, 3vw, 28px); font-weight: 800; padding: 18px; background: linear-gradient(90deg, #ff4fd822, #8b5cf622); border: 1px solid var(--line); border-radius: 16px; letter-spacing: -.02em; }

.card { background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: 22px; padding: 26px; position: relative; overflow: hidden; animation: pop .45s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: translateY(14px) scale(.98); opacity: 0; } }
.card.winner { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 20px 60px #ffcc3322; }
.crown { position: absolute; top: 14px; right: 16px; font-size: 28px; }
.site { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; min-width: 0; }
.site img { width: 36px; height: 36px; border-radius: 9px; background: #fff; flex: none; }
.site .d { font-weight: 800; font-size: 20px; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site .t { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.money { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: clamp(40px, 7vw, 68px); color: var(--green); letter-spacing: -.04em; line-height: 1.05; margin: 4px 0; text-shadow: 0 0 40px #22e07a44; }
.battle .money { font-size: clamp(30px, 4.5vw, 48px); }
.money small { font-size: .38em; color: var(--muted); letter-spacing: 0; }
.range { color: var(--muted); font-size: 14px; }
.job { margin: 18px 0; padding: 16px; border-radius: 14px; background: #ffffff08; border: 1px solid var(--line); font-size: 18px; line-height: 1.4; }
.job b { color: var(--gold); }
.job .emoji { font-size: 30px; float: left; margin-right: 12px; line-height: 1; }
.tick { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.tick span { background: #22e07a14; color: #9ff5c4; border: 1px solid #22e07a33; border-radius: 10px; padding: 6px 10px; font-size: 13px; font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { background: #00000030; border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-width: 0; }
.stat .k { color: var(--muted); font-size: 12px; font-weight: 600; }
.stat .v { font-weight: 800; font-size: 16px; margin-top: 4px; overflow-wrap: anywhere; }
.roast { margin-top: 16px; font-style: italic; color: #d9cffb; }
.platform { margin-top: 12px; font-size: 13px; color: var(--gold); background: #ffcc3312; border: 1px solid #ffcc3333; border-radius: 10px; padding: 10px 12px; }

.table { margin-top: 16px; padding: 18px; border-radius: 16px; background: linear-gradient(135deg, #ff4fd816, #ffcc3312); border: 1px solid #ff4fd844; }
.table h4 { margin: 0 0 6px; font-size: 16px; }
.table .big { font-family: 'JetBrains Mono', monospace; font-size: 28px; font-weight: 700; color: var(--gold); }
.table p { margin: 6px 0 0; color: #e7defc; font-size: 14px; line-height: 1.45; }

.offers { margin-top: 14px; padding: 18px; border-radius: 16px; background: #22e07a0c; border: 1px solid #22e07a33; }
.offers h4 { margin: 0 0 10px; font-size: 16px; }
.offer { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid #ffffff10; }
.offer:first-of-type { border-top: 0; }
.o-main { min-width: 0; }
.o-name { font-weight: 800; }
.o-pitch { color: var(--muted); font-size: 13px; line-height: 1.4; margin-top: 2px; }
.o-side { display: flex; align-items: center; gap: 12px; flex: none; }
.o-est { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--green); font-size: 18px; }
.o-est small { color: var(--muted); font-size: 12px; }
.disclose { color: #7d74a3; font-size: 12px; margin: 10px 0 0; }
@media (max-width: 720px) { .offer { flex-direction: column; align-items: flex-start; } }
.refine {margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--muted); }
.refine input { background: #00000040; border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 9px 12px; font: 600 14px Inter; width: 160px; }
.refine button, .btn { background: var(--panel2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 9px 14px; font: 700 14px Inter; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.refine button:hover, .btn:hover { border-color: var(--violet); }

.share { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line); }
.share .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btn.x { background: #000; }
.btn.primary { background: linear-gradient(135deg, var(--pink), var(--violet)); border: 0; }
.embed { margin-top: 12px; display: none; }
.embed.open { display: block; }
.embed code { display: block; background: #00000050; border: 1px solid var(--line); padding: 10px; border-radius: 10px; font-size: 12px; overflow-x: auto; white-space: nowrap; color: #c9bfff; }
.embed img { margin: 8px 0; }

.boards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 50px; }
.board { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 20px; min-width: 0; }
.board h3 { margin: 0 0 12px; font-size: 16px; }
.board ol, .board ul { margin: 0; padding: 0; list-style: none; }
.board li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid #ffffff0a; font-size: 14px; cursor: pointer; }
.board li.muted { cursor: default; }
.board li:last-child { border: 0; }
.board li .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board li .m { font-family: 'JetBrains Mono', monospace; color: var(--green); font-weight: 700; flex: none; }
.board ol { counter-reset: r; }
.board ol li .n::before { counter-increment: r; content: counter(r) ". "; color: var(--muted); }

.how { margin-top: 50px; }
.how h2 { font-size: 24px; letter-spacing: -.02em; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.steps div { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.steps p { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 6px 0 0; }
.fine { color: #7d74a3; font-size: 12px; margin-top: 16px; }
code { font-family: 'JetBrains Mono', monospace; font-size: .9em; }
footer { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 16px 40px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 80px); background: var(--green); color: #04160c; font-weight: 800; padding: 12px 18px; border-radius: 12px; transition: transform .25s; z-index: 10; }
.toast.show { transform: translate(-50%, 0); }

.confetti { position: fixed; top: -20px; font-size: 22px; pointer-events: none; z-index: 20; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

@media (max-width: 720px) {
  .battle, .boards { grid-template-columns: 1fr; }
  .search { flex-wrap: wrap; }
  .search input { flex-basis: 100%; }
  .search button { width: 100%; }
  .vs { width: 100%; text-align: center; }
  .card { padding: 20px; }
}
