/* Web chat shell, sticky header and first-level header controls. */
.web-chat-body {
  background: var(--tg-bg);
}

.web-chat-body.drawer-open {
  overflow: hidden;
}

.web-chat-body.game-search-modal-open {
  overflow: hidden;
}

.chat-shell {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.chat-stage {
  position: relative;
  min-height: 0;
}

.chat-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  gap: 10px;
  padding: 8px 8px 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
    var(--tg-header);
  color: var(--tg-header-text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 20px rgba(8, 45, 69, 0.12);
}

.chat-header-main {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-center {
  text-align: center;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.site-logo {
  width: 36px;
  height: 36px;
  display: block;
  border-radius: 8px;
  object-fit: contain;
  object-position: center;
  background: #fff;
}

.header-room-back {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: #24272f;
  color: #f7f8ff;
  box-shadow: none;
}

.header-room-back svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.header-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(7, 38, 58, 0.14);
  transition:
    background 0.18s ease,
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.theme-toggle-btn {
  position: relative;
  overflow: hidden;
}

.theme-toggle-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.theme-toggle-icon-sun {
  opacity: 0;
  transform: scale(0.78) rotate(-18deg);
}

:root[data-theme="dark"] .theme-toggle-icon-moon {
  opacity: 0;
  transform: scale(0.78) rotate(18deg);
}

:root[data-theme="dark"] .theme-toggle-icon-sun {
  opacity: 1;
  transform: scale(1) rotate(0);
}

.header-icon-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.header-icon-btn:hover,
.burger-btn.is-open {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.62);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(7, 38, 58, 0.2);
}

.header-icon-btn[hidden] {
  display: none;
}

.payment-banner[hidden] {
  display: none;
}
