:root {
  --page: #c6cabd;
  --panel: #e7e9e2;
  --panel-alt: #d8dbd0;
  --paper: #fbfbf8;
  --head: #3d4a34;
  --head-text: #f0f1ea;
  --line: #a2a899;
  --text: #20241c;
  --muted: #5e6654;
  --primary: #4d6a2d;
  --danger: #9c2f25;
  --link: #214e80;
  --map-bg: #1d2620;
  --ok: #3b6b25;
  --accent-bg: #e3ecd2;
  --warn-bg: #efe9d2;
  --bar-btn: #4b5a40;
  --bar-btn-hover: #596a4c;
  --bar-line: #6b7a5f;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--page); color: var(--text); font: 14px/1.4 "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--link); }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.grow { flex: 1; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 1px; }

.topbar { display: flex; align-items: center; gap: 16px; padding: 7px 14px; background: var(--head); color: var(--head-text); position: relative; }
.topbar a { color: var(--head-text); }
.topbar .brand { font-weight: 700; font-size: 16px; text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }

.topbar .brand .logo { height: 40px; width: auto; display: block; padding: 3px 10px; border-radius: 3px; }
.topbar .brand .brand-note { font-size: 13px; font-weight: 400; opacity: .85; }
.topbar button, .bar button { background: var(--bar-btn); border-color: var(--bar-line); color: var(--head-text); }
.topbar button:hover, .bar button:hover { background: var(--bar-btn-hover); }
.topbar button.primary, .bar button.primary { background: #5f7f38; border-color: #86a85a; }
.topbar button.danger, .bar button.danger { background: #6d2a24; border-color: #a5483f; color: #fff; }
.bar button.active, .topbar button.active { background: #e9edd8; color: var(--text); border-color: #e9edd8; }

.box { background: var(--panel); border: 1px solid var(--line); }
.box > .box-title { margin: 0; padding: 5px 10px; background: var(--head); color: var(--head-text); font-size: 14px; font-weight: 600; }
.box > .box-body { padding: 12px; }

input, select, textarea { font: inherit; color: var(--text); }
input[type=text], input[type=password], input:not([type]), select, textarea {
  width: 100%; padding: 5px 7px; background: var(--paper); border: 1px solid var(--line); border-radius: 2px; }
label { display: block; margin: 10px 0 3px; font-weight: 600; }
.btn, button { font: inherit; padding: 5px 12px; border: 1px solid #7d8473; border-radius: 2px; background: #dfe2d8; color: var(--text); cursor: pointer; }
.btn:hover, button:hover { background: #eceee6; }
button:disabled { opacity: .55; cursor: default; background: #dfe2d8; }
button.primary { background: var(--primary); border-color: #3a5220; color: #fff; }
button.primary:hover { background: #5a7a36; }
button.danger { color: var(--danger); }
button.small { padding: 1px 7px; font-size: 12px; }
button.active { background: var(--head); color: #fff; border-color: var(--head); }
.error { color: var(--danger); min-height: 1.4em; margin: 8px 0 0; }
.hint { color: var(--muted); font-size: 12px; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 5px 8px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--panel-alt); font-weight: 600; }
td.r, th.r { text-align: right; }
tbody tr:hover { background: #eef0e8; }
tr.mine td { background: var(--accent-bg); }

.swatch { display: inline-block; width: 11px; height: 11px; margin-right: 6px; border: 1px solid rgba(0,0,0,.45); vertical-align: -1px; }

.wrap { max-width: 920px; margin: 22px auto; padding: 0 14px; display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.wrap.single { grid-template-columns: 1fr; }
@media (max-width: 760px) { .wrap { grid-template-columns: 1fr; } }
.about p { max-width: 62ch; }
.about h3 { margin: 14px 0 4px; }
.about dt { font-weight: 600; margin-top: 8px; }
.about dd { margin: 0; color: var(--muted); max-width: 62ch; }
.seg { display: flex; flex-wrap: wrap; }
.seg button { padding: 3px 10px; margin-left: -1px; border-radius: 0; }
.seg button:first-child { margin-left: 0; }
.seg button.active { position: relative; }
.switch { display: flex; gap: 14px; margin-bottom: 4px; }
.switch button { padding: 0 0 2px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--link); }
.switch button.active { color: var(--text); font-weight: 600; border-bottom-color: var(--head); }
form .actions { margin-top: 14px; }

.play-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 700px) { .play-grid { grid-template-columns: 1fr; } }
.play-grid h3 { margin-bottom: 4px; }
.filters { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.filters label { margin: 0; }
.filters select { width: auto; }
.pager { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.nowrap { white-space: nowrap; }
h4.sub { margin: 12px 0 4px; font-size: 14px; }

.rejoin { margin-bottom: 14px; padding: 10px 12px; background: var(--accent-bg); border: 1px solid #9db37d; }
.rejoin h3 { margin-bottom: 2px; }
.rejoin-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.box.note { margin-bottom: 10px; background: var(--warn-bg); }
.sound-panel { position: absolute; right: 10px; top: 44px; z-index: 30; width: 260px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.sound-panel[hidden] { display: none; }
.sound-panel.docked { position: static; width: auto; padding: 6px 0 2px; border: 0; border-top: 1px solid var(--line); background: transparent; }
.sound-panel.floating { position: absolute; right: 10px; top: 44px; }
.sound-panel label { margin: 8px 0 2px; font-weight: 400; display: flex; justify-content: space-between; align-items: center; }
.sound-panel input[type=range] { width: 100%; }
.sound-panel .track { margin: 8px 0 4px; color: var(--muted); font-size: 12px; }

.search-row { display: flex; gap: 8px; margin-bottom: 8px; }
.search-row input { flex: 1; }
.career-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.rank-name { font-size: 22px; font-weight: 700; }
.career-score b { font-size: 20px; font-variant-numeric: tabular-nums; }
.progress { height: 8px; background: #d3d7c8; border: 1px solid var(--line); margin-bottom: 10px; }
.progress i { display: block; height: 100%; width: 0; background: var(--primary); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 14px; }
.stat { padding: 8px 10px; background: var(--paper); border: 1px solid var(--line); }
.stat b { display: block; font-size: 20px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
@media (max-width: 600px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.chip-grid { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.chip { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 104px; padding: 5px 10px; background: var(--paper); text-align: left; }
.chip-top { display: flex; align-items: center; gap: 6px; }
.chip .sub { color: var(--muted); font-size: 12px; max-width: 170px; }
.chip.active { background: var(--head); border-color: var(--head); color: #fff; }
.chip.active .sub { color: #d6dccb; }
.chip.locked { opacity: .55; cursor: default; }
.chip .dot { width: 11px; height: 11px; border: 1px solid rgba(0,0,0,.35); }
.preview { margin: 4px 0 8px; }
.chat-tag { color: var(--muted); }

.site-footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; padding: 16px 14px 22px; color: var(--muted); font-size: 12.5px; }
.site-footer a { color: var(--muted); text-decoration: underline; }
.site-footer a:hover { color: var(--text); }
.check { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 4px; font-weight: 400; }
.check[hidden] { display: none; }
.check input { width: auto; margin-top: 3px; }
.legal { max-width: 760px; margin: 22px auto; padding: 0 16px 8px; line-height: 1.55; }
.legal h1 { margin: 0 0 2px; }
.legal h2 { margin: 22px 0 6px; font-size: 16px; }
.legal .meta { color: var(--muted); margin: 0 0 14px; }
.legal ul { padding-left: 22px; }
.legal li { margin: 4px 0; }
.legal table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 7px 9px; border: 1px solid var(--line); }
.legal th { background: var(--panel); }
.topbar a.brand { color: inherit; font-weight: 700; text-decoration: none; }

.look-box { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; margin: 6px 0 10px; }
.look-box canvas { border: 1px solid var(--line); background: #9fb77a; flex: none; }
.look-pick { flex: 1; min-width: 260px; }
.look-label { font-weight: 600; margin: 6px 0 3px; }

.invite-box { margin: 2px 0 14px; padding: 12px 14px; border: 2px solid var(--primary); background: #eef3e4; }
.invite-title { font-size: 17px; font-weight: 700; color: var(--head); }
.invite-sub { color: var(--muted); margin: 2px 0 8px; }
.invite-row { display: flex; gap: 8px; }
.invite-link { flex: 1; min-width: 0; padding: 8px 10px; font: 13px 'Courier New', monospace; border: 1px solid var(--line); background: var(--paper); color: var(--text); }
.invite-row button { flex: none; padding: 8px 18px; font-weight: 700; min-width: 128px; }
.invite-meta { margin-top: 8px; color: var(--text); }
.invite-meta span + span { margin-left: 6px; color: var(--muted); }
.fold { border-top: 1px solid var(--line); }
.fold:last-of-type { border-bottom: 1px solid var(--line); }
.fold > summary { cursor: pointer; padding: 9px 2px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: '\25B8'; color: var(--muted); margin-right: 8px; display: inline-block; transition: transform .12s; }
.fold[open] > summary::before { transform: rotate(90deg); }
.fold > summary .now { margin-left: auto; font-weight: 400; color: var(--muted); }
.fold-body { padding: 0 2px 10px; }

.wrap.with-side { max-width: none; padding: 0 18px; grid-template-columns: minmax(0, 1fr) minmax(0, 920px) minmax(0, 1fr); }
.wrap.with-side > section { grid-column: 2; }
.wrap.with-side > .ann-panel { grid-column: 1; grid-row: 1 / span 3; justify-self: end; width: min(330px, 100%); position: sticky; top: 14px; }
.wrap.with-side > .social-banner { grid-column: 3; grid-row: 1 / span 3; justify-self: start; width: min(260px, 100%); position: sticky; top: 14px; }
@media (max-width: 1440px) {
  .wrap.with-side { max-width: 920px; padding: 0 14px; grid-template-columns: 1fr; }
  .wrap.with-side > section { grid-column: 1; }
  .wrap.with-side > .ann-panel, .wrap.with-side > .social-banner { grid-column: 1; grid-row: auto; justify-self: stretch; width: auto; position: static; }
}
.social-banner { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--head); padding: 10px 12px 12px; }
.social-banner[hidden] { display: none; }
.social-title { margin: 0 0 8px; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: var(--head); }
.social-list { display: flex; flex-direction: column; gap: 6px; }
.social-link { display: flex; align-items: center; gap: 10px; padding: 7px 8px; background: var(--paper); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.social-link:hover { border-color: var(--head); background: #fff; }
.social-badge { flex: none; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 15px; background: var(--primary); }
.social-badge.discord { background: #5865f2; } .social-badge.youtube { background: #e52d27; } .social-badge.twitch { background: #9146ff; }
.social-badge.x { background: #15181c; } .social-badge.instagram { background: #c13584; } .social-badge.tiktok { background: #15181c; }
.social-badge.facebook { background: #1877f2; } .social-badge.reddit { background: #ff4500; } .social-badge.github { background: #24292f; } .social-badge.steam { background: #1b2838; }
.social-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.social-name { font-weight: 600; }
.social-note { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }

.ann-panel { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--primary); padding: 10px 12px 12px; max-height: calc(100vh - 28px); overflow-y: auto; }
.ann-panel[hidden] { display: none; }
.ann-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.ann-tab { padding: 4px 10px; font-size: 13px; background: var(--paper); border: 1px solid var(--line); color: var(--text); cursor: pointer; }
.ann-tab.active { background: var(--head); border-color: var(--head); color: var(--head-text); }
.ann-post { background: var(--paper); border: 1px solid var(--line); margin-bottom: 6px; }
.ann-post > summary { cursor: pointer; padding: 7px 9px; display: flex; flex-direction: column; gap: 1px; list-style: none; }
.ann-post > summary::-webkit-details-marker { display: none; }
.ann-title { font-weight: 600; }
.ann-date { font-size: 12px; color: var(--muted); }
.ann-body { padding: 2px 10px 10px; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.ann-body p { margin: 6px 0; }
.ann-body ul { margin: 6px 0; padding-left: 18px; }
.ann-body a { color: var(--link); }
.ann-body code { background: var(--panel-alt); padding: 0 4px; }
.ann-body .rich-h { margin: 10px 0 2px; font-size: 14px; }