html,
body {
  margin: 0;
  padding: 0;
  overflow: hidden;
}
canvas {
  display: block;
  background: #cceeff;
}

/* Botão flutuante da loja */
#shopButton {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  border: 4px solid #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 215, 0, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 35px;
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 1000;
  user-select: none;
}

#shopButton:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 30px rgba(255, 215, 0, 0.7);
}

#shopButton:active {
  transform: scale(0.95);
}

/* Modal da loja */
#shopModal {
  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: 2000;
}

#shopModal.active {
  display: flex;
}

#shopContent {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 20px;
  padding: 30px;
  max-width: 90%;
  max-height: 80%;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border: 3px solid #FFD700;
  position: relative;
}

#shopContent h2 {
  color: #FFD700;
  text-align: center;
  margin-top: 0;
  font-size: 32px;
  text-shadow: 0 2px 10px rgba(255, 215, 0, 0.5);
}

#closeShop {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: #ff4444;
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shopSection {
  margin-bottom: 30px;
}

.shopSection h3 {
  color: #00CED1;
  border-bottom: 2px solid #00CED1;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.shopItem {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 2px solid transparent;
  transition: all 0.3s;
}

.shopItem:hover {
  border-color: #FFD700;
  background: rgba(255, 215, 0, 0.1);
}

.shopItem.owned {
  opacity: 0.6;
  border-color: #4CAF50;
}

.itemInfo {
  flex: 1;
  color: white;
}

.itemName {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 5px;
}

.itemDesc {
  font-size: 14px;
  color: #aaa;
}

.itemPrice {
  display: flex;
  align-items: center;
  gap: 10px;
}

.buyButton {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  border: none;
  color: white;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s;
}

.buyButton:hover {
  transform: scale(1.05);
}

.buyButton:disabled {
  background: #666;
  cursor: not-allowed;
  transform: none;
}

/* Abas da loja */
.shopTabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid #FFD700;
}

.shopTab {
  flex: 1;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-bottom: 3px solid transparent;
  color: #aaa;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.shopTab:hover {
  background: rgba(255, 215, 0, 0.1);
  color: white;
}

.shopTab.active {
  background: rgba(255, 215, 0, 0.2);
  border-bottom-color: #FFD700;
  color: #FFD700;
}

.shopTabContent {
  display: none;
}

.shopTabContent.active {
  display: block;
}

.upgradeItem {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 10px;
  border: 2px solid transparent;
  transition: all 0.3s;
}

.upgradeItem:hover {
  border-color: #00CED1;
  background: rgba(0, 206, 209, 0.1);
}

.upgradeItem.maxed {
  opacity: 0.6;
  border-color: #FFD700;
}

.upgradeHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.upgradeTitle {
  font-size: 18px;
  font-weight: bold;
  color: white;
}

.upgradeLevel {
  background: rgba(255, 215, 0, 0.2);
  padding: 5px 15px;
  border-radius: 15px;
  color: #FFD700;
  font-weight: bold;
}

.upgradeDesc {
  color: #aaa;
  font-size: 14px;
  margin-bottom: 10px;
}

.upgradeEffect {
  color: #00ff00;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 10px;
}

.upgradeFooter {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Painel de Desenvolvedor */
#devPanel {
  position: fixed;
  right: 0;
  top: 0;
  width: 300px;
  height: 100vh;
  background: rgba(20, 20, 30, 0.98);
  border-left: 3px solid #00ff00;
  z-index: 2000;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
}

#devPanelHeader {
  background: rgba(0, 255, 0, 0.2);
  padding: 15px;
  border-bottom: 2px solid #00ff00;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#devPanelHeader h3 {
  margin: 0;
  color: #00ff00;
  font-size: 18px;
}

#closeDevPanel {
  background: #ff0000;
  color: white;
  border: none;
  padding: 5px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
}

#closeDevPanel:hover {
  background: #cc0000;
}

#devPanelContent {
  padding: 10px;
}

.devSection {
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(0, 255, 0, 0.3);
  padding-bottom: 15px;
}

.devSection h4 {
  color: #00ff00;
  margin: 10px 0;
  font-size: 14px;
}

.devBtn {
  width: 100%;
  background: rgba(0, 255, 0, 0.2);
  border: 1px solid #00ff00;
  color: #00ff00;
  padding: 10px;
  margin: 5px 0;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  transition: all 0.2s;
}

.devBtn:hover {
  background: rgba(0, 255, 0, 0.4);
  transform: translateX(-5px);
}

.devBtn:active {
  background: rgba(0, 255, 0, 0.6);
}

@media (max-width: 600px) {
  #shopContent {
    padding: 20px;
    max-width: 95%;
  }
  
  #devPanel {
    width: 100%;
    height: 50vh;
    bottom: 0;
    top: auto;
    border-left: none;
    border-top: 3px solid #00ff00;
  }
  
  #shopContent h2 {
    font-size: 24px;
  }
  
  .itemName {
    font-size: 16px;
  }
  
  .itemDesc {
    font-size: 12px;
  }
}

/* ============================================
   SISTEMA DE DIÁLOGO (Estilo RPG)
   ============================================ */
#dialogModal {
  position: fixed;
  top: 0;
  bottom: 0;
  transform: scale(.6);

  bottom: -20%;
  bottom: 0;
  width: 100%;
  /* width: 100%;
  height: 100%; */
  /* background: rgba(0, 0, 0, 0.3); */
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 3000;
  animation: fadeIn 0.3s ease;
  padding-bottom: 20px;
}

#dialogModal.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#dialogContent {
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
  border-radius: 15px;
  padding: 0;
  max-width: 900px;
  width: 95%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 206, 209, 0.3);
  border: 3px solid #00CED1;
  position: relative;
  overflow: hidden;
  animation: slideUpRPG 0.4s ease;
  display: flex;
  min-height: 200px;
}

@keyframes slideUpRPG {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Retrato do personagem (lado direito) */
#dialogPortrait {
  width: 200px;
  min-width: 200px;
  background: linear-gradient(135deg, rgba(0, 206, 209, 0.2) 0%, rgba(0, 139, 139, 0.2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border-right: 3px solid #00CED1;
  position: relative;
}

#dialogPortraitImage {
  width: 100%;
  height: auto;
  max-height: 250px;
  object-fit: contain;
  border-radius: 10px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
  animation: portraitAppear 0.5s ease;
}

#dialogPortraitImage[src=""],
#dialogPortraitImage:not([src]) {
  display: none;
}

@keyframes portraitAppear {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Área principal do diálogo */
#dialogMain {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#dialogHeader {
  background: linear-gradient(135deg, rgba(0, 206, 209, 0.3) 0%, rgba(0, 139, 139, 0.3) 100%);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #00CED1;
}

#dialogSpeakerName {
  color: #00CED1;
  font-size: 22px;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  letter-spacing: 1px;
}

#closeDialog {
  width: 35px;
  height: 35px;
  background: #ff4444;
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

#closeDialog:hover {
  background: #cc0000;
  transform: scale(1.1);
}

#dialogText {
  padding: 25px;
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 120px;
}

#dialogMessage {
  color: #fff;
  font-size: 22px;
  line-height: 1.8;
  margin: 0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

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

#dialogChoices {
  padding: 0 30px 20px;
  display: none;
}

#dialogChoices.active {
  display: block;
}

.dialogChoice {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 15px 20px;
  margin-bottom: 10px;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
  text-align: left;
  width: 100%;
  font-family: inherit;
}

.dialogChoice:hover {
  background: rgba(0, 206, 209, 0.2);
  border-color: #00CED1;
  transform: translateX(5px);
}

.dialogChoice:active {
  transform: translateX(2px);
}

#dialogFooter {
  padding: 15px 25px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: flex-end;
  border-top: 2px solid rgba(0, 206, 209, 0.3);
}

#dialogNext {
  background: linear-gradient(135deg, #00CED1 0%, #008B8B 100%);
  border: none;
  border-radius: 10px;
  padding: 12px 30px;
  color: white;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(0, 206, 209, 0.3);
}

#dialogNext:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 206, 209, 0.5);
}

#dialogNext:active {
  transform: translateY(0);
}

#dialogNext.hidden {
  display: none;
}

/* Responsivo para diálogo */
@media (max-width: 768px) {
  #dialogContent {
    max-width: 98%;
    width: 98%;
    flex-direction: column;
    min-height: auto;
  }
  
  #dialogPortrait {
    width: 100%;
    min-width: 100%;
    border-right: none;
    border-bottom: 3px solid #00CED1;
    padding: 15px;
  }
  
  #dialogPortraitImage {
    max-height: 150px;
  }
  
  #dialogSpeakerName {
    font-size: 18px;
  }
  
  #dialogMessage {
    font-size: 16px;
  }
  
  .dialogChoice {
    font-size: 14px;
    padding: 12px 15px;
  }
}