button,
a {
  outline: none;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}

body {
  margin: 0;
  font-family: sans-serif;
  background: linear-gradient(to bottom, #3b5c27, #6c9d33 70%);
  color: white;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  position: relative;
}

/* Верхний и нижний фон */
body::before,
body::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 120px;
  background-size: 100% auto;
  transform: rotate(180deg);
  z-index: 0;
}
body::before {
  top: 0;
  background: url("ball.svg") no-repeat center top;
}
body::after {
  bottom: 0;
  background: url("gate.svg") no-repeat center bottom;
}

.game-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.game-title {
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 2px;
}

.coefficient {
  font-size: 16px;
  background-color: #f0ca84;
  color: black;
  padding: 2px 14px;
  border-radius: 20px;
  border: 2px solid #be8c45;
  font-weight: bold;
  margin: 40px 0;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  max-width: 380px;
}

.cell {
  background-color: #afc594;
  border-radius: 6px;
  width: 48px;
  height: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
}

.cell.active-col {
  background-color: #ffffff !important;
}

.cell.ball::after {
  content: "⚽";
  font-size: 24px;
}

.cell.trail::after {
  content: "⚪";
  opacity: 0.6;
  font-size: 24px;
}

.button-container {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  justify-content: center;
  background-color: #2a4e0d;
  border-radius: 15px;
  padding: 10px 10px;
  width: min(90%, 400px);
  max-width: 100%;
  flex-wrap: nowrap; /* ключевой момент: НЕ РАЗРЕШАЕМ ПЕРЕНОС */
}

.btn,
a.btn {
  height: min(40px, 10vw);
  background: linear-gradient(to right, #49752e 0%, #6abd0c 70%, #49752e 100%);
  color: #fff;
  border: 2px solid #222;
  border-radius: 15px;
  font-weight: bold;
  cursor: pointer;
  font-size: clamp(12px, 2.5vw, 14px);
  padding: 0 16px;
  flex: 1 1 auto; /* одинаковая ширина */
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn:active,
a.btn:active {
  transform: scale(0.96);
}

.btn-finished {
  background: #be8c45 !important;
  color: #fff !important;
  border-color: #222;
}
