.login-page {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  place-items: center;

  font-family: Raleway, Arial, sans-serif;
}
.login-form {
  width: min(350px, calc(100vw - 48px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 32px 0;
}
.login-logo {
  width: 280px;
  max-width: 100%;
  height: 110px;
  object-fit: contain;
  align-self: center;
  margin-bottom: 22px;
}
.login-form label {
  font-size: 14px;
}
.login-form input {
  box-sizing: border-box;
  width: 100%;
  height: 46px;
  padding: 10px 12px;
  background: #141414;
  border: 1px solid #454545;
  border-radius: 6px;
  color: #fff;
  font: inherit;
}
.login-form input:focus-visible {
  outline: 2px solid #6488ff;
  outline-offset: 2px;
}
.login-form button {
  border: 0;

  color: white;
  padding: 13px;
  font: 600 16px Arial;
  cursor: pointer;
}
.login-form button:disabled {
  opacity: 0.5;
  cursor: default;
}
#loginError {
  margin: 0;
  color: #ffabab;
  font-size: 14px;
  line-height: 1.5;
  min-height: 20px;
}
.account-details {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: 24px;
  color: white;
  font:
    700 15px Raleway,
    Arial,
    sans-serif;
}
.account-profile {
  display: flex;
  align-items: center;
  gap: 9px;
  color: inherit;
  text-decoration: none;
}
.top-bar .account-profile img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 50%;
}
.account-polybits {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.top-bar .polybits-icon {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 0;
}
.character-preview {
  object-fit: contain;
  float: left;
  margin: 0 24px 20px 0;
}
.account-loading {
  visibility: hidden;
}
@media (max-width: 650px) {
  .top-bar {
    flex-wrap: wrap;
    height: auto !important;
    min-height: 64px;
    padding: 10px !important;
    gap: 10px;
  }
  .top-bar > img {
    max-width: 130px;
  }
  .top-bar input {
    order: 3;
    width: 100% !important;
    margin: 0 !important;
  }
  .account-details {
    margin-left: auto;
    gap: 12px;
  }
  .character-preview {
    float: none;
    display: block;
    margin: 0 auto 20px;
  }
}

.captcha-box {
  margin: 4px 0;
  border: 1px solid #454545;
  border-radius: 6px;
  padding: 14px;
  background: #141414;
}
.captcha-box legend {
  font-size: 13px;
  color: #bbb;
}
.human-check {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.login-form .human-check input {
  width: 23px;
  height: 23px;
  margin: 0;
  accent-color: #345bff;
}
.captcha-box img {
  display: block;
  max-width: 100%;
  margin: 16px 0 8px;
}
.login-form #refreshCaptcha {
  background: transparent;
  color: #a9beff;
  padding: 4px 0;
  font-size: 13px;
  margin-bottom: 12px;
}
.captcha-box #captchaAnswer {
  margin-top: 8px;
  text-transform: uppercase;
}

.account-switch {
  font-size: 14px;
  text-align: center;
  color: #b7bac2;
}
.account-switch a {
  text-decoration: none;
}
.account-switch a:hover {
  text-decoration: underline;
}

#character-stage {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  touch-action: none;
}
#character-stage > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.character-preview {
  width: 230px;
  height: 300px;
}
.nav-avatar-stage {
  display: block;
  position: relative;
  width: 38px;
  height: 38px;
  overflow: hidden;
  border-radius: 50%;
}
.top-bar .nav-avatar-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
#character-stage canvas {
  cursor: grab;
}
#character-stage canvas:active {
  cursor: grabbing;
}

.blue-box-normal {
  height: auto;
  min-height: 600px;
}
.home-games {
  clear: both;
  padding-top: 12px;
}
.home-games h2 {
  margin: 0 0 16px;
}
.obby-card {
  margin: 0;
}
.obby-card > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
}
.obby-card h3 {
  margin: 10px 0 0;

  line-height: 1.4;
  color: #fff;
}

.obby-card {
  width: min(150px, 100%);
}
.obby-card h3 {
  font-size: 15px;
  margin-top: 8px;
}
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 150px));
  gap: 20px;
}
.games-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.games-heading h2 {
  margin: 0;
}
.games-heading > a {
  color: #bacbff;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.games-heading > a:hover {
  text-decoration: underline;
}
.games-empty {
  grid-column: 1/-1;
  margin: 0;
  color: #c3c5d4;
  font-size: 14px;
}
.recommended-home {
  margin-top: 20px;
}
.discovery-content .home-games {
  margin-top: 28px;
}
.game-grid .obby-card {
  width: 100%;
}

/* Account menu: neutral surfaces and PolyVerse blue. */
.account-menu {
  position: relative;
}
.account-profile {
  cursor: pointer;
  border: 2px solid transparent;

  min-height: 44px;
  box-sizing: border-box;
}
.account-profile:hover {
  background: #252d3b;
}
.account-profile[aria-expanded="true"] {
  background: #252d3b;
  border-color: #739dff;
  box-shadow: 0 0 0 2px #0d1119;
}
.account-profile:focus-visible {
  outline: 2px solid #739dff;
  outline-offset: 3px;
}
.profile-chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin: 0 4px 5px 8px;
}
.account-profile[aria-expanded="true"] .profile-chevron {
  transform: rotate(225deg);
  margin-top: 8px;
}
.profile-dropdown {
  position: absolute;
  right: 0;

  max-width: calc(100vw - 24px);

  background: #10141c;
  border: 1px solid #343b49;

  box-shadow: 0 16px 36px #0006;
  z-index: 1000;
}
.profile-dropdown[hidden] {
  display: none;
}
.profile-dropdown a,
.profile-dropdown button {
  display: block;
  box-sizing: border-box;
  width: 100%;
  text-align: left;

  border: 0;

  color: #f4f6fa;
  text-decoration: none;
  background: transparent;
  font:
    700 18px Raleway,
    Arial,
    sans-serif;
  cursor: pointer;
}
.profile-dropdown a:hover {
  background: #223750;
}
.profile-dropdown .profile-signout {
  background: #d94c55;
}
.profile-dropdown .profile-signout:hover {
  background: #bd3540;
}
.profile-dropdown :focus-visible {
  outline: 2px solid #87afff;
  outline-offset: 1px;
}
.site-page .top-bar {
  position: relative;
  z-index: 20;
}
.site-page .home-intro {
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 350px;
}
.site-page .character-preview {
  width: 260px;
  height: 350px;
}
@media (max-width: 700px) {
  .site-page .home-intro {
    grid-template-columns: minmax(0, 1fr);
  }
  .site-page .character-preview {
    width: min(260px, 100%);
    height: 310px;
  }
  .profile-dropdown a,
  .profile-dropdown button {
    font-size: 17px;
  }
}

.profile-dropdown {
  width: 220px;
  padding: 7px;
  border-radius: 9px;
  top: calc(100% + 8px);
}
.profile-dropdown a,
.profile-dropdown button {
  font-size: 15px;
  padding: 11px 12px;
  border-radius: 5px;
}
.account-profile {
  padding: 4px 8px;
  border-radius: 9px;
}
.profile-dropdown .profile-signout {
  margin-top: 4px;
}

/* Authentication uses the same surfaces as the account dropdown. */
.login-page {
  background: #10141c;
  color: #f4f6fa;
}
.login-form input,
.captcha-box {
  background: #151b25;
  border-color: #343b49;
  border-radius: 7px;
}
.login-form label,
.account-switch {
  color: #b8c2d2;
}
.login-form button {
  background: #345bff;
  border-radius: 7px;
}
.login-form button:hover:not(:disabled) {
  background: #284cda;
}
.login-form input:focus-visible {
  outline-color: #739dff;
}
.account-switch a {
  color: #9fbcff;
}

/* Friends sit directly beneath the existing count. */
.friend-previews { display:flex; gap:16px; overflow-x:auto; max-width:100%; padding:4px 0 8px; }
.friend-preview { flex:0 0 96px; min-width:0; text-align:center; color:inherit; text-decoration:none; }
.friend-preview img { display:block; width:80px; height:80px; margin:0 auto 8px; border-radius:50%; object-fit:cover; background:var(--secondary-background,#151b25); }
.friend-preview span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; }
