:root {
  --bg: #06080d; --bg2: #0a0e16; --card: #0e1420; --card2: #131b2a; --line: #1b2433; --line2: #27344a;
  --text: #edf3fb; --muted: #8494ab; --dim: #56637a;
  --acc: #3dffa0; --accD: #1fd283; --acc2: #7c5cff; --gold: #ffcc4d; --wait: #ffa94d; --bad: #ff5d6c; --heart: #ff5c8a;
  --head: 'Space Grotesk', Inter, sans-serif; --mono: 'JetBrains Mono', ui-monospace, monospace;
  --card-w: 160px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; min-height: 100vh; }
body::before { content: ''; position: fixed; inset: 0; background: radial-gradient(ellipse 70% 50% at 15% -10%, rgba(61,255,160,.10), transparent 60%), radial-gradient(ellipse 60% 50% at 100% 0%, rgba(124,92,255,.12), transparent 60%); pointer-events: none; z-index: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--acc); }
.hidden { display: none !important; }
* { scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 11px; border: 1px solid var(--line2); background: var(--card); font-weight: 600; font-size: 13px; white-space: nowrap; transition: .15s; }
.btn:hover { border-color: var(--acc); }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: linear-gradient(135deg, var(--acc), #3de6ff); color: #04170d; border-color: transparent; font-weight: 700; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.on { border-color: var(--acc); color: var(--acc); }
.btn.wide { width: 100%; height: 46px; font-size: 15px; }
.card { background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line); border-radius: 18px; }
.sel { height: 38px; border-radius: 11px; border: 1px solid var(--line2); background: var(--card); padding: 0 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font: 700 18px var(--head); letter-spacing: .5px; white-space: nowrap; }
.brand img { width: 34px; height: 34px; filter: drop-shadow(0 0 12px rgba(61,255,160,.35)); }
.brand b { color: var(--acc); }
.brand.big { font-size: 22px; } .brand.big img { width: 46px; height: 46px; }

/* ---------- sign in */
.auth { position: relative; min-height: 100vh; display: flex; flex-direction: column; overflow: hidden; z-index: 1; }
.wall { position: absolute; inset: -40px; display: grid; grid-template-columns: repeat(auto-fill, 120px); gap: 14px; opacity: .16; transform: rotate(-8deg) scale(1.15); pointer-events: none; mask-image: radial-gradient(ellipse at 30% 50%, #000 20%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at 30% 50%, #000 20%, transparent 75%); animation: drift 60s linear infinite; }
.wall img { width: 120px; height: 120px; object-fit: contain; }
@keyframes drift { to { transform: rotate(-8deg) scale(1.15) translateY(-400px); } }
.auth-in { flex: 1; display: grid; grid-template-columns: 1.15fr 420px; gap: 60px; align-items: center; max-width: 1180px; width: 100%; margin: 0 auto; padding: 60px 28px; position: relative; }
.hero h1 { font: 700 clamp(40px, 5.4vw, 74px)/1.02 var(--head); margin: 26px 0 18px; letter-spacing: -1px; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--acc), #3de6ff, var(--acc2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 17px; max-width: 520px; margin: 0; }
.hstats { display: flex; gap: 34px; margin-top: 34px; }
.hstats b { display: block; font: 700 28px var(--head); }
.hstats span { color: var(--muted); font-size: 13px; }
.authcard { padding: 26px; box-shadow: 0 30px 80px rgba(0,0,0,.5); backdrop-filter: blur(10px); }
.atabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: var(--bg2); border-radius: 12px; margin-bottom: 20px; }
.atabs button { border: 0; background: transparent; height: 38px; border-radius: 9px; font-weight: 700; color: var(--muted); }
.atabs button.on { background: var(--card2); color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,.3); }
form label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 14px; }
form input { display: block; width: 100%; height: 46px; margin-top: 6px; border-radius: 12px; border: 1px solid var(--line2); background: var(--bg2); padding: 0 14px; font-size: 15px; color: var(--text); transition: border-color .15s, box-shadow .15s; }
form input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 4px rgba(61,255,160,.12); }
.pw { position: relative; display: block; }
.pw button { position: absolute; right: 8px; top: 13px; height: 32px; border: 0; background: var(--card2); border-radius: 8px; padding: 0 10px; font-size: 12px; font-weight: 700; color: var(--muted); }
.meter { display: flex; align-items: center; gap: 10px; margin: -6px 0 14px; }
.meter i { flex: 1; height: 5px; border-radius: 5px; background: var(--line2); position: relative; overflow: hidden; }
.meter i::after { content: ''; position: absolute; inset: 0; width: var(--w, 0%); background: var(--mc, var(--bad)); transition: .25s; border-radius: 5px; }
.meter span { font-size: 11.5px; font-weight: 700; color: var(--mc, var(--muted)); width: 70px; text-align: right; }
.err { color: var(--bad); font-weight: 600; font-size: 13px; min-height: 20px; margin-bottom: 8px; }
.fine { color: var(--dim); font-size: 12px; margin: 14px 0 0; text-align: center; }
.credit { position: relative; text-align: center; color: var(--dim); font-size: 12px; padding: 18px; }
.credit b { color: var(--acc); }

/* ---------- app */
#app { position: relative; z-index: 1; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 12px 22px; background: rgba(6,8,13,.82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.search { flex: 1; max-width: 560px; margin: 0 auto; position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--muted); }
.search input { width: 100%; height: 42px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card); padding: 0 40px 0 42px; font-size: 14.5px; }
.search input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 4px rgba(61,255,160,.1); }
.search button { position: absolute; right: 8px; border: 0; background: transparent; color: var(--muted); width: 28px; height: 28px; border-radius: 7px; }
.topr { display: flex; gap: 8px; align-items: center; }
.user { padding: 0 10px 0 5px; }
.av { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: linear-gradient(135deg, var(--acc), var(--acc2)); color: #071018; }
.viewing { font-size: 12.5px; color: var(--muted); padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line2); }
.viewing b { color: var(--acc); }
.dash { display: grid; grid-template-columns: 170px 1fr 1.6fr; gap: 14px; padding: 20px 22px 6px; max-width: 1600px; margin: 0 auto; }
.ring { position: relative; display: grid; place-items: center; padding: 14px; }
.ring svg { width: 130px; height: 130px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .trk { stroke: var(--line2); }
.ring .val { stroke: url(#g); stroke: var(--acc); stroke-linecap: round; stroke-dasharray: 314.16; stroke-dashoffset: 314.16; transition: stroke-dashoffset .9s cubic-bezier(.2,.8,.2,1); filter: drop-shadow(0 0 6px rgba(61,255,160,.6)); }
.rtxt { position: absolute; text-align: center; }
.rtxt b { display: block; font: 700 28px var(--head); }
.rtxt span { color: var(--muted); font-size: 11.5px; }
.nums { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 8px; }
.nums div { padding: 12px 16px; }
.nums b { display: block; font: 700 30px/1.1 var(--head); }
.nums div:nth-child(1) b { color: var(--acc); } .nums div:nth-child(3) b { color: var(--wait); } .nums div:nth-child(4) b { color: var(--heart); } .nums div:nth-child(5) b { color: var(--gold); }
.nums span { color: var(--muted); font-size: 12.5px; }
.cats { padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; align-content: start; }
.cat { border: 1px solid var(--line); background: var(--bg2); border-radius: 12px; padding: 9px 11px; text-align: left; transition: .15s; }
.cat:hover { border-color: var(--line2); }
.cat.on { border-color: var(--acc); background: rgba(61,255,160,.07); }
.cat .t { display: flex; justify-content: space-between; font-weight: 700; font-size: 13px; }
.cat .t small { color: var(--muted); font-weight: 600; font-family: var(--mono); font-size: 11px; }
.cat .p { height: 4px; border-radius: 4px; background: var(--line2); margin-top: 7px; overflow: hidden; }
.cat .p i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc), #3de6ff); border-radius: 4px; transition: width .6s; }
.bar { position: sticky; top: 67px; z-index: 15; display: flex; align-items: center; gap: 10px; padding: 12px 22px; max-width: 1600px; margin: 0 auto; flex-wrap: wrap; background: linear-gradient(180deg, rgba(6,8,13,.95) 70%, rgba(6,8,13,0)); }
.seg { display: inline-flex; padding: 3px; background: var(--card); border: 1px solid var(--line2); border-radius: 12px; }
.seg button { border: 0; background: transparent; height: 32px; padding: 0 13px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--acc); color: #04170d; }
.free { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; cursor: pointer; }
.free input { accent-color: var(--acc); width: 16px; height: 16px; }
.grow { flex: 1; }
.count { font: 600 12px var(--mono); color: var(--muted); }
#zoom { width: 110px; accent-color: var(--acc); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--card-w), 1fr)); gap: 12px; padding: 8px 22px 30px; max-width: 1600px; margin: 0 auto; }
.it { position: relative; border-radius: 16px; background: linear-gradient(180deg, #121a28, #0c121c); border: 1px solid var(--line); overflow: hidden; cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .2s; user-select: none; animation: pop .3s both; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.it:hover { transform: translateY(-3px); border-color: var(--line2); box-shadow: 0 14px 30px rgba(0,0,0,.4); }
.it .im { aspect-ratio: 1; display: grid; place-items: center; background: radial-gradient(circle at 50% 42%, #1b2840, #0b111b 72%); position: relative; }
.it .im img { width: 88%; height: 88%; object-fit: contain; transition: transform .25s, filter .25s; filter: grayscale(.25) brightness(.92); }
.it:hover .im img { transform: scale(1.06); }
.it .im .ph { color: var(--dim); font: 700 11px var(--mono); }
.it .tx { padding: 9px 11px 11px; }
.it .tx b { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.it .tx small { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 2px; }
.it .tx small .pr { font-family: var(--mono); }
.it .tx small .pr.f { color: var(--acc); }
.it .chk { position: absolute; top: 9px; left: 9px; width: 28px; height: 28px; border-radius: 9px; border: 2px solid rgba(255,255,255,.18); background: rgba(6,8,13,.5); display: grid; place-items: center; transition: .2s; }
.it .chk svg { width: 16px; height: 16px; opacity: 0; transform: scale(.4); transition: .2s; color: #04170d; }
.it .ht { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 9px; border: 0; background: rgba(6,8,13,.5); display: grid; place-items: center; color: rgba(255,255,255,.5); opacity: 0; transition: .15s; }
.it:hover .ht, .it.wish .ht { opacity: 1; }
.it .ht svg { width: 17px; height: 17px; }
.it .ht:hover { color: var(--heart); }
.it.wish .ht { color: var(--heart); }
.it.wish .ht svg { fill: currentColor; }
.it.own { border-color: rgba(61,255,160,.5); box-shadow: 0 0 0 1px rgba(61,255,160,.25) inset; }
.it.own .im img { filter: none; }
.it.own .chk { background: var(--acc); border-color: var(--acc); box-shadow: 0 0 14px rgba(61,255,160,.6); }
.it.own .chk svg { opacity: 1; transform: none; }
.it.own .im::after, .it.wait .im::after { content: 'OWNED'; position: absolute; bottom: 8px; left: 9px; font: 700 9.5px var(--mono); letter-spacing: 1.5px; color: var(--acc); background: rgba(6,8,13,.65); padding: 2px 6px; border-radius: 5px; }
.it .wt { position: absolute; top: 8px; right: 42px; width: 30px; height: 30px; border-radius: 9px; border: 0; background: rgba(6,8,13,.5); display: grid; place-items: center; color: rgba(255,255,255,.5); opacity: 0; transition: .15s; }
.it:hover .wt, .it.wait .wt { opacity: 1; }
.it .wt svg { width: 17px; height: 17px; }
.it .wt:hover { color: var(--wait); }
.it.wait { border-color: rgba(255,169,77,.6); box-shadow: 0 0 0 1px rgba(255,169,77,.25) inset; }
.it.wait .wt { color: var(--wait); }
.it.wait .chk { background: var(--wait); border-color: var(--wait); box-shadow: 0 0 14px rgba(255,169,77,.6); }
.it.wait .im img { filter: none; }
.it.wait .im::after { content: 'WAITING TO ARRIVE'; color: var(--wait); }
.it.wait .chk svg { opacity: 1; transform: none; }
.selmode .it .wt { display: none; }
.it.flash { animation: flash .5s; }
@keyframes flash { 30% { transform: scale(1.04); box-shadow: 0 0 0 3px var(--acc), 0 0 40px rgba(61,255,160,.4); } }
.it.picked { outline: 3px solid #3de6ff; outline-offset: -3px; }
.it.picked::before { content: '✓'; position: absolute; inset: 0; background: rgba(61,230,255,.12); z-index: 1; display: grid; place-items: center; font-size: 40px; color: #3de6ff; font-weight: 800; }
.selmode .it .ht { display: none; }
.more { height: 60px; }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; font-size: 15px; }
.empty b { display: block; font: 700 22px var(--head); color: var(--text); margin-bottom: 6px; }
.foot { text-align: center; color: var(--dim); font-size: 12px; padding: 30px 20px 100px; }
.foot b { color: var(--acc); }
.selbar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 18px; border-radius: 16px; background: rgba(14,20,32,.95); border: 1px solid var(--line2); box-shadow: 0 20px 60px rgba(0,0,0,.6); backdrop-filter: blur(12px); flex-wrap: wrap; justify-content: center; max-width: calc(100% - 24px); }
.selbar b { margin-right: 6px; }
/* menu, modal, toast */
.menu { position: fixed; z-index: 40; min-width: 230px; background: var(--card2); border: 1px solid var(--line2); border-radius: 14px; padding: 6px; box-shadow: 0 20px 50px rgba(0,0,0,.55); }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: transparent; padding: 10px 12px; border-radius: 9px; text-align: left; font-weight: 600; font-size: 13.5px; }
.menu button:hover { background: var(--card); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }
.menu .who { padding: 8px 12px 10px; color: var(--muted); font-size: 12px; }
.menu .who b { color: var(--text); display: block; font-size: 15px; }
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(2,4,8,.7); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.mbox { position: relative; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--bg2); border: 1px solid var(--line2); border-radius: 20px; padding: 26px; box-shadow: 0 40px 100px rgba(0,0,0,.6); }
.mx { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card); }
.mbox h2 { margin: 0 0 6px; font: 700 24px var(--head); }
.mbox .sub { color: var(--muted); margin: 0 0 18px; }
.mbox h3 { font-size: 13px; font-weight: 700; margin: 22px 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inp { height: 42px; border-radius: 11px; border: 1px solid var(--line2); background: var(--card); padding: 0 12px; flex: 1; min-width: 0; color: var(--text); }
.inp:focus { outline: none; border-color: var(--acc); }
.tgl { position: relative; width: 44px; height: 24px; flex: none; }
.tgl input { opacity: 0; width: 0; height: 0; }
.tgl span { position: absolute; inset: 0; border-radius: 99px; background: var(--line2); transition: .15s; cursor: pointer; }
.tgl span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .15s; }
.tgl input:checked + span { background: var(--acc); }
.tgl input:checked + span::after { transform: translateX(20px); }
.detail { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: center; }
.detail .big { aspect-ratio: 1; border-radius: 16px; background: radial-gradient(circle at 50% 42%, #1e2d48, #0b111b 72%); display: grid; place-items: center; }
.detail .big img { width: 90%; height: 90%; object-fit: contain; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 16px; }
.tag { font: 600 11px var(--mono); padding: 4px 9px; border-radius: 7px; background: var(--card2); color: var(--muted); border: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 30px); opacity: 0; z-index: 60; display: flex; align-items: center; gap: 14px; background: #121a28; border: 1px solid var(--line2); padding: 11px 12px 11px 18px; border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.5); transition: .25s; pointer-events: none; font-weight: 600; font-size: 13.5px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { border: 0; background: var(--acc); color: #04170d; font-weight: 800; padding: 7px 13px; border-radius: 9px; }
.cmp { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.cmp div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.cmp b { display: block; font: 700 24px var(--head); }
.cmp span { font-size: 11.5px; color: var(--muted); }

@media (max-width: 1100px) { .dash { grid-template-columns: 150px 1fr; } .cats { grid-column: 1 / -1; } }
@media (max-width: 900px) { .auth-in { grid-template-columns: 1fr; gap: 30px; padding: 30px 18px; } .hero h1 { font-size: 40px; } .hstats { gap: 22px; } }
@media (max-width: 640px) {
  .nums { grid-template-columns: 1fr 1fr; }
  .top { padding: 10px 12px; gap: 8px; flex-wrap: wrap; } .brand span, .hide-sm { display: none; } .search { order: 3; flex-basis: 100%; max-width: none; }
  .bar { top: 115px; padding: 10px 12px; } .grid { padding: 6px 12px 30px; gap: 9px; --card-w: 120px; } .dash { padding: 14px 12px 4px; grid-template-columns: 1fr; } .ring svg { width: 100px; height: 100px; }
  #zoom { display: none; } .detail { grid-template-columns: 1fr; } .nums b { font-size: 24px; }
}

/* touch screens: no hover, so the heart / clock buttons are always there and big enough to tap */
@media (hover: none) {
  .it .ht, .it .wt { opacity: 1; width: 34px; height: 34px; }
  .it .wt { right: 46px; }
  .it:hover { transform: none; box-shadow: none; }
}
@media (max-width: 640px) {
  .top { position: sticky; }
  .bar { position: static; background: none; gap: 8px; }
  .bar .seg { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .bar .seg button { flex: 1; padding: 0 8px; }
  .bar .sel { flex: 1; }
  .bar .grow { display: none; }
  .dash { gap: 10px; }
  .ring { grid-row: span 1; }
  .cats { grid-template-columns: repeat(2, 1fr); padding: 10px; }
  .toast { left: 12px; right: 12px; transform: translateY(30px); width: auto; justify-content: space-between; bottom: 16px; }
  .toast.show { transform: none; }
  .selbar { left: 8px; right: 8px; bottom: 10px; transform: none; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding: 8px; gap: 6px; scrollbar-width: none; max-width: none; }
  .selbar b { flex: none; font-size: 13px; padding: 0 6px; }
  .selbar .btn { flex: none; height: 36px; padding: 0 12px; }
  .mbox { padding: 20px 16px; border-radius: 18px; }
  .detail .big { max-width: 240px; margin: 0 auto; width: 100%; }
  .menu { left: 12px; right: 12px !important; }
  .it .tx b { font-size: 12.5px; }
  .search input { font-size: 16px; }   /* stops iPhone zooming into the search box */
  form input { font-size: 16px; }
}
body.selmode .toast { bottom: 84px; }
