body {
  background: #0f1720;
  color: white;
  font-family: Arial, sans-serif;
  text-align: center;
}

.table-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.controls-row + .table-wrapper {
  margin-top: 6px;
}

/* заголовки всегда видимы */
.header .cell {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  height: 48px;
  font-size: 14px;
  font-weight: 600;
  background: rgba(255,255,255,0.05);
  position: relative;
}

.green { background: #2ecc71; }
.yellow { background: #f1c40f; color: black; }
.red { background: #e74c3c; }

.hero-cell {
  padding: 0;
  border: none;
  background: transparent;
}

.hero-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-cell span {
  display: none; /* имя больше не занимает место */
}

.hero-cell::after {
  content: attr(data-hero-name);
  position: absolute;
  inset: 0;                    /* 🔥 занимает всю ячейку */

  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);

  background: rgba(0, 0, 0, 0.65); /* полупрозрачный слой */
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  padding: 6px;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 5;
}

.hero-cell:hover::after {
  opacity: 1;
}


.hero-cell:hover::after {
  opacity: 1;
}

.suggestions {
  width: 300px;
  margin: 0 auto;
  background: #111;
  border: 1px solid #333;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  position: relative;
  z-index: 3000;
}

.suggestion {
  padding: 6px;
  cursor: pointer;
  border-bottom: 1px solid #222;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
}

.move-speed-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;              /* расстояние между текстом и стрелкой */
}

.ms-value {
  font-weight: 500;
}

.ms-arrow-inline {
  transform: translateY(-1px);
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
}

.ms-arrow-inline.up {
  color: rgba(255, 255, 255, 0.9);
}

.ms-arrow-inline.down {
  color: rgba(0, 0, 0, 0.8);
}

.suggestion:hover {
  background: #333;
}

.input-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 4px;
}

.input-row input {
  width: 300px;
}

.input-wrapper {
  position: relative;
  width: 360px;      /* 🔥 фиксированная ширина */
  margin: 0 auto;    /* центр */
  z-index: 10;
}

.input-row {
  display: flex;
  gap: 8px;
}

.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: auto;

  background: #111;
  border: 1px solid #333;
  max-height: 200px;
  overflow-y: auto;

  display: none;
  z-index: 1000;
}

.header-cell {
  font-weight: bold;
  background: #222;
}

.game-message {
  margin-top: 20px;
  font-size: 20px;
  font-weight: bold;
  animation: popIn 0.3s ease-out;
}

.game-message.win {
  color: #2ecc71;
}

.game-message.lose {
  color: #e74c3c;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes rowAppear {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stats-box {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;          /* расстояние между пунктами */
  flex-wrap: wrap;   /* чтобы на маленьких экранах переносилось */
  font-size: 14px;
}

#stats {
  margin-top: 2px;   /* попробуй 8–12px */
}

@keyframes flipIn {
  0% {
    transform: rotateY(90deg);
    opacity: 0;
  }
  100% {
    transform: rotateY(0deg);
    opacity: 1;
  }
}

.cell.flip {
  opacity: 0;
  transform: rotateY(90deg);
  animation: flipIn 0.6s ease-out forwards;
}

.row {
  display: grid;
  grid-template-columns: repeat(8, 96px);
  gap: 8px;
  margin-bottom: 10px;
}


.cell {
  position: relative;

  opacity: 1;
  transform: none;

  width: 96px;
  height: 96px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.08);
  text-align: center;
  word-break: break-word;
}

.header {
  width: 100%;
}

.header {
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.suggestion img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.ms-arrow {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 18px;
  font-weight: bold;
  opacity: 0.9;
}

.ms-arrow.up::after {
  content: "▲"; 
}

.ms-arrow.down::after {
  content: "▼";
}

.ms-arrow.up {
  color: #ffffff;
}

.ms-arrow.down {
  color: #000000;
}

#heroInput {
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(46, 204, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

.start-hint {
  margin-top: 6px;
  font-size: 14px;
  opacity: 0.75;
  transition: opacity 0.3s ease;
}

.start-hint.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #0f1720;
  width: min(900px, 95%);
  max-height: 80vh;
  border-radius: 10px;
  padding: 16px;
  overflow: hidden;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.hero-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 12px 0;
}

.hero-tabs button {
  padding: 6px 12px;
  background: #1e2933;
  border: none;
  color: white;
  cursor: pointer;
  border-radius: 6px;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 72px);
  gap: 10px;
  justify-content: center;
  overflow-y: auto;
  padding: 10px;
}

.hero-smile {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 8px;
  padding: 6px;
  transition: background 0.15s, transform 0.15s;
}

.hero-smile:hover {
  background: rgba(255,255,255,0.08);
  transform: scale(1.05);
}

#gameMessage {
  margin: 2px 0;
  min-height: 0;
  display: none;
  font-size: 20px;
  font-weight: 600;
}

.hero-smile img {
  width: 75%;           /* ⬅️ −25% */
  height: auto;
  object-fit: contain;

  image-rendering: crisp-edges;
}

.hero-section {
  margin-bottom: 18px;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.hero-section h3 {
  margin: 10px 0 6px;
  font-size: 16px;
  font-weight: bold;
  opacity: 0.9;
  text-align: left;
}

.hero-section .hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 72px);
  gap: 10px;
  justify-content: flex-start;
}

h1 {
  margin-bottom: 10px; /* вместо дефолтных ~20px */
}

.controls-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  margin-bottom: 10px;
}

/* ВСЕ кнопки в ряду — одинаковые */
.controls-row button {
  width: 160px;          /* 🔥 фиксированная ширина */
  height: 44px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  background: #1e2933;
  color: white;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;

  font-size: 15px;
  font-weight: 500;
  cursor: pointer;

  transition: background 0.15s ease, transform 0.12s ease;
}

/* disabled — но размер тот же */
.controls-row button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}


.modal-content.small {
  max-width: 420px;
}

.modal-text {
  margin: 16px 0 20px;
  font-size: 15px;
  opacity: 0.85;
  text-align: center;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.top-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}


/* кнопки */
.btn-secondary {
  background: #1e2933;
  color: white;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-danger {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #263241;
}

.btn-danger:hover {
  background: #ff5c4d;
}

.modal-content.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.restart-title {
  margin: 10px 0 18px;
  font-size: 22px;
  font-weight: 600;
}

.back-home {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 3000;

  display: flex;
  align-items: center;
  gap: 6px;

  padding: 8px 14px;
  background: rgba(30, 41, 51, 0.9);
  color: white;
  text-decoration: none;

  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;

  font-size: 14px;
  font-weight: 500;

  transition: background 0.2s ease, transform 0.15s ease;
}

.back-home:hover {
  background: rgba(38, 50, 65, 1);
  transform: translateX(-2px);
}

.back-home:active {
  transform: scale(0.96);
}

/* затемнённый фон */
.win-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 5000;

  display: flex;
  align-items: center;
  justify-content: center;

  animation: fadeIn 0.3s ease;
}

/* победная карточка */
.win-box {
  background: linear-gradient(145deg, #1e2933, #0f1720);
  border-radius: 16px;
  padding: 36px 48px;

  text-align: center;
  box-shadow: 0 0 40px rgba(46, 204, 113, 0.4);

  animation: winPop 0.45s ease-out;
}

/* YOU WIN */
.win-title {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #2ecc71;

  text-shadow:
    0 0 12px rgba(46,204,113,0.8),
    0 0 24px rgba(46,204,113,0.4);

  margin-bottom: 12px;
}

/* имя героя */
.win-hero {
  font-size: 26px;
  font-weight: 600;
  color: white;
  margin-bottom: 6px;
}

/* подзаголовок */
.win-sub {
  font-size: 14px;
  opacity: 0.8;
}

/* анимации */
@keyframes winPop {
  0% {
    transform: scale(0.85);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.win-close {
  position: absolute;
  top: 14px;
  right: 16px;

  background: none;
  border: none;
  color: rgba(255,255,255,0.7);

  font-size: 20px;
  cursor: pointer;

  transition: color 0.15s ease, transform 0.15s ease;
}

.win-close:hover {
  color: white;
  transform: scale(1.1);
}

.win-close:active {
  transform: scale(0.95);
}

.voice-quote {
  margin: 14px auto;
  font-size: 18px;
  font-style: italic;
  opacity: 0.9;
  max-width: 600px;
}

.hint-attribute {
  margin-top: 10px;
  font-size: 16px;
  font-weight: 600;
  color: #f1c40f;
}

.hint-attribute.hidden {
  display: none;
}


/* Контейнер всех попыток */
#results {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px; /* 🔥 расстояние между карточками */
}

.voice-attempt {
  width: 170px;          /* было ~150 */
  padding: 14px 10px 14px;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;

  border-radius: 16px;
  font-weight: 600;
  text-align: center;

  color: white;
}

/* Красная / зелёная */
.voice-attempt.red {
  background: #e74c3c;
}

.voice-attempt.green {
  background: #2ecc71;
}

.voice-attempt img {
  width: 120px;          /* 🔥 больше почти в 2 раза */
  height: 120px;

  object-fit: cover;

  border-radius: 12px;

  background: none;      /* ❌ убираем квадрат */
  padding: 0;            /* ❌ убираем внутренний отступ */
}

.voice-attempt .hero-name {
  font-size: 14px;
  line-height: 1.2;
  opacity: 0.95;
}

.hints {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 12px 0;
}

.hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;

  opacity: 0.9;
}

.hint img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.hint span {
  font-size: 13px;
  opacity: 0.8;
}

.hidden {
  display: none;
}

.voice-controls {
  margin-top: 10px;

  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 5;
}

/* кнопка Voice такая же, как остальные */
.voice-controls button {
  width: 160px;
  height: 44px;

  background: #1e2933;
  color: white;

  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;

  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  z-index: 10; /* 🔥 кнопка выше слайдера */
}

/* ползунок громкости */
#volumeSlider {
  width: 120px;
  cursor: pointer;
  position: relative;
  z-index: 1;
  pointer-events: auto;
  height: 6px;
}

.voice-controls button:hover:not(:disabled) {
  background: #263241;
}

.voice-controls button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ===== BACKGROUND IMAGE ===== */
body {
  position: relative;
  min-height: 100vh;
  background: #000; /* запасной цвет */
  overflow-x: hidden;
}

/* Картинка фона */
body::before {
  content: "";
  position: fixed;
  inset: 0;

  background-image: url("../../photo/loadingscreen_tga1.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  z-index: -2;
}

/* Затемнение поверх картинки */
body::after {
  content: "";
  position: fixed;
  inset: 0;

  background: rgba(0, 0, 0, 0.7); /* 🔥 уровень затемнения */
  z-index: -1;
}




