@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700;800&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #07080a; --panel: #0d0f13; --panel2: #121419;
  --line: #1c1f27; --line2: #2a2e39;
  --accent: #34e5b0; --accent-dim: #1c8f6e;
  --text: #d6dae3; --muted: #6c7280; --dim: #444a56;
  --red: #ff5c72; --amber: #ffb23e;
}
html, body { height: 100%; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(800px 400px at 50% -5%, rgba(52,229,176,.06), transparent 70%),
    linear-gradient(transparent 0, transparent calc(100% - 1px), rgba(255,255,255,.015) 100%);
  background-size: auto, 100% 3px;
  color: var(--text);
  font-family: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  min-height: 100vh; font-size: 15px; line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 22px; }
.mono-dim { color: var(--muted); }
.accent { color: var(--accent); }

/* Nav */
.topnav { display: flex; align-items: center; justify-content: space-between; max-width: 920px; margin: 0 auto; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; font-size: 18px; letter-spacing: -.5px; }
.brand .b { color: var(--accent); }
.brand::before { content: "> "; color: var(--accent); }
.topnav .links a { color: var(--muted); font-size: 13px; margin-left: 22px; transition: color .12s; }
.topnav .links a:hover, .topnav .links a.active { color: var(--accent); }

/* Hero */
.hero { padding: 60px 22px 26px; }
.hero .kicker { color: var(--accent); font-size: 13px; letter-spacing: 3px; text-transform: uppercase; }
.hero h1 { font-size: 44px; font-weight: 800; letter-spacing: -1.5px; margin: 12px 0 8px; }
.hero h1 .cursor { display: inline-block; width: 14px; height: 40px; background: var(--accent); margin-left: 4px; vertical-align: middle; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero p { color: var(--muted); max-width: 560px; }

/* Tool grid */
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; padding: 26px 0 50px; }
.tool { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 24px; transition: border-color .14s, background .14s; position: relative; display: block; }
.tool:not(.soon):hover { border-color: var(--accent-dim); background: var(--panel2); }
.tool.soon { opacity: .45; }
.tool .idx { color: var(--dim); font-size: 12px; letter-spacing: 1px; }
.tool h3 { font-size: 18px; margin: 10px 0 8px; font-weight: 700; }
.tool h3::before { content: "// "; color: var(--accent); }
.tool p { color: var(--muted); font-size: 13.5px; }
.tool .go { margin-top: 16px; color: var(--accent); font-size: 13px; }
.tool .go::after { content: " _"; animation: blink 1.1s steps(1) infinite; }
.tool .soon-tag { position: absolute; top: 20px; right: 20px; font-size: 11px; color: var(--amber); border: 1px solid var(--amber); padding: 2px 8px; border-radius: 3px; letter-spacing: 1px; }

/* Tool sub-page head */
.tool-head { padding: 34px 0 22px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.tool-head .path { color: var(--muted); font-size: 13px; }
.tool-head .path .accent { color: var(--accent); }
.tool-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -1px; margin-top: 8px; }
.tool-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* Search */
.searchbar { display: flex; gap: 0; border: 1px solid var(--line2); border-radius: 4px; overflow: hidden; background: var(--panel); }
.searchbar .prompt { display: flex; align-items: center; padding: 0 14px; color: var(--accent); font-weight: 700; border-right: 1px solid var(--line); }
.searchbar input { flex: 1; background: transparent; border: none; padding: 15px 8px; color: var(--text); font-family: inherit; font-size: 15px; outline: none; }
.searchbar input::placeholder { color: var(--dim); }
.searchbar button { background: var(--accent); border: none; padding: 0 24px; color: #04110c; font-weight: 800; font-family: inherit; font-size: 14px; cursor: pointer; letter-spacing: 1px; }
.searchbar button:disabled { opacity: .5; cursor: wait; }

/* Game autocomplete */
.field { margin-bottom: 12px; }
.field .flabel { font-size: 12px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; margin: 0 2px 6px; display: block; }
.gamepick { position: relative; }
.gamepick .selected { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--accent-dim); border-radius: 4px; background: var(--panel2); }
.gamepick .selected img { width: 34px; height: 34px; border-radius: 3px; }
.gamepick .selected .x { margin-left: auto; color: var(--muted); cursor: pointer; padding: 0 6px; }
.gamepick .selected .x:hover { color: var(--red); }
.dropdown { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--panel2); border: 1px solid var(--line2); border-radius: 4px; z-index: 20; max-height: 320px; overflow-y: auto; }
.dropdown .opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.dropdown .opt:last-child { border-bottom: none; }
.dropdown .opt:hover { background: var(--panel); }
.dropdown .opt img { width: 38px; height: 38px; border-radius: 3px; background: var(--bg); }
.dropdown .opt .o-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropdown .opt .o-players { font-size: 11px; color: var(--muted); }
.dropdown .loading { padding: 12px; color: var(--muted); font-size: 13px; }

/* Results */
#result { margin-top: 24px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 22px; margin-bottom: 16px; }
.profile { display: flex; gap: 18px; align-items: center; }
.profile img.avatar { width: 84px; height: 84px; border-radius: 4px; background: var(--panel2); border: 1px solid var(--line2); }
.profile .info h2 { font-size: 20px; font-weight: 700; }
.profile .info .uname { color: var(--muted); font-size: 13px; margin-top: 3px; }
.badge { display: inline-block; padding: 3px 11px; border-radius: 3px; font-size: 12px; font-weight: 700; margin-top: 10px; letter-spacing: 1px; text-transform: uppercase; border: 1px solid currentColor; }
.badge.offline { color: var(--dim); }
.badge.online { color: var(--accent); }
.badge.ingame { color: var(--accent); }
.badge.studio { color: var(--amber); }
.now { margin-top: 14px; padding: 14px; background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.now .g { font-weight: 700; color: var(--accent); }
.btn { display: inline-block; background: var(--accent); color: #04110c; padding: 10px 18px; border-radius: 3px; font-weight: 800; font-size: 13px; letter-spacing: 1px; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent-dim); }

.section { font-size: 12px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; margin: 6px 2px 14px; }
.section::before { content: "// "; color: var(--accent); }

.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.game { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; transition: border-color .1s; }
.game:hover { border-color: var(--accent-dim); }
.game img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--panel2); display: block; }
.game .g-body { padding: 10px 12px; }
.game .g-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game .g-date { font-size: 11px; color: var(--muted); margin: 3px 0 9px; }
.game a.join { display: block; text-align: center; background: transparent; color: var(--accent); border: 1px solid var(--accent-dim); padding: 6px; border-radius: 3px; font-size: 12px; font-weight: 700; letter-spacing: 1px; }
.game a.join:hover { background: var(--accent); color: #04110c; }

/* Stats grid */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 18px; }
.stat .val { font-size: 26px; font-weight: 800; color: var(--accent); }
.stat .lbl { font-size: 12px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; margin-top: 4px; }

.msg { text-align: center; color: var(--muted); padding: 28px; border: 1px dashed var(--line2); border-radius: 4px; }
.msg.err { color: var(--red); border-color: var(--red); }
footer { text-align: center; color: var(--dim); font-size: 12px; padding: 30px 0; border-top: 1px solid var(--line); margin-top: 20px; }
.spinner { width: 30px; height: 30px; border: 2px solid var(--line2); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
