* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  /* Цвет под орнаментом (его средний): им браузер красит поля вне страницы у выреза экрана, иначе они белые. */
  background: #dcba8a url('img/background.webp') repeat;
  color: #ffffff;
  min-height: 100vh;
  /* Отключение контекстного меню и выделения/лупы по лонгтапу на всей странице игры */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  /* Запрет pull-to-refresh на мобильных браузерах
  overscroll-behavior-y: none;
  overscroll-behavior: none;
  */
}

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 20px;
  z-index: 1000;
}

.login-button {
  background: #007bff;
  color: white;
  border: none;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.login-button:hover {
  background: #0056b3;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  object-fit: cover;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
}

.logout-button {
  background: transparent;
  color: #999;
  border: 1px solid #333;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.logout-button:hover {
  color: #fff;
  border-color: #555;
}

.main-content {
  margin-top: 60px;
  padding: 150px 100px 100px 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 60px);
  box-sizing: border-box;
}

#canvas {
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  background: rgba(0, 0, 0, 0.1);
  /* Рамка :focus-visible перерисовывается поверх канваса каждый кадр. */
  outline: none;
  /* Убираем ограничения, чтобы JS мог задавать точные размеры под 16:9 */
  max-width: none;
  max-height: none;
}

#xl_auth {
  display: none;
}