html, body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #05070a;
  font-family: Arial, sans-serif;
}

#hud {
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 10;
  color: white;
  background: rgba(0,0,0,.55);
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.15);
}

#hud button, #hud a {
  margin-top: 8px;
  display: inline-block;
  background: #0487C8;
  color: white;
  border: 0;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
}

.editor-body {
  background: #111820;
  color: white;
  overflow: auto;
}

.editor-panel {
  position: fixed;
  top: 15px;
  left: 15px;
  width: 320px;
  background: rgba(0,0,0,.75);
  padding: 16px;
  border-radius: 14px;
  z-index: 20;
}

.editor-panel input,
.editor-panel textarea {
  width: 100%;
  margin: 6px 0 10px;
  padding: 8px;
  border-radius: 8px;
  border: 0;
}

.editor-panel textarea {
  height: 80px;
}

#editorGrid {
  margin-left: 370px;
  margin-top: 20px;
  display: grid;
  gap: 3px;
}

.editor-cell {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  cursor: pointer;
}

.editor-cell.floor {
  background: #2b3440;
}

.editor-cell.wall {
  background: #596879;
}

.editor-cell.item {
  background: #d69a3a;
  color: #000;
}

.editor-cell.note {
  background: #0487c8;
}

.editor-cell.door {
  background: #8a3f28;
}

#caseronModal,
#inventoryBox,
#miniMapBox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.caseron-modal-box {
  background: #111820;
  color: white;
  width: min(600px, 90vw);
  max-height: 80vh;
  overflow: auto;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 20px 80px rgba(0,0,0,.45);
}

.caseron-modal-box button {
  float: right;
  background: #8a3f28;
  color: white;
  border: 0;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.inventory-item {
  background: rgba(255,255,255,.08);
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 10px;
}

#miniMap {
  display: grid;
  gap: 2px;
}

.mini-cell {
  width: 18px;
  height: 18px;
  border-radius: 3px;
}

.unknown {
  background: #000;
}

.mini-wall {
  background: #596879;
}

.mini-floor {
  background: #2b3440;
}

.mini-player {
  background: #d69a3a;
  color: #000;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  line-height: 18px;
}



#mobileControls {
  display: none;
}

@media (max-width: 900px), (pointer: coarse) {
  #mobileControls {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
  }

  #joyBase {
    position: fixed;
    left: 28px;
    bottom: 35px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    border: 2px solid rgba(255,255,255,.25);
    pointer-events: auto;
  }

  #joyStick {
    position: absolute;
    left: 38px;
    top: 38px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(4,135,200,.85);
    box-shadow: 0 0 20px rgba(4,135,200,.5);
  }

  #btnInteractMobile,
  #btnMapMobile,
  #btnInvMobile {
    position: fixed;
    right: 28px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 0;
    background: rgba(4,135,200,.9);
    color: white;
    font-weight: bold;
    font-size: 18px;
    pointer-events: auto;
  }

  #btnInteractMobile {
    bottom: 110px;
  }

  #btnMapMobile {
    bottom: 180px;
  }

  #btnInvMobile {
    bottom: 40px;
  }
}

#btnAttackMobile {
  position: fixed;
  right: 100px;
  bottom: 110px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 0;
  background: rgba(138,63,40,.95);
  color: white;
  font-weight: bold;
  font-size: 20px;
  pointer-events: auto;
}

body.attack-mode #hud::after {
  content: "MODO ATAQUE";
  display: block;
  margin-top: 8px;
  color: #d69a3a;
  font-weight: bold;
}
@media (max-width: 900px), (pointer: coarse) {
  #joyBase {
    left: 32px;
    bottom: 42px;
    width: 155px;
    height: 155px;
  }

  #joyStick {
    left: 48px;
    top: 48px;
    width: 58px;
    height: 58px;
  }

  #btnInteractMobile,
  #btnMapMobile,
  #btnInvMobile,
  #btnAttackMobile {
    width: 76px;
    height: 76px;
    font-size: 24px;
  }

  #btnInteractMobile {
    right: 32px;
    bottom: 135px;
  }

  #btnMapMobile {
    right: 32px;
    bottom: 225px;
  }

  #btnInvMobile {
    right: 32px;
    bottom: 45px;
  }

  #btnAttackMobile {
    right: 120px;
    bottom: 135px;
  }
}


@media (max-width: 900px), (pointer: coarse) {
  #joyBase {
    left: 34px !important;
    bottom: 42px !important;
    width: 240px !important;
    height: 240px !important;
  }

  #joyStick {
    left: 80px !important;
    top: 80px !important;
    width: 80px !important;
    height: 80px !important;
  }

  #btnInteractMobile,
  #btnMapMobile,
  #btnInvMobile,
  #btnAttackMobile {
    width: 116px !important;
    height: 116px !important;
    font-size: 34px !important;
  }

  #btnInvMobile {
    right: 36px !important;
    bottom: 50px !important;
  }

  #btnInteractMobile {
    right: 36px !important;
    bottom: 185px !important;
  }

  #btnMapMobile {
    right: 36px !important;
    bottom: 320px !important;
  }

  #btnAttackMobile {
    right: 170px !important;
    bottom: 185px !important;
  }
}


@media (max-width: 900px), (pointer: coarse) {
  #joyBase {
    width: 480px !important;
    height: 480px !important;
    left: 28px !important;
    bottom: 35px !important;
  }

  #joyStick {
    width: 160px !important;
    height: 160px !important;
    left: 160px !important;
    top: 160px !important;
  }
}
.nct-result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
  background: #111820;
  color: white;
}

.nct-result-table th,
.nct-result-table td {
  border-bottom: 1px solid rgba(255,255,255,.15);
  padding: 9px 10px;
  text-align: left;
}

.nct-result-table th {
  position: sticky;
  top: 0;
  background: #024C70;
}


.file-item {
  background: rgba(255,255,255,.08);
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: .15s;
}

.file-item:hover {
  background: rgba(4,135,200,.25);
}

@media (max-width: 900px), (pointer: coarse) {
  #joyBase {
    width: 300px !important;
    height: 300px !important;
    left: 24px !important;
    bottom: 30px !important;
  }

  #joyStick {
    width: 90px !important;
    height: 90px !important;
    left: 105px !important;
    top: 105px !important;
  }

  #lookBase {
    position: fixed;
    right: 24px;
    bottom: 30px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,.10);
    border: 2px solid rgba(255,255,255,.22);
    pointer-events: auto;
  }

  #lookStick {
    position: absolute;
    left: 105px;
    top: 105px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(138,63,40,.9);
  }

  #btnMapMobile,
  #btnInteractMobile,
  #btnInvMobile {
    width: 78px !important;
    height: 78px !important;
    font-size: 26px !important;
    top: 18px !important;
    bottom: auto !important;
  }

  #btnMapMobile {
    right: 24px !important;
  }

  #btnInteractMobile {
    right: 115px !important;
  }

  #btnInvMobile {
    right: 206px !important;
  }

  #btnAttackMobile {
    display: none !important;
  }
}
