:root {
  --friend-blue: #42c6ff;
  --friend-yellow: #ffdc35;
  --friend-pink: #ff4f9a;
  --friend-danger: #ff5879;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: .58;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.friends-page {
  min-height: 100%;
  background:
    radial-gradient(circle at 88% 18%, rgba(141, 255, 31, .07), transparent 25rem),
    #050d09;
}

.friends-page main {
  overflow: hidden;
}

.friends-topbar {
  position: fixed;
  background: rgba(3, 12, 8, .84);
  border-bottom-color: rgba(218, 255, 227, .12);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.desktop-nav .nav-current {
  color: var(--lime);
  opacity: 1;
}

.account-chip {
  position: relative;
  min-height: 52px;
  padding: 6px 10px 6px 7px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(141, 255, 31, .25);
  background: rgba(141, 255, 31, .055);
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.account-chip:hover {
  border-color: var(--lime);
  background: rgba(141, 255, 31, .1);
  transform: translateY(-2px);
}

.account-avatar {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #061008;
  background: var(--lime);
  font: 950 12px/1 ui-monospace, monospace;
  clip-path: polygon(10% 0, 90% 0, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0 90%, 0 10%);
}

.account-copy {
  min-width: 88px;
}

.account-copy small,
.account-copy strong {
  display: block;
}

.account-copy small {
  margin-bottom: 3px;
  color: #809188;
  font: 800 7px/1 ui-monospace, monospace;
  letter-spacing: .13em;
}

.account-copy strong {
  max-width: 140px;
  overflow: hidden;
  color: #edf5ef;
  font-size: 11px;
  line-height: 1.1;
  letter-spacing: .04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-count {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 23px;
  height: 23px;
  padding: 0 6px;
  place-items: center;
  border: 2px solid #050d09;
  border-radius: 99px;
  color: #fff;
  background: var(--friend-pink);
  box-shadow: 0 0 17px rgba(255, 79, 154, .45);
  font: 950 10px/1 ui-monospace, monospace;
}

.request-count:not([hidden]) {
  display: grid;
}

.friends-hero {
  position: relative;
  min-height: 680px;
  padding: 132px max(4%, calc((100% - var(--max)) / 2)) 70px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(285px, .55fr);
  align-items: center;
  gap: clamp(45px, 8vw, 120px);
  overflow: hidden;
  background:
    radial-gradient(circle at 77% 36%, rgba(141, 255, 31, .17), transparent 23rem),
    radial-gradient(circle at 8% 88%, rgba(66, 198, 255, .09), transparent 22rem),
    linear-gradient(135deg, #07150e, #020705);
}

.hero-grid {
  position: absolute;
  inset: 0;
  opacity: .11;
  background-image:
    linear-gradient(rgba(141, 255, 31, .24) 1px, transparent 1px),
    linear-gradient(90deg, rgba(141, 255, 31, .24) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: linear-gradient(120deg, transparent, #000 38%, transparent 95%);
  mask-image: linear-gradient(120deg, transparent, #000 38%, transparent 95%);
  transform: perspective(680px) rotateY(-8deg) scale(1.12);
}

.hero-number {
  position: absolute;
  top: 10%;
  right: -2vw;
  color: rgba(141, 255, 31, .04);
  font-size: clamp(270px, 40vw, 610px);
  font-weight: 950;
  font-style: italic;
  line-height: .8;
  letter-spacing: -.13em;
  pointer-events: none;
}

.friends-hero-copy,
.team-summary {
  position: relative;
  z-index: 2;
}

.friends-hero-copy h1 {
  margin: 12px 0 26px;
  font-size: clamp(82px, 10vw, 142px);
}

.friends-hero-copy > p:not(.hero-kicker) {
  max-width: 640px;
  margin-bottom: 31px;
  color: #b8c7bd;
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.7;
}

.team-summary {
  width: 100%;
  max-width: 370px;
  justify-self: end;
  padding: 27px;
  border: 1px solid rgba(141, 255, 31, .25);
  border-top: 3px solid var(--lime);
  background:
    radial-gradient(circle at 85% 10%, rgba(141, 255, 31, .11), transparent 45%),
    rgba(5, 19, 12, .88);
  box-shadow: 14px 14px 0 rgba(141, 255, 31, .07);
}

.summary-head {
  padding-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 14px var(--lime);
  animation: pulse 1.4s infinite;
}

.summary-head small {
  color: #91a39a;
  font: 800 8px/1 ui-monospace, monospace;
  letter-spacing: .16em;
}

.summary-avatar {
  width: 70px;
  height: 70px;
  margin: 25px 0 17px;
  display: grid;
  place-items: center;
  color: #061008;
  background: var(--lime);
  font: 950 20px/1 ui-monospace, monospace;
  clip-path: polygon(12% 0, 88% 0, 100% 12%, 100% 88%, 88% 100%, 12% 100%, 0 88%, 0 12%);
}

.team-summary > strong,
.team-summary > span {
  display: block;
}

.team-summary > strong {
  overflow: hidden;
  margin-bottom: 7px;
  font-size: 23px;
  font-style: italic;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-summary > span {
  color: #86988d;
  font-size: 12px;
}

.summary-stats {
  margin-top: 25px;
  padding-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.summary-stats > div {
  min-width: 0;
  text-align: center;
}

.summary-stats > div + div {
  border-left: 1px solid rgba(255, 255, 255, .1);
}

.summary-stats b,
.summary-stats small {
  display: block;
}

.summary-stats b {
  overflow: hidden;
  color: var(--lime);
  font: 950 22px/1 ui-monospace, monospace;
  text-overflow: ellipsis;
}

.summary-stats small {
  margin-top: 8px;
  color: #73857a;
  font: 800 7px/1 ui-monospace, monospace;
  letter-spacing: .1em;
}

.guest-panel,
.friends-tools,
.squad-section,
.team-board-section {
  width: min(92%, var(--max));
  margin: 0 auto;
}

.guest-panel {
  min-height: 350px;
  margin-block: 100px;
  padding: clamp(28px, 5vw, 58px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(25px, 4vw, 55px);
  border: 1px solid rgba(141, 255, 31, .22);
  border-left: 4px solid var(--lime);
  background:
    radial-gradient(circle at 10% 50%, rgba(141, 255, 31, .1), transparent 28%),
    #081810;
}

.guest-mark {
  width: 90px;
  height: 90px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(141, 255, 31, .35);
  color: var(--lime);
  background: rgba(141, 255, 31, .07);
  font-size: 42px;
}

.guest-panel h2 {
  margin-bottom: 18px;
  font-size: clamp(40px, 5vw, 66px);
}

.guest-panel div > p:last-child {
  max-width: 650px;
  margin: 0;
  color: #9caea3;
  line-height: 1.7;
}

.friends-tools,
.squad-section,
.team-board-section {
  padding-block: 110px;
}

.squad-section,
.team-board-section {
  padding-top: 40px;
}

.section-intro,
.board-heading {
  margin-bottom: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .55fr);
  align-items: end;
  gap: 40px;
}

.section-intro .section-tag,
.board-heading .section-tag {
  margin-bottom: 35px;
}

.section-intro h2,
.board-heading h2 {
  margin-bottom: 0;
}

.section-intro > p {
  margin: 0 0 10px;
  color: #92a399;
  font-size: 15px;
  line-height: 1.7;
}

.section-intro.compact {
  grid-template-columns: 1fr auto;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 14px;
}

.tool-grid > .nickname-card,
.tool-grid > .invite-card {
  min-height: 510px;
}

.code-options {
  grid-column: 1 / -1;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(9, 25, 18, .72);
}

.code-options summary {
  min-height: 64px;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #c9d6cd;
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
  list-style: none;
}

.code-options summary::-webkit-details-marker {
  display: none;
}

.code-options summary b {
  color: var(--friend-blue);
  font-size: 22px;
  transition: transform .2s ease;
}

.code-options[open] summary b {
  transform: rotate(45deg);
}

.code-options-grid {
  padding: 0 14px 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.code-options-grid .tool-card {
  min-height: 390px;
}

.code-options-grid .tool-card + .tool-card {
  border-left: 1px solid rgba(255, 255, 255, .12);
}

.code-options-grid .add-card {
  grid-column: auto;
}

.tool-card,
.list-card,
.board-panel {
  position: relative;
  border: 1px solid rgba(255, 255, 255, .12);
  background: #091912;
}

.tool-card {
  min-width: 0;
  min-height: 440px;
  padding: 31px;
  display: flex;
  flex-direction: column;
}

.tool-card + .tool-card {
  border-left: 0;
}

.tool-card small,
.card-title small,
.board-label small {
  color: #7f9186;
  font: 850 8px/1.2 ui-monospace, monospace;
  letter-spacing: .14em;
}

.tool-card h3 {
  margin: 12px 0 15px;
  color: #eef5f0;
  font-size: clamp(25px, 2.5vw, 35px);
  font-style: italic;
  line-height: .98;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}

.tool-card > p {
  color: #899b90;
  font-size: 13px;
  line-height: 1.65;
}

.card-number {
  position: absolute;
  top: 16px;
  right: 18px;
  color: rgba(255, 255, 255, .19);
  font: 900 9px/1 ui-monospace, monospace;
}

.tool-icon {
  width: 54px;
  height: 54px;
  margin-bottom: 34px;
  display: grid;
  place-items: center;
  color: #061008;
  background: var(--lime);
  font-size: 25px;
  font-weight: 950;
  transform: rotate(-3deg);
}

.code-card {
  border-top: 3px solid var(--friend-blue);
}

.code-card .tool-icon {
  background: var(--friend-blue);
}

.code-card h3 {
  color: var(--friend-blue);
  font: 950 clamp(30px, 3.2vw, 43px)/.95 ui-monospace, monospace;
  letter-spacing: .02em;
}

.nickname-card {
  border-top: 3px solid var(--lime);
  background:
    radial-gradient(circle at 93% 0, rgba(141, 255, 31, .1), transparent 43%),
    #091912;
}

.nickname-card .tool-icon {
  background: var(--lime);
}

.nickname-card h3 {
  color: var(--lime);
}

.nickname-search-form {
  margin-top: 18px;
}

.nickname-search-form label {
  display: block;
  margin-bottom: 8px;
  color: #75877d;
  font: 850 8px/1 ui-monospace, monospace;
  letter-spacing: .13em;
}

.nickname-search-form input {
  width: 100%;
  min-width: 0;
  height: 50px;
  padding: 0 13px;
  border: 1px solid rgba(141, 255, 31, .22);
  border-radius: 0;
  color: #f2f8f3;
  outline: none;
  background: #06110c;
  font: 800 12px/1 ui-monospace, monospace;
  appearance: none;
}

.nickname-search-form input::-webkit-search-cancel-button {
  filter: invert(1);
}

.nickname-search-form input::placeholder {
  color: #5d6e64;
}

.nickname-search-form input:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(141, 255, 31, .08);
}

.nickname-search-form .card-button:disabled {
  filter: grayscale(.65);
  cursor: wait;
  opacity: .72;
  transform: none;
}

.nickname-search-help {
  display: block;
  margin-top: 9px;
  color: #64766b !important;
  font-size: 8px !important;
  line-height: 1.4 !important;
  letter-spacing: .05em !important;
}

.nickname-results {
  max-height: 365px;
  margin-top: 7px;
  padding: 0 11px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(141, 255, 31, .16);
  background: rgba(4, 16, 10, .64);
}

.nickname-result {
  min-height: 72px;
}

.nickname-result .friend-avatar {
  background: var(--lime);
}

.nickname-result .friend-action {
  min-height: 42px;
}

.friend-action.status {
  border-color: rgba(255, 255, 255, .1);
  color: #84958a;
  background: rgba(255, 255, 255, .035);
  cursor: default;
}

.invite-card {
  border-top: 3px solid var(--friend-yellow);
  background:
    radial-gradient(circle at 93% 0, rgba(255, 220, 53, .1), transparent 43%),
    #091912;
}

.invite-card .tool-icon {
  background: var(--friend-yellow);
}

.invite-card h3 {
  color: var(--friend-yellow);
}

.invite-steps {
  margin: 2px 0 18px;
  display: grid;
  gap: 8px;
}

.invite-steps span {
  min-height: 35px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #c5d0c8;
  font-size: 13px;
  font-weight: 800;
}

.invite-steps b {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 220, 53, .3);
  color: var(--friend-yellow);
  background: rgba(255, 220, 53, .06);
  font: 950 10px/1 ui-monospace, monospace;
}

.add-card {
  border-top: 3px solid var(--lime);
}

.add-card form {
  margin-top: auto;
}

.add-card label,
.invite-field label {
  display: block;
  margin-bottom: 8px;
  color: #75877d;
  font: 850 8px/1 ui-monospace, monospace;
  letter-spacing: .13em;
}

.add-card input,
.invite-field input {
  width: 100%;
  min-width: 0;
  height: 50px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 0;
  color: #f2f8f3;
  outline: none;
  background: #06110c;
  font: 800 12px/1 ui-monospace, monospace;
}

.add-card input {
  text-transform: uppercase;
}

.add-card input::placeholder {
  color: #5d6e64;
  text-transform: none;
}

.add-card input:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(141, 255, 31, .08);
}

.card-button {
  min-height: 48px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  color: #061008;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .1em;
  text-align: center;
  transition: transform .2s ease, filter .2s ease;
}

.card-button:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
}

.card-button.blue {
  margin-top: auto;
  background: var(--friend-blue);
}

.card-button.yellow {
  margin-top: auto;
  background: var(--friend-yellow);
}

.card-button.green {
  width: 100%;
  margin-top: 9px;
  background: var(--lime);
}

.invite-field {
  margin-top: 14px;
}

.invite-field > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.invite-field input {
  height: 44px;
  border-color: rgba(255, 220, 53, .3);
  border-right: 0;
  font-size: 9px;
}

.invite-field input:focus {
  border-color: var(--friend-yellow);
}

.invite-field button {
  min-width: 76px;
  border: 0;
  color: #061008;
  background: var(--friend-yellow);
  font-size: 8px;
  font-weight: 950;
}

.form-status {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--lime);
  font-size: 12px;
  line-height: 1.45;
}

.form-status.is-error {
  color: var(--friend-danger);
}

.refresh-button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(141, 255, 31, .35);
  color: var(--lime);
  background: rgba(141, 255, 31, .06);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .1em;
}

.squad-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.list-card {
  padding: 27px;
}

.requests-card {
  grid-column: span 5;
  border-top: 3px solid var(--friend-yellow);
}

.accepted-card {
  grid-column: span 7;
  border-top: 3px solid var(--lime);
}

.outgoing-card {
  grid-column: 1 / -1;
  border-top: 3px solid var(--friend-pink);
}

.card-title,
.board-label {
  padding-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.card-title h3,
.board-label h3 {
  margin: 7px 0 0;
  color: #eef5f0;
  font-size: clamp(21px, 2.4vw, 29px);
  font-style: italic;
  letter-spacing: -.04em;
}

.card-title > span {
  min-width: 38px;
  height: 38px;
  padding: 0 9px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(141, 255, 31, .25);
  color: var(--lime);
  background: rgba(141, 255, 31, .06);
  font: 950 15px/1 ui-monospace, monospace;
}

.requests-card .card-title > span {
  border-color: rgba(255, 220, 53, .3);
  color: var(--friend-yellow);
  background: rgba(255, 220, 53, .06);
}

.outgoing-card .card-title > span {
  border-color: rgba(255, 79, 154, .28);
  color: var(--friend-pink);
  background: rgba(255, 79, 154, .06);
}

.friend-list {
  display: grid;
}

.friend-row {
  min-width: 0;
  padding: 17px 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.friend-row:last-child {
  border-bottom: 0;
}

.friend-row.has-profile-link {
  grid-template-columns: minmax(0, 1fr) auto;
}

.friend-profile-link {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  border-radius: 2px;
}

.friend-profile-link:hover .friend-info strong,
.friend-profile-link:focus-visible .friend-info strong,
.table-profile-link:hover .table-name strong,
.table-profile-link:focus-visible .table-name strong {
  color: var(--lime);
}

.friend-profile-link:focus-visible,
.table-profile-link:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 5px;
}

.friend-avatar,
.table-avatar {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #061008;
  background: var(--lime);
  font: 950 12px/1 ui-monospace, monospace;
  clip-path: polygon(11% 0, 89% 0, 100% 11%, 100% 89%, 89% 100%, 11% 100%, 0 89%, 0 11%);
}

.requests-card .friend-avatar {
  background: var(--friend-yellow);
}

.outgoing-card .friend-avatar {
  color: #fff;
  background: var(--friend-pink);
}

.friend-info {
  min-width: 0;
}

.friend-info strong,
.friend-info small {
  display: block;
}

.friend-info strong {
  overflow: hidden;
  margin-bottom: 5px;
  color: #eff5f0;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-info small {
  color: #708178;
  font: 750 7px/1.35 ui-monospace, monospace;
  letter-spacing: .08em;
}

.friend-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.friend-action {
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, .14);
  color: #dce6df;
  background: rgba(255, 255, 255, .04);
  font-size: 7px;
  font-weight: 950;
  letter-spacing: .08em;
}

.friend-action.primary {
  border-color: rgba(141, 255, 31, .3);
  color: #071009;
  background: var(--lime);
}

.friend-action.danger {
  border-color: rgba(255, 88, 121, .28);
  color: #ff8ca3;
  background: rgba(255, 88, 121, .06);
}

.empty-list {
  min-height: 108px;
  padding: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: #718279;
  text-align: center;
}

.empty-list span {
  color: var(--lime);
  font-size: 23px;
}

.empty-list p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.friends-error {
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid rgba(255, 88, 121, .28);
  border-left: 3px solid var(--friend-danger);
  background: rgba(255, 88, 121, .055);
}

.friends-error strong {
  color: #ff8ea5;
  font-size: 13px;
  letter-spacing: .06em;
}

.friends-error p {
  margin: 8px 0 0;
  color: #a7959a;
  font-size: 12px;
}

.board-heading {
  align-items: end;
}

.game-filter {
  display: block;
}

.game-filter > span {
  display: block;
  margin-bottom: 9px;
  color: #75877d;
  font: 850 8px/1 ui-monospace, monospace;
  letter-spacing: .14em;
}

.game-filter select {
  width: 100%;
  height: 55px;
  padding: 0 43px 0 15px;
  border: 1px solid rgba(141, 255, 31, .28);
  border-radius: 0;
  color: #edf5ef;
  outline: none;
  background: #091912;
  font-size: 12px;
  font-weight: 800;
}

.game-filter select:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(141, 255, 31, .08);
}

.board-panel {
  overflow: hidden;
  border-top: 3px solid var(--lime);
}

.board-label {
  min-height: 95px;
  padding: 23px clamp(20px, 4vw, 36px);
  background:
    radial-gradient(circle at 95% 0, rgba(141, 255, 31, .1), transparent 38%),
    #0a1c14;
}

.board-label > span {
  color: var(--lime);
  font: 900 9px/1.2 ui-monospace, monospace;
  letter-spacing: .1em;
  text-align: right;
}

.board-state {
  min-height: 245px;
  padding: 38px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.board-state > span {
  color: var(--lime);
  font-size: 38px;
}

.board-state strong {
  color: #eaf2ec;
  font-size: clamp(15px, 2vw, 20px);
  font-style: italic;
}

.board-state p {
  margin: 0;
  color: #829389;
  font-size: 13px;
}

.board-state .card-button {
  width: auto;
  margin-top: 8px;
}

.error-state > span,
.error-state strong {
  color: var(--friend-danger);
}

.loading-ball {
  display: inline-block;
  animation: ballLoad 1.1s ease-in-out infinite;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.friends-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.friends-table th {
  height: 48px;
  padding: 0 24px;
  color: #687a70;
  background: #07130d;
  font: 850 8px/1 ui-monospace, monospace;
  letter-spacing: .12em;
  text-align: left;
}

.friends-table th:first-child {
  width: 110px;
  text-align: center;
}

.friends-table th:last-child {
  width: 210px;
  text-align: right;
}

.friends-table td {
  height: 76px;
  padding: 12px 24px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.friends-table tr.is-me {
  background: rgba(141, 255, 31, .055);
  box-shadow: inset 3px 0 var(--lime);
}

.rank-cell {
  text-align: center;
}

.rank-number {
  color: #c4d0c8;
  font: 950 16px/1 ui-monospace, monospace;
}

.table-player {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
}

.table-profile-link {
  border-radius: 2px;
}

.table-name {
  min-width: 0;
}

.table-name strong,
.table-name small {
  display: block;
}

.table-name strong {
  overflow: hidden;
  margin-bottom: 5px;
  color: #ecf4ee;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-name small {
  color: #718279;
  font: 750 7px/1 ui-monospace, monospace;
  letter-spacing: .08em;
}

.table-name small.you-label {
  color: var(--lime);
}

.score-cell {
  text-align: right;
}

.score-value strong,
.score-value small {
  display: block;
}

.score-value strong {
  color: var(--lime);
  font: 950 22px/1 ui-monospace, monospace;
}

.score-value small {
  margin-top: 5px;
  color: #708178;
  font: 800 7px/1 ui-monospace, monospace;
  letter-spacing: .08em;
}

.friends-toast {
  position: fixed;
  z-index: 90;
  right: 28px;
  bottom: calc(var(--app-nav-height, 76px) + var(--app-nav-bottom, 18px) + 28px);
  width: min(410px, calc(100% - 56px));
  padding: 16px 18px;
  border: 1px solid rgba(141, 255, 31, .4);
  border-left: 4px solid var(--lime);
  color: #eaf4ec;
  background: rgba(5, 20, 13, .97);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .4);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.45;
  letter-spacing: .04em;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .22s ease, transform .22s ease;
}

.friends-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.friends-toast.is-error {
  border-color: rgba(255, 88, 121, .45);
  border-left-color: var(--friend-danger);
}

@keyframes ballLoad {
  50% {
    transform: translateY(-9px) rotate(25deg);
  }
}

@media (max-width: 980px) {
  .friends-hero {
    min-height: 760px;
    grid-template-columns: minmax(0, 1fr) minmax(260px, .58fr);
    gap: 35px;
  }

  .tool-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .tool-card + .tool-card {
    border-left: 1px solid rgba(255, 255, 255, .12);
  }

  .add-card {
    grid-column: 1 / -1;
    min-height: 340px;
  }

  .add-card form {
    max-width: 620px;
  }

  .requests-card,
  .accepted-card {
    grid-column: span 6;
  }
}

@media (max-width: 760px) {
  .friends-topbar {
    height: 72px;
    padding: 0 16px;
  }

  .desktop-nav {
    display: none !important;
  }

  .friends-topbar .brand-name {
    display: none;
  }

  .account-chip {
    min-height: 45px;
    padding: 4px 8px 4px 5px;
  }

  .account-avatar {
    width: 34px;
    height: 34px;
  }

  .account-copy {
    min-width: 72px;
  }

  .account-copy strong {
    max-width: 104px;
    font-size: 10px;
  }

  .friends-hero {
    min-height: 580px;
    padding: 110px 18px 65px;
    display: flex;
    align-items: stretch;
    justify-content: center;
  }

  .friends-hero-copy h1 {
    font-size: clamp(69px, 22vw, 100px);
  }

  .friends-hero-copy .button {
    width: 100%;
  }

  .team-summary {
    display: none;
  }

  .summary-avatar {
    width: 56px;
    height: 56px;
    margin: 20px 0 14px;
    font-size: 16px;
  }

  .guest-panel {
    margin-block: 70px;
    grid-template-columns: 1fr;
  }

  .guest-mark {
    width: 70px;
    height: 70px;
    font-size: 32px;
  }

  .guest-panel .button {
    width: 100%;
  }

  .friends-tools {
    padding-top: 82px;
  }

  .friends-tools,
  .squad-section,
  .team-board-section {
    width: calc(100% - 36px);
    padding-bottom: 82px;
  }

  .squad-section,
  .team-board-section {
    padding-top: 18px;
  }

  .section-intro,
  .board-heading {
    grid-template-columns: 1fr;
    gap: 23px;
  }

  .section-intro.compact {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }

  .tool-grid > .nickname-card,
  .tool-grid > .invite-card {
    min-height: 0;
  }

  .code-options-grid {
    grid-template-columns: 1fr;
  }

  .add-card {
    grid-column: auto;
  }

  .tool-card {
    min-height: 390px;
    padding: 26px;
  }

  .tool-card + .tool-card {
    border-top-width: 3px;
  }

  .requests-card,
  .accepted-card,
  .outgoing-card {
    grid-column: 1 / -1;
  }

  .list-card {
    padding: 22px;
  }

  .friend-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .friend-row.has-profile-link {
    grid-template-columns: 1fr;
  }

  .friend-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .friend-action {
    flex: 1 1 120px;
    min-height: 44px;
  }

  .board-heading {
    margin-bottom: 26px;
  }

  .friends-table {
    min-width: 560px;
  }

  .friends-table th,
  .friends-table td {
    padding-inline: 18px;
  }

  .friends-toast {
    right: 16px;
    bottom: calc(var(--app-nav-height, 70px) + env(safe-area-inset-bottom, 0px) + 14px);
    left: 16px;
    width: auto;
  }
}

@media (max-width: 440px) {
  .section-intro.compact {
    grid-template-columns: 1fr;
  }

  .refresh-button {
    width: 100%;
  }

  .card-title h3 {
    font-size: 20px;
  }

  .board-label {
    align-items: flex-start;
    flex-direction: column;
  }

  .board-label > span {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-dot,
  .loading-ball {
    animation: none;
  }

  .friends-toast {
    transition: none;
  }
}
