/* open!bancho website: dark purple-grey with pink accents, triangle header. Original design. */
:root {
  --bg: #1c1719; --bg2: #2a2226; --bg3: #382e32; --bg4: #46393f; --line: #54454c;
  --text: #f0e6ea; --dim: #b8a7ae; --pink: #ff66aa; --pink2: #e23c88; --blue: #66ccff; --yellow: #ffd966;
  --green: #b3d944; --red: #ff6666; --purple: #8866ee;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--pink); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20; height: 70px;
  background: linear-gradient(90deg, #b3326e, #d9448a 50%, #b3326e);
  box-shadow: 0 2px 12px #0007; overflow: hidden;
}
.top::before { /* faint triangles like a rhythm-game header */
  content: ""; position: absolute; inset: 0; opacity: .18;
  background:
    conic-gradient(from 150deg at 10% 120%, #fff0 0 60deg, #fff 60deg 61deg, #fff0 61deg),
    repeating-linear-gradient(60deg, #fff1 0 2px, #fff0 2px 40px),
    repeating-linear-gradient(-60deg, #fff1 0 2px, #fff0 2px 40px);
}
.top-in { position: relative; max-width: 1240px; margin: 0 auto; height: 100%; display: flex; align-items: center; gap: 22px; padding: 0 16px; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 20px; letter-spacing: .3px; }
.logo:hover { text-decoration: none; }
.logo .disc { width: 46px; height: 46px; border-radius: 50%; border: 3px solid #fff; display: grid; place-items: center; font-size: 11px; background: var(--pink2); }
.nav { display: flex; gap: 18px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a { color: #fff; font-weight: 700; font-size: 17px; white-space: nowrap; opacity: .92; padding: 6px 2px; }
.nav a.on { opacity: 1; border-bottom: 3px solid #fff; padding-bottom: 2px; }
.search { position: relative; }
.search input { width: 190px; background: #0003; border: 0; border-radius: 20px; padding: 9px 16px; color: #fff; }
.search input::placeholder { color: #fffa; }
.me { display: flex; align-items: center; gap: 10px; }
.me img, .me .av { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border: 0; border-radius: 20px; padding: 9px 22px; font-size: 15px; background: var(--pink); color: #fff; font-weight: 700; }
.btn:hover { filter: brightness(1.1); }
.btn.ghost { background: #fff2; }
.btn.blue { background: #3b8ee8; } .btn.green { background: #6aa84f; } .btn.red { background: #d0455b; } .btn.grey { background: var(--bg4); }
.btn:disabled { opacity: .5; cursor: default; }
.menu { position: fixed; right: 16px; top: 66px; background: var(--bg3); border-radius: var(--radius); box-shadow: 0 6px 20px #000a; min-width: 190px; padding: 6px; display: none; z-index: 30; }
.menu.open { display: block; }
.menu a { display: block; padding: 8px 12px; color: var(--text); border-radius: 6px; }
.menu a:hover { background: var(--bg4); text-decoration: none; }

/* ---------- layout ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 24px 16px 80px; }
.page-title { display: flex; align-items: center; gap: 12px; background: var(--bg2); border-radius: var(--radius) var(--radius) 0 0; padding: 18px 24px; font-size: 20px; }
.page-title .ico { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--pink); display: grid; place-items: center; color: var(--pink); font-weight: 800; }
.card { background: var(--bg2); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 16px; }
.card h2 { margin: 0 0 14px; font-size: 18px; display: inline-block; border-bottom: 3px solid var(--pink); padding-bottom: 4px; }
.card h3 { margin: 18px 0 10px; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.card h3::before { content: ""; width: 4px; height: 14px; background: var(--pink); border-radius: 2px; }
.muted { color: var(--dim); }
.small { font-size: 13px; }
.grid { display: grid; gap: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 10px; background: var(--bg4); font-size: 12px; font-weight: 700; }
.flag { display: inline-grid; place-items: center; min-width: 26px; height: 18px; border-radius: 3px; background: #fff; color: #222; font-size: 11px; font-weight: 800; padding: 0 3px; }
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { color: var(--dim); padding: 10px 0; font-weight: 600; white-space: nowrap; }
.tabs a.on { color: var(--text); border-bottom: 3px solid var(--pink); }
.modes { display: flex; gap: 10px; }
.modes a { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; opacity: .55; }
.modes a.on, .modes a:hover { opacity: 1; text-decoration: none; }
.modes svg { width: 26px; height: 26px; }
.empty { text-align: center; color: var(--dim); padding: 30px 0; }
.err { color: var(--red); }

/* ---------- home ---------- */
.hero { position: relative; border-radius: var(--radius); overflow: hidden; padding: 50px 30px; margin-bottom: 16px;
  background: radial-gradient(circle at 80% 20%, #ff66aa55, #0000 50%), linear-gradient(135deg, #3a2030, #1c1719); }
.hero h1 { margin: 0 0 8px; font-size: 40px; }
.hero .big-logo { position: absolute; right: 40px; top: 50%; transform: translateY(-50%); width: 190px; height: 190px; border-radius: 50%;
  background: var(--pink2); border: 8px solid #fff; display: grid; place-items: center; font-size: 48px; font-weight: 900; color: #fff;
  text-shadow: 0 4px 0 #8a1450; box-shadow: 0 0 0 14px #ff66aa22; animation: beat 1.2s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: translateY(-50%) scale(1); } 15% { transform: translateY(-50%) scale(1.04); } }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.stat { background: var(--bg2); border-radius: var(--radius); padding: 16px 20px; }
.stat b { display: block; font-size: 28px; }
.users { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.ucard { display: flex; gap: 12px; align-items: center; background: var(--bg3); border-radius: var(--radius); padding: 10px; color: var(--text); position: relative; overflow: hidden; }
.ucard:hover { background: var(--bg4); text-decoration: none; }
.ucard img, .ucard .av { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; flex: none; }
.ucard .rk { position: absolute; right: 10px; bottom: 2px; font-size: 30px; font-weight: 800; opacity: .18; }
.ucard .st { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.av { display: grid; place-items: center; background: var(--pink2); color: #fff; font-weight: 800; font-size: 22px; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: separate; border-spacing: 0 4px; }
th { text-align: left; color: var(--dim); font-weight: 600; font-size: 13px; padding: 4px 10px; }
td { background: var(--bg3); padding: 9px 10px; }
tr td:first-child { border-radius: 8px 0 0 8px; } tr td:last-child { border-radius: 0 8px 8px 0; }
tr:hover td { background: var(--bg4); }
.num { text-align: right; white-space: nowrap; }
.rankno { font-weight: 800; color: var(--dim); width: 50px; }

/* ---------- profile ---------- */
.cover { height: 250px; background: linear-gradient(135deg, #5a2a45, #2a1d33); background-size: cover; background-position: center; }
.phead { display: flex; gap: 20px; align-items: flex-end; padding: 0 24px 16px; background: var(--bg3); }
.phead .pav { width: 120px; height: 120px; border-radius: 16px; object-fit: cover; margin-top: -50px; border: 4px solid var(--bg3); background: var(--bg4); flex: none; }
.phead .pav.av { font-size: 52px; }
.pname { font-size: 26px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.ptitle { font-size: 13px; font-weight: 700; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #777; display: inline-block; }
.dot.on { background: #6fe35f; box-shadow: 0 0 6px #6fe35f; }
.pbody { display: grid; grid-template-columns: 1fr 300px; gap: 16px; padding: 20px 24px; background: var(--bg2); }
.ranks { display: flex; gap: 34px; flex-wrap: wrap; }
.ranks .lbl { font-size: 12px; color: var(--dim); font-weight: 600; }
.ranks .val { font-size: 28px; font-weight: 300; }
.graph { width: 100%; height: 90px; margin: 10px 0; }
.mini { display: flex; gap: 26px; flex-wrap: wrap; align-items: flex-end; }
.mini .lbl { font-size: 12px; color: var(--dim); }
.mini .val { font-size: 17px; }
.grades { display: flex; gap: 6px; }
.grade { text-align: center; font-size: 12px; }
.grade span { display: block; width: 44px; border-radius: 10px; color: #fff; font-weight: 900; font-style: italic; font-size: 14px; padding: 1px 0; margin-bottom: 2px; }
.g-ssh span { background: linear-gradient(#e0e0f0, #9aa); color: #333; } .g-ss span { background: linear-gradient(#ffcf3f, #e09a00); }
.g-sh span { background: linear-gradient(#d0d8e0, #8899a6); color: #333; } .g-s span { background: linear-gradient(#3fd0d0, #18909a); }
.g-a span { background: linear-gradient(#9be65a, #4a9a1a); }
.side { background: var(--bg3); border-radius: var(--radius); padding: 14px 16px; font-size: 13px; }
.side div { display: flex; justify-content: space-between; padding: 2px 0; }
.side b { font-weight: 700; }
.level { display: flex; align-items: center; gap: 12px; padding: 0 24px 14px; background: var(--bg2); justify-content: flex-end; }
.bar { width: 200px; height: 6px; border-radius: 3px; background: #0005; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--pink); }
.hex { width: 46px; height: 50px; display: grid; place-items: center; font-weight: 800; color: var(--yellow);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: var(--yellow); position: relative; }
.hex::after { content: attr(data-l); position: absolute; inset: 3px; display: grid; place-items: center; background: var(--bg2);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.pinfo { padding: 10px 24px; background: var(--bg2); border-top: 1px solid var(--line); font-size: 13px; display: flex; gap: 18px; flex-wrap: wrap; }
.links { padding: 0 24px 14px; background: var(--bg2); font-size: 13px; display: flex; gap: 18px; flex-wrap: wrap; }
.subnav { display: flex; gap: 22px; padding: 12px 24px; background: var(--bg3); position: sticky; top: 70px; z-index: 10; overflow-x: auto; }
.subnav a { color: var(--text); font-weight: 600; white-space: nowrap; }
.bio { line-height: 1.6; word-wrap: break-word; }
.bio h4 { margin: 10px 0 4px; font-size: 18px; }
.score { display: flex; align-items: center; gap: 12px; background: var(--bg3); border-radius: 8px; padding: 8px 12px; margin-bottom: 5px; }
.score:hover { background: var(--bg4); }
.score .badge { width: 46px; text-align: center; border-radius: 10px; font-weight: 900; font-style: italic; color: #fff; padding: 1px 0; flex: none; }
.score .t { flex: 1; min-width: 0; }
.score .t b, .score .t div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.score .v { color: var(--yellow); font-size: 12px; }
.score .acc { color: var(--yellow); font-weight: 700; width: 70px; text-align: right; }
.score .pp { background: var(--bg4); border-radius: 0 8px 8px 0; margin: -8px -12px -8px 0; padding: 14px 16px; color: var(--pink); font-weight: 800; min-width: 80px; text-align: right; }
.medals { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px; }
.medal { text-align: center; font-size: 11px; color: var(--dim); }
.medal .m { width: 62px; height: 68px; margin: 0 auto 4px; display: grid; place-items: center; font-weight: 900; font-size: 18px; color: #fff;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: linear-gradient(135deg, var(--pink), var(--purple)); }
.medal.off .m { background: var(--bg4); color: #fff4; }
.medal.off { opacity: .6; }

/* ---------- settings ---------- */
.form { display: grid; gap: 12px; max-width: 640px; }
.form label { display: grid; gap: 4px; font-size: 13px; color: var(--dim); }
.form input[type=text], .form input[type=password], .form select, .form textarea {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; color: var(--text); }
.form textarea { min-height: 160px; resize: vertical; }
.checks { display: flex; gap: 18px; flex-wrap: wrap; color: var(--text); }
.uprow { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.uprow .prev { width: 100px; height: 100px; border-radius: 14px; object-fit: cover; background: var(--bg4); }
.uprow .prev.wide { width: 260px; height: 80px; border-radius: 8px; }
.ok { color: var(--green); }

/* ---------- chat ---------- */
.chat { display: grid; grid-template-columns: 220px 1fr; height: 70vh; background: var(--bg2); border-radius: var(--radius); overflow: hidden; }
.chans { background: var(--bg3); overflow-y: auto; padding: 8px; }
.chans a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); }
.chans a.on { background: var(--pink2); }
.chans .h { font-size: 11px; color: var(--dim); text-transform: uppercase; margin: 10px 6px 4px; }
.msgs { display: flex; flex-direction: column; min-height: 0; }
.log { flex: 1; overflow-y: auto; padding: 12px 16px; font-size: 14px; }
.log div { padding: 2px 0; word-wrap: break-word; }
.log .tm { color: var(--dim); font-size: 12px; margin-right: 6px; }
.log .bot { color: var(--pink); }
.send { display: flex; gap: 8px; padding: 10px; background: var(--bg3); }
.send input { flex: 1; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: #000a; display: none; place-items: center; z-index: 50; padding: 16px; }
.modal.open { display: grid; }
.modal .box { background: var(--bg2); border-radius: 14px; padding: 28px; width: min(420px, 100%); }
.modal .btn { width: 100%; min-height: 44px; font-size: 16px; }
.modal h2 { margin: 0 0 16px; }

footer { text-align: center; color: var(--dim); font-size: 12px; padding: 30px 16px; }

@media (max-width: 800px) {
  .pbody { grid-template-columns: 1fr; }
  .hero .big-logo { display: none; }
  .stats3 { grid-template-columns: 1fr; }
  .chat { grid-template-columns: 1fr; height: auto; }
  .chans { display: flex; overflow-x: auto; }
  .log { height: 50vh; }
  .search input { width: 110px; }
  .phead { flex-wrap: wrap; }
  .hide-sm { display: none; }
}
