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

body {
  font-family: 'Arial Black', Impact, sans-serif;
  color: #fff;
  background: linear-gradient(180deg, #081128, #0F172A, #182048);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  user-select: none;
  overflow: hidden;
}

/* ---------- Header ---------- */
header {
  width: 100%;
  padding: 15px;
  text-align: center;
  position: relative;
}

header h1 {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.45);
}

/* ---------- Language Switch ---------- */
.lang-switch {
  position: absolute;
  right: 15px;
  top: 15px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-switch img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}

.lang-switch span {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.lang-switch .active {
  opacity: 1;
}

/* ---------- Main Menu ---------- */
.main-menu {
  height: 100vh;
  overflow: hidden;
}

.main-menu .games-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 20px;
  padding: 15px;
  overflow-y: auto;
  flex: 1;
}

.game-card {
  width: 90%;
  background: rgba(255,255,255,0.05);
  border-radius: 14px;
  text-align: center;
  padding: 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(255,255,255,0.2);
}

/* ---------- Golden Frame ---------- */
.icon-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #F5D36B;
  border-radius: 18px;
  box-shadow: 0 0 12px rgba(245, 211, 107, 0.5);
  width: 60%;
  margin: 0 auto;
  overflow: hidden;
  background: rgba(255, 215, 100, 0.08);
}

.icon-frame img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 18px;
}

.game-title {
  margin-top: 10px;
  font-weight: bold;
  font-size: 16px;
}

/* ---------- Common Mines Container ---------- */
.mines-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  height: calc(100vh - 80px);
  width: 100%;
}

.grid {
  display: grid;
  grid-template-columns: repeat(5, 64px);
  gap: 10px;
  justify-content: center;
  align-content: center;
}

.cell {
  width: 64px;
  height: 64px;
  background: #1e2a4a;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.cell.opened {
  background: #0ea5e9;
  transform: scale(1.1);
}

.cell img {
  width: 70%;
  height: auto;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cell.opened img {
  opacity: 1;
}

/* ---------- Traps Selector ---------- */
.trap-select {
  text-align: center;
  margin-top: 10px;
}

.trap-select p {
  font-size: 16px;
  margin-bottom: 6px;
}

.trap-select .selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  font-size: 16px;
  font-weight: bold;
}

.trap-select button {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 5px 10px;
}

/* ---------- Buttons ---------- */
.action-btn {
  width: 80%;
  padding: 12px;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  border: none;
  border-radius: 12px;
  font-weight: bold;
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.action-btn:hover:not(:disabled) {
  transform: scale(1.03);
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.menu-btn {
  width: 80%;
  padding: 12px;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  border: none;
  border-radius: 12px;
  font-weight: bold;
  color: white;
  font-size: 18px;
  cursor: pointer;
}

/* ---------- MINES 2 Theme ---------- */
.mines2-game {
  background: linear-gradient(180deg, #111111, #1f1f1f);
}

/* ---------- CoinFlip Layout Centered ---------- */
.coinflip-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 35%, #3b3b3b 0%, #333334 40%, #000000 100%);
}

.coinflip-page header {
  width: 100%;
  text-align: center;
  padding: 15px 0 5px;
  position: relative;
}

.coinflip-page .lang-switch {
  position: absolute;
  right: 15px;
  top: 15px;
}

.coinflip-page h1 {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #ffffff;          /* чисто белая надпись */
  text-shadow: none;       /* убираем свечение */
}

/* Центрирование монетки и кнопок */
.coin-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 30px;
  width: 100%;
  margin-top: 20px;
}

/* Увеличенная монетка */
.coin {
  position: relative;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  transform-style: preserve-3d;
  transition: transform 1s cubic-bezier(0.4, 0.2, 0.3, 1);
  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.25),
    inset 0 2px 4px rgba(255, 255, 255, 0.2),
    inset 0 -4px 6px rgba(0, 0, 0, 0.25);
}

/* Внутренняя структура монеты */
.coin-face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 4px 8px rgba(255, 255, 255, 0.3),
    inset 0 -4px 10px rgba(0, 0, 0, 0.3);
}

.coin-front {
  background: radial-gradient(circle at 30% 30%, #FFF8C1, #E8C547, #C6A520);
  border: 3px solid rgba(255, 230, 120, 0.6);
}

.coin-back {
  background: radial-gradient(circle at 30% 30%, #F5F8FA, #CBD6E0, #9CAFBF);
  border: 3px solid rgba(210, 220, 230, 0.6);
  transform: rotateY(180deg);
}

.coin-text {
  font-size: 20px;
  font-weight: 900;
  color: rgba(0, 0, 0, 0.55);
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8),
    0 -1px 2px rgba(0, 0, 0, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
  letter-spacing: 1px;
}

.coin.glow-gold {
  box-shadow: 0 0 35px 10px rgba(255, 200, 50, 0.6);
}

.coin.glow-silver {
  box-shadow: 0 0 35px 10px rgba(210, 230, 255, 0.7);
}

/* Отступы кнопок */
.action-btn, .menu-btn {
  width: 80%;
  max-width: 300px;
}

.menu-btn {
  margin-top: -10px;
}

/* Адаптив под маленькие экраны */
@media (max-height: 720px) {
  .coin {
    width: 200px;
    height: 200px;
  }
  .coin-container {
    gap: 20px;
    margin-top: 10px;
  }
}