/* The friends' page: the panel's look (style.css), made for a group of friends rather than an operator:
   the map first, the server's name on top, a friendly door in, and room for thumbs. */
[hidden] { display: none !important; }
body { background: var(--bg, var(--surface)); }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- the way in: login and invite ---- */
#gate { min-height: 100vh; background:
  radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%), var(--rail); }
.login { gap: 6px; }
.gatemark { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: var(--ink); padding-bottom: 18px; }
.gatemark svg { color: var(--accent); flex: none; }
.gatetitle { margin: 0; font-size: 26px; letter-spacing: -0.02em; line-height: 1.15; }
.gatehint { margin: 2px 0 10px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.gatehint.faint { margin: 12px 0 0; font-size: 13px; color: var(--faint); }
.login .btn.quiet { margin-top: 10px; }
.invfields { display: flex; flex-direction: column; gap: 6px; }
.pwfield { position: relative; display: flex; }
.pwfield .field { flex: 1; padding-right: 44px; min-width: 0; }
.pwshow { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); border-radius: 8px; cursor: pointer; }
.pwshow:hover { color: var(--ink); }
.pwcheck { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--faint); }
.pwcheck li { display: flex; align-items: center; gap: 8px; }
.pwcheck li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; flex: none; }
.pwcheck li.ok { color: var(--ok); }
.pwcheck li.ok::before { background: currentColor; }

/* ---- the menu: three pages and who you are ---- */
.nav { display: flex; flex-direction: column; gap: 2px; }
.navme { gap: 8px !important; }
#nav-me { display: inline-flex; }
#nav-me > * { width: 20px; height: 20px; font-size: 11px; }
@media (max-width: 720px) {
  .nav { flex-direction: row; gap: 4px; margin-left: auto; }
  .nav a.navtop { padding: 8px 10px; }
  .rail .mark span { display: inline; font-size: 14px; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 420px) { .rail .mark span { display: none; } }

/* ---- the map and the waypoint panel beside it ---- */
.wplayout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.wplayout:has(.wppanel:not([hidden])) { grid-template-columns: minmax(0, 1fr) 340px; }
.wmbox.placing { cursor: crosshair; }
.mapfab { position: absolute; right: 12px; bottom: 34px; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 12px; border: 0; border-radius: 22px; background: var(--accent); color: #1a1209; font: 700 14px var(--sans); cursor: pointer; box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }
.mapfab svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mapfab:hover { filter: brightness(1.06); }
.mapfab:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.wmbox.placing .mapfab { display: none; }
.wpplacing { position: absolute; left: 12px; right: 12px; bottom: 34px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 12px; background: rgba(10, 13, 18, .9); color: #fff; font-size: 14px; font-weight: 600; box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }

.wppanel { align-self: start; padding: 0 18px 18px; max-height: calc(100vh - 200px); overflow: auto; overscroll-behavior: contain; }
.wppanel.waiting { opacity: .55; }
.wpbar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 -18px 12px; padding: 14px 10px 10px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.wpbar h2 { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.wpclose { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; flex: none; }
.wpclose:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.wpmeta { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13.5px; color: var(--muted); }
.wpdot { flex: none; width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35) inset; display: inline-block; }
.wpcoords { display: flex; align-items: center; gap: 10px; margin: 14px 0; }
.wpcoords code { font: 500 15px var(--mono); }
.wpnote { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 14px; }

.wpform { display: flex; flex-direction: column; gap: 14px; }
.wpfield { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.wpfield label, .wpform legend { font-size: 13px; color: var(--muted); }
.wpform fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.wpform legend { padding: 0; margin-bottom: 6px; }
.wpform textarea { resize: vertical; font: inherit; }
.wpwhere { display: flex; flex-direction: column; gap: 10px; }
.wpxyz { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.wpxyz .field { font-family: var(--mono); width: 100%; }
.wpwherebtns { display: flex; flex-wrap: wrap; gap: 8px; }
.wpwherebtns .btn { display: inline-flex; align-items: center; gap: 6px; }
.wpwherebtns .ico { width: 16px; height: 16px; }
.wpcolors { display: flex; flex-wrap: wrap; gap: 8px; }
.wpcolors legend { width: 100%; }
.swatch { position: relative; width: 30px; height: 30px; border-radius: 50%; background: var(--c); cursor: pointer; box-shadow: 0 0 0 1px rgba(0, 0, 0, .3) inset; }
.swatch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.swatch:has(input:checked) { outline: 2px solid var(--ink); outline-offset: 2px; }
.swatch:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.wpvis { display: flex; flex-direction: column; gap: 2px; }
.wpvis label { display: flex; align-items: center; gap: 8px; min-height: 32px; font-size: 14px; cursor: pointer; }
.wpvis label.off { color: var(--faint); cursor: default; }
.wppeople { display: flex; flex-wrap: wrap; gap: 6px; }
.wppeople .chip input { margin: 0; }
.wpactions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wpactions .note { flex-basis: 100%; margin: 0; }
.wpactions.sticky { position: sticky; bottom: -18px; margin: 4px -18px -18px; padding: 12px 18px 16px; background: var(--surface); border-top: 1px solid var(--line); }
.discard { padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.discard p { margin: 0 0 10px; font-weight: 600; }

/* On phones the panel is a sheet from the bottom, over the page, with its buttons always in reach. */
@media (max-width: 900px) {
  .wplayout:has(.wppanel:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
  .wppanel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; max-height: 78svh; border-radius: 16px 16px 0 0; border-bottom: 0; box-shadow: 0 -12px 40px rgba(0, 0, 0, .45); padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .wppanel.waiting { transform: translateY(calc(100% - 64px)); opacity: 1; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
  .wpbar { border-radius: 16px 16px 0 0; }
  .wpbar::before { content: ""; position: absolute; left: 50%; top: 6px; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line-strong); }
  .wpactions.sticky { bottom: calc(-18px - env(safe-area-inset-bottom)); padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  body.sheet-open .mapfab { display: none; }
}
@media (prefers-reduced-motion: reduce) { .wppanel.waiting { transition: none; } }
@media (max-width: 720px) { .wmbox { height: 62svh; min-height: 300px; } }

.wptools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }
.wptools-lbl { font-size: 13px; color: var(--muted); }
.wptools .wmplayers { margin-top: 0; }
.wplists { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 14px; margin-top: 16px; }
.wplist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.wpitem { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: none; color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.wpitem:hover { border-color: var(--line-strong); }
.wpitem .nm { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.wpitem .sub { display: block; font: 400 12px var(--mono); color: var(--faint); }

/* ---- statistics: yours (or a friend's) first, you highlighted everywhere ---- */
#mystats { margin-bottom: 22px; }
.sechead { margin: 0 0 12px; font-size: 17px; }
.pstats .ch h2 { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pstats .ch h2 > span { overflow-wrap: anywhere; }
.backlink { margin-bottom: 8px; display: inline-flex; align-items: center; gap: 4px; min-height: 40px; color: var(--accent); font-weight: 600; font-size: 14px; text-decoration: none; }
.backlink .ico { width: 16px; height: 16px; }
.board .who.me { border-color: var(--c); box-shadow: 0 0 0 1px var(--c) inset; }
.board li.me .nm { color: var(--c); }
.myplace { display: flex; justify-content: space-between; gap: 8px; margin: 0; padding: 8px 10px 0 4px; border-top: 1px dashed var(--line); font-size: 13.5px; font-weight: 600; color: var(--c); }
.myplace .v { font-family: var(--mono); }
#stattable tr.me td { background: color-mix(in srgb, var(--accent) 9%, transparent); }
#stattable tr.me td:first-child span, #stattable tr.me td:first-child a { color: var(--accent) !important; }
.sortbtn { font-size: 12.5px; }
@media (max-width: 720px) {
  .stiles.hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stiles.hero .stile { flex-direction: column; align-items: flex-start; gap: 8px; }
  .stiles.hero .stile b { font-size: 20px; }
}

/* ---- account ---- */
.narrowcard { max-width: 480px; }
.narrowcard + .narrowcard { margin-top: 14px; }
.pwstack { display: flex; flex-direction: column; gap: 8px; }
.pwstack label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.pwstack .btn { align-self: flex-start; margin-top: 8px; }

/* ---- room for thumbs: 40px targets on touch screens ---- */
@media (pointer: coarse) {
  .mapbtn { min-width: 40px; height: 40px; font-size: 16px; }
  .swatch { width: 36px; height: 36px; }
  .wpcolors { gap: 10px; }
  .wpvis label { min-height: 40px; }
  .sortbtn { min-height: 40px; }
  .nav a.navtop { min-height: 40px; }
  .morestats summary { min-height: 40px; display: flex; align-items: center; }
  .rail .mark { min-height: 40px; }
  .btn.small { min-height: 40px; }
}
@media (max-width: 720px) { .pstats > .ch { flex-direction: column; align-items: flex-start; gap: 2px; } }

/* ---- players: everyone on the whitelist ---- */
.plfilter { margin-bottom: 12px; max-width: 360px; }
.plfilter .field { width: 100%; }
.plgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; }
.plcard { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .12s; }
.plcard:hover { border-color: var(--line-strong); }
.plcard.me { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.pltext { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.plcard .nm { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.plcard .sub { font-size: 12.5px; color: var(--muted); }
.plcard .sub + .sub { color: var(--faint); }
#pl-one .pstats { margin-top: 4px; }
@media (max-width: 420px) { .nav a.navtop { padding: 8px 7px; font-size: 13.5px; } }

/* ---- Statistik: the whole server, awards, longest alive, what kills people ---- */
.secnote { margin: -6px 0 12px; font-size: 13.5px; color: var(--muted); }
.sechead { margin-top: 28px; }
.srvtotals.hero .stile.big { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 13%, var(--raised)), var(--raised) 70%); }
.srvtotals .snote { color: var(--ink); opacity: .8; }

.awards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.award { --c: var(--accent); display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 2px 12px; align-items: center; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--c) 30%, var(--line)); border-radius: var(--r); background: linear-gradient(140deg, color-mix(in srgb, var(--c) 16%, var(--surface)), var(--surface) 62%); color: var(--ink); text-decoration: none; transition: border-color .12s, transform .12s; }
a.award:hover { border-color: var(--c); transform: translateY(-1px); }
.award .spic { width: 44px; height: 44px; grid-row: span 2; }
.award .atitle { font-weight: 800; font-size: 17px; letter-spacing: -0.01em; line-height: 1.15; }
.award .awhat { font-size: 12.5px; color: var(--muted); }
.award .awho { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed color-mix(in srgb, var(--c) 35%, var(--line)); min-width: 0; font-weight: 700; font-size: 14.5px; }
.award .awho .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.award .av { grid-column: 1 / -1; font: 600 13.5px var(--mono); color: var(--c); }
.award.me { box-shadow: 0 0 0 1px var(--accent) inset; border-color: var(--accent); }

.duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 14px; margin: 28px 0 14px; }
.duo .card, .srvtops { --c: var(--accent); }
.duo .card:last-child { --c: var(--bad); }
.rlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.rlist li { display: grid; grid-template-columns: 16px 28px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; }
.rlist li .face, .rlist li .spic { width: 28px; height: 28px; }
.rlist .rank { font: 12px var(--mono); color: var(--faint); }
.rlist .nm { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); text-decoration: none; text-transform: none; }
.danger .nm::first-letter { text-transform: uppercase; }
.rlist .sub { display: block; font-size: 12px; font-weight: 400; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.rlist .v { font: 600 13.5px var(--mono); color: var(--c); }
.rlist .b { grid-column: 3 / -1; height: 4px; border-radius: 2px; background: var(--raised); overflow: hidden; }
.rlist .b i { display: block; height: 100%; background: var(--c); opacity: .6; }
.rlist li.me .nm { color: var(--accent); }
.rlist li.mine { display: flex; justify-content: space-between; padding-top: 10px; border-top: 1px dashed var(--line); font-weight: 600; font-size: 13.5px; color: var(--accent); }
.srvtops .tops { margin-top: 6px; }
@media (max-width: 720px) {
  .srvtotals:not(.hero) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .srvtotals:not(.hero) .stile { flex-direction: column; align-items: flex-start; gap: 6px; }
}
@media (max-width: 720px) { .duo .ch, .srvtops .ch { flex-direction: column; align-items: flex-start; gap: 2px; } }

/* ---- Statistik: the comparison chart ---- */
.cmpcard { margin-top: 28px; }
.cmpcard .ch { flex-wrap: wrap; gap: 10px; }
.cmppick { flex-wrap: wrap; }
.cmpcard .bchart { background: none; border: 0; padding: 4px 0 0; }
