/* ==========================================================================
   mangoclient.live - the public face of the presence server.

   The palette is lifted straight out of the launcher's own app.css so that a
   player who alt-tabs from MangoClient to this page feels no seam: the same
   warm browns pulled towards the brown in a mango's shadow, the same accent
   sampled from the logo. What the site adds is the rank colours, and they are
   the only saturated things on the page besides the mark.
   ========================================================================== */

:root {
  --surface-1:   #191614;
  --surface-2:   #201c18;
  --surface-3:   #2a2621;
  --surface-4:   #38332c;

  --text:        #ffffff;
  --text-2:      #c9c1b5;
  --text-3:      #a89f92;
  --text-4:      #7c7367;

  --brand:       #e89a2c;
  --brand-hot:   #f6a93c;
  --brand-fg:    #2a1600;

  --hairline:    rgba(255, 240, 220, .07);
  --edge:        rgba(255, 240, 220, .12);
  --lift-lg:     0 6px 20px rgba(0, 0, 0, .34);

  /* The four mangos, in the order a player earns them. */
  --owner:       #ffd24a;
  --support:     #69b4ff;
  --mangoplus:   #f6a93c;
  --member:      #ffffff;

  --ok:          #1bd96a;
  --danger:      #ff6b5e;

  --r-sm: .5rem;
  --r-md: .75rem;
  --r-lg: 1rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100%;
  background:
    radial-gradient(1200px 700px at 68% -12%, rgba(232, 154, 44, .09), transparent 70%),
    var(--surface-1);
  background-attachment: fixed;
  color: var(--text-2);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* --- masthead ------------------------------------------------------------ */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem clamp(1.25rem, 5vw, 4.5rem);
}

.mark {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
  text-decoration: none;
  font-size: 1.05rem;
}

.mark img { width: 30px; height: 30px; display: block; }

.top nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-size: .85rem;
  color: var(--text-3);
}

.top nav a { text-decoration: none; transition: color .18s; }
.top nav a:hover { color: var(--brand-hot); }

/* The heartbeat: green while the numbers are fresh, red once a poll fails. */
.pulse {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .78rem;
  letter-spacing: .04em;
  color: var(--text-4);
}

.pulse::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(27, 217, 106, .55);
  animation: beat 2.6s ease-out infinite;
}

.pulse.stale { color: var(--danger); }
.pulse.stale::before { background: var(--danger); animation: none; box-shadow: none; }

@keyframes beat {
  0%   { box-shadow: 0 0 0 0 rgba(27, 217, 106, .5); }
  70%  { box-shadow: 0 0 0 7px rgba(27, 217, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(27, 217, 106, 0); }
}

/* --- the sentence -------------------------------------------------------- */

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 4.5rem) 5rem;
}

.lede {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: end;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding: clamp(1.5rem, 5vw, 3.25rem) 0 clamp(2rem, 4vw, 3rem);
}

/* One sentence, set big, with the live numbers standing inside it. Cards
   would have made three equal boxes out of three unequal facts. */
.say {
  font-size: clamp(1.5rem, 3.6vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: -.025em;
  font-weight: 500;
  color: var(--text-3);
  max-width: 15ch;
}

/* The two live counts sit under the big total, smaller, so the page has a
   loud fact and a quiet one rather than three of the same size. */
.now {
  font-size: clamp(1.05rem, 1.9vw, 1.4rem);
  line-height: 1.45;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: -.01em;
  max-width: 24ch;
  padding-bottom: .6rem;
}

.now .n { color: var(--text); font-weight: 800; font-variant-numeric: tabular-nums; }

.say .n {
  color: var(--text);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
}

.say .n.hero {
  display: block;
  font-size: clamp(3.6rem, 13vw, 7.5rem);
  line-height: .92;
  color: var(--brand);
  margin-bottom: .1em;
}

.say .n.live { color: var(--text); }

/* A number that just changed gets one warm flash, no layout movement. */
.n.bumped { animation: bump .9s cubic-bezier(.16, 1, .3, 1); }

@keyframes bump {
  0%   { color: var(--brand-hot); }
  100% { color: inherit; }
}

/* --- the strip of smaller facts ------------------------------------------ */

.strip {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.75rem, 5vw, 3.5rem);
  align-items: flex-start;
  padding: 1.5rem 0 2.75rem;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.fact { min-width: 8rem; }

.fact dt {
  font-size: .72rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-4);
  margin-bottom: .35rem;
}

.fact dd {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.fact dd small { font-size: .8rem; font-weight: 500; color: var(--text-4); letter-spacing: 0; }

/* Where the installs are: one bar, segments in weight order. */
.split { flex: 1 1 16rem; min-width: 14rem; }

.bar {
  display: flex;
  height: 10px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--surface-3);
  margin-bottom: .6rem;
}

.bar span { transition: width .8s cubic-bezier(.16, 1, .3, 1); }

.keys {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1rem;
  font-size: .8rem;
  color: var(--text-3);
}

.keys b { color: var(--text-2); font-weight: 600; }

.keys i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: .4rem;
  vertical-align: baseline;
}

/* --- the staff ------------------------------------------------------------ */

.staff { padding-top: clamp(2.5rem, 6vw, 4rem); }

.staff h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}

.staff > p {
  color: var(--text-4);
  font-size: .9rem;
  margin: .3rem 0 2rem;
  max-width: 60ch;
}

.rank { margin-bottom: 2.75rem; }

.rank header {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  margin-bottom: .35rem;
}

.rank .blurb {
  font-size: .82rem;
  color: var(--text-4);
  margin-bottom: 1rem;
}

.rank h3 {
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--rank-color, var(--text));
}

.rank .count {
  font-size: .78rem;
  color: var(--text-4);
  font-variant-numeric: tabular-nums;
}

.rank .rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--rank-color, var(--text-4)), transparent);
  opacity: .35;
  transform: translateY(-.25rem);
}

.people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .5rem;
  list-style: none;
}

.person {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem .7rem;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid transparent;
  transition: border-color .2s, background .2s, transform .2s cubic-bezier(.16, 1, .3, 1);
}

.person:hover {
  background: var(--surface-3);
  border-color: color-mix(in oklab, var(--rank-color, var(--edge)) 35%, transparent);
  transform: translateY(-1px);
}

.person .head {
  width: 34px;
  height: 34px;
  border-radius: 5px;
  image-rendering: pixelated;
  background: var(--surface-4);
  flex: none;
}

.person .who { min-width: 0; }

.person .ign {
  display: block;
  color: var(--text);
  font-weight: 600;
  font-size: .92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person .since {
  display: block;
  font-size: .72rem;
  color: var(--text-4);
}

.person .mango { margin-left: auto; flex: none; }

.empty {
  color: var(--text-4);
  font-size: .88rem;
  padding: .9rem 0;
  border-top: 1px dashed var(--hairline);
}

/* --- the mango glyph, tinted the way Minecraft tints it ------------------- */

/* The page shows the very bitmaps the mod draws in game, so what a visitor
   sees here is exactly what stands next to a name on a server. */
.mango {
  display: inline-block;
  width: var(--size, 22px);
  height: var(--size, 22px);
  object-fit: contain;
  image-rendering: pixelated;
  vertical-align: middle;
  flex: none;
}

/* --- legend and footer ---------------------------------------------------- */

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--hairline);
}

.legend div { display: flex; align-items: center; gap: .55rem; font-size: .85rem; }
.legend b { color: var(--text-2); font-weight: 600; }
.legend span { color: var(--text-4); }

footer.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
  font-size: .8rem;
  color: var(--text-4);
}

footer.foot a { color: var(--text-3); text-decoration: none; }
footer.foot a:hover { color: var(--brand-hot); }

/* --- admin ---------------------------------------------------------------- */

.gate {
  max-width: 21rem;
  margin: clamp(3rem, 12vh, 7rem) auto;
  text-align: left;
}

.gate h1 { font-size: 1.5rem; color: var(--text); letter-spacing: -.02em; margin-bottom: .4rem; }
.gate p { color: var(--text-4); font-size: .9rem; margin-bottom: 1.5rem; }

input[type="password"], input[type="text"] {
  width: 100%;
  padding: .7rem .85rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--edge);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: .95rem;
  transition: border-color .18s, box-shadow .18s;
}

input:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(232, 154, 44, .18);
}

button {
  font: inherit;
  font-weight: 600;
  font-size: .9rem;
  border: 0;
  border-radius: var(--r-sm);
  padding: .7rem 1.1rem;
  background: var(--brand);
  color: var(--brand-fg);
  cursor: pointer;
  transition: background .18s, transform .12s;
}

button:hover { background: var(--brand-hot); }
button:active { transform: translateY(1px); }
button[disabled] { opacity: .55; cursor: default; transform: none; }

.row { display: flex; gap: .5rem; margin-top: .75rem; }
.row input { flex: 1; }

.note { font-size: .82rem; margin-top: .8rem; min-height: 1.2em; }
.note.bad { color: var(--danger); }
.note.good { color: var(--ok); }

/* The remove button is quiet until you are on the row it belongs to. */
.person .kill {
  margin-left: auto;
  background: none;
  color: var(--text-4);
  padding: .3rem .45rem;
  font-size: 1rem;
  line-height: 1;
  border-radius: var(--r-sm);
  opacity: 0;
  transition: opacity .18s, color .18s, background .18s;
}

.person:hover .kill, .person:focus-within .kill { opacity: 1; }
.person .kill:hover { color: var(--danger); background: rgba(255, 107, 94, .12); }

.admin-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.admin-head h1 { font-size: 1.4rem; color: var(--text); letter-spacing: -.02em; }
.linkish {
  background: none;
  color: var(--text-3);
  padding: .35rem .5rem;
  font-weight: 500;
}
.linkish:hover { background: none; color: var(--brand-hot); }

.adder {
  display: flex;
  gap: .5rem;
  margin-bottom: 1rem;
  max-width: 26rem;
}
.adder input { flex: 1; }

/* --- entrance ------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    animation: rise .7s cubic-bezier(.16, 1, .3, 1) backwards;
  }
  @keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
  }
}

@media (max-width: 760px) {
  .lede { grid-template-columns: 1fr; align-items: start; }
  .say { max-width: none; }
  .now { max-width: none; padding-bottom: 0; }
}
