body {
  margin: 0;
  overflow: hidden;
  overflow-x: hidden;
  background: #111;
  font-family: Arial, sans-serif;
  color: white;
}

/* canvas */
#game {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 0;
  pointer-events: none;
  touch-action: none;
}

#abilityBar {
  position: fixed;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(440px, calc(100vw - 16px));
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  z-index: 10001;
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
}

#abilityBar.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.abilityBtn {
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(0,0,0,0.7);
  color: white;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  letter-spacing: 0;
  min-width: 0;
  width: 100%;
  padding:10px 6px;
  border:none;
  border-radius:8px;
  cursor:pointer;
  color:white;
  font-weight:bold;
  font-size:13px;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
  background: linear-gradient(135deg,#111,#222);
  border:1px solid rgba(0,255,255,0.35);
  box-shadow:
    0 0 8px rgba(0,255,255,.25),
    inset 0 0 8px rgba(255,255,255,.05);
  transition: .18s ease;
  position: relative;
  overflow: hidden;
}

/* 🔥 верхняя панель */
#topBar {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  transform: translateY(0);

  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background: linear-gradient(180deg, rgba(0,0,0,0.8), rgba(0,0,0,0.4));
  display: none;
  align-items: center;
  padding: 0 20px;
  box-sizing: border-box;
  z-index: 100;
}

#topBar.hidden {
  opacity: 0;
  transform: translateY(-100%);
}

/* кнопки */
#startBtn, #restartBtn, #menuBtn {
  padding: 8px 12px;
  font-size: 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin: 0 5px;
  height: 36px;
  box-sizing: border-box;
  line-height: 1;

  background: rgba(255,255,255,0.1);
  color: white;
  transition: all 0.2s ease;
  transform: scale(1);
}

#startBtn:hover, #restartBtn:hover, #menuBtn:hover {
  transform: scale(1.05);
  filter: brightness(1.2);
  background: rgba(255,255,255,0.2);
}

#startBtn:active, #restartBtn:active, #menuBtn:active {
  transform: scale(0.95);
  transition: all 0.1s ease;
}

#restartBtn {
  margin-right: 5px;
}

#menuBtn {
  margin-left: 5px;
}

/* title */
#title {
  font-size: 14px;
  font-weight: bold;
}

/* панель */
#uiPanel {
  display: none;
  border: 1px solid rgba(0,255,255,0.2);
  box-shadow:
    0 0 10px rgba(0,255,255,0.2),
    inset 0 0 10px rgba(0,255,255,0.1);
  position: fixed;
  right: 15px;
  top: 60px;
  z-index: 10;

  width: 160px;
  max-height: 30vh;
  overflow-y: auto;

  padding: 8px;
  border-radius: 10px;

  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
}

#activeEffectsHud {
  position: fixed;
  top: 60px;
  right: 15px;
  z-index: 11;
  display: none;
  width: min(280px, calc(100vw - 235px));
  left: 315px;
  max-height: 34vh;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  background: rgba(0,0,0,0.52);
  backdrop-filter: blur(10px);
  box-shadow:
    0 0 10px rgba(0,255,255,0.18),
    inset 0 0 10px rgba(255,255,255,0.06);
}

/* ===== BETTING PANEL ===== */
#bettingPanel {
  position: fixed;
  top: 60px;
  left: 15px;
  width: 280px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 12px;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(15px);
  box-shadow:
    0 0 20px rgba(255,215,0,0.2),
    inset 0 0 20px rgba(255,215,0,0.05);
  z-index: 10;
  display: none;
  color: white;
}

#bettingPanel.show {
  display: block;
  animation: betPanelSlideIn 0.3s ease;
}

@keyframes betPanelSlideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.bettingHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,215,0,0.3);
}

.bettingTitle {
  font-size: 16px;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255,215,0,0.5);
}

.balanceDisplay {
  font-size: 14px;
  color: #00ff9f;
  font-weight: bold;
}

#balanceAmount {
  color: #ffd700;
  text-shadow: 0 0 5px rgba(255,215,0,0.5);
}

.sectionLabel {
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 8px;
  color: rgba(255,255,255,0.8);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.betInfoSection {
  margin-bottom: 15px;
  padding: 10px;
  background: rgba(255,215,0,0.1);
  border: 1px solid rgba(255,215,0,0.2);
  border-radius: 8px;
}

.infoMessage {
  font-size: 12px;
  color: rgba(255,255,255,0.9);
  text-align: center;
  margin-bottom: 8px;
  font-weight: bold;
}

.multipliers {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 5px;
}

.multiplier-item {
  font-size: 10px;
  padding: 4px 8px;
  background: rgba(255,215,0,0.15);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 6px;
  color: #ffd700;
  font-weight: bold;
  text-align: center;
  min-width: 60px;
}

.betAmountSection {
  margin-bottom: 15px;
}

.betAmountButtons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.betAmountBtn {
  padding: 8px 12px;
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 8px;
  background: rgba(255,215,0,0.1);
  color: #ffd700;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.betAmountBtn:hover {
  background: rgba(255,215,0,0.2);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255,215,0,0.3);
}

.betAmountBtn.selected {
  background: rgba(255,215,0,0.3);
  border-color: #ffd700;
  box-shadow: 0 0 10px rgba(255,215,0,0.5);
}

.betAmountBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.currentBetDisplay {
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  text-align: center;
  padding: 5px;
  background: rgba(255,215,0,0.1);
  border-radius: 6px;
  border: 1px solid rgba(255,215,0,0.2);
}

#currentBetAmount {
  color: #ffd700;
  font-weight: bold;
}

.playerSelectSection {
  margin-bottom: 15px;
}

#playerBettingList {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.playerBetOption {
  display: flex;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 11px;
}

.playerBetOption:hover {
  background: rgba(255,255,255,0.1);
  transform: translateY(-1px);
}

.playerBetOption.selected {
  background: rgba(255,215,0,0.2);
  border-color: #ffd700;
  box-shadow: 0 0 8px rgba(255,215,0,0.3);
}

.playerBetOption img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-right: 6px;
  object-fit: cover;
}

.playerBetOption .playerName {
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.betActions {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 8px;
}

.betActionBtn {
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
}

.betActionBtn:not(.secondary) {
  background: linear-gradient(90deg, #ffd700, #ffed4e);
  color: #000;
  box-shadow: 0 2px 10px rgba(255,215,0,0.3);
}

.betActionBtn:not(.secondary):hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(255,215,0,0.5);
}

.betActionBtn.secondary {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
}

.betActionBtn.secondary:hover {
  background: rgba(255,255,255,0.2);
}

.betActionBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.betResult {
  margin-top: 15px;
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  font-weight: bold;
  animation: betResultPop 0.3s ease;
}

@keyframes betResultPop {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.betResult.win {
  background: rgba(0,255,0,0.2);
  border: 1px solid rgba(0,255,0,0.5);
  color: #00ff00;
  box-shadow: 0 0 15px rgba(0,255,0,0.3);
}

.betResult.lose {
  background: rgba(255,0,0,0.2);
  border: 1px solid rgba(255,0,0,0.5);
  color: #ff6b6b;
  box-shadow: 0 0 15px rgba(255,0,0,0.3);
}

/* Mobile adjustments */

#activeEffectsHud.hasEffects {
  display: block;
}

.effectHudTitle {
  font-size: 10px;
  line-height: 1;
  margin-bottom: 7px;
  color: rgba(255,255,255,0.62);
  text-transform: uppercase;
}

.effectHudItem {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  margin-bottom: 6px;
  padding: 5px 7px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
}

.effectHudItem:last-child {
  margin-bottom: 0;
}

.effectHudItem.boss {
  border-color: rgba(255,60,90,0.52);
  background: rgba(255,0,60,0.16);
}

.effectHudItem img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.effectHudMain {
  min-width: 0;
  width: max-content;
}

.effectHudName {
  font-size: 9px;
  line-height: 1.1;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.effectHudType {
  margin-top: 2px;
  font-size: 8px;
  line-height: 1.1;
  color: rgba(255,255,255,0.68);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.effectHudTimer {
  min-width: 20px;
  padding: 2px 3px;
  border-radius: 8px;
  background: rgba(0,0,0,0.42);
  color: #00f0ff;
  font-size: 8px;
  line-height: 1;
  text-align: center;
}

.menuVersion {
  margin-top: 20px;
  font-size: 12px;
  opacity: 0.6;
}

/* игрок */
.player {
  display: flex;
  align-items: center;
  margin-bottom: 3px;
  font-size: 10px;
}

.player img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  margin-right: 6px;
  object-fit: cover;
}

.player.leader {
  font-weight: bold;
  color: #00f0ff;
  text-shadow:
    0 0 5px #00f0ff,
    0 0 10px #00f0ff;
}

/* Effect items styled like players */
.player.effect-item {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 2px 6px;
}

.player.effect-item.boss-effect {
  background: rgba(255,0,60,0.16);
  border-color: rgba(255,60,90,0.52);
  color: #ff3c5a;
  font-weight: bold;
}

/* подпись */
/*#signature {
  position: fixed;
  bottom: 10px;
  right: 15px;
  z-index: 10;
  font-size: 12px;
  color: rgba(255,255,255,0.3);
}*/

/* 📱 мобилка */
@media (max-width: 600px) {
  #bettingPanel {
    width: calc(100vw - 10px);
    left: 5px;
    right: 5px;
    top: 55px;
    max-height: 50vh;
  }
  
  #activeEffectsHud {
    top: calc(55px + 50vh + 8px);
    right: 5px;
    left: 5px;
    width: calc(100vw - 10px);
  }
  
  .betAmountButtons {
    grid-template-columns: repeat(4, 1fr);
  }
  
  #playerBettingList {
    grid-template-columns: 1fr;
  }
  
  .bettingHeader {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  #topBar {
    height: 45px;
  }

  #startBtn, #restartBtn {
    font-size: 12px;
    padding: 6px 8px;
  }

  #title {
    font-size: 12px;
  }

  #menuStart, #menuInteractive {
    width: 295px;
    max-width: 295px;
  }

  .modeBtn {
    width: 295px;
    max-width: 295px;
  }

  #uiPanel{
    position: fixed;
    top: 55px;
    right: 5px;
    left: auto;
    width: 110px !important;
  }
  
  .menuContent{
    padding: 22px 14px;
    border-radius: 18px;
    max-height: 85vh;
  }

  .menuTitle{
    font-size: 23px;
    white-space: nowrap;
  }

  .menuSubtitle{
    font-size: 12px;
    letter-spacing: 2px;
  }
  
  .menuBettingPanel {
    margin-top: 15px;
    padding: 12px;
  }
  
  .resetBalanceBtn {
    font-size: 11px;
    padding: 6px 10px;
  }
  
  .effectHudList {
    width: 90px;
    max-height: 34vh;
    padding: 6px;
    font-size: 11px;
    overflow-y: auto;
  }

  #activeEffectsHud{
    position: fixed;
  
    top: calc(55px + 34vh + 8px);
    right: 5px;
    left: auto;
  
    width: 118px;
    max-width: 118px;
    max-height: 26vh;
  
    display: none;
  
    overflow-y: auto;
    overflow-x: hidden;
  
    padding: 4px;
    white-space: normal;
    backdrop-filter: blur(14px);
    opacity: .92;
  }

  #activeEffectsHud.hasEffects {
    display: block;
  }

  #activeEffectsHud .effectHudTitle {
    display: none;
  }

  .effectHudItem{
    display:grid;
    grid-template-columns: 18px minmax(0,1fr) auto;
  
    width:100%;
    min-height:22px;
  
    margin-bottom:3px;
    padding:3px 4px;
    gap:4px;
  }

  .effectHudItem img{
    width:18px;
    height:18px;
  }

  .effectHudName{
    font-size:9px;
  }

  .effectHudType{
    font-size:8px;
  }

  .effectHudTimer{
    font-size:8px;
    min-width:18px;
    padding:1px 3px;
  }

  .player {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
    font-size: 9px;
    line-height: 1.2;
  }

  .player img {
    width: 12px;
    height: 12px;
  }

 /* #signature {
    left: 50%;
    transform: translateX(-50%);
    right: auto;
  }*/
}

#winnerOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#winnerOverlay.show {
  opacity: 1;
}

#winnerContent {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border: 2px solid rgba(0,240,255,0.3);
  border-radius: 15px;
  padding: 40px;
  text-align: center;
  transform: scale(0.8);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 30px rgba(0,240,255,0.2);
}

#winnerOverlay.show #winnerContent {
  transform: scale(1);
}

#winnerTitle {
  font-size: 36px;
  font-weight: bold;
  color: #00f0ff;
  margin-bottom: 20px;
  text-shadow: 0 0 20px rgba(0,240,255,0.5);
  animation: winnerGlow 2s ease-in-out infinite;
}

@keyframes winnerGlow {
  0%, 100% {
    text-shadow: 0 0 20px rgba(0,240,255,0.5);
  }
  50% {
    text-shadow: 0 0 30px rgba(0,240,255,0.8), 0 0 50px rgba(0,240,255,0.4);
  }
}

#winnerImg {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 20px 0;
  border: 3px solid rgba(0,240,255,0.5);
  box-shadow: 0 0 20px rgba(0,240,255,0.3);
  animation: winnerSpin 1s ease-in-out;
}

@keyframes winnerSpin {
  from {
    transform: rotate(0deg) scale(0);
  }
  to {
    transform: rotate(360deg) scale(1);
  }
}

#winnerText {
  font-size: 20px;
  font-weight: bold;
}

#winnerBetResult {
  margin: 10px 0;
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  font-weight: bold;
  font-size: 16px;
}

#winnerBetResult.win {
  background: linear-gradient(135deg, #00ff00, #00aa00);
  color: white;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

#winnerBetResult.lose {
  background: linear-gradient(135deg, #ff0000, #aa0000);
  color: white;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

#winnerButtons {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  justify-content: center;
  align-items: center;
}

#winnerRestart, #winnerMenu {
  padding: 14px 40px;
  font-size: 18px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, #00f0ff, #ff00c8);
  color: white;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(0,255,255,0.5);
  transition: 0.2s;
}

#winnerRestart:hover, #winnerMenu:hover {
  transform: scale(1.05);
}

#winnerTitle {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
  letter-spacing: 1px;
  color: gold;
}

#winnerImg {
  max-width: 250px;
  border-radius: 50%;
  margin-bottom: 20px;
  border: 4px solid gold;
  box-shadow:
    0 0 10px gold,
    0 0 25px gold,
    0 0 50px rgba(255,215,0,0.6);
}

#winnerContent {
  text-align: center;
  color: white;

  transform: scale(0.7);
  opacity: 0;
  animation: winnerPop 0.5s ease forwards;
}

@keyframes winnerPop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  60% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

#effectText {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 12px 24px;
  background: rgba(0,0,0,0.85);
  color: white;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  z-index: 1000;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,0.2);
  opacity: 0;
  transition: all 0.3s ease;
}

/* Betting Results Display */
.bettingResults {
  position: fixed;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99990;
  pointer-events: none;
}

.bettingResultsContent {
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  min-width: 300px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  backdrop-filter: blur(10px);
  border: 2px solid;
  animation: bettingResultPop 0.5s ease;
}

.bettingResults.win .bettingResultsContent {
  background: linear-gradient(135deg, rgba(0,255,0,0.9), rgba(0,200,0,0.8));
  border-color: rgba(0,255,0,0.8);
  color: white;
  text-shadow: 0 0 10px rgba(255,255,255,0.8);
  box-shadow: 
    0 8px 32px rgba(0,255,0,0.4),
    0 0 20px rgba(0,255,0,0.3);
}

.bettingResults.lose .bettingResultsContent {
  background: linear-gradient(135deg, rgba(255,0,0,0.9), rgba(200,0,0,0.8));
  border-color: rgba(255,0,0,0.8);
  color: white;
  text-shadow: 0 0 10px rgba(255,255,255,0.8);
  box-shadow: 
    0 8px 32px rgba(255,0,0,0.4),
    0 0 20px rgba(255,0,0,0.3);
}

@keyframes bettingResultPop {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(-20px);
  }
  50% {
    opacity: 1;
    transform: scale(1.1) translateY(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

#effectText.show {
  animation: effectPop .25s ease, glowText .8s infinite alternate;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  animation: effectPop 0.3s ease;
}

#arenaEventHud {
  position: fixed;
  top: max(64px, calc(env(safe-area-inset-top) + 52px));
  left: 50%;
  transform: translate(-50%, -18px) scale(.96);
  z-index: 46;
  min-width: min(360px, calc(100vw - 28px));
  padding: 10px 18px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.16);
  background: linear-gradient(135deg, rgba(8,12,25,.92), rgba(23,8,38,.9));
  box-shadow: 0 0 28px rgba(0,240,255,.2), inset 0 0 20px rgba(255,255,255,.035);
  color: white;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  backdrop-filter: blur(10px);
}

#arenaEventHud.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

#arenaEventHud.final-duel {
  border-color: rgba(255,46,190,.75);
  box-shadow: 0 0 32px rgba(255,0,200,.34), inset 0 0 22px rgba(255,0,200,.08);
}

#arenaEventHud.catastrophe {
  top: auto;
  right: 12px;
  bottom: max(66px, calc(env(safe-area-inset-bottom) + 62px));
  left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  min-width: 0;
  max-width: min(245px, calc(100vw - 24px));
  box-sizing: border-box;
  padding: 5px 9px;
  border-radius: 10px;
  border-color: rgba(255,120,0,.8);
  box-shadow: 0 0 16px rgba(255,85,0,.3), inset 0 0 12px rgba(255,110,0,.07);
  text-align: left;
  transform: translateY(10px) scale(.96);
}

#arenaEventHud.catastrophe.show {
  transform: translateY(0) scale(1);
}

#arenaEventHud.catastrophe .arenaEventHudTitle {
  overflow: hidden;
  font-size: 10px;
  line-height: 1.15;
  letter-spacing: .65px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#arenaEventHud.catastrophe .arenaEventHudMeta {
  flex: 0 0 auto;
  margin-top: 0;
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.arenaEventHudTitle {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-shadow: 0 0 12px currentColor;
}

.arenaEventHudMeta {
  margin-top: 3px;
  color: rgba(255,255,255,.78);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .45px;
}

@keyframes glowText{
  from{ box-shadow:0 0 10px rgba(0,255,255,.2);}
  to{ box-shadow:0 0 22px rgba(255,0,200,.45);}
}

@keyframes effectPop {
  0% { transform: translateX(-50%) scale(0.8); }
  100% { transform: translateX(-50%) scale(1); }
}

#mainMenu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: all;

  z-index: 99991;

  display: flex;
  justify-content: center;
  align-items: center;

  background: radial-gradient(circle at center, rgba(10,10,20,0.2), rgba(0,0,0,0.7));
  backdrop-filter: blur(2px);
}

.menuContent {
  text-align: center;
  position: relative;
  min-height: 300px;
  overflow: hidden;
  word-wrap: break-word;
}

.menuTitle {
  font-size: 23px;
  color: #00f0ff;
  text-shadow:
    0 0 10px #00f0ff,
    0 0 30px #00f0ff;
  margin-bottom: 10px;
  animation: titlePulse 3s ease-in-out infinite;
  animation: none;
  transition: all 0.3s ease;
  font-weight: 900;
  letter-spacing: 1px;
  white-space: nowrap;
  max-width: 100%;
}

@keyframes titlePulse {
  0%, 100% {
    transform: scale(1);
    text-shadow:
      0 0 10px #00f0ff,
      0 0 30px #00f0ff;
  }
  50% {
    transform: scale(1.02);
    text-shadow:
      0 0 15px #00f0ff,
      0 0 40px #00f0ff,
      0 0 60px rgba(0,240,255,0.5);
  }
}

.menuSubtitle {
  opacity: 0.6;
  margin-bottom: 25px;
}

#menuStart, #menuInteractive {
  margin-top: 15px;
  padding: 14px 40px;
  font-size: 16px;
  border: 1px solid transparent;
  border-radius: 10px;

  background: linear-gradient(90deg, #00f0ff, #ff00c8);
  background-clip: padding-box;
  color: white;
  cursor: pointer;

  box-shadow:
    0 0 15px rgba(0,255,255,0.5);

  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(0) scale(1);
  position: relative;
  overflow: hidden;
}

#menuStart:hover, #menuInteractive:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow:
    0 5px 25px rgba(0,255,255,0.7),
    0 0 20px rgba(255,0,200,0.4);
}

#menuStart:active, #menuInteractive:active {
  transform: translateY(0) scale(0.98);
  transition: all 0.1s ease;
}


.abilityBtn:hover{
  transform: translateY(-2px) scale(1.05);
  box-shadow:
    0 0 14px rgba(0,255,255,.45),
    0 0 28px rgba(255,0,200,.25);
}

.abilityBtn:active{
  transform: scale(.94);
}

.abilityBtn.active{
  background: linear-gradient(135deg,#00cfff,#ff00c8);
  box-shadow:
    0 0 14px #00f0ff,
    0 0 30px #ff00c8;
}

.abilityBtn.cooldown{
  opacity:.45;
  pointer-events:none;
  filter: grayscale(.4);
}

.abilityBtn.ready{
  animation:pulseBtn .7s infinite alternate, wiggle 1.4s infinite;
}

@keyframes wiggle{
  0%,100%{ transform:rotate(0deg);}
  25%{ transform:rotate(-1deg);}
  75%{ transform:rotate(1deg);}
}

@keyframes pulseBtn{
  from{ box-shadow:0 0 8px rgba(0,255,255,.25);}
  to{ box-shadow:0 0 18px rgba(0,255,255,.8);}
}


.abilityBtn .label{
  position: relative;
  z-index: 3;
}

.cdOverlay{
  position:absolute;
  left:0;
  bottom:0;
  width:100%;
  height:0%;
  background:rgba(0,0,0,.72);
  z-index:2;
  pointer-events:none;
}

.cdText{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:22px;
  font-weight:bold;
  color:white;
  text-shadow:0 0 10px black;
  z-index:4;
  pointer-events:none;
}

#title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  font-weight: bold;
  color: white;
  text-shadow: 0 0 5px rgba(0,255,255,0.3);
  right: 80px; /* Reserve space for FPS indicator */
  width: auto;
  max-width: calc(100% - 160px);
  text-align: center;
}

#gameBetInfo {
  position: absolute;
  right: 45px;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 8px;
  background: rgba(255,215,0,0.2);
  border: 1px solid rgba(255,215,0,0.4);
  border-radius: 6px;
  font-size: 11px;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 0 0 4px rgba(255,215,0,0.5);
}

#gameBetDisplay {
  white-space: nowrap;
}

#fpsDisplay {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: bold;
  font-family: monospace;
  text-shadow: 0 0 2px rgba(0,0,0,0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.7;
}

/* Smooth transitions for game elements */
.player {
  transition: all 0.3s ease;
}

.player:hover {
  transform: translateX(2px);
  filter: brightness(1.1);
}

.effect-item {
  transition: all 0.3s ease;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Smooth transitions for UI panels */
#uiPanel, #activeEffectsHud {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Button animations */
#startBtn, #restartBtn, #menuBtn {
  transition: all 0.2s ease;
  transform: scale(1);
}

#startBtn:hover, #restartBtn:hover, #menuBtn:hover {
  transform: scale(1.05);
  filter: brightness(1.2);
}

#startBtn:active, #restartBtn:active, #menuBtn:active {
  transform: scale(0.95);
}

#restartBtn:disabled,
#restartBtn:disabled:hover,
#restartBtn:disabled:active {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
  filter: grayscale(0.35);
  background: rgba(255,255,255,0.06);
}

.modeSelect{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin:20px 0;
  overflow: hidden;
}

.modeBtn{
  padding:8px 12px;
  border:none;
  border-radius:8px;
  cursor:pointer;
  font-size:13px;
  font-weight:bold;
  background:rgba(255,255,255,.08);
  color:#fff;
  transition:.25s;
  width: 295px;
  max-width: 295px;
  margin-left: auto;
  margin-right: auto;
  display: block;
}

.modeBtn:hover{
  transform:scale(1.03);
}

.modeBtn.active{
  background:linear-gradient(90deg,#00f0ff,#ff00c8);
  box-shadow:0 0 18px rgba(0,240,255,.35);
}

.menuSectionTitle{
  margin: 18px 0 14px;
  font-size: 20px;
  font-weight: bold;
  color: #00f0ff;
}

.betCheck{
  display:block;
  margin-top:18px;
  font-size:16px;
  opacity:.9;
}

.betCheck input{
  margin-right:8px;
  transform: scale(1.15);
}

@keyframes menuFade{
  from{
    opacity:0;
    transform:translateY(10px);
  }
  to{
    opacity:1;
    transform:none;
  }
}

/* ===== PREMIUM MENU ===== */

.menuContent{
  width: min(420px, calc(100vw - 24px));
  max-height: 90vh;
  padding: 28px 22px;
  border-radius: 24px;
  overflow-y: auto;

  background:
    linear-gradient(180deg,
      rgba(255,255,255,.06),
      rgba(255,255,255,.02));

  border: 1px solid rgba(255,255,255,.12);

  box-shadow:
    0 0 30px rgba(0,240,255,.10),
    0 0 70px rgba(255,0,200,.08),
    inset 0 0 30px rgba(255,255,255,.03);

  backdrop-filter: blur(14px);
}

.menuSubtitle{
  font-size: 14px;
  opacity: .75;
  margin-bottom: 22px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* buttons */
#playBtn,
#menuStart,
#menuInteractive,
#battleBtn,
#snakeStartBtn ,
.modeBtn{
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 13px 10px;
  margin-top: 12px;

  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .5px;

  color: white;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);

  transition: .22s ease;
}

/* hover */
#playBtn:hover,
#menuStart:hover,
#menuInteractive:hover,
#battleBtn:hover,
#snakeStartBtn:hover ,
.modeBtn:hover{
  transform: translateY(-2px);
  background: rgba(255,255,255,.10);
}

/* active press */
#playBtn:active,
#menuStart:active,
#menuInteractive:active,
#battleBtn:active,
#snakeStartBtn:active,
.modeBtn:active{
  transform: scale(.97);
}

/* main CTA */
#playBtn{
  margin-top: 18px;

  background:
    linear-gradient(90deg,
      #00f0ff,
      #ff00c8);

  box-shadow:
    0 0 18px rgba(0,240,255,.35),
    0 0 28px rgba(255,0,200,.20);
}

/* selected mode */
.modeBtn.active,
#menuStart.active,
#menuInteractive.active{
  background: linear-gradient(90deg,#00f0ff,#ff00c8);
  border-color: transparent;

  box-shadow:
    0 0 16px rgba(0,240,255,.28),
    0 0 22px rgba(255,0,200,.18);
}

/* section title */
.menuSectionTitle{
  margin-top: 10px;
  margin-bottom: 8px;

  font-size: 18px;
  font-weight: 800;
  color: #00f0ff;
}

/* checkbox */
.betCheck{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;

  margin-top: 18px;
  padding: 14px;

  border-radius: 14px;

  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}

.betCheck input{
  transform: scale(1.25);
}

/* version */
.menuVersion{
  margin-top: 16px;
  font-size: 12px;
  opacity: .55;
}

/* animation */
#menuStep1, #menuStep2 {
  transition: opacity .25s ease, transform .25s ease;
  will-change: transform, opacity;
  width: 100%;
  overflow: hidden;
}

/* стартовое состояние */
.menu-hidden {
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

.menu-visible {
  opacity: 1;
  position: relative;
}

@keyframes menuReveal{
  from{
    opacity:0;
    transform: translateY(12px) scale(.98);
  }
  to{
    opacity:1;
    transform:none;
  }
}

/* ===== MENU BETTING PANEL ===== */
.menuBettingPanel {
  margin-top: 20px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,215,0,0.2);
  backdrop-filter: blur(10px);
  animation: menuReveal 0.3s ease;
}

.menuBettingPanel .bettingHeader {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,215,0,0.2);
}

.menuBettingPanel .bettingTitle {
  font-size: 18px;
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255,215,0,0.4);
}

.menuBettingPanel .balanceDisplay {
  font-size: 13px;
  color: #00ff9f;
}

.menuBettingPanel .betInfoSection {
  margin-bottom: 12px;
  padding: 8px;
  background: rgba(255,215,0,0.08);
  border: 1px solid rgba(255,215,0,0.15);
  border-radius: 8px;
}

.menuBettingPanel .infoMessage {
  font-size: 11px;
  margin-bottom: 6px;
}

.menuBettingPanel .multipliers {
  justify-content: center;
  gap: 8px;
}

.menuBettingPanel .multiplier-item {
  font-size: 9px;
  padding: 3px 6px;
  min-width: 50px;
}

.menuBettingPanel .betAmountSection {
  margin-bottom: 12px;
}

.menuBettingPanel .betAmountButtons {
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.menuBettingPanel .betAmountBtn {
  padding: 6px 4px;
  font-size: 12px;
}

.menuBettingPanel .currentBetDisplay {
  font-size: 11px;
  padding: 4px;
}

.menuBettingPanel .playerSelectSection {
  margin-bottom: 12px;
}

.menuBettingPanel #menuPlayerBettingList {
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-height: 120px;
  overflow-y: auto;
}

.menuBettingPanel .playerBetOption {
  padding: 6px;
  font-size: 10px;
}

.menuBettingPanel .playerBetOption img {
  width: 16px;
  height: 16px;
  margin-right: 4px;
}

.menuBettingPanel .betActions {
  grid-template-columns: 2fr 1fr;
  gap: 6px;
}

.menuBettingPanel .betActionBtn {
  padding: 8px;
  font-size: 12px;
}

.menuBettingPanel .betResult {
  margin-top: 12px;
  padding: 8px;
  font-size: 11px;
}

.resetBalanceBtn {
  width: 100%;
  padding: 8px 12px;
  margin-top: 8px;
  border: 1px solid rgba(0,255,0,0.5);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(0,255,0,0.2), rgba(0,200,0,0.3));
  color: #00ff00;
  font-weight: bold;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-shadow: 0 0 4px rgba(0,255,0,0.5);
  box-shadow: 0 0 10px rgba(0,255,0,0.3);
}

.resetBalanceBtn:hover {
  background: linear-gradient(90deg, rgba(0,255,0,0.3), rgba(0,200,0,0.4));
  transform: translateY(-1px);
  box-shadow: 0 2px 15px rgba(0,255,0,0.5);
}

.resetBalanceBtn:active {
  transform: scale(0.98);
}

/* Стили для прокрутки в меню */
.menuContent::-webkit-scrollbar {
  width: 8px;
}

.menuContent::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

.menuContent::-webkit-scrollbar-thumb {
  background: rgba(0,240,255,0.5);
  border-radius: 4px;
}

.menuContent::-webkit-scrollbar-thumb:hover {
  background: rgba(0,240,255,0.7);
}

/* mobile */
@media(max-width:600px){
  #playBtn,
  #menuStart,
  #menuInteractive,
  .modeBtn{
    padding: 14px;
    font-size: 14px;
  }
  
  .betLabel{
    font-size:14px;
  }

  .betBtn{
    padding:12px 8px;
    font-size:13px;
  }

  #arenaEventHud {
    top: max(58px, calc(env(safe-area-inset-top) + 48px));
    min-width: calc(100vw - 22px);
    padding: 9px 12px;
  }

  #arenaEventHud.catastrophe {
    top: auto;
    right: 7px;
    bottom: max(64px, calc(env(safe-area-inset-bottom) + 60px));
    min-width: 0;
    max-width: min(220px, calc(100vw - 14px));
    padding: 5px 8px;
  }

  .gameplayToggle {
    padding: 10px 7px;
  }
}
/* ===== BACK BUTTON ===== */

#menuBack{
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.08);

  background: rgba(255,255,255,.04);
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: .2s ease;
}

#menuBack:hover{
  transform: translateY(-2px);
  background: rgba(255,255,255,.08);
}

/* ===== BET TOGGLE BUTTONS ===== */

.betToggle{
  margin-top: 18px;
  padding: 14px;
  border-radius: 18px;

  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}

.betLabel{
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  text-align: center;
  color: white;
  opacity: .95;
}

.betButtons{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.betBtn{
  border: none;
  border-radius: 14px;
  padding: 13px 10px;

  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .5px;

  color: white;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);

  transition: .22s ease;
}

.betBtn:hover{
  transform: translateY(-2px);
  background: rgba(255,255,255,.10);
}

/* активная кнопка */

.betBtn.active{
  background: linear-gradient(90deg,#00f0ff,#ff00c8);
  border-color: transparent;

  box-shadow:
    0 0 16px rgba(0,240,255,.28),
    0 0 22px rgba(255,0,200,.18);
}

.betBtn:active{
  transform: scale(.97);
}

.betToggle.is-disabled {
  border-color: rgba(255, 184, 77, 0.28);
  background: rgba(255, 184, 77, 0.06);
}

.betBtn:disabled,
.betBtn:disabled:hover,
.betBtn:disabled:active {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
  background: rgba(255,255,255,.04);
  box-shadow: none;
}

.betAvailabilityMessage {
  margin-top: 10px;
  color: #ffd18a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.gameplayOptions {
  margin-top: 14px;
  padding: 13px;
  border-radius: 18px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}

.gameplayOptionsTitle {
  margin-bottom: 8px;
  color: rgba(255,255,255,.72);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.3px;
  text-align: center;
  text-transform: uppercase;
}

.gameplayToggle {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 11px 8px;
  border-radius: 13px;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

.gameplayToggle + .gameplayToggle {
  margin-top: 5px;
}

.gameplayToggle:hover {
  background: rgba(255,255,255,.055);
  transform: translateY(-1px);
}

.gameplayToggleText {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.gameplayToggleText strong {
  color: white;
  font-size: 13px;
  line-height: 1.2;
}

.gameplayToggleText small {
  color: rgba(255,255,255,.58);
  font-size: 10px;
  line-height: 1.3;
}

.gameplayToggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.gameplayToggleSwitch {
  position: relative;
  width: 46px;
  height: 25px;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  box-shadow: inset 0 2px 7px rgba(0,0,0,.3);
  transition: .22s ease;
}

.gameplayToggleSwitch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(255,255,255,.7);
  box-shadow: 0 2px 7px rgba(0,0,0,.35);
  content: "";
  transition: .22s ease;
}

.gameplayToggle input:checked + .gameplayToggleSwitch {
  border-color: transparent;
  background: linear-gradient(90deg, #00f0ff, #ff00c8);
  box-shadow: 0 0 15px rgba(0,240,255,.3), 0 0 20px rgba(255,0,200,.18);
}

.gameplayToggle input:checked + .gameplayToggleSwitch::after {
  left: 24px;
  background: white;
}

.gameplayToggle input:focus-visible + .gameplayToggleSwitch {
  outline: 2px solid white;
  outline-offset: 3px;
}

#snakeBtn{

  width:100%;
  max-width: 295px;
  margin-left: auto;
  margin-right: auto;
  display: block;

  border:none;

  border-radius:14px;

  padding:13px 10px;

  margin-top:12px;

  cursor:pointer;

  font-size:14px;

  font-weight:800;

  color:white;

  background:rgba(255,255,255,.06);

  border:1px solid rgba(255,255,255,.10);

  transition:.22s ease;

}

#snakeBtn:hover{

  transform:translateY(-2px);

  background:rgba(255,255,255,.10);

}

#snakePlayerList{
  width:100%;
  padding:12px;

  font-size:14px;
  font-weight:600;

  color:white;

  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,215,0,.2);
  border-radius:14px;

  backdrop-filter:blur(10px);

  appearance:none;
  -webkit-appearance:none;
  -moz-appearance:none;

  cursor:pointer;

  transition:.22s ease;
}

#snakePlayerList:hover{
  background:rgba(255,255,255,.08);
  border-color:rgba(255,215,0,.35);
}

#snakePlayerList:focus{
  outline:none;

  border-color:#ffd700;

  box-shadow:
    0 0 12px rgba(255,215,0,.25),
    0 0 24px rgba(255,215,0,.12);
}

#snakePlayerList option{
  background:#161616;
  color:white;
}

/* ===== SNAKE MOBILE CONTROLS ===== */

body.snake-active {
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
}

#snakeControls {
  display: none;
  position: fixed;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10002;
  grid-template-columns: repeat(3, minmax(56px, 72px));
  grid-template-rows: repeat(2, minmax(56px, 72px));
  gap: 8px;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#snakeControls.show {
  display: grid;
}

#snakeCtrlUp { grid-column: 2; grid-row: 1; }
#snakeCtrlLeft { grid-column: 1; grid-row: 2; }
#snakeCtrlDown { grid-column: 2; grid-row: 2; }
#snakeCtrlRight { grid-column: 3; grid-row: 2; }

.snakeCtrlBtn {
  width: 100%;
  height: 100%;
  min-width: 56px;
  min-height: 56px;
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 16px;
  background: rgba(0, 20, 30, 0.82);
  color: #00f0ff;
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  transition: transform 0.1s ease, background 0.1s ease;
}

.snakeCtrlBtn:active {
  transform: scale(0.92);
  background: rgba(0, 240, 255, 0.18);
}

@media (max-width: 600px) {
  #snakeBtn,
  #snakeStartBtn,
  #battleBtn {
    width: 100%;
    max-width: 295px;
    margin-left: auto;
    margin-right: auto;
    display: block;
  }

  #topBar {
    padding: 0 10px;
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }

  #restartBtn, #menuBtn {
    font-size: 12px;
    padding: 6px 10px;
    height: 34px;
  }

  .snakeCtrlBtn {
    min-width: 52px;
    min-height: 52px;
    font-size: 20px;
  }
}
