/* The other rooms: profiles, ranks, house rules, settings, notifications, the mod queue and 404. */

/* ---------- Profile ---------- */

.profile-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(16px, 4vw, 32px);
  align-items: center;
  margin: 8px 0 26px;
}
.profile-head .sigil {
  width: clamp(88px, 18vw, 140px);
  height: clamp(88px, 18vw, 140px);
  font-size: clamp(40px, 8vw, 64px);
}
.profile-name {
  margin: 0;
  font-size: clamp(36px, 7vw, 76px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.92;
  overflow-wrap: anywhere;
}
.profile-handle {
  margin: 6px 0 0;
  font: 600 15px/1.3 var(--mono);
  color: var(--mute);
}
.profile-bio {
  font-family: var(--read);
  font-weight: 400;
  font-optical-sizing: auto;
  margin: 12px 0 0;
  max-width: 54ch;
  color: var(--bone-2);
  font-size: 17px;
}
.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.stat {
  padding: 16px;
  border-radius: var(--r-3);
  border: 1px solid var(--line);
  background: var(--ink-2);
  display: grid;
  gap: 6px;
}
.stat b {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat span {
  font: 600 11px/1.2 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mute);
}
.stat.is-streak b {
  color: var(--hot);
}
.rank-meter {
  display: grid;
  gap: 10px;
  padding: 18px 20px;
  border-radius: var(--r-3);
  border: 1px solid var(--line);
  background: var(--ink-2);
  margin-bottom: 18px;
}
.rank-meter-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}
.rank-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.rank-next {
  font-size: 14px;
  color: var(--mute);
}
.bar-meter {
  height: 10px;
  border-radius: var(--r-1);
  background: var(--ink-4);
  overflow: hidden;
}
.bar-meter i {
  display: block;
  height: 100%;
  width: calc(var(--fill, 0) * 100%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--acid-2), var(--acid));
  box-shadow: 0 0 16px var(--acid-glow);
  transition: width 0.9s var(--ease-out);
}

.badges {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 26px;
}
.badge {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: var(--r-3);
  border: 1px solid var(--line);
  background: var(--ink-2);
}
.badge-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r-2);
  display: grid;
  place-items: center;
  background: var(--ink-4);
  color: var(--dim);
}
.badge-icon .icon,
.note-icon .icon {
  width: 22px;
  height: 22px;
}
.badge.is-earned .badge-icon {
  background: radial-gradient(circle at 30% 30%, #fff8, transparent 50%), var(--gold);
  color: var(--ink);
  box-shadow: 0 0 20px var(--gold-glow);
}
.badge b {
  display: block;
  font-size: 15px;
  line-height: 1.2;
}
.badge span {
  display: block;
  font-size: 12.5px;
  color: var(--mute);
  line-height: 1.3;
}
.badge:not(.is-earned) b {
  color: var(--mute);
}

.section-title {
  margin: 34px 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

/* ---------- Ranks ---------- */

.board {
  display: grid;
  gap: 8px;
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
}
.board-row {
  display: grid;
  grid-template-columns: 2.6em auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--r-3);
  border: 1px solid var(--line);
  background: var(--ink-2);
  text-decoration: none;
  transition:
    border-color 0.2s,
    background 0.2s;
}
.board-row:hover {
  border-color: var(--line-2);
  background: var(--ink-3);
}
.board-row.is-me {
  border-color: rgba(210, 255, 31, 0.45);
}
.board-place {
  font: 800 18px/1 var(--mono);
  color: var(--dim);
}
.board-row:nth-child(1) .board-place {
  color: var(--gold);
}
.board-row:nth-child(2) .board-place {
  color: var(--bone);
}
.board-row:nth-child(3) .board-place {
  color: #e4a77a;
}
.board-who {
  min-width: 0;
  display: grid;
  line-height: 1.25;
}
.board-who b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board-who span {
  font-size: 13px;
  color: var(--mute);
}
.board-score {
  text-align: right;
  font: 700 16px/1.2 var(--mono);
  color: var(--acid);
  white-space: nowrap;
}
.board-score small {
  display: block;
  font-size: 11px;
  color: var(--mute);
  font-weight: 500;
}

.ladder {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
}
.ladder li {
  padding: 14px 16px;
  border-radius: var(--r-2);
  border: 1px solid var(--line);
  background: var(--ink-2);
}
.ladder b {
  display: block;
  font-weight: 800;
  font-size: 19px;
}
.ladder span {
  font: 600 12px/1 var(--mono);
  color: var(--mute);
}
.ladder li.is-mine {
  border-color: var(--acid);
  box-shadow: 0 0 22px rgba(210, 255, 31, 0.12);
}

.rules-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 26px;
  font-size: 15px;
}
.rules-table th,
.rules-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
}
.rules-table th {
  font: 600 12px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mute);
}
.rules-table td:last-child {
  text-align: right;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--acid);
  white-space: nowrap;
}
.rules-table td.is-minus {
  color: var(--ice);
}

/* ---------- Prose (rules) ---------- */

.prose {
  font-family: var(--read);
  font-weight: 400;
  font-optical-sizing: auto;
  max-width: 68ch;
  display: grid;
  gap: 16px;
  font-size: 18px;
  color: var(--bone-2);
}
.prose h2 {
  margin: 22px 0 0;
  color: var(--bone);
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.prose p,
.prose ul {
  margin: 0;
}
.prose ul {
  list-style: none;
  padding: 0;
}
.prose li {
  position: relative;
  margin: 10px 0;
  padding-left: 1.5em;
}
.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 0.85em;
  height: 2px;
  background: var(--acid);
  box-shadow: 0 0 10px var(--acid-glow);
  transform: skewX(-24deg);
}
.prose h2,
.prose strong {
  font-family: var(--display);
}
.prose strong {
  color: var(--bone);
}
.manifesto {
  margin: 8px 0 18px;
  font-family: var(--serif);
  font-weight: 500;
  font-size-adjust: 0.47;
  font-style: italic;
  font-size: clamp(26px, 4.6vw, 44px);
  line-height: 1.12;
  color: var(--bone);
}
.manifesto span {
  display: block;
}
.manifesto .acid {
  color: var(--acid);
}

/* ---------- Settings ---------- */

.settings {
  display: grid;
  gap: 18px;
  max-width: 680px;
}
.settings-card {
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: var(--r-3);
  border: 1px solid var(--line);
  background: var(--ink-2);
}
.settings-card h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}
.settings-card.is-danger {
  border-color: rgba(255, 90, 79, 0.28);
}
.keys {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.key {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-2);
  background: var(--ink-3);
}
.key .icon {
  color: var(--acid);
}
.key div {
  display: grid;
  min-width: 0;
}
.key small {
  color: var(--mute);
}
.key .button {
  margin-left: auto;
}
.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.switch {
  /* a 44px-tall hit area around a 54x32 track, so it is easy to flip with a thumb */
  position: relative;
  width: 54px;
  height: 44px;
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.switch::before {
  content: "";
  position: absolute;
  inset: 6px 0;
  border-radius: var(--r-1);
  border: 1px solid var(--line-2);
  background: var(--ink-4);
  transition: background 0.2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bone-2);
  transition:
    transform 0.25s var(--ease-spring),
    background 0.2s;
}
.switch[aria-checked="true"]::before {
  background: var(--acid);
  border-color: transparent;
}
.switch[aria-checked="true"]::after {
  transform: translateX(22px);
  background: var(--acid-ink);
}
.switch:focus-visible {
  outline: none;
}
.switch:focus-visible::before {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

/* ---------- Notifications ---------- */

.notes {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.note {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--r-3);
  border: 1px solid var(--line);
  background: var(--ink-2);
  text-decoration: none;
  transition:
    border-color 0.2s,
    background 0.2s;
}
.note:hover {
  border-color: var(--line-2);
}
.note.is-unread {
  background: linear-gradient(90deg, rgba(210, 255, 31, 0.07), transparent 60%), var(--ink-2);
  border-color: rgba(210, 255, 31, 0.25);
}
.note-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-2);
  display: grid;
  place-items: center;
  background: var(--ink-4);
  color: var(--acid);
}
.note-text {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.note-text b {
  color: var(--bone);
}
.note time {
  font: 500 12px/1 var(--mono);
  color: var(--mute);
  white-space: nowrap;
}

/* ---------- Mod ---------- */

.mod-item {
  display: grid;
  gap: 10px;
}
.mod-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font: 600 13px/1.3 var(--mono);
  color: var(--mute);
}

/* ---------- 404 ---------- */

.lost {
  display: grid;
  gap: 18px;
  padding: 40px 0;
}

@media (max-width: 1000px) {
  .bar-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .rail {
    position: static;
    order: -1;
  }
  .rail .panel-hide-small {
    display: none;
  }
}

@media (max-width: 760px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stats .stat:first-child {
    grid-column: 1 / -1;
  }
  .toast-actions {
    gap: 6px;
  }
  .react {
    padding: 0 12px;
  }
  .react-share .react-label {
    display: none;
  }
  .board-row {
    grid-template-columns: 2em auto minmax(0, 1fr) auto;
    padding: 12px;
    gap: 10px;
  }
  .note {
    grid-template-columns: 40px minmax(0, 1fr);
  }
  .note time {
    grid-column: 2;
  }
}

.lost-toast {
  margin: 4px 0 26px;
  font: 800 clamp(22px, 4vw, 30px) / 1.15 var(--display);
  color: var(--bone);
  max-width: 34ch;
}
.lost-toast em {
  font-family: var(--serif);
  font-weight: 500;
  font-size-adjust: 0.47;
  color: var(--acid);
}
