@charset "UTF-8";
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

html,
body {
  height: 100vh;
  width: 100vw;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
}

.game-panel {
  width: 450px;
  height: 670px;
  border: 4px solid #bdbdbd;
  border-radius: 2px;
  background-color: #faf8ef;
  padding: 10px;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

@media screen and (max-width: 450px) {
  .game-panel {
    width: 100%;
    height: 100%;
    justify-content: space-around;
  }
}
.score-board {
  width: 100%;
  height: 100px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.score-board .logo {
  width: 160px;
  height: 100px;
  line-height: 90px;
  padding: 5px;
  border-radius: 5px;
  background-color: #5979ac;
  color: #fff;
  text-align: center;
}
.score-board a {
  text-decoration: none;
  color: #fff;
}

@media screen and (max-width: 450px) {
  .score-board .logo {
    width: 150px;
  }
}
@media screen and (max-width: 380px) {
  .score-board .logo {
    width: 140px;
  }
}
@media screen and (max-width: 360px) {
  .score-board .logo {
    width: 110px;
  }
  .score-board a {
    font-size: 18px;
  }
}
.best-score {
  width: 120px;
  height: 100px;
  padding: 10px;
  background-color: #bbada0;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  color: #eae0d1;
}
.best-score span {
  font-size: 19px;
  font-weight: bold;
  display: block;
  width: 100%;
  text-align: center;
}
.best-score h2 {
  color: #fff;
}

@media screen and (max-width: 450px) {
  .best-score {
    width: 105px;
  }
  .best-score span {
    font-size: 17px;
  }
}
@media screen and (max-width: 380px) {
  .best-score {
    width: 95px;
  }
}
@media screen and (max-width: 360px) {
  .best-score {
    width: 90px;
  }
  .best-score span {
    font-size: 15px;
  }
}
.game-progress {
  width: 120px;
  height: 100px;
  padding: 10px;
  background-color: #bbada0;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  color: #eae0d1;
}
.game-progress span {
  font-size: 19px;
  font-weight: bold;
  display: block;
  width: 100%;
  text-align: center;
}
.game-progress h2 {
  color: #fff;
}

@media screen and (max-width: 450px) {
  .game-progress {
    width: 105px;
  }
  .game-progress span {
    font-size: 17px;
  }
}
@media screen and (max-width: 380px) {
  .game-progress {
    width: 95px;
  }
}
@media screen and (max-width: 360px) {
  .game-progress {
    width: 90px;
  }
  .game-progress span {
    font-size: 15px;
  }
}
.chess-board {
  margin-top: 20px;
  width: 100%;
  background-color: #fff;
  height: 530px;
  border-radius: 4px;
  padding: 10px 5px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  align-content: space-around;
}
.chess-board .chess-board-card-container:nth-child(4n) {
  margin-right: 0px;
}

@media screen and (max-width: 450px) {
  .chess-board {
    height: 480px;
    padding: 10px 0px;
  }
}
@media screen and (max-width: 370px) {
  .chess-board {
    height: 450px;
  }
}
.chess-board-card-container {
  width: 100px;
  height: 121px;
  margin-right: 3px;
  cursor: pointer;
  position: relative;
  perspective: 800px;
}
.chess-board-card-container .card {
  width: 100%;
  height: 100%;
  transition: transform 1s;
  transform-style: preserve-3d;
}
.chess-board-card-container .card.flipped {
  transform: rotateY(180deg);
}
.chess-board-card-container .card.no-transition {
  transition: none;
}
.chess-board-card-container .card img {
  display: block;
  height: 100%;
  width: 100%;
  position: absolute;
  backface-visibility: hidden;
}
.chess-board-card-container .card .back {
  background: blue;
  transform: rotateY(0deg);
}
.chess-board-card-container .card .front {
  background: blue;
  transform: rotateY(180deg);
}

@media screen and (max-width: 450px) {
  .chess-board-card-container {
    width: 92px;
    height: 111px;
    margin-right: 1px;
  }
}
@media screen and (max-width: 395px) {
  .chess-board-card-container {
    width: 85px;
    height: 102px;
    margin-right: 1px;
  }
}
@media screen and (max-width: 360px) {
  .chess-board-card-container {
    width: 70px;
    height: 84px;
    margin-right: 1px;
  }
}
.game-status-container {
  position: relative;
  margin-top: 10px;
  width: 100%;
  height: 20px;
  line-height: 20px;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
}
.game-status-container button {
  border: none;
  cursor: pointer;
  background: transparent;
  color: #5979ac;
  font-size: 17px;
  font-weight: bold;
}
.game-status-container .sec-past {
  position: absolute;
  right: 10px;
  font-size: 15px;
  font-weight: normal;
}
.game-status-container .moves,
.game-status-container .mistakes {
  position: absolute;
  left: 10px;
  font-size: 15px;
  font-weight: normal;
}
.game-status-container .mistakes {
  left: 90px;
}

.current-score {
  width: 120px;
  height: 100px;
  padding: 10px;
  background-color: #bbada0;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  color: #eae0d1;
}
.current-score span {
  font-size: 19px;
  font-weight: bold;
  display: block;
  width: 100%;
  text-align: center;
}
.current-score h2 {
  color: #fff;
}

@media screen and (max-width: 450px) {
  .current-score {
    width: 105px;
  }
  .current-score span {
    font-size: 17px;
  }
}
@media screen and (max-width: 380px) {
  .current-score {
    width: 95px;
  }
}
@media screen and (max-width: 360px) {
  .current-score {
    width: 90px;
  }
  .current-score span {
    font-size: 15px;
  }
}
.auth-form-container {
  max-width: 320px;
  margin: 0 auto;
  padding: 16px;
}
.auth-form-container h2 {
  text-align: center;
  color: #5979ac;
}
.auth-form-container form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-form-container input {
  padding: 8px;
  border: 1px solid #d8cfc0;
  border-radius: 6px;
}
.auth-form-container button[type=submit] {
  background: #5979ac;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
}
.auth-form-container .auth-toggle {
  display: block;
  margin: 10px auto 0;
  background: transparent;
  border: none;
  color: #5979ac;
  cursor: pointer;
}
.auth-form-container .auth-error {
  color: #c0392b;
  font-size: 13px;
}
.auth-form-container .auth-info {
  color: #2e7d32;
  font-size: 13px;
}

.logout-btn {
  display: block;
  margin: 6px auto 0;
  background: transparent;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 13px;
}

.card-set-selector {
  background: #faf6ee;
  border: 1px solid #d8cfc0;
  border-radius: 10px;
  padding: 16px;
  max-width: 360px;
  margin: 0 auto;
}
.card-set-selector h2 {
  text-align: center;
  color: #5979ac;
}
.card-set-selector .card-set-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.card-set-selector .card-set-item {
  padding: 10px;
  border: 1px solid #d8cfc0;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  text-align: left;
}
.card-set-selector .card-set-item.active {
  background: #5979ac;
  color: white;
  border-color: #5979ac;
}

.set-selector-btn {
  display: block;
  margin: 6px auto 0;
  background: transparent;
  border: none;
  color: #5979ac;
  cursor: pointer;
  font-size: 13px;
}

/* Лендинг на весь экран — выходим из рамки .game-panel (position: fixed). */
.landing-screen {
  position: fixed;
  inset: 0; /* top/right/bottom/left: 0 → весь вьюпорт */
  z-index: 50;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end; /* контент в нижней трети (над пейзажем) */
  /* По умолчанию — вертикальный фон (мобилка) */
  background-image: url("public/bg-mobile.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Десктоп/планшет — широкий фон, контент по центру */
@media (min-width: 768px) {
  .landing-screen {
    background-image: url("public/bg-desktop.webp");
    justify-content: center;
  }
}
.lang-switcher-container {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
}

.landing-overlay {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #fff;
  padding: 0 24px;
  margin-bottom: 8vh;
}

@media (min-width: 768px) {
  .landing-overlay {
    margin-bottom: 0;
  }
}
.landing-title {
  font-size: 44px;
  margin: 0;
  letter-spacing: 1px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

.landing-subtitle {
  font-size: 18px;
  opacity: 0.95;
  margin: 8px 0 28px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.landing-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 260px;
}

.landing-btn {
  padding: 16px 24px;
  border-radius: 10px;
  border: none;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

/* Золотая кнопка «Играть» в тон арту */
.landing-btn.primary {
  background: linear-gradient(180deg, #f3d27a 0%, #d9a93a 100%);
  color: #1b2a5b;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.landing-btn.primary:hover:not(:disabled) {
  transform: translateY(-1px);
}

.landing-btn.primary:active:not(:disabled) {
  transform: translateY(1px);
}

.landing-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Серая кнопка-заглушка (регистрация — «скоро») */
.landing-btn.ghost {
  background: rgba(255, 255, 255, 0.16);
  color: #e9edf6;
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-weight: 600;
}

.landing-btn.secondary {
  background: #ffffff;
  color: #1b2a5b;
}

/* Контейнер для анимации появления */
.lang-switcher-container {
  display: inline-block;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  animation: fadeInSlide 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Основная кнопка */
.lang-switcher {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.lang-switcher:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.lang-switcher:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Иконка глобуса с анимацией */
.globe {
  font-size: 18px;
  line-height: 1;
  transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.lang-switcher:hover .globe {
  transform: rotate(15deg) scale(1.1);
}

/* Анимация вращения при клике */
.lang-switcher.spinning .globe {
  animation: spinGlobe 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes spinGlobe {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.2);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}
/* Текст языка */
.lang-label {
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}

.lang-switcher:active .lang-label {
  transform: scale(0.95);
}

/* Эффект ряби */
.ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease, opacity 0.6s ease;
  opacity: 0;
}

.lang-switcher:active .ripple {
  width: 200px;
  height: 200px;
  opacity: 0;
}

/* Анимация появления */
@keyframes fadeInSlide {
  0% {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
/* Градиентный блик */
.lang-switcher::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
  transform: rotate(45deg);
  transition: all 0.6s ease;
  opacity: 0;
}

.lang-switcher:hover::after {
  opacity: 1;
  transform: rotate(45deg) translate(20%, 20%);
}

.lang-switcher {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #d8cfc0;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-weight: bold;
  color: #5979ac;
}

.dashboard-screen {
  max-width: 400px;
  margin: 40px auto;
  padding: 20px;
  background: #faf6ee;
  border-radius: 10px;
  text-align: center;
}
.dashboard-screen h1 {
  color: #5979ac;
}
.dashboard-screen .dashboard-stats {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 16px 0;
}
.dashboard-screen .stat-card {
  background: white;
  border: 1px solid #d8cfc0;
  border-radius: 8px;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
}
.dashboard-screen .stat-label {
  font-size: 12px;
  color: #888;
}
.dashboard-screen .stat-value {
  font-size: 22px;
  font-weight: bold;
  color: #5979ac;
}
.dashboard-screen .dashboard-set-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 20px;
}
.dashboard-screen .dashboard-set-item {
  padding: 10px;
  border: 1px solid #d8cfc0;
  border-radius: 6px;
  background: white;
  cursor: pointer;
}
.dashboard-screen .dashboard-set-item.active {
  background: #5979ac;
  color: white;
}
.dashboard-screen .dashboard-play-btn {
  background: #5979ac;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
}
.dashboard-screen .dashboard-play-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =====================================================================
   Тема «Небесный пергамент» (glass на фоне арта).
   Импортируется последней — перекрывает базовые бежево-синие стили.
   ===================================================================== */
:root {
  --sm-navy: #1b2a5b;
  --sm-gold: #d9a93a;
  --sm-gold-2: #f3d27a;
  --sm-text: #eef1f8;
}

/* Фон-арт за всем приложением (как на лендинге) */
body {
  background-image: url("public/bg-mobile.webp");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

@media (min-width: 768px) {
  body {
    background-image: url("public/bg-desktop.webp");
  }
}
/* Панель игры — тёмно-синее стекло с золотой рамкой */
.game-panel {
  background: rgba(18, 26, 54, 0.55) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(243, 210, 122, 0.55) !important;
  border-radius: 14px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  color: var(--sm-text);
}

/* Плитки счёта / логотип-лидерборд — стекло с золотым кантом */
.score-board .logo,
.best-score,
.current-score {
  background: rgba(27, 42, 91, 0.55) !important;
  border: 1px solid rgba(243, 210, 122, 0.5) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.score-board .logo,
.score-board a {
  color: var(--sm-gold-2) !important;
}

.best-score h2,
.current-score h2 {
  color: var(--sm-gold-2) !important;
}

.best-score span,
.current-score span,
.best-score,
.current-score {
  color: var(--sm-text) !important;
}

/* Доска — глубокий синий «бархат» с золотой кромкой */
.chess-board {
  background-color: rgba(10, 18, 44, 0.45) !important;
  border: 1px solid rgba(243, 210, 122, 0.35);
}

/* Лицо карты — реальная картинка (из S3) */
.chess-board-card-container .card .front {
  border-radius: 8px !important;
  object-fit: cover;
  background: #0d1430; /* подложка, пока картинка грузится */
}

/* Рубашка — золотой градиент (div, без картинки), чтобы не было битого <img> */
.chess-board-card-container .card .back {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  backface-visibility: hidden;
  transform: rotateY(0deg);
  object-fit: cover; /* рубашка-картинка заполняет карту */
  background: linear-gradient(145deg, #f3d27a 0%, #d9a93a 55%, #b8860b 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.35);
}

/* Статус-строка и её кнопки */
.game-status-container {
  color: var(--sm-text);
}

.game-status-container button {
  color: var(--sm-gold-2) !important;
}

/* Дэшборд и выбор набора — в тон */
.dashboard-screen,
.card-set-selector {
  background: rgba(18, 26, 54, 0.6) !important;
  border: 1px solid rgba(243, 210, 122, 0.5) !important;
  color: var(--sm-text) !important;
}

.dashboard-screen h1,
.card-set-selector h2 {
  color: var(--sm-gold-2) !important;
}

.stat-card,
.dashboard-set-item,
.card-set-item {
  background: rgba(27, 42, 91, 0.5) !important;
  border: 1px solid rgba(243, 210, 122, 0.35) !important;
  color: var(--sm-text) !important;
}

.dashboard-set-item.active,
.card-set-item.active {
  background: rgba(217, 169, 58, 0.9) !important;
  color: var(--sm-navy) !important;
  border-color: rgba(243, 210, 122, 0.8) !important;
}

.stat-label {
  color: #c9d2e6 !important;
}

.stat-value {
  color: var(--sm-gold-2) !important;
}

.dashboard-play-btn {
  background: linear-gradient(180deg, #f3d27a 0%, #d9a93a 100%) !important;
  color: var(--sm-navy) !important;
  border: none !important;
  font-weight: 700 !important;
}

.set-selector-btn {
  color: var(--sm-gold-2) !important;
}
