/* Estilos gerais */
html, body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #444;
  touch-action: none;
  user-select: none;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

body.fullscreen {
  background: #87ceeb;
}

body.fullscreen.night-mode {
  background: #1a1a3a;
}

/* Container do telefone */
#phone-container {
  width: 800px;
  height: 450px;
  background: #000;
  border-radius: 20px;
  border: 12px solid #333;
  position: relative;
  box-shadow: 0 0 50px rgba(0,0,0,0.5);
  overflow: hidden;
}

.fullscreen #phone-container {
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

/* Área do jogo */
#game-area {
  width: 100%;
  height: 100%;
  position: relative;
  background: #87ceeb;
  overflow: hidden;
  transition: background-color 1s;
}

.night-mode #game-area {
  background: #1a1a3a;
}

canvas { 
  width: 100%; 
  height: 100%; 
  display: block;
}

/* Contador de pontuação */
#score {
  position: absolute;
  left: 18px;
  top: 18px;
  font-family: Arial, sans-serif;
  font-size: 1.8em;
  color: #fff;
  text-shadow: 2px 2px 6px rgba(0,0,0,0.8), 0 0 15px #ff6b35;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.9), rgba(255, 149, 0, 0.9));
  padding: 10px 20px;
  border-radius: 25px;
  border: 3px solid #ffd700;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.5);
  backdrop-filter: blur(10px);
  z-index: 2;
}

/* Indicador de dia/noite */
#day-night-indicator {
  position: absolute;
  left: 18px;
  top: 60px;
  font-family: Arial, sans-serif;
  font-size: 1.2em;
  color: #fff;
  text-shadow: 1px 2px 4px #333, 0 0 10px #1e90ff;
  z-index: 2;
  padding: 5px 10px;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  transition: text-shadow 0.3s, transform 0.3s;
}

/* Indicador da carteira */
#wallet {
  position: absolute;
  top: 70px;
  left: 20px;
  color: #fff;
  font-size: 0.9em;
  font-weight: bold;
  text-shadow: 2px 2px 6px rgba(0,0,0,0.8), 0 0 10px #20b2aa;
  background: linear-gradient(135deg, rgba(32, 178, 170, 0.9), rgba(64, 224, 208, 0.9));
  padding: 12px 18px;
  border-radius: 20px;
  border: 3px solid #ffd700;
  box-shadow: 0 4px 15px rgba(32, 178, 170, 0.5);
  backdrop-filter: blur(10px);
  z-index: 3;
}

#wallet-value {
  color: #ffd700;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

/* Tela de game over */
#gameover {
  position: absolute;
  left: 0; top: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 2em;
  text-align: center;
  z-index: 3;
  display: none;
}

#gameover button {
  margin-top: 20px;
  font-size: 0.9em;
  padding: 15px 35px;
  border: none;
  border-radius: 25px;
  background: linear-gradient(135deg, #ff6b35, #ff9500);
  color: #fff;
  font-weight: bold;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
  border: 3px solid #ffd700;
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#gameover button:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(255, 107, 53, 0.7);
  background: linear-gradient(135deg, #ff8a50, #ffb347);
}

/* Tela inicial */
#startscreen {
  position: absolute;
  left: 0; top: 0; width: 100%; height: 100%;
  background-color: #242424;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  background-image: url(../sprites/main-menu/background.jpg);
  color: #fff;
  font-family: 'Arial', sans-serif;
  font-size: 2em;
  text-align: center;
  z-index: 4;
  display: flex;
  flex-direction: column;
}



/* Container para informações superiores direitas */
.top-right-info {
  position: absolute;
  top: 20px;
  right: 70px;
  display: flex;
  /* flex-direction: column; */
  align-items: flex-end;
  gap: 15px;
}

/* Best Score Display */
#best-score {
  font-size: 0.7em;
  color: #fff;
  text-shadow: 2px 2px 6px rgba(0,0,0,0.8), 0 0 10px #ff6b35;
  padding: 12px 20px;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.9), rgba(255, 149, 0, 0.9));
  border-radius: 15px;
  border: 3px solid #ffd700;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.5);
  backdrop-filter: blur(10px);
  text-align: center;
}

#best-score-value {
  font-weight: bold;
  color: #ffd700;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

/* New Record Indicator */
#new-record {
  font-size: 1.2em;
  color: #ffd700;
  text-shadow: 2px 2px 6px rgba(0,0,0,0.8);
  margin: 15px 0;
  padding: 10px 20px;
  background: linear-gradient(45deg, #ff6b35, #ffd700);
  border-radius: 15px;
  border: 3px solid #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
  text-align: center;
}

/* Aviso de rotação para celular */
#rotate {
  display: none;
  position: absolute;
  left: 0; top: 0; width: 100%; height: 100%;
  background: #222;
  color: #fff;
  z-index: 5;
  font-family: Arial, sans-serif;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.5em;
}

/* Botão de tela cheia */
#fullscreen-btn {
  display: none !important;
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  cursor: pointer;
  border: none;
  outline: none;
}

#fullscreen-btn:before {
  content: "";
  width: 20px;
  height: 20px;
  border: 2px solid white;
  border-radius: 2px;
  display: block;
}

.fullscreen #fullscreen-btn:before {
  width: 16px;
  height: 16px;
}

/* Exibição da carteira na tela inicial */
#wallet-display {
  font-size: 0.7em;
  color: #fff;
  text-shadow: 2px 2px 6px rgba(0,0,0,0.8), 0 0 10px #20b2aa;
  padding: 12px 20px;
  background: linear-gradient(135deg, rgba(32, 178, 170, 0.9), rgba(64, 224, 208, 0.9));
  border-radius: 15px;
  border: 3px solid #ffd700;
  box-shadow: 0 4px 15px rgba(32, 178, 170, 0.5);
  backdrop-filter: blur(10px);
  text-align: center;
}

#wallet-display-value {
  font-weight: bold;
  color: #ffd700;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

/* Container para botões inferiores direitos */
.bottom-right-buttons {
  position: absolute;
  bottom: 30px;
  right: 70px;
  display: flex;
  /* flex-direction: column; */
  gap: 15px;
  align-items: flex-end;
}

/* Botões do menu */
.menu-buttons {
  display: flex;
  /* flex-direction: column; */
  gap: 15px;
  align-items: flex-end;
}

.menu-buttons button {
  padding: 15px 30px;
  font-size: 0.8em;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(135deg, #ff6b35, #ff9500);
  border: none;
  border-radius: 25px;
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 140px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 3px solid #ffd700;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

.menu-buttons button:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(255, 107, 53, 0.7);
  background: linear-gradient(135deg, #ff8a50, #ffb347);
}

/* Tela da loja */
#shop-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
}

#shop-screen h2 {
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
  margin-bottom: 20px;
  font-size: 1.5em;
}

#shop-wallet {
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: 1em;
  font-weight: bold;
  text-shadow: 2px 2px 6px rgba(0,0,0,0.8), 0 0 10px #20b2aa;
  margin-bottom: 30px;
  padding: 15px 25px;
  background: linear-gradient(135deg, rgba(32, 178, 170, 0.9), rgba(64, 224, 208, 0.9));
  border-radius: 20px;
  border: 3px solid #ffd700;
  box-shadow: 0 4px 15px rgba(32, 178, 170, 0.5);
  backdrop-filter: blur(10px);
}

#shop-wallet img {
  margin-left: 5px;
}

.shop-items {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-bottom: 30px;
  max-width: 100%;
}

.shop-item {
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 15px;
  padding: 20px;
  min-width: 200px;
  max-width: 250px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.shop-item h3 {
  color: #fff;
  margin: 0 0 10px 0;
  font-size: 1.1em;
}

.shop-item p {
  color: #ccc;
  font-size: 0.7em;
  margin: 10px 0;
  line-height: 1.3;
}

.shop-price {
  display: flex;
  justify-content: center;
  align-items: center;
  color: #ffd700;
  font-weight: bold;
  font-size: 0.8em;
  margin: 15px 0;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
  padding: 5px 10px;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.shop-price img {
  margin-left: 5px;
}

.shop-buy-btn {
  background: linear-gradient(135deg, #20b2aa, #40e0d0);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 15px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.7em;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
  border: 2px solid #ffd700;
  box-shadow: 0 4px 10px rgba(32, 178, 170, 0.4);
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.shop-buy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(32, 178, 170, 0.6);
  background: linear-gradient(135deg, #40e0d0, #7fffd4);
}

.shop-buy-btn:disabled {
  background: #666;
  cursor: not-allowed;
  transform: none;
}

#back-to-menu-btn {
  background: linear-gradient(135deg, #ff69b4, #ff1493);
  color: #fff;
  border: none;
  padding: 15px 30px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.8em;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
  border: 3px solid #ffd700;
  box-shadow: 0 4px 15px rgba(255, 105, 180, 0.5);
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#back-to-menu-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(255, 105, 180, 0.7);
  background: linear-gradient(135deg, #ff8fa3, #ff69b4);
}

/* Quantidade de itens na loja */
.shop-quantity {
  color: #40e0d0;
  font-weight: bold;
  font-size: 0.7em;
  margin: 10px 0;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
  padding: 3px 8px;
  background: rgba(64, 224, 208, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(64, 224, 208, 0.3);
}

/* Tela de seleção de poderes */
#power-selection-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #4a90e2, #357abd);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 15;
  padding: 20px;
  box-sizing: border-box;
}

#power-selection-screen h2 {
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
  margin-bottom: 10px;
  font-size: 1.5em;
}

#power-selection-screen p {
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  margin-bottom: 30px;
  font-size: 0.9em;
}

.power-selection-items {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  margin-bottom: 30px;
  max-width: 100%;
  max-height: 200px;
  overflow-y: auto;
}

.power-selection-item {
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 12px;
  padding: 15px;
  min-width: 120px;
  max-width: 150px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
}

.power-selection-item:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

.power-selection-item.selected {
  border-color: #ffdb58;
  background: rgba(255,219,88,0.2);
  box-shadow: 0 0 15px rgba(255,219,88,0.5);
}

.power-selection-item h4 {
  color: #fff;
  margin: 0 0 8px 0;
  font-size: 0.9em;
}

.power-selection-item .quantity {
  color: #ffdb58;
  font-weight: bold;
  font-size: 0.7em;
}

.power-selection-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.power-selection-buttons button {
  padding: 15px 25px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.8em;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
  transition: all 0.3s;
  border: 3px solid #ffd700;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

#start-without-power {
  background: linear-gradient(135deg, #ff69b4, #ff1493);
  color: #fff;
}

#start-without-power:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 105, 180, 0.5);
  background: linear-gradient(135deg, #ff8fa3, #ff69b4);
}

#start-with-selected-power {
  background: linear-gradient(135deg, #20b2aa, #40e0d0);
  color: #fff;
}

#start-with-selected-power:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(32, 178, 170, 0.5);
  background: linear-gradient(135deg, #40e0d0, #7fffd4);
}

#start-with-selected-power:disabled {
  background: #666;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Responsividade */
@media (max-width: 800px) {
  #phone-container {
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
  }
}

/* Animações */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
  }
  50% {
    box-shadow: 0 4px 25px rgba(255, 215, 0, 0.8);
  }
}

/* Aplicando animações */
.top-right-info {
  animation: slideInRight 0.8s ease-out;
}

.bottom-right-buttons {
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

#best-score {
  animation: glow 2s infinite;
}

.menu-buttons button:active {
  transform: translateY(-1px) scale(0.98);
}
