#public-home .header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
#arena-profile {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 12px 24px 12px;
  overflow: auto;
}
#arena-profile[hidden] {
  display: none;
}
.profile-title {
  display: flex;
  align-items: center;
  gap: 28px;
}
#arena-profile h2 {
  font-size: clamp(24px, 3.2vw, 50px);
  font-style: italic;
  color: #ffe18b;
}
.profile-title p {
  border-left: 2px solid #e8c76c;
  padding-left: 28px;
  font-style: italic;
  font-size: clamp(14px, 1.8vw, 28px);
}
.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.15fr);
  gap: 18px;
  min-height: 0;
}
.profile-card {
  min-width: 0;
  min-height: 0;
  border: 2px solid #efc65d;
  border-radius: 24px;
  background: radial-gradient(at 20% 0%, #005338, #002c25 50%, #001c22);
  box-shadow: inset 0 2px 3px #fff5;
}
.profile-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 32px 12px;
  overflow: auto;
}
.profile-avatar {
  width: min(70%, 260px);
  min-height: 0;
  aspect-ratio: 1;
  object-fit: contain;
  flex: 1 1 180px;
  max-height: 38%;
  filter: drop-shadow(0 5px 5px #0008);
}
#arena-profile #profile-name {
  font-size: clamp(20px, 3vw, 48px);
  text-align: center;
  overflow-wrap: anywhere;
  margin: 4px 0 8px;
  line-height: 1.05;
}
#profile-kind {
  background: linear-gradient(#54716a, #123d33);
  border: 1px solid #a2bab0;
  border-radius: 24px;
  padding: 4px 18px;
  font-size: clamp(10px, 1.35vw, 20px);
  font-weight: bold;
  white-space: nowrap;
}
.profile-id-row {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 18px;
}
.profile-id-row label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  font-style: italic;
  font-size: clamp(12px, 1.5vw, 22px);
}
#profile-id {
  min-width: 0;
  width: 9ch;
  text-overflow: ellipsis;
  border: 0;
  padding: 0;
  background: transparent;
  color: white;
  font: inherit;
}
#profile-copy {
  background: transparent;
  border: 0;
  padding: 2px;
  font-size: 28px;
}
#profile-form {
  width: 100%;
  display: grid;
  gap: 10px;
  border-top: 2px solid #c8a54f;
  padding-top: 16px;
}
#profile-form label {
  font-weight: bold;
  font-size: clamp(14px, 1.6vw, 24px);
}
#profile-display-name {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid #b2c9c3;
  border-radius: 16px;
  padding: 10px 16px;
  color: #fff;
  background: #001f1c;
  font: inherit;
  font-size: clamp(16px, 1.8vw, 28px);
}
#public-home #profile-save {
  border: 1px solid #ffe6a0;
  border-radius: 24px;
  color: #06120c;
  background: linear-gradient(#fff4b4, #ffce4d 48%, #efaf10);
  box-shadow: 0 2px 0 #b2760b;
  font-weight: bold;
  font-size: clamp(16px, 1.8vw, 28px);
  padding: 8px;
}
#profile-form small {
  text-align: center;
  font-size: clamp(10px, 1.25vw, 18px);
  font-style: italic;
}
#profile-status {
  font-size: 12px;
  text-align: center;
  min-height: 1em;
}
.profile-details {
  display: grid;
  grid-template-rows: 1.05fr 0.48fr 1fr;
  gap: 14px;
  min-height: 0;
}
#arena-profile .profile-card h3 {
  color: #ffe18b;
  font-size: clamp(18px, 2.4vw, 36px);
}
.profile-level {
  display: flex;
  flex-direction: column;
  padding: 8px 22px 12px;
}
.profile-level-body {
  display: flex;
  flex: 1;
  align-items: center;
  min-height: 0;
  gap: 24px;
  border-top: 1px solid #74978b;
  margin-top: 8px;
  padding-top: 8px;
}
.profile-shield {
  flex: 0 1 27%;
  min-width: 0;
  height: 100%;
  display: grid;
  place-items: center;
  border-right: 2px solid #d4bb5d;
  padding-right: 22px;
}
#public-home .profile-shield svg {
  width: 100%;
  height: 100%;
  max-height: 170px;
}
.profile-level-copy {
  flex: 1;
  min-width: 0;
}
.profile-level-copy h4 {
  font-size: clamp(20px, 2.6vw, 40px);
  margin: 0;
}
#profile-total-xp {
  font-style: italic;
  font-size: clamp(14px, 1.8vw, 28px);
}
.profile-progress-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: clamp(11px, 1.4vw, 22px);
  margin-top: 6px;
}
#profile-progress {
  appearance: none;
  width: 100%;
  height: clamp(14px, 2vw, 28px);
  border: 1px solid #c4d3c9;
  border-radius: 30px;
  overflow: hidden;
  background: #001c18;
  margin-top: 5px;
}
#profile-progress::-webkit-progress-bar {
  background: #001c18;
}
#profile-progress::-webkit-progress-value {
  background: linear-gradient(#a5ffc4, #00d75a 65%, #00943d);
  border-radius: 30px;
}
#profile-progress::-moz-progress-bar {
  background: linear-gradient(#a5ffc4, #00d75a 65%, #00943d);
  border-radius: 30px;
}
#arena-profile .profile-reward {
  text-align: center;
  font-style: italic;
  margin-top: 8px;
  font-size: clamp(11px, 1.4vw, 22px);
}
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
}
.profile-stats article {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
}
.profile-stats article > span {
  color: #ffdc79;
  font-size: clamp(26px, 3.8vw, 60px);
  padding-right: 14px;
  border-right: 2px solid #cbb254;
}
.profile-stats strong {
  font-size: clamp(24px, 3.6vw, 56px);
  line-height: 1;
}
.profile-stats p {
  font-size: clamp(10px, 1.25vw, 19px);
  font-style: italic;
  white-space: nowrap;
}
.profile-clubs {
  display: flex;
  flex-direction: column;
  padding: 8px 20px 10px;
}
.profile-clubs header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #74978b;
}
#profile-view-clubs {
  background: transparent;
  border: 0;
  font-size: clamp(12px, 1.5vw, 24px);
  font-style: italic;
  padding: 6px;
}
#profile-club-list {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 4px 0;
  font-size: clamp(12px, 1.6vw, 24px);
}
.profile-club-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #819c8c;
  padding: 6px 10px;
  min-height: 48%;
}
.profile-club-row:last-child {
  border-bottom: 0;
}
#public-home .profile-club-crest svg,
.profile-club-crest img {
  width: clamp(38px, 5vw, 80px);
  height: clamp(40px, 5.5vw, 85px);
  object-fit: contain;
}
.profile-club-copy {
  flex: 1;
  min-width: 0;
}
.profile-club-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(14px, 2vw, 30px);
}
.profile-club-copy small {
  font-style: italic;
  font-size: clamp(11px, 1.5vw, 23px);
}
.profile-club-row b {
  border: 1px solid #b9e8ba;
  border-radius: 30px;
  background: linear-gradient(#087d43, #003c2c);
  padding: 4px 18px;
  font-size: clamp(10px, 1.4vw, 22px);
}
#public-home .profile-club-row b.owner {
  color: #0c170b;
  background: linear-gradient(#fff1ab, #ffc63b, #f0ad09);
  border-color: #ffe8aa;
}
#arena-profile footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: clamp(10px, 1.1vw, 17px);
  font-style: italic;
}
@media (max-height: 600px) {
  #arena-profile {
    padding: 6px 12px;
    gap: 6px;
  }
  .profile-layout {
    gap: 10px;
  }
  .profile-card {
    border-radius: 16px;
  }
  .profile-identity {
    padding: 8px 16px 4px;
  }
  .profile-avatar {
    max-height: 30%;
  }
  #arena-profile #profile-name {
    font-size: clamp(18px, 2.6vw, 28px);
    margin: 3px 0;
  }
  .profile-id-row {
    margin: 4px 0;
  }
  #profile-form {
    gap: 4px;
    padding-top: 6px;
  }
  #profile-display-name,
  #public-home #profile-save {
    padding: 5px 10px;
  }
  .profile-details {
    gap: 6px;
    grid-template-rows: 116px 46px minmax(70px, 1fr);
  }
  .profile-level {
    padding: 4px 12px;
  }
  .profile-level-body {
    gap: 12px;
    margin-top: 3px;
    padding-top: 3px;
  }
  .profile-shield {
    padding-right: 12px;
  }
  #public-home .profile-shield svg {
    max-height: 90px;
  }
  .profile-level-copy h4 {
    font-size: 18px;
  }
  #arena-profile .profile-card h3 {
    font-size: 18px;
  }
  #profile-total-xp {
    font-size: 12px;
  }
  .profile-level-body {
    flex: 1 1 auto;
  }
  .profile-level-copy > .profile-progress-labels:first-of-type {
    display: none;
  }
  .profile-progress-labels {
    font-size: 10px;
  }
  #profile-progress {
    height: 12px;
    margin-top: 2px;
  }
  .profile-shield {
    height: 64px;
  }
  .profile-progress-labels {
    margin-top: 3px;
  }
  #arena-profile .profile-reward {
    margin-top: 3px;
  }
  .profile-stats {
    gap: 6px;
  }
  .profile-stats article {
    gap: 8px;
    padding: 4px 8px;
  }
  .profile-stats article > span {
    padding-right: 8px;
  }
  .profile-clubs {
    padding: 3px 12px;
  }
  .profile-club-row {
    padding: 3px 0;
    gap: 8px;
  }
}
@media (max-height: 360px) {
  #profile-view-clubs {
    padding: 2px;
  }
  #public-home .profile-club-crest svg,
  .profile-club-crest img {
    width: 24px;
    height: 22px;
  }
  .profile-club-row {
    min-height: 24px;
    padding: 1px 0;
  }
  .profile-club-copy strong {
    font-size: 11px;
  }
  .profile-club-copy small {
    font-size: 9px;
  }
  #profile-club-list {
    padding: 0;
  }
  .profile-details {
    grid-template-rows: 90px 36px minmax(60px, 1fr);
  }
  #arena-profile .profile-card h3 {
    font-size: 16px;
  }
  .profile-level-body {
    padding-top: 0;
    margin-top: 1px;
  }
  .profile-level-copy h4 {
    font-size: 15px;
    display: inline;
  }
  #profile-total-xp {
    display: inline;
    margin-left: 8px;
    font-size: 10px;
  }
  .profile-level-copy .profile-progress-labels {
    margin-top: 1px;
    font-size: 9px;
  }
  .profile-shield {
    height: 45px;
  }
  #arena-profile .profile-reward {
    font-size: 9px;
    margin-top: 1px;
  }
  .profile-stats strong {
    font-size: 22px;
  }
  .profile-stats p {
    font-size: 9px;
  }
  .profile-club-row b {
    padding: 3px 8px;
  }
  .profile-avatar {
    max-height: 22%;
  }
  #profile-form small {
    display: none;
  }
  .profile-stats article > span {
    display: none;
  }
  .profile-title p {
    font-size: 12px;
  }
  #arena-profile h2 {
    font-size: 24px;
  }
}
@media (orientation: portrait) {
  .profile-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .profile-identity {
    overflow: visible;
  }
  .profile-avatar {
    flex: none;
    width: 130px;
    max-height: none;
  }
  .profile-details {
    grid-template-rows: auto auto minmax(150px, auto);
  }
  #arena-profile {
    grid-template-rows: auto auto auto;
  }
}
