/* =========================================================
   ИМАДЖИНАРИУМ — СТИЛИ ИНТЕРФЕЙСА (ЧАСТЬ 1)
   ========================================================= */

:root {
  --bg-dark: #0c1824;
  --gold-primary: #ebb11b;
  --gold-hover: #f5be38;
  --gold-active: #d69c10;
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-pill: rgba(255, 255, 255, 0.15);
  --glass-pill-hover: rgba(255, 255, 255, 0.25);
  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.7);
  --card-radius: 18px;
}

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

input, textarea {
  user-select: text !important;
  -webkit-user-select: text !important;
  cursor: text !important;
  pointer-events: auto !important;
}

button, .pill-btn, .btn, .btn-hero-gold, .color-bubble, .btn-close-modal, .deck-card-item, .chip {
  cursor: pointer !important;
  pointer-events: auto !important;
}

.hidden {
  display: none !important;
}

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-dark);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ==================== ВОЛШЕБНЫЙ ФОН СО СКРИНШОТА ==================== */
#ambient-canvas-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  background: 
    radial-gradient(ellipse at 72% 38%, rgba(220, 145, 30, 0.42) 0%, transparent 46%),
    radial-gradient(ellipse at 15% 18%, rgba(22, 130, 142, 0.65) 0%, transparent 52%),
    radial-gradient(circle at 88% 85%, rgba(55, 20, 75, 0.85) 0%, transparent 55%),
    radial-gradient(circle at 10% 85%, rgba(10, 45, 60, 0.7) 0%, transparent 50%),
    #0c1824;
}

canvas#stars-canvas {
  width: 100%;
  height: 100%;
}

/* ==================== ЭКРАНЫ ==================== */
.screen-view {
  display: none;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 24px 48px;
}

.screen-view.active {
  display: flex;
  flex-direction: column;
}

/* ==================== ГЛАВНЫЙ ЭКРАН (LANDING) ==================== */
.landing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding-bottom: 20px;
}

/* Кнопка «Представиться» */
.pill-btn.profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-pill);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  padding: 10px 22px 10px 14px;
  border-radius: 30px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
}

.pill-btn.profile-pill:hover {
  background: var(--glass-pill-hover);
  transform: translateY(-1px);
}

.user-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-circle-btn {
  background: var(--glass-pill);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.icon-circle-btn:hover {
  background: var(--glass-pill-hover);
}

/* Основной контент Hero */
.landing-hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  gap: 40px;
}

.hero-left {
  display: flex;
  flex-direction: column;
  gap: 36px;
  max-width: 520px;
}

/* Логотип «ИмаджинариуМ» */
.brand-title {
  font-family: 'Playfair Display', serif;
  font-size: 72px;
  font-weight: 700;
  letter-spacing: -1px;
  color: #ffffff;
  display: inline-flex;
  align-items: baseline;
  position: relative;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.word-accent {
  font-style: italic;
  font-weight: 800;
  margin: 0 2px;
}

.letter-m-wrap {
  position: relative;
  display: inline-block;
}

/* Крылатый слоник на букве «М» */
.logo-flying-elephant {
  position: absolute;
  top: -26px;
  right: -34px;
  width: 64px;
  height: 56px;
  filter: drop-shadow(0 4px 12px rgba(235, 40, 130, 0.45));
  animation: elephantHover 3.2s ease-in-out infinite alternate;
}

@keyframes elephantHover {
  0% { transform: translateY(0px) rotate(-3deg); }
  100% { transform: translateY(-7px) rotate(4deg); }
}

/* Большая золотая кнопка «ИГРАТЬ» */
.btn-hero-gold {
  background: linear-gradient(180deg, var(--gold-hover) 0%, var(--gold-primary) 50%, var(--gold-active) 100%);
  color: #2b1700;
  font-family: 'Nunito', sans-serif;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 1.5px;
  padding: 16px 54px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(235, 177, 27, 0.38), 0 2px 0 rgba(255, 255, 255, 0.4) inset;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-block;
  width: fit-content;
}

.btn-hero-gold:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 16px 32px rgba(235, 177, 27, 0.5), 0 2px 0 rgba(255, 255, 255, 0.5) inset;
}

.btn-hero-gold:active {
  transform: translateY(1px) scale(0.98);
}

/* ==================== ПРАВАЯ ЧАСТЬ: КАРТОЧКА С ЛЕТАЮЩИМИ ТЕГАМИ ==================== */
.hero-right {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.showcase-card-container {
  position: relative;
  width: 320px;
  height: 480px;
}

.showcase-card-frame {
  width: 100%;
  height: 100%;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.65),
    0 0 40px rgba(235, 177, 27, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.25);
  transform: rotate(1.5deg);
  transition: transform 0.4s ease;
  position: relative;
}

.showcase-card-frame:hover {
  transform: rotate(0deg) scale(1.03);
}

.showcase-card-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Плавающие полупрозрачные плашки ассоциаций */
.floating-tag {
  position: absolute;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  z-index: 2;
  pointer-events: none;
}

.tag-top-right {
  top: 30px;
  right: -50px;
  animation: tagFloat1 4s ease-in-out infinite alternate;
}

.tag-mid-left {
  top: 140px;
  left: -65px;
  animation: tagFloat2 4.5s ease-in-out infinite alternate;
}

.tag-bot-right {
  bottom: 80px;
  right: -40px;
  animation: tagFloat3 5s ease-in-out infinite alternate;
}

@keyframes tagFloat1 {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-8px) rotate(-1deg); }
}
@keyframes tagFloat2 {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(7px) rotate(1.5deg); }
}
@keyframes tagFloat3 {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-6px) rotate(-1deg); }
}

/* ==================== СТЕКЛЯННЫЕ ПАНЕЛИ И МОДАЛКИ ==================== */
.glass-panel {
  background: rgba(14, 25, 38, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 18, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.25s ease;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-window {
  width: 100%;
  max-width: 480px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: modalPop 0.25s ease-out;
}

@keyframes modalPop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 22px;
  font-weight: 800;
}

.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}

.btn-close-modal:hover {
  color: #fff;
}

/* Кнопки общие */
.btn {
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-gold {
  background: linear-gradient(180deg, var(--gold-hover), var(--gold-primary));
  color: #2b1700;
}

.btn-gold:hover {
  background: var(--gold-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--glass-pill);
  border: 1px solid var(--glass-border);
  color: #fff;
}

.btn-outline:hover {
  background: var(--glass-pill-hover);
}

.btn-block {
  width: 100%;
}

/* Поля ввода */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

input[type="text"] {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus {
  border-color: var(--gold-primary);
}

/* Выбор цвета слоника */
.color-bubbles-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-bubble {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s, border-color 0.2s;
}

.color-bubble:hover {
  transform: scale(1.15);
}

.color-bubble.active {
  border-color: #ffffff;
  transform: scale(1.2);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
}

/* Тост уведомление */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 28, 40, 0.92);
  border: 1px solid var(--gold-primary);
  color: #fff;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 14px;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.25s ease;
}

.toast.hidden { display: none; }

@keyframes toastIn {
  0% { transform: translate(-50%, -15px); opacity: 0; }
  100% { transform: translate(-50%, 0); opacity: 1; }
}

/* ==================== АДАПТИВНОСТЬ ПОД МОБИЛЬНЫЕ ==================== */
@media (max-width: 900px) {
  .screen-view {
    padding: 16px 20px;
  }
  .landing-hero {
    flex-direction: column;
    text-align: center;
    gap: 30px;
    margin-top: 10px;
  }
  .hero-left {
    align-items: center;
    max-width: 100%;
  }
  .brand-title {
    font-size: 48px;
  }
  .logo-flying-elephant {
    width: 48px;
    height: 42px;
    top: -20px;
    right: -24px;
  }
  .showcase-card-container {
    width: 240px;
    height: 360px;
  }
  .floating-tag {
    font-size: 12px;
    padding: 6px 14px;
  }
  .tag-top-right { right: -25px; }
  .tag-mid-left { left: -30px; }
  .tag-bot-right { right: -20px; }
}


/* ==================== СТИЛИ ЛОББИ И ВЫБОРА КОЛОД ==================== */
.lobby-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.btn-icon-back {
  background: var(--glass-pill);
  border: 1px solid var(--glass-border);
  color: #fff;
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s;
}

.btn-icon-back:hover {
  background: var(--glass-pill-hover);
}

.lobby-code-chip {
  background: var(--glass-pill);
  border: 1px solid var(--gold-primary);
  padding: 8px 20px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s;
}

.lobby-code-chip:hover {
  background: rgba(235, 177, 27, 0.2);
}

.lobby-code-chip b {
  color: var(--gold-primary);
  letter-spacing: 2px;
}

.lobby-container {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  flex: 1;
}

.lobby-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title-row h3 {
  font-size: 18px;
  font-weight: 800;
}

.btn-xs-pill {
  background: rgba(59, 130, 246, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.5);
  color: #93c5fd;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.btn-xs-pill:hover {
  background: rgba(59, 130, 246, 0.4);
}

.btn-xs-link {
  background: none;
  border: none;
  color: var(--gold-primary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  margin-left: 8px;
  text-decoration: underline;
}

/* Список игроков */
.lobby-players-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  overflow-y: auto;
}

.player-lobby-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 10px 16px;
  border-radius: 14px;
}

.player-badge-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.elephant-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}

.player-badge-name {
  font-weight: 700;
  font-size: 15px;
}

.host-tag {
  font-size: 11px;
  background: rgba(235, 177, 27, 0.2);
  color: var(--gold-primary);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 800;
}

/* Сетка колод */
.decks-scroll-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  max-height: 440px;
  overflow-y: auto;
  padding-right: 6px;
}

.deck-card-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.deck-card-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.deck-card-item.selected {
  border-color: var(--gold-primary);
  background: rgba(235, 177, 27, 0.12);
}

.deck-thumb-wrap {
  width: 48px;
  height: 70px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #000;
}

.deck-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.deck-item-info {
  flex: 1;
}

.deck-item-name {
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 2px;
}

.deck-item-count {
  font-size: 12px;
  color: var(--text-muted);
}

.deck-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--gold-primary);
  cursor: pointer;
}

.lobby-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
}

.cards-count-info {
  font-size: 15px;
  color: var(--text-muted);
}

.cards-count-info b {
  color: #fff;
  font-size: 18px;
}

.btn-xl {
  padding: 14px 40px;
  font-size: 17px;
}

/* ==================== ИГРОВОЙ ЭКРАН ==================== */
.game-hud-bar {
  padding: 14px 24px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hud-stats {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hud-pill {
  background: rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.25s ease;
}

.hud-pill b {
  color: var(--gold-primary);
}

.hud-pill.role-leader-badge {
  background: linear-gradient(135deg, rgba(235, 177, 27, 0.35), rgba(245, 158, 11, 0.22));
  border: 1.5px solid var(--gold-primary);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(235, 177, 27, 0.45);
  animation: leaderPillGlow 2.2s ease-in-out infinite;
  letter-spacing: 0.5px;
}

@keyframes leaderPillGlow {
  0%, 100% {
    box-shadow: 0 0 12px rgba(235, 177, 27, 0.4);
    border-color: var(--gold-primary);
  }
  50% {
    box-shadow: 0 0 24px rgba(235, 177, 27, 0.85);
    border-color: #fde047;
  }
}

.btn-icon-exit {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.btn-icon-exit:hover {
  background: rgba(239, 68, 68, 0.35);
  border-color: rgba(239, 68, 68, 0.7);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Дорожка слоников */
.elephants-track-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}

.elephants-track {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 800px;
  padding: 6px 0;
}

.track-step {
  width: 32px;
  height: 48px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  font-size: 11px;
  color: var(--text-muted);
  position: relative;
  padding-bottom: 4px;
}

.track-step.finish {
  border-color: var(--gold-primary);
  background: rgba(235, 177, 27, 0.15);
}

.track-elephant-icon {
  position: absolute;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: 0 0 6px currentColor;
  transition: all 0.4s ease;
}

/* Игровой стол и баннер загадки */
.game-center-board {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.clue-banner {
  width: 100%;
  max-width: 800px;
  padding: 16px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.35s ease;
}

.clue-banner.leader-active {
  background: linear-gradient(135deg, rgba(235, 177, 27, 0.22), rgba(14, 25, 38, 0.88));
  border: 2px solid var(--gold-primary);
  box-shadow: 0 0 35px rgba(235, 177, 27, 0.35);
  animation: leaderBannerGlow 3s ease-in-out infinite alternate;
}

@keyframes leaderBannerGlow {
  0% {
    border-color: var(--gold-primary);
    box-shadow: 0 0 20px rgba(235, 177, 27, 0.3);
  }
  100% {
    border-color: #fde047;
    box-shadow: 0 0 42px rgba(235, 177, 27, 0.6);
  }
}

.leader-banner-pill {
  display: inline-block;
  background: linear-gradient(180deg, var(--gold-hover), var(--gold-primary));
  color: #2b1700;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 5px 18px;
  border-radius: 20px;
  box-shadow: 0 4px 14px rgba(235, 177, 27, 0.4);
  margin-bottom: 4px;
}

.clue-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold-primary);
  font-weight: 800;
}

.clue-phrase {
  font-size: 24px;
  font-weight: 800;
  font-family: 'Playfair Display', serif;
}

.clue-instruction {
  font-size: 13px;
  color: var(--text-muted);
}

.table-felt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.table-cards-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  align-items: center;
  max-width: 960px;
}

.board-card-wrap {
  width: 140px;
  height: 210px;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.25s ease;
}

.board-card-wrap:hover {
  transform: translateY(-6px) scale(1.04);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.7);
}

.board-card-wrap.voted {
  border-color: var(--gold-primary);
}

.board-card-wrap.my-card {
  opacity: 0.6;
  cursor: not-allowed;
}

.board-card-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.board-card-number {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
}

.card-back-pattern {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, #2d1345, #0c1824);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

/* Рука игрока внизу */
.player-hand-wrapper {
  margin-top: 14px;
  padding: 12px 20px 8px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hand-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hand-bar-title span:first-child {
  font-weight: 800;
  font-size: 15px;
}

.hand-state-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: 12px;
}

.player-hand-cards {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 24px 10px 12px 10px;
  align-items: flex-end;
}

.hand-card {
  width: 112px;
  height: 168px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  transition: transform 0.22s ease-out, border-color 0.22s ease-out, box-shadow 0.22s ease-out;
  border: 2px solid transparent;
  transform-origin: center bottom;
}

.hand-card:hover {
  transform: translateY(-10px) scale(1.04);
  border-color: var(--gold-primary);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.7), 0 0 16px rgba(235, 177, 27, 0.4);
  z-index: 10;
}

.hand-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Модалки карточки и итогов */
.chosen-card-centered {
  display: flex;
  justify-content: center;
  margin: 12px 0;
}

.chosen-card-centered img {
  width: 130px;
  height: 195px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chosen-card-centered img:hover {
  transform: scale(1.05);
  box-shadow: 0 14px 30px rgba(235, 177, 27, 0.4);
}

.quick-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.chip {
  background: var(--glass-pill);
  border: 1px solid var(--glass-border);
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 12px;
  cursor: pointer;
}

.chip:hover {
  background: var(--glass-pill-hover);
}

/* Модалка зума */
.zoom-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.zoom-box img {
  max-width: 85vw;
  max-height: 75vh;
  border-radius: 18px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.8);
}

.zoom-close-btn {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 36px;
  cursor: pointer;
}

/* Модалка результатов раунда */
.results-modal-window {
  max-width: 680px;
}

.results-clue-recap {
  font-size: 20px;
  text-align: center;
  font-weight: 800;
  color: var(--gold-primary);
  margin-bottom: 16px;
}

.results-cards-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 10px 0;
}

.result-card-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 120px;
  flex-shrink: 0;
}

.result-card-col img {
  width: 100%;
  height: 180px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid transparent;
}

.result-card-col.leader img {
  border-color: var(--gold-primary);
  box-shadow: 0 0 16px rgba(235, 177, 27, 0.6);
}

.card-owner-name {
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.card-voters-list {
  display: flex;
  gap: 4px;
}


/* ==================== ПРЕДПРОСМОТР КОЛОДЫ И ПЕРЕДАЧА ХОСТА ==================== */
.btn-transfer-host {
  background: rgba(235, 177, 27, 0.15);
  border: 1px solid rgba(235, 177, 27, 0.4);
  color: var(--gold-primary);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-transfer-host:hover {
  background: rgba(235, 177, 27, 0.35);
  transform: translateY(-1px);
}

.deck-thumb-wrap {
  position: relative;
  cursor: pointer;
}

.deck-preview-badge {
  position: absolute;
  bottom: 2px;
  left: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
  border-radius: 4px;
  padding: 2px 0;
  letter-spacing: 0.5px;
}

.deck-preview-window {
  max-width: 900px;
  width: 92vw;
}

.deck-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  padding: 6px;
}

.deck-preview-card {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.deck-preview-card:hover {
  transform: translateY(-4px) scale(1.06);
  border-color: var(--gold-primary);
}

.deck-preview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ==================== АВТОРСКАЯ ПЛАШКА (MADE BY REWZZZI) ==================== */
.landing-bottom-right {
  position: absolute;
  bottom: 24px;
  right: 36px;
  z-index: 25;
}

.credit-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: rgba(14, 25, 38, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 8px 18px;
  border-radius: 30px;
  color: #a0aec0;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  user-select: none;
}

.credit-badge b {
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0.5px;
  transition: color 0.2s;
}

.credit-badge .github-icon {
  fill: #a0aec0;
  transition: all 0.2s ease;
}

.credit-badge:hover {
  background: rgba(235, 177, 27, 0.16);
  border-color: rgba(235, 177, 27, 0.6);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(235, 177, 27, 0.25);
}

.credit-badge:hover b {
  color: var(--gold-primary);
}

.credit-badge:hover .github-icon {
  fill: var(--gold-primary);
  transform: scale(1.15) rotate(-6deg);
}

@media (max-width: 768px) {
  .landing-bottom-right {
    bottom: 16px;
    right: 16px;
  }
  .credit-badge {
    padding: 6px 14px;
    font-size: 12px;
  }
}

/* ==================== НАСТРОЙКИ ЛОББИ И GAME OVER ==================== */
.lobby-settings-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px 18px;
  margin-top: 10px;
}

.setting-block {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.setting-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-muted);
}

.setting-chips {
  display: flex;
  gap: 6px;
  align-items: center;
}

.setting-chip {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #d1d5db;
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.setting-chip:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.setting-chip.active {
  background: rgba(235, 177, 27, 0.25);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  font-weight: 800;
  box-shadow: 0 0 10px rgba(235, 177, 27, 0.3);
}

.setting-chip:disabled {
  cursor: default;
  opacity: 0.65;
}

.setting-chip.active:disabled {
  opacity: 1;
}

/* Модалка финала игры (Game Over) */
.game-over-window {
  max-width: 520px;
  width: 95vw;
  text-align: center;
  animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.game-over-headline {
  font-size: 26px;
  font-weight: 900;
  color: var(--gold-primary);
  letter-spacing: 0.5px;
}

.winner-spotlight {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(235, 177, 27, 0.18), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(235, 177, 27, 0.35);
  border-radius: 16px;
  margin-bottom: 16px;
}

.winner-elephant-wrap {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  box-shadow: 0 0 25px rgba(235, 177, 27, 0.6);
  border: 2px solid var(--gold-primary);
  animation: winnerBounce 2s infinite ease-in-out;
}

@keyframes winnerBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.08); }
}

.winner-name {
  font-size: 20px;
  font-weight: 900;
  color: #fff;
}

.winner-score-tag {
  font-size: 14px;
  color: var(--gold-primary);
  font-weight: 800;
}

.ranks-section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 800;
  margin-bottom: 10px;
  text-align: left;
}

.game-over-ranks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 10px;
}

.rank-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.rank-row-item.first-place {
  background: rgba(235, 177, 27, 0.14);
  border-color: rgba(235, 177, 27, 0.4);
}

.rank-place-badge {
  font-weight: 900;
  font-size: 15px;
  width: 30px;
  text-align: left;
}

.rank-player-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.rank-player-score {
  font-weight: 900;
  font-size: 16px;
  color: var(--gold-primary);
}


