.app-sidebar {
  position: fixed;
  z-index: 30;
  inset: 18px auto 18px 18px;
  width: 184px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 12px;
  background: linear-gradient(180deg, rgba(3, 11, 22, 0.98), rgba(5, 16, 30, 0.95));
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

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

.brand-block img {
  width: 152px;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.38));
}

.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: #b7c9da;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.side-nav a.active,
.side-nav a:hover {
  color: var(--text);
  background: rgba(230, 197, 110, 0.1);
  border-color: rgba(230, 197, 110, 0.44);
  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: 218px;
}

.top-bar {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: rgba(2, 8, 19, 0.76);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
}

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

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

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

.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: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

.language-select select {
  color: var(--ink);
  background: var(--paper);
  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;
}

.page {
  width: min(1180px, calc(100% - 44px));
  margin: 0 auto;
  padding: 42px 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(8, 21, 38, 0.94), rgba(4, 14, 27, 0.96));
  box-shadow: var(--shadow);
}

.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 {
    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;
  }
}
