.app-sidebar {
  position: fixed;
  z-index: 30;
  inset: 18px auto 18px 18px;
  width: 214px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 13px;
  background:
    linear-gradient(180deg, rgba(31, 62, 106, 0.72), rgba(18, 45, 83, 0.68)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow), var(--inner-glow);
  backdrop-filter: blur(22px) saturate(1.2);
}

.brand-block {
  min-height: 132px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
}

.brand-block img {
  width: 170px;
  filter: drop-shadow(0 12px 24px rgba(11, 30, 57, 0.32));
}

.brand-block small {
  color: var(--gold);
  font-weight: 850;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.side-nav a {
  min-height: 48px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  color: #c9dceb;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.side-nav a.active,
.side-nav a:hover {
  color: var(--text);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), rgba(238, 248, 255, 0.08));
  border-color: rgba(246, 211, 117, 0.48);
  box-shadow: inset 3px 0 0 var(--gold);
}

.side-nav span {
  display: grid;
  place-items: center;
}

.side-nav b {
  overflow: hidden;
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell {
  min-height: 100vh;
  margin-left: 250px;
}

.top-bar {
  position: sticky;
  z-index: 20;
  top: 14px;
  width: min(1380px, calc(100% - 44px));
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px auto 0;
  padding: 14px 22px;
  background:
    linear-gradient(90deg, rgba(31, 64, 111, 0.62), rgba(27, 55, 96, 0.42)),
    rgba(18, 43, 80, 0.54);
  border: 1px solid rgba(232, 245, 255, 0.28);
  border-radius: 14px;
  box-shadow: var(--shadow), var(--inner-glow);
  backdrop-filter: blur(22px) saturate(1.22);
}

.top-summary {
  color: var(--soft);
  font-weight: 900;
}

.top-summary b {
  color: var(--gold);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-language-message:empty {
  display: none;
}

.top-language-message:not(:empty) {
  position: fixed;
  z-index: 30;
  top: 74px;
  right: 20px;
  max-width: min(340px, calc(100vw - 40px));
  min-height: 0;
  padding: 10px 14px;
  font-size: 0.82rem;
  background: var(--panel);
  border: 1px solid currentColor;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.language-select select,
.detail-panel select,
.detail-panel input,
.join-room-row input,
.visages-input,
.guess-select {
  min-height: 42px;
  min-width: 0;
  padding: 0 12px;
  color: var(--text);
  background: var(--field);
  border: 1px solid rgba(210, 236, 255, 0.22);
  border-radius: 10px;
}

.language-select select {
  color: var(--text);
  background: rgba(238, 248, 255, 0.14);
  border-color: rgba(232, 245, 255, 0.28);
  font-weight: 950;
}

.avatar-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--gold);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  font-weight: 950;
  background-position: center;
  background-size: cover;
  overflow: hidden;
}

.avatar-button,
.profile-avatar-image,
.profile-avatar-choice > span,
.avatar-token,
.combat-avatar-portrait,
.familles-player-avatar {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.account-avatar-media,
.account-avatar-fallback,
.account-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.account-avatar-media {
  z-index: 0;
  overflow: hidden;
  border: 2px solid var(--avatar-accent, #8c83cb);
  background: color-mix(in srgb, var(--avatar-accent, #8c83cb) 16%, #f7f6fb);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.68);
}

.account-avatar-fallback {
  z-index: 0;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--avatar-accent) 72%, white), #24213d 88%);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
}

.account-avatar-img {
  z-index: 1;
  display: block;
  object-fit: cover;
  pointer-events: none;
}

.page {
  width: min(1380px, calc(100% - 44px));
  margin: 0 auto;
  padding: 22px 0 60px;
}

.onboarding-page {
  min-height: calc(100vh - 72px);
  display: grid;
  place-items: center;
}

.onboarding-card {
  width: min(860px, 100%);
  padding: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)),
    var(--panel);
  box-shadow: var(--shadow), var(--inner-glow);
}

.onboarding-card h1 {
  margin: 8px 0 10px;
  font-size: 2.6rem;
}

@media (max-width: 1080px) {
  .app-sidebar {
    inset: auto 0 0 0;
    width: auto;
    min-height: 68px;
    flex-direction: row;
    align-items: center;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
  }

  .brand-block {
    min-width: 48px;
    width: 48px;
    min-height: 48px;
    overflow: hidden;
  }

  .brand-block img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    object-position: left center;
    border: 1px solid rgba(230, 197, 110, 0.32);
    border-radius: 8px;
  }

  .brand-block small,
  .side-nav b {
    display: none;
  }

  .side-nav {
    flex: 1;
    display: flex;
    overflow-x: auto;
  }

  .side-nav a {
    min-width: 54px;
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .app-shell {
    margin-left: 0;
    padding-bottom: 76px;
  }
}

@media (max-width: 720px) {
  .top-bar {
    width: min(100% - 28px, 460px);
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr 42px 48px;
  }

  .top-actions .ghost-button {
    min-width: 48px;
    overflow: hidden;
    padding: 0;
    font-size: 0;
  }

  .top-actions .ghost-button::before {
    content: "↪";
    font-size: 1.1rem;
  }

  .page {
    width: min(100% - 28px, 460px);
    padding-top: 30px;
  }
}
